From: Christian Thalinger <twisti@complang.tuwien.ac.at>
To: Carl Shapiro <carl.shapiro@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Problems with hook-stop
Date: Thu, 27 Sep 2007 12:35:00 -0000 [thread overview]
Message-ID: <1190895312.11262.7.camel@c1.complang.tuwien.ac.at> (raw)
In-Reply-To: <4dcb5abd0709260133h10aede86wb60a22094c8d9884@mail.gmail.com>
On Wed, 2007-09-26 at 01:33 -0700, Carl Shapiro wrote:
> Hi,
>
> I am trying to write a user-defined command hook that automatically
> passes a SIGTRAP to my program. Here is the definition I am working
> with:
>
> define hook-stop
> if (((* (char *) ($pc - 1)) & 0xff) == 0xcc)
> signal SIGTRAP
> end
> end
Hi!
I'm also searching for a solution for that problem. The reason why we
want to use the INT3 instruction on i386 and x86_64 is because we must
be able to replace a machine instruction atomically in our JIT compiler
(where "atomically" reads as "the patching instruction must not be
shorter than the patched one", for obvious reasons). And INT3 is the
only instruction that is suitable.
Right now we're using UD2, but that's only a temporary solution.
- twisti
prev parent reply other threads:[~2007-09-27 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 16:06 Carl Shapiro
2007-09-27 12:06 ` Mark Kettenis
2007-09-28 1:23 ` Carl Shapiro
2007-09-29 21:44 ` Daniel Jacobowitz
2007-10-02 7:57 ` Carl Shapiro
2007-10-02 11:42 ` Daniel Jacobowitz
2007-09-27 12:35 ` Christian Thalinger [this message]
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=1190895312.11262.7.camel@c1.complang.tuwien.ac.at \
--to=twisti@complang.tuwien.ac.at \
--cc=carl.shapiro@gmail.com \
--cc=gdb@sourceware.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