From: Doug Evans <xdje42@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>,
guile-user@gnu.org,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Fun with LD_PRELOAD
Date: Sun, 02 Feb 2014 22:08:00 -0000 [thread overview]
Message-ID: <CAP9bCMRsRrqEYG+7jS-m2EOhByAB+9hTFUuikoNJeJpxGATu5Q@mail.gmail.com> (raw)
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)
...
next reply other threads:[~2014-02-02 22:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 22:08 Doug Evans [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP9bCMRsRrqEYG+7jS-m2EOhByAB+9hTFUuikoNJeJpxGATu5Q@mail.gmail.com \
--to=xdje42@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=guile-user@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox