value eval(value arg, table env) { if (arg.tag == conscell) { value operator = car(arg); value operands = cdr(arg); // <- debugger stopped here if print argument arg p arg, get:
(lldb) p arg (value) $0 = { data = { number = 1068272 list = 0x0000000100104cf0 symbol = 0x0000000100104cf0 "?l\x10" } tag = conscell } but if p operator, get:
(lldb) p operator error: expected 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++ , objective-c. operator, name of variable, reserved keyword in c++. when use p command (which alias expression command), lldb passes expression clang parse , evaluate in c++/objective-c (or, if you're debugging swift method, parse , evaluate in swift). though program written in straight c, expressions evaluated c++ expressions , that's not valid c++ expression.
frame variable (fr v short) doesn't go through compiler evaluation, tries simple parsing of variable path provided. can simple dereferencing , following of pointers, can't cast values instance.
Comments
Post a Comment