Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

195
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda