[ECOS] gdb "step" behavior in multi-threaded programs

Kevin Hilman khilman@equator.com
Wed Jan 22 03:39:00 GMT 2003


I'm working on the eCos gdb stub for new architecture, and I'm a bit
confused about the correct gdb behavior for breaking/stepping for
multi-threaded programs.  For example, if you have a function being
called by multiple threads and you set a breakpoint at that function.

I presume that for breakpoints, whenever ANY thread calls that
function, the breakpoint should be hit, right?

What about stepping in that function (via the "step" command)? Should
gdb stop whenever ANY thread hits the next source line? or just the
thread that hit the breakpoint?  And what about "stepi"?

My guess is that it should stop whenever any thread hits the next
line/instruction, but I'm not sure.  This would be the easiest to
implement, but not necessarily the most useful from the debugger users
perspective.  I also noticed in the gdb docs that for watchpoints,
they are specifically mentioned as being one thread only.

-- 
Kevin Hilman               ---  Equator Technologies, Inc.
khilman@equator.com        ---  Seattle, WA USA

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list