[Lldb-commits] [PATCH] D51569: Hold GIL while allocating memory for PythonString.

2018-09-02 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 163646.
tatyana-krasnukha added a comment.

%feature("nothreadallow") looks more appropriate in this case. GetDescription 
method is quite cheap, no need to handle the GIL.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51569

Files:
  scripts/Python/python-extensions.swig


Index: scripts/Python/python-extensions.swig
===
--- scripts/Python/python-extensions.swig
+++ scripts/Python/python-extensions.swig
@@ -1,4 +1,4 @@
-
+%feature("nothreadallow");
 %extend lldb::SBAddress {
 PyObject *lldb::SBAddress::__str__ (){
 lldb::SBStream description;
@@ -121,6 +121,7 @@
 print >>sb_command_return_object, "something"
 will work correctly */
 
+%feature("nothreadallow", "");
 void lldb::SBCommandReturnObject::write (const char* str)
 {
 if (str)
@@ -129,6 +130,8 @@
 void lldb::SBCommandReturnObject::flush ()
 {}
 }
+
+%feature("nothreadallow");
 %extend lldb::SBCompileUnit {
 PyObject *lldb::SBCompileUnit::__str__ (){
 lldb::SBStream description;
@@ -457,6 +460,7 @@
 return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
 %}
 }
+%feature("nothreadallow", "");
 %extend lldb::SBStream {
 /* the write() and flush() calls are not part of the SB API proper, 
and are solely for Python usage
 they are meant to make an SBStream into a file-like object so that 
instructions of the sort
@@ -471,6 +475,7 @@
 void lldb::SBStream::flush ()
 {}
 }
+%feature("nothreadallow");
 %extend lldb::SBSymbol {
 PyObject *lldb::SBSymbol::__str__ (){
 lldb::SBStream description;
@@ -827,6 +832,7 @@
 }
 }
 
+%feature("nothreadallow", "");
 
 // %extend lldb::SBDebugger {
 // // FIXME: We can't get the callback and baton


Index: scripts/Python/python-extensions.swig
===
--- scripts/Python/python-extensions.swig
+++ scripts/Python/python-extensions.swig
@@ -1,4 +1,4 @@
-
+%feature("nothreadallow");
 %extend lldb::SBAddress {
 PyObject *lldb::SBAddress::__str__ (){
 lldb::SBStream description;
@@ -121,6 +121,7 @@
 print >>sb_command_return_object, "something"
 will work correctly */
 
+%feature("nothreadallow", "");
 void lldb::SBCommandReturnObject::write (const char* str)
 {
 if (str)
@@ -129,6 +130,8 @@
 void lldb::SBCommandReturnObject::flush ()
 {}
 }
+
+%feature("nothreadallow");
 %extend lldb::SBCompileUnit {
 PyObject *lldb::SBCompileUnit::__str__ (){
 lldb::SBStream description;
@@ -457,6 +460,7 @@
 return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
 %}
 }
+%feature("nothreadallow", "");
 %extend lldb::SBStream {
 /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
 they are meant to make an SBStream into a file-like object so that instructions of the sort
@@ -471,6 +475,7 @@
 void lldb::SBStream::flush ()
 {}
 }
+%feature("nothreadallow");
 %extend lldb::SBSymbol {
 PyObject *lldb::SBSymbol::__str__ (){
 lldb::SBStream description;
@@ -827,6 +832,7 @@
 }
 }
 
+%feature("nothreadallow", "");
 
 // %extend lldb::SBDebugger {
 // // FIXME: We can't get the callback and baton
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D51578: DWARFConcatenatingDataExtractor for D32167

2018-09-02 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, davide.
jankratochvil added a project: LLDB.
Herald added subscribers: JDevlieghere, aprantl, mgorny.

Tried to address Greg Clayton's performance concerns 
 here:
Rebased https://reviews.llvm.org/D32167:

  real=0m0.909s user=0m14.254s

Rebased https://reviews.llvm.org/D32167 patched by 
DWARFConcatenatingDataExtractor:

  real=0m0.927s user=0m14.405s

Built by `clang-7.0.0-0.6.rc2.fc30.x86_64` as `RelWithDebInfo`. Tested by 
`image lookup --type` (to force manual indexing) on DWARF-3 `.debug_info`-only 
613MB file with no index.

There is just an additional SmallVector.size() comparison + two indirect 
fetches.

With this patch one could revert the new `GetData()` from 
https://reviews.llvm.org/D46606 but the code may be cleaner with it anyway. It 
is just no longer needed to be virtual so this patch removes its virtuality.

Rebased https://reviews.llvm.org/D32167:

  git clone -b gdbtypes git://git.jankratochvil.net/lldb
  https://people.redhat.com/jkratoch/lldb-D32167.patch

Rebased https://reviews.llvm.org/D32167 patched by 
DWARFConcatenatingDataExtractor - this patch:

  git clone -b concat   git://git.jankratochvil.net/lldb
  https://people.redhat.com/jkratoch/lldb-D32167-2018-09-02.patch


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51578

Files:
  include/lldb/lldb-forward.h
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFConcatenatingDataExtractor.cpp
  source/Plugins/SymbolFile/DWARF/DWARFConcatenatingDataExtractor.h
  source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -36,6 +36,7 @@
 #include "lldb/lldb-private.h"
 
 // Project includes
+#include "DWARFConcatenatingDataExtractor.h"
 #include "DWARFDataExtractor.h"
 #include "DWARFDefines.h"
 #include "DWARFIndex.h"
@@ -252,6 +253,9 @@
   const lldb_private::DWARFDataExtractor &get_apple_objc_data();
   const lldb_private::DWARFDataExtractor &get_gnu_debugaltlink();
 
+  const lldb_private::DWARFConcatenatingDataExtractor &
+  get_debug_concatenated_data();
+
   DWARFDebugAbbrev *DebugAbbrev();
 
   const DWARFDebugAbbrev *DebugAbbrev() const;
@@ -459,6 +463,8 @@
   std::unique_ptr m_dwp_symfile;
 
   lldb_private::DWARFDataExtractor m_dwarf_data;
+  llvm::once_flag m_concatenated_data_once;
+  lldb_private::DWARFConcatenatingDataExtractor m_concatenated_data;
 
   DWARFDataSegment m_data_debug_abbrev;
   DWARFDataSegment m_data_debug_addr;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -580,24 +580,8 @@
 const DWARFDataExtractor &
 SymbolFileDWARF::GetCachedSectionData(lldb::SectionType sect_type,
   DWARFDataSegment &data_segment) {
-  llvm::call_once(data_segment.m_flag, [&] {
+  llvm::call_once(data_segment.m_flag, [this, sect_type, &data_segment] {
 this->LoadSectionData(sect_type, std::ref(data_segment.m_data));
-if (sect_type == eSectionTypeDWARFDebugTypes) {
-  // To add .debug_types support in DWARF 4 and earlier with minimally
-  // invasive changes to the current DWARF parsing code, we pretend that
-  // any DIEs in .debug_types start at the end of the .debug_info section.
-  // All info in .debug_types is relative and has no external DIE
-  // references unless thay are DW_AT_signature references, so the DIE
-  // offset for things in the .debug_types. If we do this, then we can
-  // just add the type units to the compile unit

[Lldb-commits] [PATCH] D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5

2018-09-02 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In https://reviews.llvm.org/D32167#1215821, @clayborg wrote:

> I have stalled on this due to performance. Anything I do will ruin the 
> performance of 99% of the DWARF consumers for .debug_types which is rarely 
> used by our clients.


I have tried to implement it with acceptable performance as 
https://reviews.llvm.org/D51578.


https://reviews.llvm.org/D32167



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


[Lldb-commits] [PATCH] D48704: [LLDB] Fix for "Bug 37950: ExecutionContext::GetByteOrder() always returns endian::InlHostByteOrder()"

2018-09-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

Do we have a test case for different target byte orders that could be used as a 
test template here? Otherwise I would just merge this in as the previous 
behavior of this function was clearly wrong.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D48704



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


[Lldb-commits] [PATCH] D51569: Hold GIL while allocating memory for PythonString.

2018-09-02 Thread Enrico Granata via Phabricator via lldb-commits
granata.enrico resigned from this revision.
granata.enrico added a comment.

I don't work on LLDB anymore. I am sure Greg will do a fine job reviewing!


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51569



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


[Lldb-commits] [PATCH] D48704: [LLDB] Fix for "Bug 37950: ExecutionContext::GetByteOrder() always returns endian::InlHostByteOrder()"

2018-09-02 Thread Venkata Ramanaiah Nalamothu via Phabricator via lldb-commits
ramana-nvr added a comment.

Sorry, I don't have a test case for this and I am yet to understand lldb test 
suite to create one.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D48704



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