Commit 42157195 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[gdb] Select frame above the DCHECK function

Rather than having GDB always stop on the line containing
V8_IMMEDIATE_CRASH(), walk up the stack looking for V8_Dcheck and select
the frame above it. This will be the frame containing DCHECK (including
related macros like DCHECK_EQ).

Change-Id: I9760e7a4dd78b567dfa77ff12569d287d80ca873
Reviewed-on: https://chromium-review.googlesource.com/1172780Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55112}
parent 5fecd146
......@@ -122,3 +122,22 @@ end
set disassembly-flavor intel
set disable-randomization off
# Install a handler whenever the debugger stops due to a signal. It walks up the
# stack looking for V8_Dcheck and moves the frame to the one above it so it's
# immediately at the line of code that triggered the DCHECK.
python
def dcheck_stop_handler(event):
orig_frame = gdb.selected_frame()
frame = orig_frame
while frame is not None:
if frame.name() == 'V8_Dcheck':
select_frame = frame.older()
if select_frame is not None:
select_frame.select()
gdb.execute('frame')
break
frame = frame.older()
gdb.events.stop.connect(dcheck_stop_handler)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment