[Lldb-commits] [PATCH] D127048: [lldb] Set COFF module ABI from default triple and make it an option

2022-06-09 Thread Muhammad Omair Javaid via Phabricator via lldb-commits
omjavaid added a comment.

>> 1. This rev apparently assumes x86_64 only but what about Arm/AArch64?
>
> Where do you get that impression? This should all be architecture independent 
> (or done in the same way for all architectures).

Sorry I just brushed over the code and saw x86_64 specifc obj files in tests.

> 

This looks good to me and I also gave this change a test on AArch64/Windows 
Surface X pro. No regressions. LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127048

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


[Lldb-commits] [PATCH] D126367: [lldb] Add gnu-debuglink support for Windows PE/COFF

2022-06-09 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

When testing this patch, I ran into crashes in the 
`SymbolFile/NativePDB/load-pdb.cpp` testcase. To fix it, I had to add a change 
like this:

  diff --git a/lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp 
b/lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
  index 26df0035b37c..e08753b86d5b 100644
  --- a/lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
  +++ b/lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
  @@ -108,6 +108,8 @@ SymbolVendorPECOFF::CreateInstance(const lldb::ModuleSP 
&module_sp,
 // that.
 SectionList *module_section_list = module_sp->GetSectionList();
 SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
  +  if (!objfile_section_list || !module_section_list)
  +return nullptr;
   
 static const SectionType g_sections[] = { 
 eSectionTypeDWARFDebugAbbrev,   eSectionTypeDWARFDebugAranges,

Also, when built with assertions enabled (which often is to prefer during 
development, to catch things before the buildbots do), reading the debuglink 
info failed an assert:

  lldb/source/Utility/DataExtractor.cpp:135: 
lldb_private::DataExtractor::DataExtractor(const void*, lldb::offset_t, 
lldb::ByteOrder, uint32_t, uint32_t): Assertion `addr_size >= 1 && addr_size <= 
8' failed.

This is easy to fix with a change like this:

  diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 
b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  index ba4612178be7..657fcdc5af6d 100644
  --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  @@ -63,7 +63,7 @@ static bool GetDebugLinkContents(const 
llvm::object::COFFObjectFile &coff_obj,
 }
 DataExtractor data(
 content->data(), content->size(),
  -  coff_obj.isLittleEndian() ? eByteOrderLittle : eByteOrderBig, 0);
  +  coff_obj.isLittleEndian() ? eByteOrderLittle : eByteOrderBig, 4);
 lldb::offset_t gnu_debuglink_offset = 0;
 gnu_debuglink_file = data.GetCStr(&gnu_debuglink_offset);
 // Align to the next 4-byte offset

If it's ok with you, I can squash these changes (plus a rewording regarding GNU 
ld and the codeview build ID) and push the patch.




Comment at: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:96
+
+  // The GNU linker does not write a PDB build id, so we should fall back to
+  // using the crc from .gnu_debuglink if it exists, just like how 
ObjectFileELF

Actually, the GNU linker does write such a build id if you pass it 
`-Wl,--build-id`, but it's not default like in LLD.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126367

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


[Lldb-commits] [PATCH] D127234: [lldb] Add setting to override PE/COFF ABI by module name

2022-06-09 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a reviewer: omjavaid.
mstorsjo added a comment.

(I guess this one might need some updates after D127048 
 is finalized?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127234

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


[Lldb-commits] [PATCH] D126367: [lldb] Add gnu-debuglink support for Windows PE/COFF

2022-06-09 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun added a comment.

Ah I did not realize that GNU ld also has the option to add the same build id 
for mingw. I am fine with you committing these changes. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126367

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


[Lldb-commits] [lldb] c8daf4a - [lldb] Add gnu-debuglink support for Windows PE/COFF

2022-06-09 Thread Martin Storsjö via lldb-commits

Author: Alvin Wong
Date: 2022-06-09T14:39:33+03:00
New Revision: c8daf4a707ad502b9694461246114bba01af5222

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

LOG: [lldb] Add gnu-debuglink support for Windows PE/COFF

The specification of gnu-debuglink can be found at:
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

The file CRC or the CRC value from the .gnu_debuglink section is now
used to calculate the module UUID as a fallback, to allow verifying that
the debug object does match the executable. Note that if a CodeView
build id exists, it still takes precedence. This works even for MinGW
builds because LLD writes a synthetic CodeView build id which does not
get stripped from the debug object.

The `Minidump/Windows/find-module` test also needs a fix by adding a
CodeView record to the exe to match the one in the minidump, otherwise
it fails due to the new UUID calculated from the file CRC.

Fixes https://github.com/llvm/llvm-project/issues/54344

Reviewed By: DavidSpickett

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

Added: 
lldb/source/Plugins/SymbolVendor/PECOFF/CMakeLists.txt
lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.h
lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-i686.yaml
lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-mismatched-crc.yaml
lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-pdb-buildid.yaml
lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink.yaml

Modified: 
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
lldb/source/Plugins/SymbolVendor/CMakeLists.txt
lldb/source/Symbol/LocateSymbolFile.cpp
lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml

Removed: 




diff  --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 
b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index e07b2edd2b17..657fcdc5af6d 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -31,6 +31,7 @@
 #include "llvm/BinaryFormat/COFF.h"
 
 #include "llvm/Object/COFFImportFile.h"
+#include "llvm/Support/CRC.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 
@@ -44,10 +45,42 @@ using namespace lldb_private;
 
 LLDB_PLUGIN_DEFINE(ObjectFilePECOFF)
 
+static bool GetDebugLinkContents(const llvm::object::COFFObjectFile &coff_obj,
+ std::string &gnu_debuglink_file,
+ uint32_t &gnu_debuglink_crc) {
+  static ConstString g_sect_name_gnu_debuglink(".gnu_debuglink");
+  for (const auto §ion : coff_obj.sections()) {
+auto name = section.getName();
+if (!name) {
+  llvm::consumeError(name.takeError());
+  continue;
+}
+if (*name == g_sect_name_gnu_debuglink.GetStringRef()) {
+  auto content = section.getContents();
+  if (!content) {
+llvm::consumeError(content.takeError());
+return false;
+  }
+  DataExtractor data(
+  content->data(), content->size(),
+  coff_obj.isLittleEndian() ? eByteOrderLittle : eByteOrderBig, 4);
+  lldb::offset_t gnu_debuglink_offset = 0;
+  gnu_debuglink_file = data.GetCStr(&gnu_debuglink_offset);
+  // Align to the next 4-byte offset
+  gnu_debuglink_offset = llvm::alignTo(gnu_debuglink_offset, 4);
+  data.GetU32(&gnu_debuglink_offset, &gnu_debuglink_crc, 1);
+  return true;
+}
+  }
+  return false;
+}
+
 static UUID GetCoffUUID(llvm::object::COFFObjectFile &coff_obj) {
   const llvm::codeview::DebugInfo *pdb_info = nullptr;
   llvm::StringRef pdb_file;
 
+  // First, prefer to use the PDB build id. LLD generates this even for mingw
+  // targets without PDB output, and it does not get stripped either.
   if (!coff_obj.getDebugPDBInfo(pdb_info, pdb_file) && pdb_info) {
 if (pdb_info->PDB70.CVSignature == llvm::OMF::Signature::PDB70) {
   UUID::CvRecordPdb70 info;
@@ -57,7 +90,26 @@ static UUID GetCoffUUID(llvm::object::COFFObjectFile 
&coff_obj) {
 }
   }
 
-  return UUID();
+  std::string gnu_debuglink_file;
+  uint32_t gnu_debuglink_crc;
+
+  // The GNU linker normally does not write a PDB build id (unless requested
+  // with the --build-id option), so we should fall back to using the crc
+  // from .gnu_debuglink if it exists, just like how ObjectFileELF does it.
+  if (!GetDebugLinkContents(coff_obj, gnu_debuglink_file, gnu_debuglink_crc)) {
+// If there is no .gnu_debuglink section, then this may be an object
+// containing DWARF debug info for .gnu_debuglink, so calculate the crc of
+// the object itself.
+

[Lldb-commits] [lldb] 39c4ac1 - [lldb] Silence a GCC warning about missing returns after a fully covered switch. NFC.

2022-06-09 Thread Martin Storsjö via lldb-commits

Author: Martin Storsjö
Date: 2022-06-09T14:39:33+03:00
New Revision: 39c4ac140d1ee67d152c990f5d16a8df98155cbc

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

LOG: [lldb] Silence a GCC warning about missing returns after a fully covered 
switch. NFC.

Added: 


Modified: 
lldb/source/Target/Target.cpp

Removed: 




diff  --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index ca9754d40af0..34dea43a64dd 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -3466,6 +3466,7 @@ void Target::PrintDummySignals(Stream &strm, Args 
&signal_args) {
   case eLazyBoolYes: return "true   ";
   case eLazyBoolNo: return "false  ";
 }
+llvm_unreachable("Fully covered switch above!");
   };
   size_t num_args = signal_args.GetArgumentCount();
   for (const auto &elem : m_dummy_signals) {



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


[Lldb-commits] [PATCH] D126367: [lldb] Add gnu-debuglink support for Windows PE/COFF

2022-06-09 Thread Martin Storsjö via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc8daf4a707ad: [lldb] Add gnu-debuglink support for Windows 
PE/COFF (authored by alvinhochun, committed by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D126367?vs=435214&id=435498#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126367

Files:
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/SymbolVendor/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/PECOFF/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
  lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.h
  lldb/source/Symbol/LocateSymbolFile.cpp
  lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml
  lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-i686.yaml
  lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-mismatched-crc.yaml
  lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-pdb-buildid.yaml
  lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink.yaml

Index: lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink.yaml
@@ -0,0 +1,50 @@
+# This test produces a stripped version of the object file and adds a
+# gnu-debuglink section to it linking to the unstripped version of the object
+# file. The debug info shall be loaded from the gnu-debuglink reference.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t %t %t.stripped
+# RUN: lldb-test object-file %t.stripped | FileCheck %s
+
+# CHECK: Name: .debug_info
+# CHECK-NEXT: Type: dwarf-info
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+header:
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  4096
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+  - Name:.data
+Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  8192
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+  - Name:.debug_info
+Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  16384
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+symbols: []
+...
Index: lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-pdb-buildid.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/dwarf-gnu-debuglink-pdb-buildid.yaml
@@ -0,0 +1,63 @@
+# This test produces a stripped version of the object file and adds a
+# gnu-debuglink section to it linking to the unstripped version of the object
+# file. Then the unstripped version is stripped to keep only debug info to
+# cause its crc to change. In this case the object files still have the
+# synthetic PDB build id that LLD adds even for the mingw target. Because this
+# build id still matches, the debug info shall still be loaded from the
+# gnu-debuglink reference.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t %t %t.stripped
+# RUN: llvm-strip --only-keep-debug %t
+# RUN: lldb-test object-file %t.stripped | FileCheck %s
+
+# CHECK: Name: .debug_info
+# CHECK-NEXT: Type: dwarf-info
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+  Debug:
+ 

[Lldb-commits] [PATCH] D127001: [trace][intelpt] Support system-wide tracing [16] - Create threads automatically from context switch data in the post-mortem case

2022-06-09 Thread Jakob Johnson via Phabricator via lldb-commits
jj10306 requested changes to this revision.
jj10306 added inline comments.
This revision now requires changes to proceed.



Comment at: 
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp:167-170
+  // A list of known threads for the given process. When context switch
+  // data is provided, LLDB will automatically create threads for the
+  // this process whenever it finds new threads when traversing the
+  // context switches.

So should this be an empty list or will the key not exist at all in the case 
that context switches are provided?



Comment at: 
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp:212-215
+  "dontCreateThreadsFromContextSwitches"?: boolean,
+// If this is true, then the automatic creation of threads from context 
switch
+// data is disabled, and thus only the threads provided in the 
"processes.threads"
+// section will be created.

is this necessary? can't this be inferred by if the threads key isn't 
present/the list is empty?
also, is this even being used rn? It appears to me that you always invoke 
`CreateThreadsFromContextSwitches()` if `session.cores` is present?



Comment at: 
lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json:31-35
+  "threads": [
+{
+  "tid": 3497234
+}
+  ]

shouldn't this be gone or just an empty list depending on how we want to 
implement it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127001

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


[Lldb-commits] [PATCH] D50304: [lldb] Fix thread step until to not set breakpoint(s) on incorrect line numbers

2022-06-09 Thread Venkata Ramanaiah Nalamothu via Phabricator via lldb-commits
RamNalamothu added a comment.

Ping.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D50304

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


[Lldb-commits] [PATCH] D48865: [LLDB] CommandObjectThreadUntil::DoExecute() sets the wrong selected thread ID

2022-06-09 Thread Venkata Ramanaiah Nalamothu via Phabricator via lldb-commits
RamNalamothu added a comment.

Ping.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D48865

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


[Lldb-commits] [lldb] a339837 - Pass plugin_name in SBProcess::SaveCore

2022-06-09 Thread Tobias Hieta via lldb-commits

Author: Levon
Date: 2022-06-09T16:29:50+02:00
New Revision: a33983729df641559b639a48d1b65e2de55f6e90

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

LOG: Pass plugin_name in SBProcess::SaveCore

This CL allows to use minidump save-core functionality 
(https://reviews.llvm.org/D108233) via SBProcess interface.
After adding a support from gdb-remote client 
(https://reviews.llvm.org/D101329) if the plugin name is empty the plugin 
manager will try to save the core directly from the process plugin.
See 
https://github.com/llvm/llvm-project/blob/main/lldb/source/Core/PluginManager.cpp#L696

To have an ability to save the core with minidump plugin I added plugin name as 
a parameter in SBProcess::SaveCore.

Reviewed By: clayborg

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

Added: 


Modified: 
lldb/bindings/interface/SBProcess.i
lldb/include/lldb/API/SBProcess.h
lldb/source/API/SBProcess.cpp

lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py

Removed: 




diff  --git a/lldb/bindings/interface/SBProcess.i 
b/lldb/bindings/interface/SBProcess.i
index 14566a2942d04..7a9f8fc5757c1 100644
--- a/lldb/bindings/interface/SBProcess.i
+++ b/lldb/bindings/interface/SBProcess.i
@@ -397,6 +397,9 @@ public:
 bool
 IsInstrumentationRuntimePresent(lldb::InstrumentationRuntimeType type);
 
+lldb::SBError
+SaveCore(const char *file_name, const char *flavor, lldb::SaveCoreStyle 
core_style);
+
 lldb::SBError
 SaveCore(const char *file_name);
 

diff  --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index 73a8d918f4d65..49b3256869ed6 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -337,7 +337,21 @@ class LLDB_API SBProcess {
 
   bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type);
 
-  /// Save the state of the process in a core file (or mini dump on Windows).
+  /// Save the state of the process in a core file.
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
+  ///
+  /// \param[in] flavor - Specify the flavor of a core file plug-in to save.
+  /// Currently supported flavors include "mach-o" and "minidump"
+  ///
+  /// \param[in] core_style - Specify the style of a core file to save.
+  lldb::SBError SaveCore(const char *file_name, const char *flavor,
+ SaveCoreStyle core_style);
+
+  /// Save the state of the process with the a flavor that matches the
+  /// current process' main executable (if supported).
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
   lldb::SBError SaveCore(const char *file_name);
 
   /// Query the address load_addr and store the details of the memory

diff  --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 2538013412b68..27593559bb3dd 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -1138,6 +1138,13 @@ bool SBProcess::IsInstrumentationRuntimePresent(
 
 lldb::SBError SBProcess::SaveCore(const char *file_name) {
   LLDB_INSTRUMENT_VA(this, file_name);
+  return SaveCore(file_name, "", SaveCoreStyle::eSaveCoreFull);
+}
+
+lldb::SBError SBProcess::SaveCore(const char *file_name,
+  const char *flavor,
+  SaveCoreStyle core_style) {
+  LLDB_INSTRUMENT_VA(this, file_name, flavor, core_style);
 
   lldb::SBError error;
   ProcessSP process_sp(GetSP());
@@ -1155,8 +1162,9 @@ lldb::SBError SBProcess::SaveCore(const char *file_name) {
   }
 
   FileSpec core_file(file_name);
-  SaveCoreStyle core_style = SaveCoreStyle::eSaveCoreFull;
-  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style, "");
+  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style,
+flavor);
+
   return error;
 }
 

diff  --git 
a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
 
b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
index a7d2a05964a4b..4275c93aadd87 100644
--- 
a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
+++ 
b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
@@ -21,6 +21,7 @@ def test_save_linux_mini_dump(self):
 self.build()
 exe = self.getBuildArtifact("a.out")
 core = self.getBuildArtifact("core.dmp")
+core_sb = self.getBuildArtifact("core_sb.dmp")
 try:
 target = self.dbg.CreateTarget(exe)
 process = target.LaunchSimple(
@@ -43,6 +44,17 @@ def test_save_linux_mini_dump(self):
 # save core an

[Lldb-commits] [PATCH] D125325: Pass plugin_name in SBProcess::SaveCore

2022-06-09 Thread Tobias Hieta via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa33983729df6: Pass plugin_name in SBProcess::SaveCore 
(authored by PatriosTheGreat, committed by thieta).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125325

Files:
  lldb/bindings/interface/SBProcess.i
  lldb/include/lldb/API/SBProcess.h
  lldb/source/API/SBProcess.cpp
  
lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py

Index: lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
===
--- lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
+++ lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
@@ -21,6 +21,7 @@
 self.build()
 exe = self.getBuildArtifact("a.out")
 core = self.getBuildArtifact("core.dmp")
+core_sb = self.getBuildArtifact("core_sb.dmp")
 try:
 target = self.dbg.CreateTarget(exe)
 process = target.LaunchSimple(
@@ -43,6 +44,17 @@
 # save core and, kill process and verify corefile existence
 self.runCmd("process save-core --plugin-name=minidump --style=stack " + core)
 self.assertTrue(os.path.isfile(core))
+
+# validate savinig via SBProcess
+error = process.SaveCore(core_sb, "minidump", lldb.eSaveCoreStackOnly)
+self.assertTrue(error.Success())
+self.assertTrue(os.path.isfile(core_sb))
+
+error = process.SaveCore(core_sb, "minidump", lldb.eSaveCoreFull)
+self.assertTrue(error.Fail())
+error = process.SaveCore(core_sb, "minidump", lldb.eSaveCoreDirtyOnly)
+self.assertTrue(error.Fail())
+
 self.assertSuccess(process.Kill())
 
 # To verify, we'll launch with the mini dump
@@ -77,3 +89,5 @@
 self.assertTrue(self.dbg.DeleteTarget(target))
 if (os.path.isfile(core)):
 os.unlink(core)
+if (os.path.isfile(core_sb)):
+os.unlink(core_sb)
Index: lldb/source/API/SBProcess.cpp
===
--- lldb/source/API/SBProcess.cpp
+++ lldb/source/API/SBProcess.cpp
@@ -1138,6 +1138,13 @@
 
 lldb::SBError SBProcess::SaveCore(const char *file_name) {
   LLDB_INSTRUMENT_VA(this, file_name);
+  return SaveCore(file_name, "", SaveCoreStyle::eSaveCoreFull);
+}
+
+lldb::SBError SBProcess::SaveCore(const char *file_name,
+  const char *flavor,
+  SaveCoreStyle core_style) {
+  LLDB_INSTRUMENT_VA(this, file_name, flavor, core_style);
 
   lldb::SBError error;
   ProcessSP process_sp(GetSP());
@@ -1155,8 +1162,9 @@
   }
 
   FileSpec core_file(file_name);
-  SaveCoreStyle core_style = SaveCoreStyle::eSaveCoreFull;
-  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style, "");
+  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style,
+flavor);
+
   return error;
 }
 
Index: lldb/include/lldb/API/SBProcess.h
===
--- lldb/include/lldb/API/SBProcess.h
+++ lldb/include/lldb/API/SBProcess.h
@@ -337,7 +337,21 @@
 
   bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type);
 
-  /// Save the state of the process in a core file (or mini dump on Windows).
+  /// Save the state of the process in a core file.
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
+  ///
+  /// \param[in] flavor - Specify the flavor of a core file plug-in to save.
+  /// Currently supported flavors include "mach-o" and "minidump"
+  ///
+  /// \param[in] core_style - Specify the style of a core file to save.
+  lldb::SBError SaveCore(const char *file_name, const char *flavor,
+ SaveCoreStyle core_style);
+
+  /// Save the state of the process with the a flavor that matches the
+  /// current process' main executable (if supported).
+  ///
+  /// \param[in] file_name - The name of the file to save the core file to.
   lldb::SBError SaveCore(const char *file_name);
 
   /// Query the address load_addr and store the details of the memory
Index: lldb/bindings/interface/SBProcess.i
===
--- lldb/bindings/interface/SBProcess.i
+++ lldb/bindings/interface/SBProcess.i
@@ -397,6 +397,9 @@
 bool
 IsInstrumentationRuntimePresent(lldb::InstrumentationRuntimeType type);
 
+lldb::SBError
+SaveCore(const char *file_name, const char *flavor, lldb::SaveCoreStyle core_style);
+
 lldb::SBError
 SaveCore(const char *file_name);
 
___
lldb-commits mailing li

[Lldb-commits] [PATCH] D125325: Pass plugin_name in SBProcess::SaveCore

2022-06-09 Thread Tobias Hieta via Phabricator via lldb-commits
thieta added a comment.

FYI: I helped @PatriosTheGreat to commit this after he asked for help in 
discord.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125325

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


[Lldb-commits] [PATCH] D127378: [lldb] Use assertState in more tests (NFC)

2022-06-09 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.

In never realized we had both `assertEqual` and `assertEquals`. Great...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127378

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


[Lldb-commits] [PATCH] D127410: [lldb] Add table with custom LLDB asserts

2022-06-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: jingham.
Herald added a project: All.
JDevlieghere requested review of this revision.

Add table with custom LLDB asserts to the docs.


https://reviews.llvm.org/D127410

Files:
  lldb/docs/resources/test.rst


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@
 several expressive asserts such as `self.assertIn` that automatically
 generate an explanation how the received values differ from the expected
 ones. Check the documentation of Python's `unittest` module to see what
-asserts are available. If you can't find a specific assert that fits your
-needs and you fall back to a generic assert, make sure you put useful
-information into the assert's `msg` argument that helps explain the 
failure.
+asserts are available. LLDB also has a few custom asserts that are tailored
+to our own data types.
+
++---+---+
+| **Assert**| **Description**  
 |
++---+---+
+| ``assertSuccess`` | Assert that an 
``lldb.SBError`` is in the "success" state.|
++---+---+
+| ``assertState``   | Assert that two states 
(``lldb.eState*``) are equal.  |
++---+---+
+
+If you can't find a specific assert that fits your needs and you fall back
+to a generic assert, make sure you put useful information into the assert's
+`msg` argument that helps explain the failure.
 
 ::
 


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@
 several expressive asserts such as `self.assertIn` that automatically
 generate an explanation how the received values differ from the expected
 ones. Check the documentation of Python's `unittest` module to see what
-asserts are available. If you can't find a specific assert that fits your
-needs and you fall back to a generic assert, make sure you put useful
-information into the assert's `msg` argument that helps explain the failure.
+asserts are available. LLDB also has a few custom asserts that are tailored
+to our own data types.
+
++---+---+
+| **Assert**| **Description**   |
++---+---+
+| ``assertSuccess`` | Assert that an ``lldb.SBError`` is in the "success" state.|
++---+---+
+| ``assertState``   | Assert that two states (``lldb.eState*``) are equal.  |
++---+---+
+
+If you can't find a specific assert that fits your needs and you fall back
+to a generic assert, make sure you put useful information into the assert's
+`msg` argument that helps explain the failure.
 
 ::
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D127410: [lldb] Add table with custom LLDB asserts

2022-06-09 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Excellent, thanks for doing this, these are really handy asserts!


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

https://reviews.llvm.org/D127410

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


[Lldb-commits] [lldb] 5a10620 - [lldb] Fix code blocks in docs/use/intel_pt.rst

2022-06-09 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2022-06-09T09:14:56-07:00
New Revision: 5a1062055e44f4b9623800aeaed06dc1e405a9d9

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

LOG: [lldb] Fix code blocks in docs/use/intel_pt.rst

Added: 


Modified: 
lldb/docs/use/intel_pt.rst

Removed: 




diff  --git a/lldb/docs/use/intel_pt.rst b/lldb/docs/use/intel_pt.rst
index 7b46262ba52ee..8b80b4a25b75b 100644
--- a/lldb/docs/use/intel_pt.rst
+++ b/lldb/docs/use/intel_pt.rst
@@ -18,6 +18,7 @@ Confirm that your CPU supports Intel PT
 and that your operating system is Linux.
 
 Check for the existence of this particular file on your Linux system
+
 ::
 
   $ cat /sys/bus/event_source/devices/intel_pt/type
@@ -42,6 +43,7 @@ This will generate a few files in the `/lib`
 and `/libipt/include` directories.
 
 Configure and build LLDB with Intel PT support
+
 ::
 
   $ cmake \
@@ -64,7 +66,9 @@ After turning it on, you can continue debugging, and at any 
breakpoint,
 you can inspect the instruction list.
 
 For example:
+
 ::
+
   lldb 
   > b main
   > run
@@ -98,7 +102,9 @@ which keeps the latest information.
 By default, LLDB uses a buffer of 4KB per thread,
 but you can change it by running.
 The size must be a power of 2 and at least 4KB.
+
 ::
+
   thread trace start all -s 
 
 For reference, a 1MB trace buffer can easily store around 5M instructions.
@@ -107,7 +113,9 @@ Printing more instructions
 --
 
 If you want to dump more instructions at a time, you can run
+
 ::
+
   thread trace dump instructions -c 
 
 Printing the instructions of another thread
@@ -115,7 +123,9 @@ Printing the instructions of another thread
 
 By default the current thread will be picked when dumping instructions,
 but you can do
+
 ::
+
   thread trace dump instructions <#thread index>
   #e.g.
   thread trace dump instructions 8
@@ -127,12 +137,16 @@ Crash Analysis
 
 What if you are debugging + tracing a process that crashes?
 Then you can just do
+
 ::
+
   thread trace dump instructions
 
 To inspect how it crashed! There's nothing special that you need to do.
 For example
+
 ::
+
 * thread #1, name = 'a.out', stop reason = signal SIGFPE: integer divide 
by zero
 frame #0: 0x004009f1 a.out`main at main.cpp:8:14
   6   int x;
@@ -164,7 +178,9 @@ For that, the command trace load is useful.
 In order to use trace load, you need to first create a JSON file with
 the definition of the trace session.
 For example
+
 ::
+
   {
 "trace": {
   "type": "intel-pt",
@@ -206,7 +222,9 @@ For example
   }
 
 You can see the full schema by typing
+
 ::
+
   trace schema intel-pt
 
 The JSON file mainly contains all the shared libraries that
@@ -217,7 +235,9 @@ If the analysis is done on a 
diff erent machines, these files need to be
 copied over and the “file” field should point to the
 location of the file relative to the JSON file.
 Once you have the JSON file and the module files in place, you can simple run
+
 ::
+
   lldb
   > trace load /path/to/json
   > thread trace dump instructions 



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


[Lldb-commits] [lldb] 6565580 - [lldb] Add table with custom LLDB asserts to the docs

2022-06-09 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2022-06-09T09:14:56-07:00
New Revision: 6565580f1b40edf8d9339fa849f4a1778d8816a9

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

LOG: [lldb] Add table with custom LLDB asserts to the docs

Add table with custom LLDB asserts to the documentation.

Differential revision: https://reviews.llvm.org/D127410

Added: 


Modified: 
lldb/docs/resources/test.rst

Removed: 




diff  --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst
index 258a8083baca8..001803dc5d284 100644
--- a/lldb/docs/resources/test.rst
+++ b/lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@ A better way to write the test above would be using LLDB's 
testing function
 several expressive asserts such as `self.assertIn` that automatically
 generate an explanation how the received values 
diff er from the expected
 ones. Check the documentation of Python's `unittest` module to see what
-asserts are available. If you can't find a specific assert that fits your
-needs and you fall back to a generic assert, make sure you put useful
-information into the assert's `msg` argument that helps explain the 
failure.
+asserts are available. LLDB also has a few custom asserts that are tailored
+to our own data types.
+
++---+---+
+| **Assert**| **Description**  
 |
++---+---+
+| ``assertSuccess`` | Assert that an 
``lldb.SBError`` is in the "success" state.|
++---+---+
+| ``assertState``   | Assert that two states 
(``lldb.eState*``) are equal.  |
++---+---+
+
+If you can't find a specific assert that fits your needs and you fall back
+to a generic assert, make sure you put useful information into the assert's
+`msg` argument that helps explain the failure.
 
 ::
 



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


[Lldb-commits] [PATCH] D127410: [lldb] Add table with custom LLDB asserts

2022-06-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6565580f1b40: [lldb] Add table with custom LLDB asserts to 
the docs (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127410

Files:
  lldb/docs/resources/test.rst


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@
 several expressive asserts such as `self.assertIn` that automatically
 generate an explanation how the received values differ from the expected
 ones. Check the documentation of Python's `unittest` module to see what
-asserts are available. If you can't find a specific assert that fits your
-needs and you fall back to a generic assert, make sure you put useful
-information into the assert's `msg` argument that helps explain the 
failure.
+asserts are available. LLDB also has a few custom asserts that are tailored
+to our own data types.
+
++---+---+
+| **Assert**| **Description**  
 |
++---+---+
+| ``assertSuccess`` | Assert that an 
``lldb.SBError`` is in the "success" state.|
++---+---+
+| ``assertState``   | Assert that two states 
(``lldb.eState*``) are equal.  |
++---+---+
+
+If you can't find a specific assert that fits your needs and you fall back
+to a generic assert, make sure you put useful information into the assert's
+`msg` argument that helps explain the failure.
 
 ::
 


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@
 several expressive asserts such as `self.assertIn` that automatically
 generate an explanation how the received values differ from the expected
 ones. Check the documentation of Python's `unittest` module to see what
-asserts are available. If you can't find a specific assert that fits your
-needs and you fall back to a generic assert, make sure you put useful
-information into the assert's `msg` argument that helps explain the failure.
+asserts are available. LLDB also has a few custom asserts that are tailored
+to our own data types.
+
++---+---+
+| **Assert**| **Description**   |
++---+---+
+| ``assertSuccess`` | Assert that an ``lldb.SBError`` is in the "success" state.|
++---+---+
+| ``assertState``   | Assert that two states (``lldb.eState*``) are equal.  |
++---+---+
+
+If you can't find a specific assert that fits your needs and you fall back
+to a generic assert, make sure you put useful information into the assert's
+`msg` argument that helps explain the failure.
 
 ::
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 0bc291a - [lldb] Add a reference to the "On Demand Symbols" docs.

2022-06-09 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2022-06-09T09:14:56-07:00
New Revision: 0bc291ad35a26982c13ea0b5e19890fdbf2674f1

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

LOG: [lldb] Add a reference to the "On Demand Symbols" docs.

Include a reference to the documentation for "on demand symbols" in the
documentation index. This will ensure the page shows up in the side bar
on the website.

Added: 


Modified: 
lldb/docs/index.rst

Removed: 




diff  --git a/lldb/docs/index.rst b/lldb/docs/index.rst
index 087731002094..d1fa6279b4b4 100644
--- a/lldb/docs/index.rst
+++ b/lldb/docs/index.rst
@@ -138,6 +138,7 @@ interesting areas to contribute to lldb.
use/remote
use/qemu-testing
use/intel_pt
+   use/ondemand
use/troubleshooting
use/links
 



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


[Lldb-commits] [PATCH] D127048: [lldb] Set COFF module ABI from default triple and make it an option

2022-06-09 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun updated this revision to Diff 435604.
alvinhochun added a comment.

Rebased patch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127048

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/source/Core/PluginManager.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
  lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml
  lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml
  lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml
  lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-gnu.yaml
  lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
  lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
  lldb/test/Shell/lit.cfg.py

Index: lldb/test/Shell/lit.cfg.py
===
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -62,6 +62,12 @@
 if re.match(r'^arm(hf.*-linux)|(.*-linux-gnuabihf)', config.target_triple):
 config.available_features.add("armhf-linux")
 
+if re.match(r'.*-(windows-msvc)$', config.target_triple):
+config.available_features.add("windows-msvc")
+
+if re.match(r'.*-(windows-gnu|mingw32)$', config.target_triple):
+config.available_features.add("windows-gnu")
+
 def calculate_arch_features(arch_string):
 # This will add a feature such as x86, arm, mips, etc for each built
 # target
Index: lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
@@ -0,0 +1,49 @@
+# RUN: yaml2obj %s -o %t
+
+## Default ABI is msvc:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=msvc -DFILENAME=%basename_t.tmp %s
+
+## Default ABI is gnu:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=gnu -DFILENAME=%basename_t.tmp %s
+
+# CHECK-LABEL: image list --triple --basename
+# CHECK-NEXT: x86_64-pc-windows-[[ABI]] [[FILENAME]]
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+header:
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  4096
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+  - Name:.data
+Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  8192
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+symbols: []
+...
Index: lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
@@ -0,0 +1,41 @@
+# XFAIL: windows-gnu
+
+# RUN: yaml2obj %s -o %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: Architecture: x86_64-pc-windows-msvc
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+header:
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+VirtualAddre

[Lldb-commits] [PATCH] D127234: [lldb] Add setting to override PE/COFF ABI by module name

2022-06-09 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun updated this revision to Diff 435605.
alvinhochun added a comment.

Rebased patch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127234

Files:
  lldb/include/lldb/Interpreter/OptionValueDictionary.h
  lldb/source/Interpreter/OptionValueDictionary.cpp
  lldb/source/Interpreter/Property.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
  lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml

Index: lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
===
--- lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
+++ lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
@@ -1,4 +1,5 @@
 # RUN: yaml2obj %s -o %t
+# RUN: yaml2obj %s -o %t.debug
 
 ## Default ABI is msvc:
 # RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
@@ -10,6 +11,30 @@
 # RUN:   -f %t -o "image list --triple --basename" -o exit | \
 # RUN:   FileCheck -DABI=gnu -DFILENAME=%basename_t.tmp %s
 
+## Default ABI is msvc, module override is gnu:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
+# RUN:   -O "settings append plugin.object-file.pe-coff.module-abi %basename_t.tmp=gnu" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=gnu -DFILENAME=%basename_t.tmp %s
+
+## Default ABI is gnu, module override is msvc:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
+# RUN:   -O "settings append plugin.object-file.pe-coff.module-abi %basename_t.tmp=msvc" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=msvc -DFILENAME=%basename_t.tmp %s
+
+## Default ABI is msvc, module override is gnu (with .debug suffix):
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
+# RUN:   -O "settings append plugin.object-file.pe-coff.module-abi %basename_t.tmp=gnu" \
+# RUN:   -f %t.debug -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=gnu -DFILENAME=%basename_t.tmp.debug %s
+
+## Default ABI is gnu, module override is msvc (with .debug suffix):
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
+# RUN:   -O "settings append plugin.object-file.pe-coff.module-abi %basename_t.tmp=msvc" \
+# RUN:   -f %t.debug -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=msvc -DFILENAME=%basename_t.tmp.debug %s
+
 # CHECK-LABEL: image list --triple --basename
 # CHECK-NEXT: x86_64-pc-windows-[[ABI]] [[FILENAME]]
 
Index: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
===
--- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
+++ lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
@@ -6,4 +6,9 @@
 DefaultEnumValue<"llvm::Triple::UnknownEnvironment">,
 EnumValues<"OptionEnumValues(g_abi_enums)">,
 Desc<"ABI to use when loading a PE/COFF module. This configures the C++ ABI used, which affects things like the handling of class layout. Accepted values are: `msvc` for the MSVC ABI, `gnu` for the MinGW / Itanium ABI, and `default` to follow the default target if it is a Windows triple or use the MSVC ABI by default.">;
+  def ModuleABIMap: Property<"module-abi", "Dictionary">,
+Global,
+ElementType<"Enum">,
+EnumValues<"OptionEnumValues(g_abi_enums)">,
+Desc<"A mapping of ABI override to use for specific modules. The module name is matched by its file name with extension. These versions are checked in sequence: exact, lowercase, exact with '.debug' suffix stripped, lowercase with '.debug' suffix stripped.">;
 }
Index: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===
--- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -16,6 +16,7 @@
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Core/StreamFile.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
 #include "lldb/Interpreter/OptionValueProperties.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"
@@ -91,6 +92,11 @@
 m_collection_sp->GetPropertyAtIndexAsEnumeration(
 nullptr, ePropertyABI, llvm::Triple::UnknownEnvironment);
   }
+
+  OptionValueDictionary *ModuleABIMap() const {
+return m_collection_sp->GetPropertyAtIndexAsOptionValueDictionary(
+nullptr, ePropertyModuleABIMap);
+  }
 };
 
 static PluginProperties &GetGlobalPluginProperties() {
@@ -283,7 +289,41 @@
 return llvm::Triple::MSVC;
   }();
 
-  llvm::Triple::EnvironmentType env = GetGlobalPluginProperties().ABI();
+  // Check for a module-specific override.
+  OptionValueSP module_env_option;
+  const auto *map = GetGlobalPlug

[Lldb-commits] [PATCH] D125509: [LLDB][NFC] Decouple dwarf location table from DWARFExpression.

2022-06-09 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu added inline comments.



Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp:180
 if (!Loc)
-  return Callback(Loc.takeError());
-if (*Loc)
+  consumeError(Loc.takeError());
+else if (*Loc)

rnk wrote:
> Did this change cause the presubmit test failure? 
> DebugInfoDWARFTests/DWARFDie::getLocations looks related.
Yes. If I don't make this change, several existing tests crashed at here due to 
`Expected must be checked before access or destruction`. I'm not sure how to 
fix this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125509

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


[Lldb-commits] [PATCH] D125509: [LLDB][NFC] Decouple dwarf location table from DWARFExpression.

2022-06-09 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 435625.
zequanwu added a comment.

Add missing check for Expected.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125509

Files:
  lldb/include/lldb/Expression/DWARFExpression.h
  lldb/include/lldb/Expression/DWARFExpressionList.h
  lldb/include/lldb/Symbol/Function.h
  lldb/include/lldb/Symbol/Variable.h
  lldb/include/lldb/Target/StackFrame.h
  lldb/include/lldb/lldb-forward.h
  lldb/source/Core/ValueObjectVariable.cpp
  lldb/source/Expression/CMakeLists.txt
  lldb/source/Expression/DWARFExpression.cpp
  lldb/source/Expression/DWARFExpressionList.cpp
  lldb/source/Expression/Materializer.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Symbol/Function.cpp
  lldb/source/Symbol/Variable.cpp
  lldb/source/Target/RegisterContextUnwind.cpp
  lldb/source/Target/StackFrame.cpp
  lldb/test/Shell/SymbolFile/DWARF/x86/debug_loc.s
  lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
  llvm/utils/gn/secondary/lldb/source/Expression/BUILD.gn

Index: llvm/utils/gn/secondary/lldb/source/Expression/BUILD.gn
===
--- llvm/utils/gn/secondary/lldb/source/Expression/BUILD.gn
+++ llvm/utils/gn/secondary/lldb/source/Expression/BUILD.gn
@@ -23,6 +23,7 @@
   include_dirs = [ ".." ]
   sources = [
 "DWARFExpression.cpp",
+"DWARFExpressionList.cpp",
 "DiagnosticManager.cpp",
 "Expression.cpp",
 "ExpressionVariable.cpp",
Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
===
--- lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
+++ lldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
@@ -19,29 +19,29 @@
 # SYMBOLS-NEXT:   Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x0
 # SYMBOLS-NEXT:   Function{{.*}}, demangled = F0
 # SYMBOLS-NEXT:   Block{{.*}}, ranges = [0x-0x0001)
-# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location = 
-# SYMBOLS-NEXT:   DW_LLE_startx_length   (0x0001, 0x0001): DW_OP_reg0 RAX
+# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
+# SYMBOLS-NEXT:   [0x, 0x0001): DW_OP_reg0 RAX
 # SYMBOLS-EMPTY:
 # SYMBOLS-NEXT: CompileUnit{0x0001}, language = "", file = '1.c'
 # SYMBOLS-NEXT:   Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x2
 # SYMBOLS-NEXT:   Function{{.*}}, demangled = F1
 # SYMBOLS-NEXT:   Block{{.*}}, ranges = [0x0001-0x0002)
-# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location = 
-# SYMBOLS-NEXT:   DW_LLE_startx_length   (0x0003, 0x0001): DW_OP_reg1 RDX
+# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
+# SYMBOLS-NEXT:   [0x0001, 0x0002): DW_OP_reg1 RDX
 # SYMBOLS-EMPTY:
 # SYMBOLS-NEXT: CompileUnit{0x0002}, language = "", file = '2.c'
 # SYMBOLS-NEXT:   Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x4
 # SYMBOLS-NEXT:   Function{{.*}}, demangled = F2
 # SYMBOLS-NEXT:   Block{{.*}}, ranges = [0x0002-0x0003)
-# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location = 
-# SYMBOLS-NEXT:   DW_LLE_startx_length   (0x0005, 0x0001): DW_OP_reg2 RCX
+# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
+# SYMBOLS-NEXT:   [0x0002, 0x0003): DW_OP_reg2 RCX
 # SYMBOLS-EMPTY:
 # SYMBOLS-NEXT: CompileUnit{0x0003}, language = "", file = '3.c'
 # SYMBOLS-NEXT:   Variable{{.*}}, name = "A", {{.*}}, location = DW_OP_GNU_addr_index 0x6
 # SYMBOLS-NEXT:   Function{{.*}}, demangled = F3
 # SYMBOLS-NEXT:   Block{{.*}}, ranges = [0x0003-0x0004)
-# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location = 
-# SYMBOLS-NEXT:   DW_LLE_startx_length   (0x0007, 0x0001): DW_OP_reg3 RBX
+# SYMBOLS-NEXT: Variable{{.*}}, name = "x", {{.*}}, location =
+# SYMBOLS-NEXT:   [0x0003, 0x0004): DW_OP_reg3 RBX
 # SYMBOLS-EMPTY:
 # SYMBOLS-NEXT: CompileUnit{0x0004}, language = "", file = ''
 # SYMBOLS-EMPTY:
@@ -116,7 +116,7 @@
 .Lloc\I:
 .byte   3

[Lldb-commits] [PATCH] D125509: [LLDB][NFC] Decouple dwarf location table from DWARFExpression.

2022-06-09 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu marked an inline comment as done.
zequanwu added inline comments.



Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp:180
 if (!Loc)
-  return Callback(Loc.takeError());
-if (*Loc)
+  consumeError(Loc.takeError());
+else if (*Loc)

zequanwu wrote:
> rnk wrote:
> > Did this change cause the presubmit test failure? 
> > DebugInfoDWARFTests/DWARFDie::getLocations looks related.
> Yes. If I don't make this change, several existing tests crashed at here due 
> to `Expected must be checked before access or destruction`. I'm not sure 
> how to fix this.
NVM, I missed a checking for expected above. Reverted this part.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125509

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


[Lldb-commits] [PATCH] D125503: [trace][intelpt] Support system-wide tracing [7] - Create a base IntelPTProcessTrace class

2022-06-09 Thread walter erquinigo via Phabricator via lldb-commits
wallace added inline comments.



Comment at: lldb/source/Plugins/Process/Linux/IntelPTCollector.h:73
+  /// The target process.
   NativeProcessProtocol &m_process;
   /// Threads traced due to "thread tracing"

jj10306 wrote:
> Could this be moved to be a part of the new `IntelPTProcessTrace` abstract 
> class or is this also needed for handling `thread trace`?
i can't because you the reason you mention: thread trace



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:36
 
-Expected IntelPTMultiCoreTrace::StartOnAllCores(
-const TraceIntelPTStartRequest &request) {
+Expected
+IntelPTMultiCoreTrace::StartOnAllCores(const TraceIntelPTStartRequest &request,

jj10306 wrote:
> If this now returns `IntelPTProcessTraceUP` instead of an instance of itself, 
> then we are basically forcing any uses of this class to be done using dynamic 
> polymorphism (behind the indirection of a pointer to the super class). Should 
> this instead return an instance of itself and then leave it up to the caller 
> to decide if they want to use the object directly or behind a pointer?
> I know that currently the only use of this is behind the 
> `IntelPTProcessTraceUP` (stored on the collector), but maybe in the future we 
> would want to use it directly.
> wdyt?
> 
good call



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:119-125
+  // All the process' threads are being traced automatically.
+  return (bool)m_process.GetThreadByID(tid);
+}
+
+llvm::Error IntelPTMultiCoreTrace::TraceStart(lldb::tid_t tid) {
+  // This instance is already tracing all threads automatically.
+  return llvm::Error::success();

jj10306 wrote:
> In `TracesThread` you check that the tid is a thread of `m_process` but in 
> `TraceStart` you return success for all threads without checking if it's a 
> part of the process.
> I don't think it particularly matters if we do the check or not, but I do 
> think that the behavior should be consistent between these functions.
ahh you are right



Comment at: 
lldb/source/Plugins/Process/Linux/IntelPTPerThreadProcessTrace.cpp:58
+
+Expected
+IntelPTPerThreadProcessTrace::Start(const TraceIntelPTStartRequest &request,

jj10306 wrote:
> same comment here as above on the other subclasss
+1



Comment at: lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h:19
+
+// Abstract class to be inherited by all the process tracing strategies.
+class IntelPTProcessTrace {

jj10306 wrote:
> 
+1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125503

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


[Lldb-commits] [PATCH] D127436: [lldb] Resolve exe location for `target create`

2022-06-09 Thread Alvin Wong via Phabricator via lldb-commits
alvinhochun created this revision.
alvinhochun added reviewers: JDevlieghere, labath, mstorsjo.
Herald added subscribers: jsji, pengfei.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This fixes an issue that, when you start lldb or use `target create`
with a program name which is on $PATH, or not specify the .exe suffix of
a program in the working directory on Windows, you get a confusing
error, for example:

  (lldb) target create notepad
  error: 'C:\WINDOWS\SYSTEM32\notepad.exe' doesn't contain any 'host'
  platform architectures: i686, x86_64, i386, i386

Fixes https://github.com/mstorsjo/llvm-mingw/issues/265


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127436

Files:
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Target/TargetList.cpp


Index: lldb/source/Target/TargetList.cpp
===
--- lldb/source/Target/TargetList.cpp
+++ lldb/source/Target/TargetList.cpp
@@ -121,6 +121,14 @@
   if (!user_exe_path.empty()) {
 ModuleSpec module_spec(FileSpec(user_exe_path, FileSpec::Style::native));
 FileSystem::Instance().Resolve(module_spec.GetFileSpec());
+
+// Try to resolve the exe based on PATH and/or platform-specific suffixes,
+// but only if using the host platform.
+if (platform_sp->IsHost() &&
+!FileSystem::Instance().Exists(module_spec.GetFileSpec()))
+  FileSystem::Instance().ResolveExecutableLocation(
+  module_spec.GetFileSpec());
+
 // Resolve the executable in case we are given a path to a application
 // bundle like a .app bundle on MacOSX.
 Host::ResolveExecutableInBundle(module_spec.GetFileSpec());
Index: lldb/source/Commands/CommandObjectTarget.cpp
===
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -299,12 +299,6 @@
 
   const char *file_path = command.GetArgumentAtIndex(0);
   LLDB_SCOPED_TIMERF("(lldb) target create '%s'", file_path);
-  FileSpec file_spec;
-
-  if (file_path) {
-file_spec.SetFile(file_path, FileSpec::Style::native);
-FileSystem::Instance().Resolve(file_spec);
-  }
 
   bool must_set_platform_path = false;
 
@@ -333,6 +327,18 @@
 
   PlatformSP platform_sp = target_sp->GetPlatform();
 
+  FileSpec file_spec;
+  if (file_path) {
+file_spec.SetFile(file_path, FileSpec::Style::native);
+FileSystem::Instance().Resolve(file_spec);
+
+// Try to resolve the exe based on PATH and/or platform-specific
+// suffixes, but only if using the host platform.
+if (platform_sp && platform_sp->IsHost() &&
+!FileSystem::Instance().Exists(file_spec))
+  FileSystem::Instance().ResolveExecutableLocation(file_spec);
+  }
+
   if (remote_file) {
 if (platform_sp) {
   // I have a remote file.. two possible cases


Index: lldb/source/Target/TargetList.cpp
===
--- lldb/source/Target/TargetList.cpp
+++ lldb/source/Target/TargetList.cpp
@@ -121,6 +121,14 @@
   if (!user_exe_path.empty()) {
 ModuleSpec module_spec(FileSpec(user_exe_path, FileSpec::Style::native));
 FileSystem::Instance().Resolve(module_spec.GetFileSpec());
+
+// Try to resolve the exe based on PATH and/or platform-specific suffixes,
+// but only if using the host platform.
+if (platform_sp->IsHost() &&
+!FileSystem::Instance().Exists(module_spec.GetFileSpec()))
+  FileSystem::Instance().ResolveExecutableLocation(
+  module_spec.GetFileSpec());
+
 // Resolve the executable in case we are given a path to a application
 // bundle like a .app bundle on MacOSX.
 Host::ResolveExecutableInBundle(module_spec.GetFileSpec());
Index: lldb/source/Commands/CommandObjectTarget.cpp
===
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -299,12 +299,6 @@
 
   const char *file_path = command.GetArgumentAtIndex(0);
   LLDB_SCOPED_TIMERF("(lldb) target create '%s'", file_path);
-  FileSpec file_spec;
-
-  if (file_path) {
-file_spec.SetFile(file_path, FileSpec::Style::native);
-FileSystem::Instance().Resolve(file_spec);
-  }
 
   bool must_set_platform_path = false;
 
@@ -333,6 +327,18 @@
 
   PlatformSP platform_sp = target_sp->GetPlatform();
 
+  FileSpec file_spec;
+  if (file_path) {
+file_spec.SetFile(file_path, FileSpec::Style::native);
+FileSystem::Instance().Resolve(file_spec);
+
+// Try to resolve the exe based on PATH and/or platform-specific
+// suffixes, but only if using the host platform.
+if (platform_sp && platform_sp->IsHost() &&

[Lldb-commits] [PATCH] D127437: [LLDB][Docs] Fix formatting of example code-block

2022-06-09 Thread Michael Buch via Phabricator via lldb-commits
Michael137 created this revision.
Michael137 added a reviewer: aprantl.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Tested by building the `docs-lldb-html` target and
confirming the code-block renders properly with
the fix.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127437

Files:
  lldb/docs/use/variable.rst


Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -808,6 +808,7 @@
 Simple [3] as:
 
 ::
+
(lldb) type summary add --summary-string "${var[].x}" -x "Simple \[[0-9]+\]"
(lldb) frame variable
(Simple [3]) sarray = [1,4,7]


Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -808,6 +808,7 @@
 Simple [3] as:
 
 ::
+
(lldb) type summary add --summary-string "${var[].x}" -x "Simple \[[0-9]+\]"
(lldb) frame variable
(Simple [3]) sarray = [1,4,7]
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D127048: [lldb] Set COFF module ABI from default triple and make it an option

2022-06-09 Thread Martin Storsjö via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG25c8a061c573: [lldb] Set COFF module ABI from default triple 
and make it an option (authored by alvinhochun, committed by mstorsjo).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127048

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/source/Core/PluginManager.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
  lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml
  lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml
  lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml
  lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-gnu.yaml
  lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
  lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
  lldb/test/Shell/lit.cfg.py

Index: lldb/test/Shell/lit.cfg.py
===
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -62,6 +62,12 @@
 if re.match(r'^arm(hf.*-linux)|(.*-linux-gnuabihf)', config.target_triple):
 config.available_features.add("armhf-linux")
 
+if re.match(r'.*-(windows-msvc)$', config.target_triple):
+config.available_features.add("windows-msvc")
+
+if re.match(r'.*-(windows-gnu|mingw32)$', config.target_triple):
+config.available_features.add("windows-gnu")
+
 def calculate_arch_features(arch_string):
 # This will add a feature such as x86, arm, mips, etc for each built
 # target
Index: lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
@@ -0,0 +1,49 @@
+# RUN: yaml2obj %s -o %t
+
+## Default ABI is msvc:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=msvc -DFILENAME=%basename_t.tmp %s
+
+## Default ABI is gnu:
+# RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
+# RUN:   -f %t -o "image list --triple --basename" -o exit | \
+# RUN:   FileCheck -DABI=gnu -DFILENAME=%basename_t.tmp %s
+
+# CHECK-LABEL: image list --triple --basename
+# CHECK-NEXT: x86_64-pc-windows-[[ABI]] [[FILENAME]]
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+header:
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  4096
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+  - Name:.data
+Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  8192
+VirtualSize: 64
+SectionData: DEADBEEFBAADF00D
+symbols: []
+...
Index: lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
===
--- /dev/null
+++ lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
@@ -0,0 +1,41 @@
+# XFAIL: windows-gnu
+
+# RUN: yaml2obj %s -o %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: Architecture: x86_64-pc-windows-msvc
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 5152
+  ImageBase:   5368709120
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+header:
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+

[Lldb-commits] [lldb] 25c8a06 - [lldb] Set COFF module ABI from default triple and make it an option

2022-06-09 Thread Martin Storsjö via lldb-commits

Author: Alvin Wong
Date: 2022-06-09T22:43:33+03:00
New Revision: 25c8a061c5739677d2fc0af29a8cc9520207b923

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

LOG: [lldb] Set COFF module ABI from default triple and make it an option

PE/COFF can use either MSVC or GNU (MinGW) ABI for C++ code, however
LLDB had defaulted to MSVC implicitly with no way to override it. This
causes issues when debugging modules built with the GNU ABI, sometimes
even crashes.

This changes the PE/COFF plugin to set the module triple according to
the default target triple used to build LLDB. If the default target
triple is Windows and a valid environment is specified, then this
environment will be used for the module spec. This not only works for
MSVC and GNU, but also other environments.

A new setting, `plugin.object-file.pe-coff.abi`,  has been added to
allow overriding this default ABI.

* Fixes https://github.com/llvm/llvm-project/issues/50775
* Fixes https://github.com/mstorsjo/llvm-mingw/issues/226
* Fixes https://github.com/mstorsjo/llvm-mingw/issues/282

Reviewed By: omjavaid

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

Added: 
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-gnu.yaml
lldb/test/Shell/ObjectFile/PECOFF/default-triple-windows-msvc.yaml
lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml

Modified: 
lldb/include/lldb/Core/PluginManager.h
lldb/source/Core/PluginManager.cpp
lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml
lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml
lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml
lldb/test/Shell/lit.cfg.py

Removed: 




diff  --git a/lldb/include/lldb/Core/PluginManager.h 
b/lldb/include/lldb/Core/PluginManager.h
index 1ab9d26d3af4f..8322585b2253e 100644
--- a/lldb/include/lldb/Core/PluginManager.h
+++ b/lldb/include/lldb/Core/PluginManager.h
@@ -174,7 +174,8 @@ class PluginManager {
  ObjectFileCreateInstance create_callback,
  ObjectFileCreateMemoryInstance create_memory_callback,
  ObjectFileGetModuleSpecifications get_module_specifications,
- ObjectFileSaveCore save_core = nullptr);
+ ObjectFileSaveCore save_core = nullptr,
+ DebuggerInitializeCallback debugger_init_callback = nullptr);
 
   static bool UnregisterPlugin(ObjectFileCreateInstance create_callback);
 
@@ -482,6 +483,13 @@ class PluginManager {
   Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
   ConstString description, bool is_global_property);
 
+  static lldb::OptionValuePropertiesSP
+  GetSettingForObjectFilePlugin(Debugger &debugger, ConstString setting_name);
+
+  static bool CreateSettingForObjectFilePlugin(
+  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
+  ConstString description, bool is_global_property);
+
   static lldb::OptionValuePropertiesSP
   GetSettingForSymbolFilePlugin(Debugger &debugger, ConstString setting_name);
 

diff  --git a/lldb/source/Core/PluginManager.cpp 
b/lldb/source/Core/PluginManager.cpp
index 37050494aa2ea..f12efad560b21 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -621,9 +621,10 @@ struct ObjectFileInstance : public 
PluginInstance {
   CallbackType create_callback,
   ObjectFileCreateMemoryInstance create_memory_callback,
   ObjectFileGetModuleSpecifications get_module_specifications,
-  ObjectFileSaveCore save_core)
-  : PluginInstance(name, description,
- create_callback),
+  ObjectFileSaveCore save_core,
+  DebuggerInitializeCallback debugger_init_callback)
+  : PluginInstance(
+name, description, create_callback, debugger_init_callback),
 create_memory_callback(create_memory_callback),
 get_module_specifications(get_module_specifications),
 save_core(save_core) {}
@@ -644,10 +645,11 @@ bool PluginManager::RegisterPlugin(
 ObjectFileCreateInstance create_callback,
 ObjectFileCreateMemoryInstance create_memory_callback,
 ObjectFileGetModuleSpecifications get_module_specifications,
-ObjectFileSaveCore save_core) {
+ObjectFileSaveCore save_core,
+DebuggerInitializeCallback debugger_init_callback) {
   return GetObjectFileInstances().RegisterPlugin(
   name, description, create_callback, create_memory_callback,
-  get_module_specifications, save_core);
+  get_module_specific

[Lldb-commits] [PATCH] D125850: [trace][intelpt] Support system-wide tracing [8] - Improve the single buffer perf_event configuration

2022-06-09 Thread walter erquinigo via Phabricator via lldb-commits
wallace added inline comments.



Comment at: lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp:186
   attr.exclude_kernel = 1;
-  attr.sample_type = PERF_SAMPLE_TIME;
-  attr.sample_id_all = 1;

jj10306 wrote:
> won't we need this in order to get timestamps in the context switching 
> events? I agree we don't need it for the time being so maybe in the diff 
> where you add context switch collection you will reintroduce it 🙂
in a later diff I define separate settings for context switches, so this one 
should be fine



Comment at: lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp:316
-if (Error mmap_err = perf_event->MmapMetadataAndBuffers(buffer_numpages,
-buffer_numpages)) {
   return std::move(mmap_err);

jj10306 wrote:
> In the future if we need to collect itrace we will need a small data buffer.
> Do you plan to collect context switch info as part of the same perf event 
> used for intel pt or will you open a separate event?
context switches are done separately
besides, that let's see in the future if itrace is useful


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125850

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


[Lldb-commits] [PATCH] D127437: [LLDB][Docs] Fix formatting of example code-block

2022-06-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127437

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


[Lldb-commits] [lldb] 47c4c6a - [lldb] Use assertState in more tests (NFC)

2022-06-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-06-09T16:18:07-07:00
New Revision: 47c4c6a7469f3fd3e364a9b3669838686d4f1de6

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

LOG: [lldb] Use assertState in more tests (NFC)

Follow to D127355, converting more `assertEquals` to `assertState`.

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

Added: 


Modified: 
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py

lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
lldb/test/API/functionalities/exec/TestExec.py
lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py

lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
lldb/test/API/functionalities/signal/raise/TestRaise.py

lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
lldb/test/API/functionalities/step_scripted/TestStepScripted.py

lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
lldb/test/API/python_api/frame/TestFrames.py
lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
lldb/test/API/python_api/target/TestTargetAPI.py
lldb/test/API/python_api/thread/TestThreadAPI.py
lldb/test/API/python_api/type/TestTypeList.py
lldb/test/API/python_api/value/TestValueAPI.py
lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

Removed: 




diff  --git 
a/lldb/test/API/commands/register/register/register_command/TestRegisters.py 
b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
index 083f56c300f6a..0fd90dc973d2b 100644
--- a/lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -221,8 +221,8 @@ def fp_special_purpose_register_read(self):
 self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)
 
 process = target.GetProcess()
-self.assertEqual(process.GetState(), lldb.eStateStopped,
-PROCESS_STOPPED)
+self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
 
 thread = process.GetThreadAtIndex(0)
 self.assertTrue(thread.IsValid(), "current thread is valid")

diff  --git 
a/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py 
b/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
index c0633360137a0..86f896dbb2e27 100644
--- a/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
+++ b/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
@@ -26,7 +26,7 @@ def test(self):
 
 process = target.LaunchSimple(None, None,
 self.get_process_working_directory())
-self.assertEqual(process.GetState(), lldb.eStateStopped)
+self.assertState(process.GetState(), lldb.eStateStopped)
 
 thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
 self.assertIsNotNone(thread)
@@ -46,6 +46,6 @@ def test(self)

[Lldb-commits] [PATCH] D127378: [lldb] Use assertState in more tests (NFC)

2022-06-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG47c4c6a7469f: [lldb] Use assertState in more tests (NFC) 
(authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127378

Files:
  lldb/test/API/commands/register/register/register_command/TestRegisters.py
  lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
  
lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
  lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
  lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
  lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
  lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
  lldb/test/API/functionalities/exec/TestExec.py
  lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
  lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
  lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
  lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
  
lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
  lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
  lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
  lldb/test/API/functionalities/signal/raise/TestRaise.py
  
lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
  lldb/test/API/functionalities/step_scripted/TestStepScripted.py
  
lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
  lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
  lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
  lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
  lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
  lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
  lldb/test/API/python_api/frame/TestFrames.py
  lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
  lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
  lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
  lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
  lldb/test/API/python_api/target/TestTargetAPI.py
  lldb/test/API/python_api/thread/TestThreadAPI.py
  lldb/test/API/python_api/type/TestTypeList.py
  lldb/test/API/python_api/value/TestValueAPI.py
  lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
  lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
  lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
  lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
  lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
  lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
  lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

Index: lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
===
--- lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -48,8 +48,8 @@
 
 # We should be stopped due to the breakpoint.  Get frame #0.
 process = target.GetProcess()
-self.assertEqual(process.GetState(), lldb.eStateStopped,
-PROCESS_STOPPED)
+self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
 thread = lldbutil.get_stopped_thread(
 process, lldb.eStopReasonBreakpoint)
 frame0 = thread.GetFrameAtIndex(0)
@@ -122,8 +122,8 @@
 
 # We should be stopped due to the breakpoint.  Get frame #0.
 process = target.GetProcess()
-self.assertEqual(process.GetState(), lldb.eStateStopped,
-PROCESS_STOPPED)
+self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
 thread = lldbutil.get_stopped_thread(
 process, lldb.eStopReasonBreakpoint)
 frame0 = thread.GetFrameAtIndex(0)
Index: lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
===
--- lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -50,8 +50,8 @@
 
 # We should be stopped due to the breakpoint.  Get frame #0.
 process = target.GetProcess()
-self.assertEqual(process.GetState(), lldb.eStateStopped,
-PROCESS_STOPPED)
+self.assertState(process.GetState(), lldb.eStateStopped,
+ PROCESS_STOPPED)
 thread = lldbutil.get_stopped_thread(
  

[Lldb-commits] [PATCH] D127378: [lldb] Use assertState in more tests (NFC)

2022-06-09 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

@JDevlieghere `assertEquals` is the deprecated name, `assertEqual` is the


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127378

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


[Lldb-commits] [PATCH] D125897: [trace][intelpt] Support system-wide tracing [9] - Collect and return context switch traces

2022-06-09 Thread walter erquinigo via Phabricator via lldb-commits
wallace added inline comments.



Comment at: lldb/include/lldb/Utility/TraceIntelPTGDBRemotePackets.h:26-28
   static const char *kProcFsCpuInfo;
   static const char *kTraceBuffer;
+  static const char *kPerfContextSwitchTrace;

jj10306 wrote:
> nit: these are just pointers to a buffer of bytes right? if so, maybe we 
> could change the types to be `const uint8_t *`.
> Obviously it doesn't make a difference since they are the same size, but when 
> I see `const char *` my brain kinda immediately thinks STRING!
> maybe it's just me though 🤩,  wdyt?
oh no, these are just string enums, but it happens that c++ doesn't support 
natively string enums



Comment at: lldb/source/Plugins/Process/Linux/IntelPTCollector.h:41-45
+  void ProcessDidStop();
+
+  /// To be invoked before the process will resume, so that we can capture the
+  /// first instructions after the resume.
+  void ProcessWillResume();

jj10306 wrote:
> Why do we need to separate these out into two separate functions?
The "state" thing is an implementation detail, the most important thing for 
callers is to notify the collector what's happening with the target.

So I'm also going with this approach for clarity, following the standard that 
LLDB uses everywhere. DidStop and WillResume appear so in the LLDB code often 
that it's better to keep them here for consistency. 



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:36
 
+static Expected CreateContextSwitchTracePerfEvent(
+bool disabled, lldb::core_id_t core_id,

jj10306 wrote:
> thoughts on moving this to be a "utility" method of the Perf.cpp and then 
> call that utility method from here? Moving it there would make it more 
> accessible to other callers.
good idea



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:47
+  attr.size = sizeof(attr);
+  attr.sample_period = 0;
+  attr.sample_type = PERF_SAMPLE_TID | PERF_SAMPLE_TIME;

jj10306 wrote:
> what does this do?
this is super redundant because this field is already 0 after the memset



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:51-54
+  attr.exclude_kernel = 1;
+  attr.sample_id_all = 1;
+  attr.exclude_hv = 1;
+  attr.disabled = disabled;

jj10306 wrote:
> In addition to this context switching event needing to be part of the same 
> group, you also must ensure that some other config bits (exclude_kernel, 
> exclude_hv) are the same.
> Also, what would happen if the disabled bit is set here but then the enabled 
> bit of the intel pt event was set?
> 
> All of these considerations related to keeping the two events "in sync", are 
> beginning to make me lean towards what I mentioned above about using the same 
> perf event, because that would naturally remove any opportunities for the two 
> events to be "out of sync"
I've moved this function to Perf.h, so given this:
- disabled is dominated by the group perf event state, so I'll use that state 
instead of asking for the disabled value.
- exclude_hv is needed all the time
- exclude_kernel as well

so, besides the change to disabled, the only two fields that we should really 
synchronize are exclude_hv and exclude_kernel, but I don't see us creating more 
perf events, so I don't think if it's worth creating more abstractions just for 
these two fields. We could do more in the future when we need to trace kernel. 
You can leave more suggestions in my newer diff



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:56
+
+  // The given perf configuration will product context switch records of 32
+  // bytes each. Assuming that every context switch will be emitted twice (one

jj10306 wrote:
> 
+1



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:101-109
+Expected core_trace =
+IntelPTSingleBufferTrace::Start(request, /*tid=*/None, core_id,
+/*disabled=*/true);
+if (!core_trace)
   return IncludePerfEventParanoidMessageInError(core_trace.takeError());
+
+if (Expected context_switch_trace =

jj10306 wrote:
> to reduce opportunity for things to get out of sync if this is ever touched 
> in the future?
+1



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp:122-129
 void IntelPTMultiCoreTrace::ForEachCore(
 std::function
 callback) {
   for (auto &it : m_traces_per_core)
-callback(it.first, *it.second);
+callback(it.first, it.second.first);
 }
 

jj10306 wrote:
> Is there a way to consolidate these two methods?
not really :(



Comment at: lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h:97
+  llvm::DenseMap>
+  m_traces_per_core;

jj10306 wrote:
> perhaps you could make 

[Lldb-commits] [PATCH] D127456: [trace][intelpt] Support system-wide tracing [17] - Some improvements

2022-06-09 Thread walter erquinigo via Phabricator via lldb-commits
wallace created this revision.
wallace added a reviewer: jj10306.
Herald added a project: All.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This improves several things and addresses comments up to the diff [11] in this 
stack.

- Simplify many functions to receive less parameters that they can identify 
easily
- Create Storage classes for Trace and TraceIntelPT that can make it easier to 
reason about what can change with live process refreshes and what cannot.
- Don't cache the perf zero conversion numbers in lldb-server to make sure we 
get the most up-to-date numbers.
- Move the thread identifaction from context switches to the bundle parser, to 
leave TraceIntelPT simpler. This also makes sure that the constructor of 
TraceIntelPT is invoked when the entire data has been checked to be correct.
- Normalize all bundle paths before the Processes, Threads and Modules are 
created, so that they can assume that all paths are correct and absolute
- Fix some issues in the tests. Now they all pass.
- return the specific instance when constructing PerThread and MultiCore 
processor tracers.
- Properly implement IntelPTMultiCoreTrace::TraceStart.
- Improve some comments.
- Use the typedef ContextSwitchTrace more often for clarity.
- Move CreateContextSwitchTracePerfEvent to Perf.h as a utility function.
- Synchronize better the state of the context switch and the intel pt

perf events.

- Use a booblean instead of an enum for the PerfEvent state.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127456

Files:
  lldb/include/lldb/Target/Trace.h
  lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
  lldb/source/Plugins/Process/Linux/IntelPTCollector.h
  lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
  lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h
  lldb/source/Plugins/Process/Linux/IntelPTPerThreadProcessTrace.cpp
  lldb/source/Plugins/Process/Linux/IntelPTPerThreadProcessTrace.h
  lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h
  lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h
  lldb/source/Plugins/Process/Linux/Perf.cpp
  lldb/source/Plugins/Process/Linux/Perf.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCoreDecoder.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCoreDecoder.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionSaver.cpp
  lldb/source/Target/Trace.cpp
  lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
  
lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json

Index: lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json
===
--- lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json
+++ lldb/test/API/commands/trace/intelpt-multi-core-trace/trace_missing_threads.json
@@ -1,14 +1,14 @@
 {
   "cores": [
 {
-  "contextSwitchTrace": "/tmp/trace8/cores/45.perf_context_switch_trace",
+  "contextSwitchTrace": "cores/45.perf_context_switch_trace",
   "coreId": 45,
-  "traceBuffer": "/tmp/trace8/cores/45.intelpt_trace"
+  "traceBuffer": "cores/45.intelpt_trace"
 },
 {
-  "contextSwitchTrace": "/tmp/trace8/cores/51.perf_context_switch_trace",
+  "contextSwitchTrace": "cores/51.perf_context_switch_trace",
   "coreId": 51,
-  "traceBuffer": "/tmp/trace8/cores/51.intelpt_trace"
+  "traceBuffer": "cores/51.intelpt_trace"
 }
   ],
   "cpuInfo": {
Index: lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
===
--- lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
+++ lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
@@ -1,14 +1,14 @@
 {
   "cores": [
 {
-  "contextSwitchTrace": "/tmp/trace8/cores/45.perf_context_switch_trace",
+  "contextSwitchTrace": "cores/45.perf_context_switch_trace",
   "coreId": 45,
-  "traceBuffer": "/tmp/trace8/cores/45.intelpt_trace"
+  "traceBuffer": "cores/45.intelpt_trace"
 },
 {
-  "contextSwitchTrace": "/tmp/trace8/cores/51.perf_context_switch_trace",
+  "contextSwitchTrace": "cores/51.perf_context_switch_trace",
   "coreId": 51,
-  "traceBuffer": "/tmp/trace8/cores/51.intelpt_trace"
+  "traceBuffer": "cores/51.intelpt_trace"
 }
   ],
   "cpuInfo": {
Index: lldb/source/Target/Trace.cpp
===
--- lldb/source/Target/Trace.cpp
+++ lldb/source/Target/Trace.cpp
@@ -116,8 +116,9 @@
 
 Optional Tr

[Lldb-commits] [PATCH] D127458: [lldb][bindings] Implement __repr__ instead of __str__

2022-06-09 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: jingham, JDevlieghere, mib.
Herald added a project: All.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When using the `script` Python repl, SB objects are printed in a way that gives
the user no information. The simplest example is:

  (lldb) script lldb.debugger
   >

This output comes from the Python repl printing the `repr()` of an object.

None of the SB classes implement `__repr__`, and all print like the above.
However, many (most?, all?) SB classes implement `__str__`. Because they
implement `__str__`, a more detailed output can be had by `print`ing the
object, for example:

  (lldb) script print(lldb.debugger)
  Debugger (instance: "debugger_1", id: 1)

For convenience, this change switches all SB classes that implement to
`__str__` to instead implement `__repr__`. The benefit being that when writing
a `script` invocation, you don't need to remember to wrap in `print`. If that
isn't enough motivation, consider the case where your Python expression results
in a list of SB objects, in that case you'd have to `map` or use a list
comprehension like `[str(x) for x in ]` in order to see the
details of the objects in the list.

For reference, the docs for `repr` say:

> repr(object)
>
>   Return a string containing a printable representation of an object. For
>   many types, this function makes an attempt to return a string that would
>   yield an object with the same value when passed to eval(); otherwise, the
>   representation is a string enclosed in angle brackets that contains the
>   name of the type of the object together with additional information often
>   including the name and address of the object. A class can control what this
>   function returns for its instances by defining a __repr__() method.

and the docs for `__repr__` say:

> object.__repr__(self)
>
>   Called by the repr() built-in function to compute the “official” string
>   representation of an object. If at all possible, this should look like a
>   valid Python expression that could be used to recreate an object with the
>   same value (given an appropriate environment). If this is not possible, a
>   string of the form <...some useful description...> should be returned. The
>   return value must be a string object. If a class defines __repr__() but not
>   __str__(), then __repr__() is also used when an “informal” string
>   representation of instances of that class is required.
>   
>   This is typically used for debugging, so it is important that the
>   representation is information-rich and unambiguous.

Note the point that when implementing only `__repr__` (and not `__str__`), then
`__repr__` is used when `str()` is called.

Even if it were convenient to construct Python expressions for SB classes so
that they could be `eval`'d, I don't current know of a motivating reason for
typical lldb usage. As it stands, the only thing the docs say to do, that this
change doesn't do, is wrap the `repr` string in `<>` angle brackets.

An alternative implementation is to change lldb's python repl to apply `str()`
to the top level result. While this would work well in the case of a single SB
object, it doesn't work for a list of SB objects, since `str([x])` uses `repr`
to convert each list element to a string.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127458

Files:
  lldb/bindings/macros.swig


Index: lldb/bindings/macros.swig
===
--- lldb/bindings/macros.swig
+++ lldb/bindings/macros.swig
@@ -1,6 +1,6 @@
 %define STRING_EXTENSION_LEVEL(Class, Level)
 %extend {
-  std::string lldb:: ## Class ## ::__str__(){
+  std::string lldb:: ## Class ## ::__repr__(){
 lldb::SBStream stream;
 $self->GetDescription (stream, Level);
 const char *desc = stream.GetData();
@@ -15,7 +15,7 @@
 
 %define STRING_EXTENSION(Class)
 %extend {
-  std::string lldb:: ## Class ## ::__str__(){
+  std::string lldb:: ## Class ## ::__repr__(){
 lldb::SBStream stream;
 $self->GetDescription (stream);
 const char *desc = stream.GetData();


Index: lldb/bindings/macros.swig
===
--- lldb/bindings/macros.swig
+++ lldb/bindings/macros.swig
@@ -1,6 +1,6 @@
 %define STRING_EXTENSION_LEVEL(Class, Level)
 %extend {
-  std::string lldb:: ## Class ## ::__str__(){
+  std::string lldb:: ## Class ## ::__repr__(){
 lldb::SBStream stream;
 $self->GetDescription (stream, Level);
 const char *desc = stream.GetData();
@@ -15,7 +15,7 @@
 
 %define STRING_EXTENSION(Class)
 %extend {
-  std::string lldb:: ## Class ## ::__str__(){
+  std::string lldb:: ## Class ## ::__repr__(){
 lldb::SBStream stream;
 $self->GetDescription (stream);
 const char *desc = stream.GetData();
___
lldb-commits mailing list
lldb-commits@lists

[Lldb-commits] [PATCH] D127458: [lldb][bindings] Implement __repr__ instead of __str__

2022-06-09 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

What happens if you try to call __str__ after your change ? I have no objection 
with this change, I think rather it will greatly improve manipulating SBTypes 
in the interpreter ! Just making sure this passes the test suite and doesn't 
break the previous behavior


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127458

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