clayborg added a comment.

See SymbolFileDWARF::ParseVariableDIE. It has code that links up the DW_OP_addr:

  if (is_static_lifetime) {
    if (is_external)
      scope = eValueTypeVariableGlobal;
    else
      scope = eValueTypeVariableStatic;
  
    if (debug_map_symfile) {
      // When leaving the DWARF in the .o files on darwin, when we have a
      // global variable that wasn't initialized, the .o file might not
      // have allocated a virtual address for the global variable. In
      // this case it will have created a symbol for the global variable
      // that is undefined/data and external and the value will be the
      // byte size of the variable. When we do the address map in
      // SymbolFileDWARFDebugMap we rely on having an address, we need to
      // do some magic here so we can get the correct address for our
      // global variable. The address for all of these entries will be
      // zero, and there will be an undefined symbol in this object file,
      // and the executable will have a matching symbol with a good
      // address. So here we dig up the correct address and replace it in
      // the location for the variable, and set the variable's symbol
      // context scope to be that of the main executable so the file
      // address will resolve correctly.

This is what needs to be fixed.


https://reviews.llvm.org/D52678



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to