[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-threads
Subject: Single stepping through threads
From: Kelly Yancey <kelly () nttmcl ! com>
Date: 2004-12-01 2:52:12
Message-ID: 20041130181558.H42615 () alicia ! nttmcl ! com
[Download RAW message or body]
Is there a way to single-step (trap on the next instruction, not gdb's
step) a single thread in a process without any remaining threads running
concurrently *without* reimplementing gdb? My application is not a full
debugger; all it needs to do is single-step through an application.
However, I need to be certain that every instruction that is executed (no
matter which thread it is in) traps so my tracing process can inspect the
state of the application. My utility works fine for single-thread
processes, but by my reading of kse_create(), new threads are created with
the P_TRACED bit cleared meaning my utility has no control over them.
It looks like the functionality I am after is provided by libthread_db,
but it appears to require ps_global_lookup() to determine which threading
library the application is using. However, to implement
ps_global_lookup() I would have to add logic to parse the symbol table in
the target program, assuming it even has one. Which gets me to the crux
of my quandary: I'm not implementing a debugger, I don't particularly want
to implement a debugger, and even if I did I cannot assume that the
programs I am trying to trace have any debugging symbols. So how do I
control a multithreaded application? As I see no special support for
threads in truss(1), can I assume that procfs somehow avoids this issue?
Thanks,
Kelly
_______________________________________________
freebsd-threads@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic