emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/igc dbf8ced22e7 3/3: LLDB: Don't use SBValue.GetValueForExpressi


From: Gerd Moellmann
Subject: scratch/igc dbf8ced22e7 3/3: LLDB: Don't use SBValue.GetValueForExpressionPath
Date: Wed, 4 Sep 2024 02:28:42 -0400 (EDT)

branch: scratch/igc
commit dbf8ced22e720c862395b7233bafef63d52075a7
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    LLDB: Don't use SBValue.GetValueForExpressionPath
    
    The function stopped working in LLDB 18 on macOS 14.
    
    * etc/emacs_lldb.py: Replace all uses of
    SBValue.GetValueForExpressionPath with SBValue.GetChildMemberWithName.
---
 etc/emacs_lldb.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/etc/emacs_lldb.py b/etc/emacs_lldb.py
index 7511b6bc49c..978c3078d4c 100644
--- a/etc/emacs_lldb.py
+++ b/etc/emacs_lldb.py
@@ -95,7 +95,7 @@ class Lisp_Object:
     def init_unsigned(self):
         if self.tagged.GetType().GetTypeClass() == lldb.eTypeClassStruct:
             # Lisp_Object is actually a struct.
-            lisp_word = self.tagged.GetValueForExpressionPath(".i")
+            lisp_word = self.tagged.GetChildMemberWithName("i")
             self.unsigned = lisp_word.GetValueAsUnsigned()
         else:
             self.unsigned = self.tagged.GetValueAsUnsigned()
@@ -167,14 +167,19 @@ class Lisp_Object:
     # Return None otherwise.
     def get_string_data(self):
         if self.lisp_type == "Lisp_String":
-            return self.untagged.GetValueForExpressionPath("->u.s.data")
+            u = self.untagged.GetChildMemberWithName("u")
+            s = u.GetChildMemberWithName("s")
+            data = s.GetChildMemberWithName("data")
+            return data
         return None
 
     # if this is a Lisp_Symbol, return an SBBalue for its name.
     # Return None otherwise.
     def get_symbol_name(self):
         if self.lisp_type == "Lisp_Symbol":
-            name = self.untagged.GetValueForExpressionPath("->u.s.name")
+            u = self.untagged.GetChildMemberWithName("u")
+            s = u.GetChildMemberWithName("s");
+            name = s.GetChildMemberWithName("name");
             return Lisp_Object(name).get_string_data()
         return None
 
@@ -200,7 +205,8 @@ def xbacktrace(debugger, command, ctx, result, 
internal_dict):
         s = frame.EvaluateExpression(f"current_thread->m_specpdl[{i}]")
         kind = enumerator_name(s.GetChildMemberWithName("kind"))
         if kind == "SPECPDL_BACKTRACE":
-            function = Lisp_Object(s.GetValueForExpressionPath(".bt.function"))
+            bt = s.GetChildMemberWithName("bt")
+            function = Lisp_Object(bt.GetChildMemberWithName("function"))
             if function.lisp_type == "Lisp_Symbol":
                 sym_name = function.get_symbol_name()
                 result.AppendMessage(str(sym_name))
@@ -240,8 +246,11 @@ class Lisp_Object_Provider:
                 child = lisp_obj.get_string_data()
                 self.children["data"] = child
             elif lisp_type == "Lisp_Cons":
-                car = lisp_obj.untagged.GetValueForExpressionPath("->u.s.car")
-                cdr = 
lisp_obj.untagged.GetValueForExpressionPath("->u.s.u.cdr")
+                u = lisp_obj.untagged.GetChildMemberWithName("u")
+                s = u.GetChildMemberWithName("s")
+                car = s.GetChildMemberWithName("car")
+                su = s.GetChildMemberWithName("u")
+                cdr = su.GetChildMemberWithName("cdr")
                 self.children["car"] = car
                 self.children["cdr"] = cdr
             else:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]