• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
gdb not breaking on break statements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: gdb not breaking on break statements
      • From: Jason Molenda <email@hidden>
  • Prev by Date: Re: suggestions for documentation integration
  • Next by Date: Xcode 3 and CVS
  • Previous by thread: Re: suggestions for documentation integration
  • Next by thread: Re: gdb not breaking on break statements
  • Index(es):
    • Date
    • Thread