gdb not breaking on break statements
gdb not breaking on break statements
- Subject: gdb not breaking on break statements
- From: Steve Checkoway <email@hidden>
- Date: Thu, 8 Nov 2007 16:28:49 -0800
When I set a breakpoint on a line containing a break statement, gdb
will always break on the line following it.
For example, breaking on line 7 (the break statement) of
int main()
{
int i = 0;
while( 1 )
{
if( i == 10 )
break;
++i;
}
return 0;
}
gives me this when run in gdb:
(gdb) break 7
Breakpoint 1 at 0x1e44: file break.c, line 7.
(gdb) run
Starting program: /Users/steve/temp/a.out
Reading symbols for shared libraries +. done
Breakpoint 1, main () at break.c:8
8 ++i;
(gdb) p i
$1 = 0
It should be breaking on line 7 when i is 10, not on line 8 when i is 0.
When I use -gstabs -gfull with gcc 4, it doesn't work. When I use
gcc-3.3 with just -g and not -gfull, I get no breaking at all;
however, if I use gcc-3.3 -gfull break.c, then it actually breaks.
Is there some magical incantation to get gdb to break on break
statements?
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden