summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2021-04-27 12:21:24 +0100
committerPeter Zhu <peter@peterzhu.ca>2021-04-27 10:58:49 -0400
commit1c1c91535c4f8ebc2d1ccfb63076632d53604401 (patch)
tree6150f3f530cab135d4e52442f6c963ff2995e8dd /misc
parentf64bb9fc848814c3ad1f559fc3e1e0043a905b72 (diff)
lldb: highlight the slot when using dump_page_rvalue
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4420
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 2b5359da03..2a33ebfb6f 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -552,7 +552,7 @@ class HeapPageIter:
raise StopIteration
-def dump_page_internal(page, target, process, thread, frame, result, debugger):
+def dump_page_internal(page, target, process, thread, frame, result, debugger, highlight=None):
if not ('RUBY_Qfalse' in globals()):
lldb_init(debugger)
@@ -581,6 +581,10 @@ def dump_page_internal(page, target, process, thread, frame, result, debugger):
flidx = ' '
result_str = "%s idx: [%3d] freelist_idx: {%s} Addr: %0#x (flags: %0#x)" % (rb_type(flags, ruby_type_map), page_index, flidx, obj_addr, flags)
+
+ if highlight == obj_addr:
+ result_str = ' '.join([result_str, "<<<<<"])
+
print(result_str, file=result)
@@ -608,7 +612,7 @@ def dump_page_rvalue(debugger, command, result, internal_dict):
page_type = target.FindFirstType("struct heap_page").GetPointerType()
page.Cast(page_type)
- dump_page_internal(page, target, process, thread, frame, result, debugger)
+ dump_page_internal(page, target, process, thread, frame, result, debugger, highlight=val.GetValueAsUnsigned())