public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Single-step runaway
@ 2003-08-01  7:06 Robin Rowe
  2003-08-01 13:05 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Rowe @ 2003-08-01  7:06 UTC (permalink / raw)
  To: gdb

I have a program that gdb doesn't seem to be able to enforce a breakpoint
on. As I single step through my code gdb suddenly takes the bit in its teeth
and slips away to run the program forward as though I had issued continue.
When I reach a particular function call in my code it simply takes off and
runs to completion (it's a batch process) rather than stepping into the call
as it should. If I stepi half a dozen times I can get inside the call and
single-stepping mostly works from there forward -- but not consistently so.
As a debugger it is almost unusable with this flaw. It would be faster to
use printf.

Other gdb users tell me they have encountered erratic behaviour like this
from time to time. Is this a known bug? Why is it happening? What can be
done about it?

FYI, there is nothing exotic about the function call that runs away. It is a
statically linked library C call. That library uses C++ internally, but the
interface is an extern "C" function call that passes a straight C struct.
All the code involved is code I wrote myself and compiled at the same time.
I'm running on RedHat 7.1. Tried compiling gdb 5.3 from source, but no
difference.

Suggestions?

Thanks,

Robin
---------------------------------------------------------------------------
Robin.Rowe@MovieEditor.com   Hollywood, California
www.CinePaint.org   Free motion picture and still image editing software

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Single-step runaway
  2003-08-01  7:06 Single-step runaway Robin Rowe
@ 2003-08-01 13:05 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-08-01 13:05 UTC (permalink / raw)
  To: Robin Rowe; +Cc: gdb

On Fri, Aug 01, 2003 at 12:06:48AM -0700, Robin Rowe wrote:
> I have a program that gdb doesn't seem to be able to enforce a breakpoint
> on. As I single step through my code gdb suddenly takes the bit in its teeth
> and slips away to run the program forward as though I had issued continue.
> When I reach a particular function call in my code it simply takes off and
> runs to completion (it's a batch process) rather than stepping into the call
> as it should. If I stepi half a dozen times I can get inside the call and
> single-stepping mostly works from there forward -- but not consistently so.
> As a debugger it is almost unusable with this flaw. It would be faster to
> use printf.
> 
> Other gdb users tell me they have encountered erratic behaviour like this
> from time to time. Is this a known bug? Why is it happening? What can be
> done about it?
> 
> FYI, there is nothing exotic about the function call that runs away. It is a
> statically linked library C call. That library uses C++ internally, but the
> interface is an extern "C" function call that passes a straight C struct.
> All the code involved is code I wrote myself and compiled at the same time.
> I'm running on RedHat 7.1. Tried compiling gdb 5.3 from source, but no
> difference.
> 
> Suggestions?

This usually means that GDB's stack unwinder has gotten confused.  You
may want to try using a compiler recent enough to emit DWARF CFI
information (GCC 3.2/3.3 should do; I don't know whether RH7.1's
compiler does or not) and a snapshot of GDB 6.0.  That combination
seems to be rather more robust.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-01 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-01  7:06 Single-step runaway Robin Rowe
2003-08-01 13:05 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).