Bug 14446 - breakpoints may not work on jitted code
Summary: breakpoints may not work on jitted code
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 19:11 UTC by H.J. Lu
Modified: 2012-09-17 19:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-08-09 19:11:09 UTC
What happens are

1. V8 initializes memory for code with 0xdeadbeef.
2. When you set breakpoint in GDB, gdb saves and replaces one byte,
which happens to be 0xef in 0xdeadbeef, with 0xcc.
3. V8 writes out real instructions in memory.
4. When breakpoint is hit, GDB replaces 0xcc with 0xef.
5. V8 crashes due to 0xef.
Comment 1 Tom Tromey 2012-09-17 19:14:46 UTC
Could you elaborate on when gdb can put a breakpoint into
uninitialized memory?
Comment 2 H.J. Lu 2012-09-17 19:40:01 UTC
(In reply to comment #1)
> Could you elaborate on when gdb can put a breakpoint into
> uninitialized memory?

We can set a watchpoint on the breakpoint and catch the
new value.  GDB restores the new value instead of the
old saved value.