This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb behavior on tight loop
- From: John Gilmore <gnu at toad dot com>
- To: Ender Dai <xdai at uoregon dot edu>
- Cc: "Abid\, Hafiz" <Hafiz_Abid at mentor dot com>, "gdb\ at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 24 Jul 2013 14:16:43 -0700
- Subject: Re: gdb behavior on tight loop
- References: <87r4eopqdb dot fsf at cortana dot d dot cs dot uoregon dot edu> <EB3B29AD43CA924DA27099BC85192376E065C0FB at EU-MBX-02 dot mgc dot mentorg dot com> <87mwpbq3a8 dot fsf at cortana dot d dot cs dot uoregon dot edu>
> >> Please see the gdb session below. When I run "next" on line 5, the tight
> >> loop, it will take several seconds before gdb stop on line 6 and I regain
> >> control.
> >>
> >> If I set an additional breackpoint on line 6, and "continue" on line 5 instead
> >> of "next", everything looks good.
In situations like this, the "until" command is convenient.
You can say "u 6" and gdb will set a temporary breakpoint at line 6,
run the program at full speed until it hits that breakpoint (or some
other breakpoint or error) and then remove the temporary breakpoint.
John Gilmore