alvinhochun added inline comments.

================
Comment at: lldb/source/Commands/CommandObjectTarget.cpp:1551-1556
+          strm.Indent("    Value: ");
+          strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetRawValue());
+          if (symbol->GetByteSizeIsValid()) {
+            strm.Indent("    Size: ");
+            strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetByteSize());
+          }
----------------
clayborg wrote:
> alvinhochun wrote:
> > May I ask, is it expected for this to print only the value and size but not 
> > the name of the symbol?
> > 
> > Also, in some COFF binaries linked by LLD there are a bunch of absolute 
> > symbols (e.g. `__guard_flags`) and when they hit this code path all they 
> > print is `Value: 0xffffffffffffffff`.
> > 
> > llvm-readobj shows the symbol as:
> > 
> > ```
> >   Symbol {
> >     Name: __guard_flags
> >     Value: 2147550464
> >     Section: IMAGE_SYM_ABSOLUTE (-1)
> >     BaseType: Null (0x0)
> >     ComplexType: Null (0x0)
> >     StorageClass: External (0x2)
> >     AuxSymbolCount: 0
> >   }
> > ```
> > Though neither values are correct. I expect the value to be `0x10500`. I 
> > haven't looked into this yet. Any idea what might be going on?
> We should be printing the name. I guess in the "symbol->ValueIsAddress()" 
> case it would print the name from the symbolication of the address. Should be 
> an easy fix, feel free to submit a patch, or I can try to get to it when i 
> have some time.
> 
> I would look at the 
> lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp and check the 
> "ObjectFilePECOFF::ParseSymtab(Symtab &symtab)" method. It must not be 
> creating the symbols correctly from the symbol table. Any fixes for the 
> PECOFF object file plug-in would be appreciated if you find any issues or 
> things we can do better. Back in the day I had a hard time getting any symbol 
> table the show up in the PECOFF file, but that was a long time ago and I 
> wasn't super familiar with Windows binaries.
Thanks for the reply. I can make a patch for this and the indentation issue.

I did find out how to get lldb to load COFF absolute symbols, but I think there 
may be a separate issue with LLD actually writing the wrong value to the file 
in the first place. Anyway I will try to fix that separately.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131705/new/

https://reviews.llvm.org/D131705

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

Reply via email to