Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b583cb81
Commit
b583cb81
authored
Oct 07, 2023
by
Gerd Möllmann
Browse files
; Produce fewer $nnn vars in LLDB
parent
53846199
Pipeline
#26690
failed with stages
in 189 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
etc/emacs_lldb.py
etc/emacs_lldb.py
+17
-10
No files found.
etc/emacs_lldb.py
View file @
b583cb81
...
...
@@ -122,19 +122,21 @@ def init_values(self):
if
self
.
lisp_type
==
"Lisp_Symbol"
:
offset
=
self
.
get_lisp_pointer
(
"char"
).
GetValueAsUnsigned
()
self
.
value
=
self
.
eval
(
f
"(struct Lisp_Symbol *)"
f
" ((char *) &lispsym +
{
offset
}
)"
)
f
" ((char *) &lispsym +
{
offset
}
)"
,
True
)
elif
self
.
lisp_type
==
"Lisp_String"
:
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_String"
)
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_String"
,
True
)
elif
self
.
lisp_type
==
"Lisp_Vectorlike"
:
c_type
=
Lisp_Object
.
pvec2type
[
self
.
pvec_type
]
self
.
value
=
self
.
get_lisp_pointer
(
c_type
)
self
.
value
=
self
.
get_lisp_pointer
(
c_type
,
True
)
elif
self
.
lisp_type
==
"Lisp_Cons"
:
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_Cons"
)
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_Cons"
,
True
)
elif
self
.
lisp_type
==
"Lisp_Float"
:
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_Float"
)
self
.
value
=
self
.
get_lisp_pointer
(
"struct Lisp_Float"
,
True
)
elif
self
.
lisp_type
in
(
"Lisp_Int0"
,
"Lisp_Int1"
):
self
.
value
=
self
.
eval
(
f
"((EMACS_INT)
{
self
.
unsigned
}
) "
f
">> (GCTYPEBITS - 1)"
)
f
">> (GCTYPEBITS - 1)"
,
True
)
else
:
assert
False
,
"Unknown Lisp type"
...
...
@@ -143,14 +145,19 @@ def create_value(self, name, expr):
return
self
.
lisp_obj
.
CreateValueFromExpression
(
name
,
expr
)
# Evaluate EXPR in the context of the current frame.
def
eval
(
self
,
expr
):
return
self
.
frame
.
EvaluateExpression
(
expr
)
def
eval
(
self
,
expr
,
make_var
=
False
):
if
make_var
:
return
self
.
frame
.
EvaluateExpression
(
expr
)
options
=
lldb
.
SBExpressionOptions
()
options
.
SetSuppressPersistentResult
(
True
)
return
self
.
frame
.
EvaluateExpression
(
expr
,
options
)
# Return an SBValue for this object denoting a pointer of type
# TYP*.
def
get_lisp_pointer
(
self
,
typ
):
def
get_lisp_pointer
(
self
,
typ
,
make_var
=
False
):
return
self
.
eval
(
f
"(
{
typ
}
*) (((EMACS_INT) "
f
"
{
self
.
unsigned
}
) & VALMASK)"
)
f
"
{
self
.
unsigned
}
) & VALMASK)"
,
make_var
)
# If this is a Lisp_String, return an SBValue for its string data.
# Return None otherwise.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment