Commit 4a4699ed authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Adding heap_find gdb helper

heap_find walks all the page of the heap and finds the references to a given
address.

NOTRY=true

Change-Id: I3271ab96d0224acf2361fe5bc4c8b0a608caf091
Reviewed-on: https://chromium-review.googlesource.com/500190
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45202}
parent 2bd86a07
......@@ -123,5 +123,30 @@ Print stack trace with assertion scopes
Usage: bta
end
# Search for a pointer inside all valid pages.
define space_find
set $space = $arg0
set $current_page = $space->anchor()->next_page()
while ($current_page != $space->anchor())
printf "# Searching in %p - %p\n", $current_page->area_start(), $current_page->area_end()-1
find $current_page->area_start(), $current_page->area_end()-1, $arg1
set $current_page = $current_page->next_page()
end
end
define heap_find
set $heap = v8::internal::Isolate::Current()->heap()
printf "# Searching for %p in old_space ===============================\n", $arg0
space_find $heap->old_space() ($arg0)
printf "# Searching for %p in map_space ===============================\n", $arg0
space_find $heap->map_space() $arg0
printf "# Searching for %p in code_space ===============================\n", $arg0
space_find $heap->code_space() $arg0
end
document heap_find
Find the location of a given address in V8 pages.
Usage: heap_find address
end
set disassembly-flavor intel
set disable-randomization off
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