Bug 388084 - armv7l Unrecognised instruction "bkpt" 0xE1200070
Summary: armv7l Unrecognised instruction "bkpt" 0xE1200070
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.13.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 17:57 UTC by John Reiser
Modified: 2017-12-20 17:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Reiser 2017-12-20 17:57:25 UTC
On armv7l (RaspberryPi-3B ARM in 32-bit mode) coregrind does not recognize the instruction "bkpt" which is 0xE1200070.  This is a "compiled-in breakpoint" which should generate SIGTRAP, much like "int3" 0xcc on x86. [Except that x86 stops after the int3, while ARM stops at the bkpt.]

The instruction is documented in ARM Architecture Reference Manual, ARM DDI 0100E on p.A4-14 (.pdf p.114).

===== console log
$ ./gdbtest  ## kernel-4.14.6-300.fc27.armv7hl
Trace/breakpoint trap (core dumped)

$ valgrind --tool=none ./gdbtest
==2518== Nulgrind, the minimal Valgrind tool
==2518== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote.
==2518== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2518== Command: ./gdbtest
==2518== 
disInstr(arm): unhandled instruction: 0xE1200070
                 cond=14(0xE) 27:20=18(0x12) 4:4=1 3:0=0(0x0)

   <<snip>>

==2518== Process terminating with default action of signal 4 (SIGILL): dumping core
==2518==  Illegal opcode at address 0x103E4
==2518==    at 0x103E4: main (gdbtest.c:4)
===== end console log

===== test case file gdbtest.c
int
main(int argc, char *argv[])
{
    asm("bkpt");
    return 0;
}
===== end test case file gdbtest.c