guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fun with LD_PRELOAD


From: Doug Evans
Subject: Fun with LD_PRELOAD
Date: Sun, 2 Feb 2014 14:08:18 -0800

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 address@hidden: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)
...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]