[Lldb-commits] [lldb] r355629 - [lldb] Fix DW_OP_addrx uses.

2019-10-04 Thread Ali Tamur via lldb-commits
Author: tamur
Date: Thu Mar  7 11:41:08 2019
New Revision: 355629

URL: http://llvm.org/viewvc/llvm-project?rev=355629&view=rev
Log:
[lldb] Fix DW_OP_addrx uses.

Summary: DW_OP_GNU_addr_index has been renamed as DW_OP_addrx in the standard. 
clang produces DW_OP_addrx tags and with this change lldb starts to process 
them.

Reviewers: aprantl, jingham, davide, clayborg, serge-sans-paille

Reviewed By: aprantl

Subscribers: jdoerfert, dblaikie, labath, shafik, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D59004

Added:
lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s
Modified:
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp

Added: lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s?rev=355629&view=auto
==
--- lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s (added)
+++ lldb/trunk/lit/SymbolFile/DWARF/dwarf5_locations.s Thu Mar  7 11:41:08 2019
@@ -0,0 +1,66 @@
+# This tests that lldb is able to process DW_OP_addrx tags introduced in 
dwarf5.
+# REQUIRES: lld
+# RUN: llvm-mc -g -dwarf-version=5 -triple x86_64-unknown-linux-gnu %s 
-filetype=obj > %t.o
+# RUN: ld.lld -m elf_x86_64 %t.o -o %t 
+# RUN: lldb-test symbols %t | FileCheck %s
+
+# CHECK: Variable{0x0011}, name = "color"
+# CHECK-SAME: location = DW_OP_addrx(0x0)
+
+.text
+.section.debug_str,"MS",@progbits,1
+.Lstr_offsets_base0:
+.asciz  "color"
+
+.section.debug_str_offsets,"",@progbits
+.long   .Lstr_offsets_base0
+
+.section.debug_abbrev,"",@progbits
+.byte   1   # Abbreviation Code
+.byte   17  # DW_TAG_compile_unit
+.byte   1   # DW_CHILDREN_yes
+.byte   114 # DW_AT_str_offsets_base
+.byte   23  # DW_FORM_sec_offset
+.byte   0   # EOM(1)
+.byte   0   # EOM(2)
+.byte   2   # Abbreviation Code
+.byte   52  # DW_TAG_variable
+.byte   0   # DW_CHILDREN_no
+.byte   3   # DW_AT_name
+.byte   37  # DW_FORM_strx1
+.byte   63  # DW_AT_external
+.byte   25  # DW_FORM_flag_present
+.byte   2   # DW_AT_location
+.byte   24  # DW_FORM_exprloc
+.byte   0   # EOM(1)
+.byte   0   # EOM(2)
+.byte   0   # EOM(3)
+.byte   0   # EOM(4)
+
+.section.debug_info,"",@progbits
+.long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+.short  5   # DWARF version number
+.byte   1   # DWARF Unit Type
+.byte   8   # Address Size (in bytes)
+.long   .debug_abbrev   # Offset Into Abbrev. Section
+.byte   1   # Abbrev [1] 0xc:0x22 
DW_TAG_compile_unit
+.long   .Lstr_offsets_base0 # DW_AT_str_offsets_base
+.byte   2   # Abbrev [2] 0x1e:0xb DW_TAG_variable
+.byte   0   # DW_AT_name
+# DW_AT_external
+.byte   2   # DW_AT_location
+.byte   161
+.byte   0
+.byte   0   # End Of Children Mark
+.Ldebug_info_end0:
+
+.section.debug_addr,"",@progbits
+.long   .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+.short  5   # DWARF version number
+.byte   8   # Address size
+.byte   0   # Segment selector size
+.quad   color
+.Ldebug_addr_end0:
+

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=355629&r1=355628&r2=355629&view=diff
==
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Thu Mar  7 11:41:08 2019
@@ -514,6 +514,10 @@ void DWARFExpression::DumpLocation(Strea
   s->Printf("DW_OP_GNU_addr_index(0x%" PRIx64 ")",
 m_data.GetULEB128(&offset));
   break;
+case DW_OP_addr

[Lldb-commits] [lldb] r364614 - Fixing a couple of wrong logical operator bugs.

2019-10-04 Thread Ali Tamur via lldb-commits
Author: tamur
Date: Thu Jun 27 17:11:26 2019
New Revision: 364614

URL: http://llvm.org/viewvc/llvm-project?rev=364614&view=rev
Log:
Fixing a couple of wrong logical operator bugs.

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h?rev=364614&r1=364613&r2=364614&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
 Thu Jun 27 17:11:26 2019
@@ -240,7 +240,7 @@ protected:
   image_infos_addr = LLDB_INVALID_ADDRESS;
 }
 
-bool IsValid() const { return version >= 1 || version <= 2; }
+bool IsValid() const { return version >= 1 && version <= 2; }
   };
 
   void RegisterNotificationCallbacks();

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=364614&r1=364613&r2=364614&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h 
Thu Jun 27 17:11:26 2019
@@ -121,7 +121,7 @@ protected:
   dyldImageLoadAddress = LLDB_INVALID_ADDRESS;
 }
 
-bool IsValid() const { return version >= 1 || version <= 6; }
+bool IsValid() const { return version >= 1 && version <= 6; }
   };
 
   static lldb::ByteOrder GetByteOrderFromMagic(uint32_t magic);


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