Value eval(Value arg, Table env) {
if (arg.tag == ConsCell) {
Value operator = car(arg);
Value operands = cdr(arg); // <- debugger stopped here
If I print the argument arg
with p arg
, I get:
(lldb) p arg
(Value) $0 = {
data = {
number = 1068272
list = 0x0000000100104cf0
symbol = 0x0000000100104cf0 "?L\x10"
}
tag = ConsCell
}
But if p operator
, I get:
(lldb) p operator
error: expected a type
error: 1 errors parsing expression
However, using frame variable operator
works:
(lldb) frame variable operator
(Value) operator = {
data = {
number = 1068208
list = 0x0000000100104cb0
symbol = 0x0000000100104cb0 "\x10L\x10"
}
tag = ConsCell
}
What's going wrong when I'm using p operator
?
lldb evaluates expression in hybrid of C++ and Objective-C. operator
, the name of your variable, is a reserved keyword in C++. When you use the p
command (which is an alias to expression
command), lldb passes your expression to clang to parse and evaluate in C++/Objective-C (or, if you're debugging a Swift method, parse and evaluate in Swift). Even though your program is written in straight C, your expressions are evaluated as C++ expressions and that's not a valid C++ expression.
frame variable
( fr v
for short) doesn't go through a compiler for evaluation, it tries to do simple parsing of the variable path provided. It can do simple dereferencing and following of pointers, but it can't cast values for instance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.