Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tex-Twil

macrumors 68030
Original poster
May 28, 2008
2,501
15
Berlin
Hello,
so here I am reading "Programming in Objective-C 2.0" and writing my first hello word programs.

I have a very simple program but when I debug it, it takes like 30 seconds before the debugging really starts. The Debug console says "Loading program into debugger" and "sharedlibrary apply-load-rules all". Then I have to wait 30 seconds and then the debug stops at my 1st break point.

What's going on ?

I have xCode 3.2 on SL.

Thanks,
Tex
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
If you set a breakpoint on main does it take as long?

Have you tried manually running gdb on your debug binary to see if it takes the same amount of time?

-Lee
 

Vizin

macrumors 6502a
Jun 30, 2007
532
0
Yes to both. Setting the breakpoint has no effect. When I run it in gdb it hangs at "This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........" for about 45 seconds.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
At this point I would approach this like any other performance problem, as I can't reproduce this on my system...
You can take a look with instruments to see what GDB is spending its time.

I would run GDB without the program given, start watching, and run:
file myProgram

See if you have a long delay here. If so, take a look at where the most time was spent. If not, restart your watch with instruments and run your program, and once you hit the breakpoint, stop recording with instruments and see where the time was spent.

-Lee
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I've noticed this recently. It seems to be random. If you disable breakpoints it works as expected, so that must be affecting it somehow.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
I didn't think it loaded the debugger if you have no breakpoints. I might be wrong though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.