[Lldb-commits] [PATCH] D119131: [lldb] List platform plugin *instances* in "platform list"

2022-02-10 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Thanks for the review.

BTW, I don't know if you're following discourse, Greg, but there is a 
continuation of the mailing list thread there 
https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594, and 
I'd like to hear your thoughts on it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119131

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


[Lldb-commits] [PATCH] D119146: [lldb/Platform] Decouple instance and plugin names

2022-02-10 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Given the renewed interest in the size of the ConstString pool, I'd like to 
avoid adding strings there without a good reason. And I don't see any reason 
why a name-based platform lookup should be on any hot path. A Target object 
holds a platform pointer, the current platform is a pointer, and anything else 
that is hot enough should probably hold a pointer instead of a name as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119146

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


[Lldb-commits] [PATCH] D119400: Fix a double debug info size counting in top level stats for "statistics dump".

2022-02-10 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Seems fine. I might consider changing the type of the `__dof_cache` section 
(whatever that is) instead of making an exception for `eSectionTypeDebug`. It 
don't see anything depending on it, and the exception looks weird.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119400

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


[Lldb-commits] [lldb] 2937b28 - Reland "[lldb] Remove non address bits when looking up memory regions"

2022-02-10 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2022-02-10T10:42:49Z
New Revision: 2937b282188bafb6bdb65ee87c70e9109aa910b7

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

LOG: Reland "[lldb] Remove non address bits when looking up memory regions"

This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.

Additional checks are added to fix the detection of the last memory region
in GetMemoryRegions or repeating the "memory region" command when the
target has non-address bits.

Normally you keep reading from address 0, looking up each region's end
address until you get LLDB_INVALID_ADDR as the region end address.
(0x)

This is what the remote will return once you go beyond the last mapped region:
[0xfffdf000-0x0001) rw- [stack]
[0x0001-0x) ---

Problem is that when we "fix" the lookup address, we remove some bits
from it. On an AArch64 system we have 48 bit virtual addresses, so when
we fix the end address of the [stack] region the result is 0.
So we loop back to the start.

[0xfffdf000-0x0001) rw- [stack]
[0x-0x0040) ---

To fix this I added an additional check for the last range.
If the end address of the region is different once you apply
FixDataAddress, we are at the last region.

Since the end of the last region will be the last valid mappable
address, plus 1. That 1 will be removed by the ABI plugin.

The only side effect is that on systems with non-address bits, you
won't get that last catch all unmapped region from the max virtual
address up to 0xf...f.

[0xf800-0xfffdf000) ---
[0xfffdf000-0x0001) rw- [stack]


Though in some way this is more correct because that region is not
just unmapped, it's not mappable at all.

No extra testing is needed because this is already covered by
TestMemoryRegion.py, I simply forgot to run it on system that had
both top byte ignore and pointer authentication.

This change has been tested on a qemu VM with top byte ignore,
memory tagging and pointer authentication enabled.

Reviewed By: omjavaid

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

Added: 
lldb/test/API/linux/aarch64/tagged_memory_region/Makefile

lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py
lldb/test/API/linux/aarch64/tagged_memory_region/main.c

Modified: 
lldb/include/lldb/Target/Process.h
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.h
lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
lldb/source/Plugins/Process/scripted/ScriptedProcess.h
lldb/source/Target/Process.cpp
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 12ed1e09227c..7911dac40b70 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1759,7 +1759,7 @@ class Process : public 
std::enable_shared_from_this,
   ///
   /// If load_addr is within the address space the process has mapped
   /// range_info will be filled in with the start and end of that range as
-  /// well as the permissions for that range and range_info.GetMapped will
+  /// well as the permissions for that range and range_info. GetMapped will
   /// return true.
   ///
   /// If load_addr is outside any mapped region then range_info will have its
@@ -1768,23 +1768,21 @@ class Process : public 
std::enable_shared_from_this,
   /// there are no valid mapped ranges between load_addr and the end of the
   /// process address space.
   ///
-  /// GetMemoryRegionInfo will only return an error if it is unimplemented for
-  /// the current process.
+  /// GetMemoryRegionInfo calls DoGetMemoryRegionInfo. Override that function 
in
+  /// process subclasses.
   ///
   /// \param[in] load_addr
-  /// The load address to query the range_info for.
+  /// The load address to query the range_info for. May include non
+  /// address bits, these will be removed by the the ABI plugin if there is
+  /// one.
   ///
   /// \param[out] range_info
   /// An range_info value containing the details of the r

[Lldb-commits] [PATCH] D115508: Reland "[lldb] Remove non address bits when looking up memory regions"

2022-02-10 Thread David Spickett via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2937b282188b: Reland "[lldb] Remove non address bits 
when looking up memory regions" (authored by DavidSpickett).

Changed prior to commit:
  https://reviews.llvm.org/D115508?vs=402542&id=407443#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115508

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
  lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.h
  lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
  lldb/source/Plugins/Process/scripted/ScriptedProcess.h
  lldb/source/Target/Process.cpp
  lldb/test/API/linux/aarch64/tagged_memory_region/Makefile
  
lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py
  lldb/test/API/linux/aarch64/tagged_memory_region/main.c
  llvm/docs/ReleaseNotes.rst

Index: llvm/docs/ReleaseNotes.rst
===
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -145,6 +145,12 @@
 Changes to LLDB
 -
 
+* The ``memory region`` command and ``GetMemoryRegionInfo`` API method now
+  ignore non-address bits in the address parameter. This also means that on
+  systems with non-address bits the last (usually unmapped) memory region
+  will not extend to 0xF...F. Instead it will end at the end of the mappable
+  range that the virtual address size allows.
+
 Changes to Sanitizers
 -
 
Index: lldb/test/API/linux/aarch64/tagged_memory_region/main.c
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_memory_region/main.c
@@ -0,0 +1,17 @@
+#include 
+#include 
+#include 
+#include 
+
+int main(int argc, char const *argv[]) {
+  void *the_page = mmap(0, sysconf(_SC_PAGESIZE), PROT_READ | PROT_EXEC,
+MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  if (the_page == MAP_FAILED)
+return 1;
+
+  // Put something in the top byte (AArch64 Linux always enables top byte
+  // ignore)
+  the_page = (void *)((size_t)the_page | ((size_t)0x34 << 56));
+
+  return 0; // Set break point at this line.
+}
Index: lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py
@@ -0,0 +1,70 @@
+"""
+Test that "memory region" lookup uses the ABI plugin to remove
+non address bits from addresses before lookup.
+"""
+
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class AArch64LinuxTaggedMemoryRegionTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+NO_DEBUG_INFO_TESTCASE = True
+
+# AArch64 Linux always enables the top byte ignore feature
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+def test_mte_regions(self):
+self.build()
+self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(self, "main.c",
+line_number('main.c', '// Set break point at this line.'),
+num_expected_locations=1)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+if self.process().GetState() == lldb.eStateExited:
+self.fail("Test program failed to run.")
+
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+# Despite the non address bits we should find a region
+self.expect("memory region the_page", patterns=[
+"\[0x[0-9A-Fa-f]+-0x[0-9A-Fa-f]+\) r-x"])
+
+# Check that the usual error message is displayed after repeating
+# the command until the last region.
+self.runCmd("memory region 0")
+
+# Count the number of repeats for use in the next check
+repeats = 0
+interp = self.dbg.GetCommandInterpreter()
+result = lldb.SBCommandReturnObject()
+
+while True:
+interp.HandleCommand("memory region", result)
+if result.Succeeded

[Lldb-commits] [PATCH] D119386: [lldb/Plugins] Clean-up ScriptedProcess python script (NFC)

2022-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM




Comment at: lldb/examples/python/scripted_process/scripted_process.py:264
  /// not be examined.
+eStateCrashed,   ///< Process or thread has crashed and can be 
examined.
 

Unrelated? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119386

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


[Lldb-commits] [lldb] 3db7cc1 - Fix a double debug info size counting in top level stats for "statistics dump".

2022-02-10 Thread Greg Clayton via lldb-commits

Author: Greg Clayton
Date: 2022-02-10T10:55:18-08:00
New Revision: 3db7cc1ba41f192d9eeb33cdaf06f4e95abf6bdc

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

LOG: Fix a double debug info size counting in top level stats for "statistics 
dump".

This mainly affects Darwin targets (macOS, iOS, tvOS and watchOS) when these 
targets don't use dSYM files and the debug info was in the .o files. All 
modules, including the .o files that are loaded by the debug maps, were in the 
global module list. This was great because it allows us to see each .o file and 
how much it contributes. There were virtual functions on the SymbolFile class 
to fetch the symtab/debug info parse and index times, and also the total debug 
info size. So the main executable would add all of the .o file's stats together 
and report them as its own data. Then the "totalDebugInfoSize" and many other 
"totalXXX" top level totals were all being added together. This stems from the 
fact that my original patch only emitted the modules for a target at the start 
of the patch, but as comments from the reviews came in, we switched to emitting 
all of the modules from the global module list.

So this patch fixes it so when we have a SymbolFileDWARFDebugMap that loads .o 
files, the main executable will have no debug info size or symtab/debug info 
parse/index times, but each .o file will have its own data as a separate 
module. Also, to be able to tell when/if we have a dSYM file I have added a 
"symbolFilePath" if the SymbolFile for the main modules path doesn't match that 
of the main executable. We also include a "symbolFileModuleIdentifiers" key in 
each module if the module does have multiple lldb_private::Module objects that 
contain debug info so that you can track down the information for a module and 
add up the contributions of all of the .o files.

Tests were added that are labeled with @skipUnlessDarwin and 
@no_debug_info_test that test all of this functionality so it doesn't regress.

For a module with a dSYM file, we can see the "symbolFilePath" is included:
```
  "modules": [
{
  "debugInfoByteSize": 1070,
  "debugInfoIndexLoadedFromCache": false,
  "debugInfoIndexSavedToCache": false,
  "debugInfoIndexTime": 0,
  "debugInfoParseTime": 0,
  "identifier": 4873280600,
  "path": 
"/Users/gclayton/Documents/src/lldb/main/Debug/lldb-test-build.noindex/commands/statistics/basic/TestStats.test_dsym_binary_has_symfile_in_stats/a.out",
  "symbolFilePath": 
"/Users/gclayton/Documents/src/lldb/main/Debug/lldb-test-build.noindex/commands/statistics/basic/TestStats.test_dsym_binary_has_symfile_in_stats/a.out.dSYM/Contents/Resources/DWARF/a.out",
  "symbolTableIndexTime": 7.9996e-06,
  "symbolTableLoadedFromCache": false,
  "symbolTableParseTime": 7.8996e-05,
  "symbolTableSavedToCache": false,
  "triple": "arm64-apple-macosx12.0.0",
  "uuid": "E1F7D85B-3A42-321E-BF0D-29B103F5F2E3"
},
```
And for the DWARF in .o file case we can see the "symbolFileModuleIdentifiers" 
in the executable's module stats:
```
  "modules": [
{
  "debugInfoByteSize": 0,
  "debugInfoIndexLoadedFromCache": false,
  "debugInfoIndexSavedToCache": false,
  "debugInfoIndexTime": 0,
  "debugInfoParseTime": 0,
  "identifier": 4603526968,
  "path": 
"/Users/gclayton/Documents/src/lldb/main/Debug/lldb-test-build.noindex/commands/statistics/basic/TestStats.test_no_dsym_binary_has_symfile_identifiers_in_stats/a.out",
  "symbolFileModuleIdentifiers": [
4604429832
  ],
  "symbolTableIndexTime": 7.9996e-06,
  "symbolTableLoadedFromCache": false,
  "symbolTableParseTime": 0.000112,
  "symbolTableSavedToCache": false,
  "triple": "arm64-apple-macosx12.0.0",
  "uuid": "57008BF5-A726-3DE9-B1BF-3A9AD3EE8569"
},
```
And the .o file for 4604429832 looks like:
```
{
  "debugInfoByteSize": 1028,
  "debugInfoIndexLoadedFromCache": false,
  "debugInfoIndexSavedToCache": false,
  "debugInfoIndexTime": 0,
  "debugInfoParseTime": 6.0999e-05,
  "identifier": 4604429832,
  "path": 
"/Users/gclayton/Documents/src/lldb/main/Debug/lldb-test-build.noindex/commands/statistics/basic/TestStats.test_no_dsym_binary_has_symfile_identifiers_in_stats/main.o",
  "symbolTableIndexTime": 0,
  "symbolTableLoadedFromCache": false,
  "symbolTableParseTime": 0,
  "symbolTableSavedToCache": false,
  "triple": "arm64-apple-macosx"
}
```

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

Added: 


Modified: 
lldb/include/lldb/Symbol/SymbolFile.h
lldb/include/lldb/Target/Statistics.h
lldb/source/Core/Section.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/Symb

[Lldb-commits] [PATCH] D119400: Fix a double debug info size counting in top level stats for "statistics dump".

2022-02-10 Thread Greg Clayton via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3db7cc1ba41f: Fix a double debug info size counting in top 
level stats for "statistics dump". (authored by clayborg).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119400

Files:
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Target/Statistics.h
  lldb/source/Core/Section.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Target/Statistics.cpp
  lldb/test/API/commands/statistics/basic/TestStats.py

Index: lldb/test/API/commands/statistics/basic/TestStats.py
===
--- lldb/test/API/commands/statistics/basic/TestStats.py
+++ lldb/test/API/commands/statistics/basic/TestStats.py
@@ -1,5 +1,6 @@
 import lldb
 import json
+import os
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
@@ -8,10 +9,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-TestBase.setUp(self)
-self.build()
-
 NO_DEBUG_INFO_TESTCASE = True
 
 def test_enable_disable(self):
@@ -22,6 +19,7 @@
 of LLDB and test that enabling and disabling stops expesive information
 from being gathered.
 """
+self.build()
 target = self.createTestTarget()
 
 self.expect("statistics disable", substrs=['need to enable statistics before disabling'], error=True)
@@ -89,6 +87,7 @@
 return None
 
 def test_expressions_frame_var_counts(self):
+self.build()
 lldbutil.run_to_source_breakpoint(self, "// break here",
   lldb.SBFileSpec("main.c"))
 
@@ -158,6 +157,7 @@
   "totalSymbolTableIndexTime": 0.234,
 }
 """
+self.build()
 target = self.createTestTarget()
 debug_stats = self.get_stats()
 debug_stat_keys = [
@@ -225,6 +225,7 @@
 }
 
 """
+self.build()
 target = self.createTestTarget()
 lldbutil.run_to_source_breakpoint(self, "// break here",
   lldb.SBFileSpec("main.c"))
@@ -262,6 +263,7 @@
 """
 Test "statistics dump" and the memory information.
 """
+self.build()
 exe = self.getBuildArtifact("a.out")
 target = self.createTestTarget(file_path=exe)
 debug_stats = self.get_stats()
@@ -303,10 +305,18 @@
 return module
 return None
 
+def find_module_by_id_in_metrics(self, id, stats):
+modules = stats['modules']
+for module in modules:
+if module['identifier'] == id:
+return module
+return None
+
 def test_modules(self):
 """
 Test "statistics dump" and the module information.
 """
+self.build()
 exe = self.getBuildArtifact("a.out")
 target = self.createTestTarget(file_path=exe)
 debug_stats = self.get_stats()
@@ -394,6 +404,7 @@
 }
 
 """
+self.build()
 target = self.createTestTarget()
 self.runCmd("b main.cpp:7")
 self.runCmd("b a_function")
@@ -436,3 +447,108 @@
 for breakpoint in breakpoints:
 self.verify_keys(breakpoint, 'target_stats["breakpoints"]',
  bp_keys_exist, None)
+
+
+@skipUnlessDarwin
+@no_debug_info_test
+def test_dsym_binary_has_symfile_in_stats(self):
+"""
+Test that if our executable has a stand alone dSYM file containing
+debug information, that the dSYM file path is listed as a key/value
+pair in the "a.out" binaries module stats. Also verify the the main
+executable's module statistics has a debug info size that is greater
+than zero as the dSYM contains debug info.
+"""
+self.build(debug_info="dsym")
+exe_name = 'a.out'
+exe = self.getBuildArtifact(exe_name)
+dsym = self.getBuildArtifact(exe_name + ".dSYM")
+# Make sure the executable file exists after building.
+self.assertEqual(os.path.exists(exe), True)
+# Make sure the dSYM file exists after building.
+self.assertEqual(os.path.isdir(dsym), True)
+
+# Create the target
+target = self.createTestTarget(file_path=exe)
+
+debug_stats = self.get_stats()
+
+exe_stats = self.find_module_in_metrics(exe, debug_stats)
+# If we have a dSYM file, there should be a key/value pair in the module
+# statistics and the path should match the dSYM file path in the build
+# artifacts.
+self.assertIn('symbolFilePath', exe_stats)
+stats_dsym = exe_stats['symbolFilePath']
+
+# Make 

[Lldb-commits] [PATCH] D119400: Fix a double debug info size counting in top level stats for "statistics dump".

2022-02-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D119400#3310366 , @labath wrote:

> Seems fine. I might consider changing the type of the `__dof_cache` section 
> (whatever that is) instead of making an exception for `eSectionTypeDebug`. It 
> don't see anything depending on it, and the exception looks weird.

I pinged some folks at Apple to ask what this section is and if we can better 
set a section type for it. As soon as I hear back, I will make a patch for this 
and fix it. For now since no one uses .debug sections in COFF files when it 
comes to statistics, I want the "statistics dump" command to produce accurate 
output. But I will submit a patch as soon as I hear back about __dof_cache


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119400

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


[Lldb-commits] [lldb] 547a667 - Add -fmodules-local-submodule-visibility to MANDATORY_MODULE_BUILD_CFLAGS

2022-02-10 Thread Adrian Prantl via lldb-commits

Author: Adrian Prantl
Date: 2022-02-10T11:11:50-08:00
New Revision: 547a667ceeb60dca5447e5bc09165a52b22925eb

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

LOG: Add -fmodules-local-submodule-visibility to MANDATORY_MODULE_BUILD_CFLAGS

to work around build failure introduced in https://reviews.llvm.org/D119036

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index f4aa6d646711f..ce5143b87610c 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -266,7 +266,8 @@ MANDATORY_MODULE_BUILD_CFLAGS := $(MODULE_BASE_FLAGS) 
-gmodules
 MANDATORY_CXXMODULE_BUILD_CFLAGS := $(MODULE_BASE_FLAGS) -fcxx-modules -glldb
 
 ifeq "$(OS)" "Darwin"
-   MANDATORY_MODULE_BUILD_CFLAGS += -fcxx-modules
+   MANDATORY_MODULE_BUILD_CFLAGS += -fcxx-modules 
-fmodules-local-submodule-visibility
+   MANDATORY_CXXMODULE_BUILD_CFLAGS += -fmodules-local-submodule-visibility
 endif
 
 ifeq "$(MAKE_GMODULES)" "YES"



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


[Lldb-commits] [PATCH] D119400: Fix a double debug info size counting in top level stats for "statistics dump".

2022-02-10 Thread walter erquinigo via Phabricator via lldb-commits
wallace added a comment.

good catch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119400

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


[Lldb-commits] [PATCH] D119146: [lldb/Platform] Decouple instance and plugin names

2022-02-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

In D119146#3310353 , @labath wrote:

> Given the renewed interest in the size of the ConstString pool, I'd like to 
> avoid adding strings there without a good reason. And I don't see any reason 
> why a name-based platform lookup should be on any hot path. A Target object 
> holds a platform pointer, the current platform is a pointer, and anything 
> else that is hot enough should probably hold a pointer instead of a name as 
> well.

As you mention there won't be many of these, so it won't take up much space in 
the string pool, but I am not adamant that this would need to change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119146

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


[Lldb-commits] [lldb] 4ef02cb - Revert "Add -fmodules-local-submodule-visibility to MANDATORY_MODULE_BUILD_CFLAGS"

2022-02-10 Thread Adrian Prantl via lldb-commits

Author: Adrian Prantl
Date: 2022-02-10T15:37:11-08:00
New Revision: 4ef02cba2ef3fdb49c33d014dd8f4034ef9cb4cb

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

LOG: Revert "Add -fmodules-local-submodule-visibility to 
MANDATORY_MODULE_BUILD_CFLAGS"

This reverts commit 547a667ceeb60dca5447e5bc09165a52b22925eb.

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index ce5143b87610c..f4aa6d646711f 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -266,8 +266,7 @@ MANDATORY_MODULE_BUILD_CFLAGS := $(MODULE_BASE_FLAGS) 
-gmodules
 MANDATORY_CXXMODULE_BUILD_CFLAGS := $(MODULE_BASE_FLAGS) -fcxx-modules -glldb
 
 ifeq "$(OS)" "Darwin"
-   MANDATORY_MODULE_BUILD_CFLAGS += -fcxx-modules 
-fmodules-local-submodule-visibility
-   MANDATORY_CXXMODULE_BUILD_CFLAGS += -fmodules-local-submodule-visibility
+   MANDATORY_MODULE_BUILD_CFLAGS += -fcxx-modules
 endif
 
 ifeq "$(MAKE_GMODULES)" "YES"



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


[Lldb-commits] [PATCH] D119389: [lldb/crashlog] Add CrashLogScriptedProcess and resurrect_crashlog method

2022-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib updated this revision to Diff 407712.
mib added a comment.

Update `crash_log_scripted_process.py` to stop using 
`get_most_relevant_thread_index`


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

https://reviews.llvm.org/D119389

Files:
  lldb/bindings/python/CMakeLists.txt
  lldb/examples/python/crashlog.py
  lldb/examples/python/scripted_process/crashlog_scripted_process.py
  lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp

Index: lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
===
--- lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -303,6 +303,9 @@
 
   StructuredData::DictionarySP thread_info_sp = GetInterface().GetThreadsInfo();
 
+  // FIXME: Need to sort the dictionary otherwise the thread ids won't match the
+  // thread indices.
+
   if (!thread_info_sp)
 return ScriptedInterface::ErrorWithMessage(
 LLVM_PRETTY_FUNCTION,
Index: lldb/examples/python/scripted_process/crashlog_scripted_process.py
===
--- /dev/null
+++ lldb/examples/python/scripted_process/crashlog_scripted_process.py
@@ -0,0 +1,149 @@
+import os,json,struct,signal
+
+from typing import Any, Dict
+
+import lldb
+from lldb.plugins.scripted_process import ScriptedProcess
+from lldb.plugins.scripted_process import ScriptedThread
+
+from lldb.macosx.crashlog import CrashLog,CrashLogParser
+
+class CrashLogScriptedProcess(ScriptedProcess):
+# NOTE: https://at.apple.com/json-crashlog-spec
+def parse_crashlog(self):
+try:
+crash_log = CrashLogParser().parse(self.dbg, self.crashlog_path, False)
+except Exception as e:
+return
+
+self.pid = crash_log.process_id
+self.crashed_thread_idx = crash_log.crashed_thread_idx
+self.loaded_images = []
+
+for thread in crash_log.threads:
+if thread.did_crash():
+for ident in thread.idents:
+images = crash_log.find_images_with_identifier(ident)
+if images:
+for image in images:
+#FIXME: Add to self.loaded_images and load images in lldb
+err = image.add_module(self.target)
+if err:
+print(err)
+else:
+self.loaded_images.append(image)
+self.threads[thread.index] = CrashLogScriptedThread(self, None, thread)
+
+def __init__(self, target: lldb.SBTarget, args : lldb.SBStructuredData):
+super().__init__(target, args)
+
+if not self.target or not self.target.IsValid():
+return
+
+self.crashlog_path = None
+
+crashlog_path = args.GetValueForKey("crashlog_path")
+if crashlog_path and crashlog_path.IsValid():
+if crashlog_path.GetType() == lldb.eStructuredDataTypeString:
+self.crashlog_path = crashlog_path.GetStringValue(100)
+
+if not self.crashlog_path:
+return
+
+self.pid = super().get_process_id()
+self.crashed_thread_idx = 0
+self.parse_crashlog()
+
+def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo:
+return None
+
+def get_thread_with_id(self, tid: int):
+return {}
+
+def get_registers_for_thread(self, tid: int):
+return {}
+
+def read_memory_at_address(self, addr: int, size: int) -> lldb.SBData:
+# NOTE: CrashLogs don't contain any memory.
+return lldb.SBData()
+
+def get_loaded_images(self):
+# TODO: Iterate over corefile_target modules and build a data structure
+# from it.
+return self.loaded_images
+
+def get_process_id(self) -> int:
+return self.pid
+
+def should_stop(self) -> bool:
+return True
+
+def is_alive(self) -> bool:
+return True
+
+def get_scripted_thread_plugin(self):
+return CrashLogScriptedThread.__module__ + "." + CrashLogScriptedThread.__name__
+
+class CrashLogScriptedThread(ScriptedThread):
+def create_register_ctx(self):
+if not self.has_crashed:
+return dict.fromkeys([*map(lambda reg: reg['name'], self.register_info['registers'])] , 0)
+
+if not self.backing_thread or not len(self.backing_thread.registers):
+return dict.fromkeys([*map(lambda reg: reg['name'], self.register_info['registers'])] , 0)
+
+for reg in self.register_info['registers']:
+reg_name = reg['name']
+if reg_name in self.backing_thread.registers:
+self.register_ctx[reg_name] = self.backing_thread.registers[reg_name]
+else:
+self.register_ctx[reg_name] = 0
+
+return self.register_ctx
+
+def create_s

[Lldb-commits] [PATCH] D119499: [lldb/API] Add a way to check if the CommandInterpreter is interactive

2022-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib created this revision.
mib added reviewers: JDevlieghere, jingham.
mib added a project: LLDB.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch adds the ability for the user to check if the command
interpreter's IOHandler is interactive.

Signed-off-by: Med Ismail Bennani 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119499

Files:
  lldb/bindings/interface/SBCommandInterpreter.i
  lldb/include/lldb/API/SBCommandInterpreter.h
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp


Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -3157,6 +3157,10 @@
   return true;
 }
 
+bool CommandInterpreter::IsInteractive() {
+  return (GetIOHandler() ? GetIOHandler()->GetIsInteractive() : false);
+}
+
 FileSpec CommandInterpreter::GetCurrentSourceDir() {
   if (m_command_source_dirs.empty())
 return {};
Index: lldb/source/API/SBCommandInterpreter.cpp
===
--- lldb/source/API/SBCommandInterpreter.cpp
+++ lldb/source/API/SBCommandInterpreter.cpp
@@ -329,6 +329,12 @@
   return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
 }
 
+bool SBCommandInterpreter::IsInteractive() {
+  LLDB_INSTRUMENT_VA(this);
+
+  return (IsValid() ? m_opaque_ptr->IsInteractive() : false);
+}
+
 SBProcess SBCommandInterpreter::GetProcess() {
   LLDB_INSTRUMENT_VA(this);
 
Index: lldb/include/lldb/Interpreter/CommandInterpreter.h
===
--- lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -605,6 +605,8 @@
 
   FileSpec GetCurrentSourceDir();
 
+  bool IsInteractive();
+
 protected:
   friend class Debugger;
 
Index: lldb/include/lldb/API/SBCommandInterpreter.h
===
--- lldb/include/lldb/API/SBCommandInterpreter.h
+++ lldb/include/lldb/API/SBCommandInterpreter.h
@@ -59,6 +59,8 @@
 
   bool HasAliasOptions();
 
+  bool IsInteractive();
+
   lldb::SBProcess GetProcess();
 
   lldb::SBDebugger GetDebugger();
Index: lldb/bindings/interface/SBCommandInterpreter.i
===
--- lldb/bindings/interface/SBCommandInterpreter.i
+++ lldb/bindings/interface/SBCommandInterpreter.i
@@ -125,6 +125,9 @@
 bool
 HasAliasOptions ();
 
+bool
+IsInteractive ();
+
 lldb::SBProcess
 GetProcess ();
 


Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -3157,6 +3157,10 @@
   return true;
 }
 
+bool CommandInterpreter::IsInteractive() {
+  return (GetIOHandler() ? GetIOHandler()->GetIsInteractive() : false);
+}
+
 FileSpec CommandInterpreter::GetCurrentSourceDir() {
   if (m_command_source_dirs.empty())
 return {};
Index: lldb/source/API/SBCommandInterpreter.cpp
===
--- lldb/source/API/SBCommandInterpreter.cpp
+++ lldb/source/API/SBCommandInterpreter.cpp
@@ -329,6 +329,12 @@
   return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
 }
 
+bool SBCommandInterpreter::IsInteractive() {
+  LLDB_INSTRUMENT_VA(this);
+
+  return (IsValid() ? m_opaque_ptr->IsInteractive() : false);
+}
+
 SBProcess SBCommandInterpreter::GetProcess() {
   LLDB_INSTRUMENT_VA(this);
 
Index: lldb/include/lldb/Interpreter/CommandInterpreter.h
===
--- lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -605,6 +605,8 @@
 
   FileSpec GetCurrentSourceDir();
 
+  bool IsInteractive();
+
 protected:
   friend class Debugger;
 
Index: lldb/include/lldb/API/SBCommandInterpreter.h
===
--- lldb/include/lldb/API/SBCommandInterpreter.h
+++ lldb/include/lldb/API/SBCommandInterpreter.h
@@ -59,6 +59,8 @@
 
   bool HasAliasOptions();
 
+  bool IsInteractive();
+
   lldb::SBProcess GetProcess();
 
   lldb::SBDebugger GetDebugger();
Index: lldb/bindings/interface/SBCommandInterpreter.i
===
--- lldb/bindings/interface/SBCommandInterpreter.i
+++ lldb/bindings/interface/SBCommandInterpreter.i
@@ -125,6 +125,9 @@
 bool
 HasAliasOptions ();
 
+bool
+IsInteractive ();
+
 lldb::SBProcess
 GetProcess ();
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis

[Lldb-commits] [PATCH] D119501: [lldb/crashlog] Replace interactive mode by CrashLogScriptedProcess

2022-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

The crashlog command has an interactive mode that only provide a very
limited experience. This is why this patch removes all the logic for
this interactive mode and replaces it with CrashLogScriptedProcesses.

Signed-off-by: Med Ismail Bennani 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119501

Files:
  lldb/examples/python/crashlog.py

Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -769,138 +769,6 @@
 sys.exit(0)
 
 
-class Interactive(cmd.Cmd):
-'''Interactive prompt for analyzing one or more Darwin crash logs, type "help" to see a list of supported commands.'''
-image_option_parser = None
-
-def __init__(self, crash_logs):
-cmd.Cmd.__init__(self)
-self.use_rawinput = False
-self.intro = 'Interactive crashlogs prompt, type "help" to see a list of supported commands.'
-self.crash_logs = crash_logs
-self.prompt = '% '
-
-def default(self, line):
-'''Catch all for unknown command, which will exit the interpreter.'''
-print("uknown command: %s" % line)
-return True
-
-def do_q(self, line):
-'''Quit command'''
-return True
-
-def do_quit(self, line):
-'''Quit command'''
-return True
-
-def do_symbolicate(self, line):
-description = '''Symbolicate one or more darwin crash log files by index to provide source file and line information,
-inlined stack frames back to the concrete functions, and disassemble the location of the crash
-for the first frame of the crashed thread.'''
-option_parser = CreateSymbolicateCrashLogOptions(
-'symbolicate', description, False)
-command_args = shlex.split(line)
-try:
-(options, args) = option_parser.parse_args(command_args)
-except:
-return
-
-if args:
-# We have arguments, they must valid be crash log file indexes
-for idx_str in args:
-idx = int(idx_str)
-if idx < len(self.crash_logs):
-SymbolicateCrashLog(self.crash_logs[idx], options)
-else:
-print('error: crash log index %u is out of range' % (idx))
-else:
-# No arguments, symbolicate all crash logs using the options
-# provided
-for idx in range(len(self.crash_logs)):
-SymbolicateCrashLog(self.crash_logs[idx], options)
-
-def do_list(self, line=None):
-'''Dump a list of all crash logs that are currently loaded.
-
-USAGE: list'''
-print('%u crash logs are loaded:' % len(self.crash_logs))
-for (crash_log_idx, crash_log) in enumerate(self.crash_logs):
-print('[%u] = %s' % (crash_log_idx, crash_log.path))
-
-def do_image(self, line):
-'''Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided.'''
-usage = "usage: %prog [options]  [PATH ...]"
-description = '''Dump information about one or more images in all crash logs. The  can be a full path, image basename, or partial path. Searches are done in this order.'''
-command_args = shlex.split(line)
-if not self.image_option_parser:
-self.image_option_parser = optparse.OptionParser(
-description=description, prog='image', usage=usage)
-self.image_option_parser.add_option(
-'-a',
-'--all',
-action='store_true',
-help='show all images',
-default=False)
-try:
-(options, args) = self.image_option_parser.parse_args(command_args)
-except:
-return
-
-if args:
-for image_path in args:
-fullpath_search = image_path[0] == '/'
-for (crash_log_idx, crash_log) in enumerate(self.crash_logs):
-matches_found = 0
-for (image_idx, image) in enumerate(crash_log.images):
-if fullpath_search:
-if image.get_resolved_path() == image_path:
-matches_found += 1
-print('[%u] ' % (crash_log_idx), image)
-else:
-image_basename = image.get_resolved_path_basename()
-if image_basename == image_path:
-matches_found += 1
-print('[%u] ' % (crash_log_idx), image)
-if matches_found == 0:
- 

[Lldb-commits] [PATCH] D119504: [lldb/crashlog] Fix exception signal parsing

2022-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

In some cases, it can happen that crashlogs doesn't have any signal in
the exception, which caused the parser to crash.

This fixes the parsing by checking if the `signal` field is in the
`exception` dictionary before trying to access it.

Signed-off-by: Med Ismail Bennani 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119504

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -461,14 +461,17 @@
 
 def parse_crash_reason(self, json_exception):
 exception_type = json_exception['type']
-exception_signal = json_exception['signal']
+exception_signal = " "
+if 'signal' in json_exception:
+exception_signal += "({})".format(json_exception['signal'])
+
 if 'codes' in json_exception:
 exception_extra = " ({})".format(json_exception['codes'])
 elif 'subtype' in json_exception:
 exception_extra = " ({})".format(json_exception['subtype'])
 else:
 exception_extra = ""
-return "{} ({}){}".format(exception_type, exception_signal,
+return "{}{}{}".format(exception_type, exception_signal,
   exception_extra)
 
 def parse_images(self, json_images):


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -461,14 +461,17 @@
 
 def parse_crash_reason(self, json_exception):
 exception_type = json_exception['type']
-exception_signal = json_exception['signal']
+exception_signal = " "
+if 'signal' in json_exception:
+exception_signal += "({})".format(json_exception['signal'])
+
 if 'codes' in json_exception:
 exception_extra = " ({})".format(json_exception['codes'])
 elif 'subtype' in json_exception:
 exception_extra = " ({})".format(json_exception['subtype'])
 else:
 exception_extra = ""
-return "{} ({}){}".format(exception_type, exception_signal,
+return "{}{}{}".format(exception_type, exception_signal,
   exception_extra)
 
 def parse_images(self, json_images):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D119499: [lldb/API] Add a way to check if the CommandInterpreter is interactive

2022-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119499

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


[Lldb-commits] [PATCH] D119504: [lldb/crashlog] Fix exception signal parsing

2022-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/examples/python/crashlog.py:466
+if 'signal' in json_exception:
+exception_signal += "({})".format(json_exception['signal'])
+

Should this be surrounded by spaces?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119504

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


[Lldb-commits] [PATCH] D119501: [lldb/crashlog] Replace interactive mode by CrashLogScriptedProcess

2022-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/examples/python/crashlog.py:1142-1146
+if options.interactive and ci and ci.IsInteractive():
+load_crashlog_in_scripted_process(debugger, crash_log_file)
+else:
 crash_log = CrashLogParser().parse(debugger, crash_log_file, 
options.verbose)
 SymbolicateCrashLog(crash_log, options)

If `options.interactive` is set explicitly we should honor it. In the future 
we'll want to use `ci.IsInteractive()` to decide what to do if nothing is 
specified. At the same time we should create another option 
(`--non-interactive`?) and also honor it, so that this logic would look 
something like:

```
if options.interactive:
 // Interactive
else if options.noninteractive:
 // Classic
else if ci and ci.IsInteractive():
 // Interactive
else 
 // Classic 
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119501

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


[Lldb-commits] [PATCH] D119504: [lldb/crashlog] Fix exception signal parsing

2022-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added inline comments.



Comment at: lldb/examples/python/crashlog.py:471
 exception_extra = ""
-return "{} ({}){}".format(exception_type, exception_signal,
   exception_extra)

@JDevlieghere Here it's only prepended by a space, which is honored in my 
change since I concatenate `"({})".format(json_exception['signal'])` to 
`exception_signal` (which is initialized with a space).

I don't think this should have a trailing space because it's not guaranteed 
that we get something in `exception_extra`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119504

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