From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Kevin Pouget <kevin.pouget@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: GDB and LD_PRELOAD library-call interception
Date: Thu, 31 Mar 2011 12:16:00 -0000 [thread overview]
Message-ID: <20110331121617.GA32739@host1.jankratochvil.net> (raw)
In-Reply-To: <AANLkTimPAd3v2x=G5PVkzB0Jk_V9i2Zw-=vGMJPLTxWT@mail.gmail.com>
On Thu, 31 Mar 2011 11:46:56 +0200, Kevin Pouget wrote:
> I was wondering if there could be a way to hack this exec-wrapper to
> launch for instance the executable in an xterm window?
It is not such straightforward, GDB expects the PID it has spawned will be
debugged while with xterm the process being debugged is its child.
I guess you can write a small C helper which will:
* create new pty
* change its fds 0/1/2 to the slave of this pty
* fork xterm -e own-helper-part pty-unique-id
In own-helper-part interconnect the pty master part and its fds 0/1/2.
Another way is to make fork-child.c more flexible/configurable.
> but it it possible to follow easily (two) forks?
Yes, `set detach-on-fork off', so-called multi-inferior mode, it has some
issues on native GNU/Linux system.
Regards,
Jan
next prev parent reply other threads:[~2011-03-31 12:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 8:25 Kevin Pouget
2011-03-31 8:47 ` Jan Kratochvil
2011-03-31 9:47 ` Kevin Pouget
2011-03-31 12:16 ` Jan Kratochvil [this message]
2011-03-31 15:07 ` Tom Tromey
2011-04-03 16:54 ` Xavier de Gaye
[not found] ` <BANLkTi=j6+-85R4B+N1Nd5kb9bkEZfsT9A@mail.gmail.com>
2011-04-04 13:35 ` Kevin Pouget
2011-03-31 15:06 ` Tom Tromey
2011-03-31 15:55 ` Kevin Pouget
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=20110331121617.GA32739@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=kevin.pouget@gmail.com \
/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