[Lldb-commits] [PATCH] D131705: Don't create sections for SHN_ABS symbols in ELF files.

2022-09-17 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun added inline comments.



Comment at: lldb/source/Commands/CommandObjectTarget.cpp:1550
+} else {
+  strm.IndentMore();
+  strm.Indent("Value: ");

This `IndentMore` added is missing a matching `IndentLess` call.



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());
+  }

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: 0x`.

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?


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


[Lldb-commits] [PATCH] D134111: [lldb] Add newline in output of `target modules lookup`

2022-09-17 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun created this revision.
alvinhochun added a reviewer: labath.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This adds a line break between each result address in the output of the
lldb command `target modules lookup`. Before this change, a new address
result will be printed on the same line as the summary of the last
result, making the output difficult to view.

Also adds a test for this command.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134111

Files:
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/test/Shell/Commands/Inputs/symbols.yaml
  lldb/test/Shell/Commands/command-target-modules-lookup.test


Index: lldb/test/Shell/Commands/command-target-modules-lookup.test
===
--- /dev/null
+++ lldb/test/Shell/Commands/command-target-modules-lookup.test
@@ -0,0 +1,13 @@
+# RUN: yaml2obj %S/Inputs/symbols.yaml -o %t
+
+# RUN: %lldb %t -b -o "target modules lookup -A -r -s some" | FileCheck %s 
-DMODULE=%basename_t.tmp
+# CHECK:  4 symbols match the regular expression 'some' in 
{{.*}}[[MODULE]]:
+# CHECK-NEXT: Address: [[MODULE]][0x] ([[MODULE]]..text + 0)
+# CHECK-NEXT: Summary: [[MODULE]]`someFunc(int, int, int)
+# CHECK-NEXT: Address: [[MODULE]][0x001c] ([[MODULE]]..text + 28)
+# CHECK-NEXT: Summary: [[MODULE]]`someFunc(char, int)
+# CHECK-NEXT: Address: [[MODULE]][0x0034] ([[MODULE]]..text + 52)
+# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc()
+# CHECK-NEXT: Address: [[MODULE]][0x0038] ([[MODULE]]..text + 56)
+# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc(double)
+# CHECK-NOT:  ignoreThisFunction
Index: lldb/test/Shell/Commands/Inputs/symbols.yaml
===
--- /dev/null
+++ lldb/test/Shell/Commands/Inputs/symbols.yaml
@@ -0,0 +1,48 @@
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_REL
+  Machine: EM_AARCH64
+  SectionHeaderStringTable: .strtab
+Sections:
+  - Name:.text
+Type:SHT_PROGBITS
+Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
+AddressAlign:0x4
+  - Type:SectionHeaderTable
+Sections:
+  - Name:.text
+  - Name:.strtab
+  - Name:.symtab
+Symbols:
+  - Name:_Z8someFunciii
+Type:STT_FUNC
+Section: .text
+Binding: STB_GLOBAL
+Size:0x1C
+  - Name:_Z8someFuncci
+Type:STT_FUNC
+Section: .text
+Binding: STB_GLOBAL
+Value:   0x1C
+Size:0x18
+  - Name:_Z13someOtherFuncv
+Type:STT_FUNC
+Section: .text
+Binding: STB_GLOBAL
+Value:   0x34
+Size:0x4
+  - Name:_Z13someOtherFuncd
+Type:STT_FUNC
+Section: .text
+Binding: STB_GLOBAL
+Value:   0x38
+Size:0x10
+  - Name:_Z18ignoreThisFunctionv
+Type:STT_FUNC
+Section: .text
+Binding: STB_GLOBAL
+Value:   0x48
+Size:0x8
+...
Index: lldb/source/Commands/CommandObjectTarget.cpp
===
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -1546,6 +1546,7 @@
   DumpAddress(
   interpreter.GetExecutionContext().GetBestExecutionContextScope(),
   symbol->GetAddressRef(), verbose, all_ranges, strm);
+  strm.EOL();
 } else {
   strm.IndentMore();
   strm.Indent("Value: ");


Index: lldb/test/Shell/Commands/command-target-modules-lookup.test
===
--- /dev/null
+++ lldb/test/Shell/Commands/command-target-modules-lookup.test
@@ -0,0 +1,13 @@
+# RUN: yaml2obj %S/Inputs/symbols.yaml -o %t
+
+# RUN: %lldb %t -b -o "target modules lookup -A -r -s some" | FileCheck %s -DMODULE=%basename_t.tmp
+# CHECK:  4 symbols match the regular expression 'some' in {{.*}}[[MODULE]]:
+# CHECK-NEXT: Address: [[MODULE]][0x] ([[MODULE]]..text + 0)
+# CHECK-NEXT: Summary: [[MODULE]]`someFunc(int, int, int)
+# CHECK-NEXT: Address: [[MODULE]][0x001c] ([[MODULE]]..text + 28)
+# CHECK-NEXT: Summary: [[MODULE]]`someFunc(char, int)
+# CHECK-NEXT: Address: [[MODULE]][0x0034] ([[MODULE]]..text + 52)
+# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc()
+# CHECK-NEXT: Address: [[MODULE]][0x0038] ([[MODULE]]..text + 56)
+# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc(double)
+# CHECK-NOT:  ignoreThisFunction
Index: lldb/test/Shell/Commands/Inputs/symbols.yam

[Lldb-commits] [PATCH] D130796: [LLDB][NativePDB] Switch to use DWARFLocationList.

2022-09-17 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

FYI, this change caused a strange regression for reading PDB files in i386 
mode, when LLDB is built in mingw mode (not when it is built in MSVC mode), see 
https://github.com/llvm/llvm-project/issues/57799 for details.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130796

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


[Lldb-commits] [PATCH] D134041: [LLDB] Enable non-trivial types in EmulateInstruction::Context

2022-09-17 Thread Thorsten via Phabricator via lldb-commits
tschuett added a comment.

Sorry. I hoped that variant would make your life easier.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134041

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