Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fun with LD_PRELOAD
@ 2014-02-02 22:08 Doug Evans
  2014-02-04 11:21 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Evans @ 2014-02-02 22:08 UTC (permalink / raw)
  To: Ludovic Courtès, guile-user, gdb-patches

Hi.
Here's my system-call wrapping module for gdb+guile.
At this point it's just a prototype, and an initial one at that.

It's kinda useful to see the system call tracing amongst gdb's own
debug output, but my real goal is to explore ways of exercising gdb
that are otherwise harder to do.
With this I can script what happens when gdb does ptrace,waitpid,tkill,etc.
Whether this exploration yields anything useful ... TBD.

git clone git@github.com:xdje42/wrap-syscall.git

To run the example:

GDB=/path/to/gdb-with-guile ./configure
make
make run
-->
...

waitpid (-1, 140736922396708, -2147483647) -> (42816 . 0), 1407
LNW: waitpid(-1, ...) returned 42816, ERRNO-OK
LLW: waitpid 42816 received Trace/breakpoint trap (stopped)
ptrace (3 (PTRACE_PEEKUSER), 42816, 896, 0) -> (16384 . 0)
syscall (200 (tkill), 42816, 0) -> (0 . 0)
LLTA: KILL(SIG0) Thread 0x7f03c7d4a700 (LWP 42816) (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in Thread
0x7f03c7d4a700 (LWP 42816).
SC:  kill Thread 0x7f03c74f9700 (LWP 42817) **<SIGSTOP>**
Injecting SIGUSR1 to 42817 ...
syscall (200 (tkill), 42817, 19 (SIGSTOP)) -> (0 . 0)
SC:  lwp kill 0 ERRNO-OK
SC:  kill Thread 0x7f03c6ca8700 (LWP 42818) **<SIGSTOP>**
syscall (200 (tkill), 42818, 19 (SIGSTOP)) -> (0 . 0)
SC:  lwp kill 0 ERRNO-OK
SC:  kill Thread 0x7f03c6457700 (LWP 42819) **<SIGSTOP>**
syscall (200 (tkill), 42819, 19 (SIGSTOP)) -> (0 . 0)
SC:  lwp kill 0 ERRNO-OK
SC:  kill Thread 0x7f03c5c06700 (LWP 42820) **<SIGSTOP>**
syscall (200 (tkill), 42820, 19 (SIGSTOP)) -> (0 . 0)
SC:  lwp kill 0 ERRNO-OK
SC:  kill Thread 0x7f03c8533740 (LWP 42813) **<SIGSTOP>**
syscall (200 (tkill), 42813, 19 (SIGSTOP)) -> (0 . 0)
SC:  lwp kill 0 ERRNO-OK
waitpid (42817, 140736922396252, 1) -> (-1 . 10), 0
waitpid (42817, 140736922396252, -2147483647) -> (42817 . 0), 2687
WL: waitpid Thread 0x7f03c74f9700 (LWP 42817) received User defined
signal 1 (stopped)
ptrace (3 (PTRACE_PEEKUSER), 42817, 896, 0) -> (0 . 0)
SWC: Pending event User defined signal 1 (stopped) in Thread
0x7f03c74f9700 (LWP 42817)
...


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

end of thread, other threads:[~2014-02-06  7:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02 22:08 Fun with LD_PRELOAD Doug Evans
2014-02-04 11:21 ` Ludovic Courtès
2014-02-05 18:21   ` Doug Evans
2014-02-05 19:11     ` Pedro Alves
2014-02-06  7:58       ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox