Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode debugging goes back and forth during stepping through the code

I have a really weird problem with Xcode 3.2.5

In a normal code sequence XCode steps couple of lines back then continues, then again sometimes back and continues again during step mode.

This only happens in one project, but there in all files. Here an example:

When jumping in this function Xcode goes through the lines in the following sequence: 2 -> 1 -> 2 -> 3 ->5 -> 8 -> 3 -> 4 -> 5 -> 6 -> 7 ->...

I dont understand what is going on here. Please do you have any idea?

Rebooting the machine and the iPhone doesn't help.

By the way, the complete code works fine and runs without errors. It seems that the cursor sometimes goes to lines where the code is not being executed. If a certain line is entered twice by the cursor, only the second time it changes the variables in assignments etc..

Really weird!

Thanks for any hint...

 1  - (void)viewWillAppear:(BOOL)animated {
 // D_IN;
 2  [super viewWillAppear:animated];


 //get the dataManager global Object, so we always have a structured accesss to the data!
3 WebiAppDelegate *mainDelegate = (WebiAppDelegate *)[[UIApplication sharedApplication]delegate];
4 self.webiDataManager = mainDelegate.webiDataManager;

5 message.hidden = YES;
6 message.text = @"";
7 message.userInteractionEnabled = NO;
...
like image 754
user387184 Avatar asked Dec 20 '10 21:12

user387184


Video Answer


1 Answers

I agree with the comments. It looks like you're trying to debug optimized code. Try compiling with no optimization and the debugger should behave more sensibly.

e.g. gcc -O0 ...

like image 159
Wodin Avatar answered Nov 03 '22 18:11

Wodin