This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb "step" behavior in multi-threaded programs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]