[Lldb-commits] [lldb] 224caaf - [nfc] [lldb] Delete an empty trailing line.

2020-10-18 Thread Jan Kratochvil via lldb-commits

Author: Jan Kratochvil
Date: 2020-10-18T10:16:00+02:00
New Revision: 224caaf69b8110450a831c53788c74f827eacdb7

URL: 
https://github.com/llvm/llvm-project/commit/224caaf69b8110450a831c53788c74f827eacdb7
DIFF: 
https://github.com/llvm/llvm-project/commit/224caaf69b8110450a831c53788c74f827eacdb7.diff

LOG: [nfc] [lldb] Delete an empty trailing line.

A patchset being prepared shows needless diffs.

Added: 


Modified: 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Removed: 




diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 874978bf1398..8d393b295443 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -199,4 +199,3 @@ DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
 return cu->GetNonSkeletonUnit().GetDIE(die_ref.die_offset());
   return DWARFDIE(); // Not found
 }
-



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


[Lldb-commits] [lldb] fa89f64 - [nfc] [lldb] [testsuite] Fix DW_FORM_ref* in DW_AT_declaration-with-children.s .

2020-10-18 Thread Jan Kratochvil via lldb-commits

Author: Jan Kratochvil
Date: 2020-10-18T16:57:27+02:00
New Revision: fa89f641cf9fc5af4e88642cc894f83845b4cabe

URL: 
https://github.com/llvm/llvm-project/commit/fa89f641cf9fc5af4e88642cc894f83845b4cabe
DIFF: 
https://github.com/llvm/llvm-project/commit/fa89f641cf9fc5af4e88642cc894f83845b4cabe.diff

LOG: [nfc] [lldb] [testsuite] Fix DW_FORM_ref* in 
DW_AT_declaration-with-children.s .

There were invalid DIE references which nobody used. If LLDB starts to
report invalid DIE references it would lock up (mutex lock).

These invalid DIE references are there since initial check-in by:
  https://reviews.llvm.org/D83302

Added: 


Modified: 
lldb/test/Shell/SymbolFile/DWARF/DW_AT_declaration-with-children.s

Removed: 




diff  --git 
a/lldb/test/Shell/SymbolFile/DWARF/DW_AT_declaration-with-children.s 
b/lldb/test/Shell/SymbolFile/DWARF/DW_AT_declaration-with-children.s
index 9365dd966ed8..3fdee57b6687 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/DW_AT_declaration-with-children.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/DW_AT_declaration-with-children.s
@@ -147,10 +147,6 @@ c1:
 .byte   6   # DW_FORM_data4
 .byte   64  # DW_AT_frame_base
 .byte   24  # DW_FORM_exprloc
-.byte   100 # DW_AT_object_pointer
-.byte   19  # DW_FORM_ref4
-.byte   71  # DW_AT_specification
-.byte   19  # DW_FORM_ref4
 .byte   0   # EOM(1)
 .byte   0   # EOM(2)
 .byte   11  # Abbreviation Code
@@ -222,8 +218,6 @@ c1:
 .long   .LZN1AC2Ev_end-_ZN1AC2Ev# DW_AT_high_pc
 .byte   1   # DW_AT_frame_base
 .byte   86
-.long   147 # DW_AT_object_pointer
-.long   68  # DW_AT_specification
 .byte   11  # Abbrev [11] 
DW_TAG_formal_parameter
 .byte   2   # DW_AT_location
 .byte   145



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


[Lldb-commits] [PATCH] D83302: [lldb/DWARF] Don't treat class declarations with children as definitions

2020-10-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

Fixed stale+unused `DW_AT_object_pointer`+`DW_AT_specification` by 
rGfa89f641cf9f 
.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83302

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


[Lldb-commits] [PATCH] D89646: [nfc] [lldb] Move `LookupAddress` to `DWARFCompileUnit`

2020-10-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added a reviewer: labath.
jankratochvil added projects: Upstreaming LLDB's downstream patches, LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

`LookupAddress` makes no sense for `DWARFTypeUnit`. Also make 
`GetNonSkeletonUnit` to preserve the called type.
It is just a part of my bigger DWZ patchset needing these but I find it useful 
on its own.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89646

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp


Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1811,7 +1811,8 @@
   bool lookup_block,
   SymbolContext &sc) {
   assert(sc.comp_unit);
-  DWARFUnit &cu = GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
+  DWARFCompileUnit &cu =
+  GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
   DWARFDIE function_die = cu.LookupAddress(file_vm_addr);
   DWARFDIE block_die;
   if (function_die) {
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -105,7 +105,6 @@
   };
   ScopedExtractDIEs ExtractDIEsScoped();
 
-  DWARFDIE LookupAddress(const dw_addr_t address);
   bool Verify(lldb_private::Stream *s) const;
   virtual void Dump(lldb_private::Stream *s) const = 0;
   /// Get the data that contains the DIE information for this unit.
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -392,17 +392,6 @@
   m_dwo = std::shared_ptr(std::move(dwo_symbol_file), dwo_cu);
 }
 
-DWARFDIE DWARFUnit::LookupAddress(const dw_addr_t address) {
-  if (DIE()) {
-const DWARFDebugAranges &func_aranges = GetFunctionAranges();
-
-// Re-check the aranges auto pointer contents in case it was created above
-if (!func_aranges.IsEmpty())
-  return GetDIE(func_aranges.FindAddress(address));
-  }
-  return DWARFDIE();
-}
-
 size_t DWARFUnit::GetDebugInfoSize() const {
   return GetLengthByteSize() + GetLength() - GetHeaderByteSize();
 }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
@@ -20,6 +20,10 @@
 
   static bool classof(const DWARFUnit *unit) { return !unit->IsTypeUnit(); }
 
+  DWARFCompileUnit &GetNonSkeletonUnit();
+
+  DWARFDIE LookupAddress(const dw_addr_t address);
+
 private:
   DWARFCompileUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid,
const DWARFUnitHeader &header,
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -99,3 +99,18 @@
 }
   }
 }
+
+DWARFCompileUnit &DWARFCompileUnit::GetNonSkeletonUnit() {
+  return llvm::cast(DWARFUnit::GetNonSkeletonUnit());
+}
+
+DWARFDIE DWARFCompileUnit::LookupAddress(const dw_addr_t address) {
+  if (DIE()) {
+const DWARFDebugAranges &func_aranges = GetFunctionAranges();
+
+// Re-check the aranges auto pointer contents in case it was created above
+if (!func_aranges.IsEmpty())
+  return GetDIE(func_aranges.FindAddress(address));
+  }
+  return DWARFDIE();
+}


Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1811,7 +1811,8 @@
   bool lookup_block,
   SymbolContext &sc) {
   assert(sc.comp_unit);
-  DWARFUnit &cu = GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
+  DWARFCompileUnit &cu =
+  GetDWARFCompileUnit(sc.comp_unit)->GetNonSkeletonUnit();
   DWARFDIE function_die = cu.LookupAddress(file_vm_addr);
   DWARFDIE block_die;
   if (function_die) {
Index: lldb/source/Plugins/SymbolFile/

[Lldb-commits] [PATCH] D87172: Check if debug line sequences are starting after the first code segment

2020-10-18 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 298906.
aadsm added a comment.

Addressed all comments:

- Moved initialization code to InitializeObject
- Moved to lit test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87172

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/test/Shell/SymbolFile/DWARF/line-entries-invalid-addresses.yaml

Index: lldb/test/Shell/SymbolFile/DWARF/line-entries-invalid-addresses.yaml
===
--- /dev/null
+++ lldb/test/Shell/SymbolFile/DWARF/line-entries-invalid-addresses.yaml
@@ -0,0 +1,420 @@
+# RUN: yaml2obj %s > %t
+# RUN: %lldb %t -b -o "image lookup -f main.cpp -l 2 -v" | FileCheck %s
+# CHECK: LineEntry: {{.*}}main.cpp:2:{{.*}}
+
+# int foo() {
+# return 42;
+# }
+#
+# int main() {
+# int x = foo();
+# return x;
+# }
+# dwarfdump -debug-line:
+# AddressLine   Column File   ISA Discriminator Flags
+# -- -- -- -- --- - -
+# 0x00010f80  1  0  1   0 0  is_stmt
+# 0x00010f84  2  5  1   0 0  is_stmt prologue_end
+# 0x00010f8b  2  5  1   0 0  is_stmt end_sequence
+# 0x00010f90  5  0  1   0 0  is_stmt
+# 0x00010f90  5  0  1   0 0  is_stmt end_sequence
+# 0x000f  2 13  1   0 0  is_stmt prologue_end
+# 0x0014  2  9  1   0 0
+# 0x0017  3 12  1   0 0  is_stmt
+# 0x001d  3 12  1   0 0  end_sequence
+--- !mach-o
+FileHeader:
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x0003
+  filetype:0x000A
+  ncmds:   7
+  sizeofcmds:  1400
+  flags:   0x
+  reserved:0x
+LoadCommands:
+  - cmd: LC_UUID
+cmdsize: 24
+uuid:605D6BBF-4DB2-39F7-8068-F9BB3896DF0C
+  - cmd: LC_BUILD_VERSION
+cmdsize: 24
+platform:1
+minos:   659200
+sdk: 659206
+ntools:  0
+  - cmd: LC_SYMTAB
+cmdsize: 24
+symoff:  4096
+nsyms:   3
+stroff:  4144
+strsize: 37
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __PAGEZERO
+vmaddr:  0
+vmsize:  4294967296
+fileoff: 0
+filesize:0
+maxprot: 0
+initprot:0
+nsects:  0
+flags:   0
+  - cmd: LC_SEGMENT_64
+cmdsize: 232
+segname: __TEXT
+vmaddr:  4294967296
+vmsize:  4096
+fileoff: 0
+filesize:0
+maxprot: 5
+initprot:5
+nsects:  2
+flags:   0
+Sections:
+  - sectname:__text
+segname: __TEXT
+addr:0x00010F80
+size:48
+offset:  0x
+align:   4
+reloff:  0x
+nreloc:  0
+flags:   0x8400
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+content: CFFAEDFE070103000A00070078051B001800605D6BBF4DB239F7
+  - sectname:__unwind_info
+segname: __TEXT
+addr:0x00010FB0
+size:72
+offset:  0x
+align:   2
+reloff:  0x
+nreloc:  0
+flags:   0x
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+content: CFFAEDFE070103000A00070078051B001800605D6BBF4DB239F78068F9BB3896DF0C32001800010F0A00
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __LINKEDIT
+vmaddr:  4294971392
+vmsize:  4096
+fileoff: 4096
+filesize:85
+maxprot: 1
+initprot:1
+nsects:  0
+flags:   0
+  - cmd: LC_SEGMENT_64
+cmdsize: 952
+segname: __DWARF
+vmaddr:  4294975488
+vmsize:  4096
+fileoff: 8192
+filesize:839
+maxprot: 7
+initprot:3
+nsects:  4
+flags:   0
+Sections:
+  - sectname:__debug_line
+segname: __DWARF
+ad

[Lldb-commits] [PATCH] D87868: [RFC] When calling the process mmap try to call all found instead of just the first one

2020-10-18 Thread António Afonso via Phabricator via lldb-commits
aadsm added a comment.

Should I still go ahead with this since @labath implemented the memory 
allocation on lldb-server?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87868

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