Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
lldb C local variable not printing
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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!