Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:12:32+00:00 2026-06-03T00:12:32+00:00

I am trying to debug a particular function in my application but am finding

  • 0

I am trying to debug a particular function in my application but am finding it tricky as the local variables are not showing up, nor is the code execution progressing line by line. Instead, it appears to hop around a bit and many of my locally scoped variables are not visible in the debugging area.

The function is called from an assetForURL result block.

I would expect some of this behavior with optimizations on, but I turned them off and have the same problem. Here is some of the code, just in case that may be the cause.

{
UIImageView* newImage = [[tvVC imageViewArray] objectAtIndex:viewIndex];
UIImageView* oldImage = [[tvVC imageViewArray] objectAtIndex:((viewIndex + 1) % 2)];

[newImage setImage:image];
[newImage setBounds:CGRectMake(0, 0, image.size.width, image.size.height)];         
[newImage setTransform:CGAffineTransformMakeScale(scalar * minScalar, scalar * minScalar)];
CGPoint adjust = [scrollView contentOffset];
CGPoint curCenter = [oldImage center];
NSLog(@" offset %f, %f   center %f, %f",adjust.x, adjust.y, curCenter.x, curCenter.y);
}

What kills me is that the NSLog prints valid results, but if I try and step through, I can’t actually inspect the adjust or curCenter elements manually.

Compiling using Apple LLVM 3.1

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:12:33+00:00Added an answer on June 3, 2026 at 12:12 am

    A weekend away and a fresh mind helped with this issue.

    In the end, I switched to GDB debugging versus LLDB. This resulted in a much more useful error message, ‘variable optimized away by the compiler’. I guess even with optimizations off, the compiler will get rid of stupid variables that aren’t really needed. (I only added them to make debugging more clear to me, I realize they are not necessary for the code)

    Once that was established, I just identified the adjust and curCenter as ‘volatile’ and the issue was resolved. I do still see a little hopping around in the code execution, but I am chalking that up to other optimizations

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having real problems trying debug my code to malfunctioning print statements. I
I'm trying to debug my code which is being executed from a unit test
I'm trying to permit debug logging per a particular class using Log4j, and I've
I'm trying to develop J2ME SMS applications (on Symbian, but that's not important). I
*edit: this particular situation was created while I was trying to debug another problem,
I'm trying to debug a program I've written. According to the debugger a particular
I am trying to debug some async code and when I try to step
Trying to debug some ajax calls not working properly in IE, i noticed that
I am trying to dissect a legacy application through debugging, but I can't get
When trying to debug a program on Windows I can't seem to find where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.