Skip to content

Commit

Permalink
lldb: highlight the slot when using dump_page_rvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor authored and peterzhu2118 committed Apr 27, 2021
1 parent f64bb9f commit 1c1c915
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions misc/lldb_cruby.py
Expand Up @@ -552,7 +552,7 @@ def __next__(self):
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)

Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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())



Expand Down

0 comments on commit 1c1c915

Please sign in to comment.