[前][次][番号順一覧][スレッド一覧]

ruby-changes:65990

From: Matt <ko1@a...>
Date: Tue, 27 Apr 2021 23:59:11 +0900 (JST)
Subject: [ruby-changes:65990] 1c1c91535c (master): lldb: highlight the slot when using dump_page_rvalue

https://git.ruby-lang.org/ruby.git/commit/?id=1c1c91535c

From 1c1c91535c4f8ebc2d1ccfb63076632d53604401 Mon Sep 17 00:00:00 2001
From: Matt Valentine-House <matt@e...>
Date: Tue, 27 Apr 2021 12:21:24 +0100
Subject: lldb: highlight the slot when using dump_page_rvalue

---
 misc/lldb_cruby.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 2b5359d..2a33ebf 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -552,7 +552,7 @@ class HeapPageIter: https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L552
             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): https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L581
                 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): https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L612
     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())
 
 
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]