[Lldb-commits] [PATCH] D56010: [NativePDB] Fix setting breakpoint by file and line

2018-12-24 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov accepted this revision.
aleksandr.urakov added a comment.
This revision is now accepted and ready to land.

LGTM too!


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

https://reviews.llvm.org/D56010



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


[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types

2018-12-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added subscribers: dblaikie, jankratochvil.
jankratochvil added a comment.

There is a regression in trunk clang+lldb.  Using either 7.0 clang or 7.0 lldb 
makes the testcases PASS but both trunk clang and trunk lldb makes the testcase 
FAIL.
This commit (rL346165 ) is the regressing 
one for LLDB, commit rL349207  by @dblaikie 
is the regressing one for clang.

TestChar1632T.py

FAIL:

  
Failure-TestChar1632T-Char1632TestCase-test_dwo-x86_64-redhat-llvm-monorepo-clang-bin-clang-8.log
  runCmd: frame variable as16 as32
  output: (char16_t []) as16 = {}
  (char32_t []) as32 = {}

PASS:

  
Success-TestChar1632T-Char1632TestCase-test_dwo-x86_64-redhat-llvm-monorepo-clang-bin-clang-8.log
  runCmd: frame variable as16 as32
  output: (char16_t [64]) as16 = u"ﺸﺵۻ"
  (char32_t [64]) as32 = U"ЕЙРГЖО"

| clang-1 | lldb-1 | PASS |
| clang-1 | lldb   | PASS |
| clang   | lldb-1 | PASS |
| clang   | lldb   | FAIL |
|

monorepo:
clang-1=d162fb426deb61f897038e07ebd2fcaae8e51c01^=b36eb520c704507990b039011cc02c3da181c461
clang  =d162fb426deb61f897038e07ebd2fcaae8e51c01
lldb 
-1=0154738f9a1f73b5fe108671f61554b94eabf3fb^=91e3d2bffe38dbde2976cbb76cecce97a3e94af6
lldb   =0154738f9a1f73b5fe108671f61554b94eabf3fb

git:
clang = b4b260e17979210464c395ee00e6c985f305a16e = 
https://reviews.llvm.org/rL349207
lldb= 8fea0d8957787360d7e5abefc7b6a94991c07f85 = 
https://reviews.llvm.org/rL346165 = https://reviews.llvm.org/D53530

GDB seems to handle the clang output OK:

  gdb -batch -ex 'b 42' -ex r -ex 'p as16' -ex 'p as32' 
./lldb-test-build.noindex/lang/cpp/char1632_t/TestChar1632T.test_dwo/a.out
  ...
  $1 = 
u"色ハ匂ヘト散リヌルヲ\000\000\000\000\000\000y\000\000\000\xde08@\000\000᯿\001\000\000ᰰ\001\000\000ミ\x\x\xѰ\000\000\000ᇁ\000Ҡ\000ᕭ@\000\000ῠ翿\000\000\000\000\000ᔠ@\000\000ၐ@\000"
  $2 = 
U"෴\000РГЖО\000\000\000\000\x6562b026\000\xf7ffea80翿\xf7b89061翿\xf7c55c60翿ɐ\000\xf7c564f8翿\xf7b1d5ad翿\002\000\xf7b198d7翿\000\000\x405000\000ɰ\000\xf000\x\000\000\000\000\000\000\000\000\000\000\xf7c55cc0翿#\000\000\000\xff90\x\xf7c55c60翿ɐ\000\xf7b1a909翿ɀ\000\000"

Using for the test:

  
PYTHONPATH=$PWD/lib64/python2.7/site-packages:$PWD/lib64/python2.7/site-packages/lldb"
 LD_LIBRARY_PATH=$PWD/lib:$PWD/lib64/python2.7/site-packages/lldb" 
../llvm-monorepo/lldb/test/dotest.py --executable /PATH/TO/bin/lldb -C 
$PWD/bin/clang --log-success -t 
../llvm-monorepo/lldb/packages/Python/lldbsuite/test/  -p TestChar1632T.py


Repository:
  rL LLVM

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

https://reviews.llvm.org/D53530



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


[Lldb-commits] [PATCH] D55998: ELF: create "container" sections from PT_LOAD segments

2018-12-24 Thread Joerg Sonnenberger via Phabricator via lldb-commits
joerg added a comment.

In D55998#1340448 , @jankratochvil 
wrote:

> > it is in theory possible to create an elf file where only a part of a 
> > section would belong to some segment (and another part to a different one).
>
> ELF standard : "//An object file 
> segment contains one or more sections.//", "//An object file segment 
> comprises one or more sections//"


I wouldn't rule out smart tools splitting a section into a read-only and 
read-write part on linking. So no, I certainly wouldn't assume any direct 
correspondance between segments and sections.


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

https://reviews.llvm.org/D55998



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


[Lldb-commits] [PATCH] D56068: Use reference only for DW_FORM_ref*

2018-12-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, aprantl.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.

D53530  could interpret `DW_AT_count` in 
`DW_FORM_data1` as a DIE reference as it did not verify its form. Verify that 
reference really uses only `DW_FORM_ref*`  forms as it could otherwise 
accidentally follow a constant number as DIE offset. That fixes a regression as 
described there. 
That `DW_FORM_ref_sig8` comment should be updated by D54670 
 after it gets approved.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D56068

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -71,6 +71,7 @@
   bool ExtractValue(const lldb_private::DWARFDataExtractor &data,
 lldb::offset_t *offset_ptr);
   const uint8_t *BlockData() const;
+  bool FormIsReference() const;
   uint64_t Reference() const;
   uint64_t Reference(dw_offset_t offset) const;
   bool Boolean() const { return m_value.value.uval != 0; }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -603,6 +603,25 @@
   return symbol_file->get_debug_addr_data().GetMaxU64(&offset, index_size);
 }
 
+bool DWARFFormValue::FormIsReference() const {
+  switch (m_form) {
+  case DW_FORM_ref1:
+  case DW_FORM_ref2:
+  case DW_FORM_ref4:
+  case DW_FORM_ref8:
+  case DW_FORM_ref_udata:
+  case DW_FORM_ref_addr:
+return true;
+break;
+
+  // It cannot be resolved by the Reference() method.
+  case DW_FORM_ref_sig8:
+  default:
+break;
+  }
+  return false;
+}
+
 uint64_t DWARFFormValue::Reference() const {
   uint64_t die_offset = m_value.value.uval;
   switch (m_form) {
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -1001,7 +1001,8 @@
 bool check_specification_or_abstract_origin) const {
   DWARFFormValue form_value;
   if (GetAttributeValue(dwarf2Data, cu, attr, form_value, nullptr,
-check_specification_or_abstract_origin))
+check_specification_or_abstract_origin)
+  && form_value.FormIsReference())
 return form_value.Reference();
   return fail_value;
 }


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -71,6 +71,7 @@
   bool ExtractValue(const lldb_private::DWARFDataExtractor &data,
 lldb::offset_t *offset_ptr);
   const uint8_t *BlockData() const;
+  bool FormIsReference() const;
   uint64_t Reference() const;
   uint64_t Reference(dw_offset_t offset) const;
   bool Boolean() const { return m_value.value.uval != 0; }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -603,6 +603,25 @@
   return symbol_file->get_debug_addr_data().GetMaxU64(&offset, index_size);
 }
 
+bool DWARFFormValue::FormIsReference() const {
+  switch (m_form) {
+  case DW_FORM_ref1:
+  case DW_FORM_ref2:
+  case DW_FORM_ref4:
+  case DW_FORM_ref8:
+  case DW_FORM_ref_udata:
+  case DW_FORM_ref_addr:
+return true;
+break;
+
+  // It cannot be resolved by the Reference() method.
+  case DW_FORM_ref_sig8:
+  default:
+break;
+  }
+  return false;
+}
+
 uint64_t DWARFFormValue::Reference() const {
   uint64_t die_offset = m_value.value.uval;
   switch (m_form) {
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -1001,7 +1001,8 @@
 bool check_specification_or_abstract_origin) const {
   DWARFFormValue form_value;
   if (GetAttributeValue(dwarf2Data, cu, attr, form_value, nullptr,
-check_specification_or_abstract_origin))
+check_specification_or_abstr

[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types

2018-12-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added inline comments.



Comment at: 
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3476
+  if (DWARFDIE var_die = die.GetReferencedDIE(DW_AT_count)) {
+if (var_die.Tag() == DW_TAG_variable)
+  if (exe_ctx) {

Here it could accidentally follow a number as DIE reference, addressed by: 
D56068



Repository:
  rL LLVM

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

https://reviews.llvm.org/D53530



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