|
From: Jeremy F. <je...@go...> - 2005-02-03 01:28:51
|
On Wed, 2005-02-02 at 16:48 -0600, Nicholas Nethercote wrote:
> Valgrind currently only supports the 'int' instruction when it is "int
> 0x80", which is used for a system call on x86/Linux. Some Java
> implementations use the x86 'int' ("interrupt") instruction when certain
> exceptions are thrown. Steve Blackburn of ANU was having problems with
> using Cachegrind on some Java programs because of this. I made a quick
> attempt at adding support for these instructions, but failed, so I'm
> asking here about it. I tried adding a new kind of basic-block-ending
> Jmp, and then tried adding a new UCode instruction, INT. I made some
> progress but didn't really get anywhere.
Um, are you sure? I think the only interrupts which usable under Linux
are int3 and int $0x80. int3 is the breakpoint instruction, and is a
special case because it has a 1 byte opcode rather than 2 bytes.
If you try to run any other interrupt, you just get a GPF, which looks
like a SIGSEGV to user mode (currently we get this wrong by generating a
SIGILL, but nothing cares).
> Basically, if anyone knows how these interrupts work, and have ideas about
> how to support them, I'd appreciate knowing about it. Thanks.
I don't think we can in any meaningful way, except for int3. If there's
a real need, I would do it with a simple helper call.
If they are using int3, I implemented it the other day. (Attached, but
it is out of date with respect to the baseBlock removal.)
J
|