[Lldb-commits] [PATCH] D157460: [lldb] Sink StreamFile into lldbHost

2023-08-08 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

Shouldn't this be next to the other `Stream` class in `lldbUtility` ?




Comment at: lldb/include/lldb/Host/StreamFile.h:12
 
 #include "lldb/Host/File.h"
 #include "lldb/Utility/Stream.h"

Do we really need this header ? We could forward declare FileSP do avoid having 
to include it here 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157460

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


[Lldb-commits] [PATCH] D157463: [lldb] Sink StreamBuffer into lldbUtility

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, jingham, jasonmolenda.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

lldbUtility seems like a more suitable place for StreamBuffer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157463

Files:
  lldb/include/lldb/Core/StreamBuffer.h
  lldb/include/lldb/Utility/StreamBuffer.h
  lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
  lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
  lldb/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp

Index: lldb/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
===
--- lldb/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
+++ lldb/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
@@ -10,10 +10,10 @@
 
 #include "Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.h"
 
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/DataExtractor.h"
+#include "lldb/Utility/StreamBuffer.h"
 #include "lldb/Utility/StreamString.h"
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
Index: lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
===
--- lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
@@ -9,11 +9,11 @@
 #include "PDBLocationToDWARFExpression.h"
 
 #include "lldb/Core/Section.h"
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Core/dwarf.h"
 #include "lldb/Expression/DWARFExpression.h"
 #include "lldb/Symbol/Variable.h"
 #include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/StreamBuffer.h"
 
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
Index: lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
===
--- lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -14,7 +14,6 @@
 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/LineTable.h"
Index: lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
===
--- lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
+++ lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
@@ -9,7 +9,6 @@
 #include "PdbFPOProgramToDWARFExpression.h"
 #include "CodeViewRegisterMapping.h"
 
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Symbol/PostfixExpression.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Stream.h"
Index: lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
===
--- lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
+++ lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
@@ -10,10 +10,10 @@
 
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Expression/DWARFExpression.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/StreamBuffer.h"
 
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
Index: lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
===
--- lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
+++ lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp
@@ -10,7 +10,6 @@
 
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
-#include "lldb/Core/StreamBuffer.h"
 #include "lldb/Host/Config.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Function.h"
@@ -26,6 +25,7 @@
 #include "lldb/Utility/LLDBLog.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"
+#include "lldb/Utility/StreamBuffer.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/Timer.h"
 #include "llvm/Support/MemoryBuffer.h"
Index: lldb/source/Plugins/Process/MacOSX-K

[Lldb-commits] [PATCH] D157165: [lldb] [darwin kernel debug] When looking for a Darwin kernel symbol file, call GetSharedModules before DownloadObjectAndSymbolFile

2023-08-08 Thread Jason Molenda via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0d8d31bbf55c: When loading kernel binary, use 
DownloadObjectAndSymbolFile last (authored by jasonmolenda).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157165

Files:
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp


Index: 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
===
--- 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -763,28 +763,13 @@
   module_spec.GetUUID() = m_uuid;
   module_spec.GetArchitecture() = target.GetArchitecture();
 
-  // For the kernel, we really do need an on-disk file copy of the binary
-  // to do anything useful. This will force a call to dsymForUUID if it
-  // exists, instead of depending on the DebugSymbols preferences being
-  // set.
-  Status kernel_search_error;
-  if (IsKernel()) {
-if (Symbols::DownloadObjectAndSymbolFile(module_spec,
- kernel_search_error, true)) {
-  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
-m_module_sp = std::make_shared(module_spec.GetFileSpec(),
-   target.GetArchitecture());
-  }
-}
-  }
-
   // If the current platform is PlatformDarwinKernel, create a ModuleSpec
   // with the filename set to be the bundle ID for this kext, e.g.
   // "com.apple.filesystems.msdosfs", and ask the platform to find it.
   // PlatformDarwinKernel does a special scan for kexts on the local
   // system.
   PlatformSP platform_sp(target.GetPlatform());
-  if (!m_module_sp && platform_sp) {
+  if (platform_sp) {
 static ConstString g_platform_name(
 PlatformDarwinKernel::GetPluginNameStatic());
 if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) {
@@ -807,6 +792,22 @@
 m_module_sp = target.GetOrCreateModule(module_spec, true /* notify */);
   }
 
+  // For the kernel, we really do need an on-disk file copy of the binary
+  // to do anything useful. This will force a call to dsymForUUID if it
+  // exists, instead of depending on the DebugSymbols preferences being
+  // set.
+  Status kernel_search_error;
+  if (IsKernel() &&
+  (!m_module_sp || !m_module_sp->GetSymbolFileFileSpec())) {
+if (Symbols::DownloadObjectAndSymbolFile(module_spec,
+ kernel_search_error, true)) {
+  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
+m_module_sp = std::make_shared(module_spec.GetFileSpec(),
+   target.GetArchitecture());
+  }
+}
+  }
+
   if (IsKernel() && !m_module_sp) {
 Stream &s = target.GetDebugger().GetErrorStream();
 s.Printf("WARNING: Unable to locate kernel binary on the debugger "


Index: lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
===
--- lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -763,28 +763,13 @@
   module_spec.GetUUID() = m_uuid;
   module_spec.GetArchitecture() = target.GetArchitecture();
 
-  // For the kernel, we really do need an on-disk file copy of the binary
-  // to do anything useful. This will force a call to dsymForUUID if it
-  // exists, instead of depending on the DebugSymbols preferences being
-  // set.
-  Status kernel_search_error;
-  if (IsKernel()) {
-if (Symbols::DownloadObjectAndSymbolFile(module_spec,
- kernel_search_error, true)) {
-  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
-m_module_sp = std::make_shared(module_spec.GetFileSpec(),
-   target.GetArchitecture());
-  }
-}
-  }
-
   // If the current platform is PlatformDarwinKernel, create a ModuleSpec
   // with the filename set to be the bundle ID for this kext, e.g.
   // "com.apple.filesystems.msdosfs", and ask the platform to find it.
   // PlatformDarwinKernel does a special scan for kexts on the local
   // system.
   PlatformSP platform_sp(target.GetPlatform());
-  if (!m_module_sp && platform_sp) {
+  if (platform_sp) {
 static ConstString g_platform_name(
 Pl

[Lldb-commits] [lldb] 0d8d31b - When loading kernel binary, use DownloadObjectAndSymbolFile last

2023-08-08 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2023-08-08T17:30:57-07:00
New Revision: 0d8d31bbf55cedc1dad5c165187a084c1430f407

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

LOG: When loading kernel binary, use DownloadObjectAndSymbolFile last

When lldb starts a kernel debug session, it has the UUID of the
kernel binary.  lldb will try three different methods to find a
binary and symbol file for this UUID.  Currently it calls out to
Symbols::DownloadObjectAndSymbolFile() first, which may be the
slowest method when a DBGShellCommand can find the UUID on a
network filesystem or downloaded from a server.

This patch tries the local searches first, then falls back to that
method.

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

Added: 


Modified: 

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 3bf06b1af7875e..a95ae4f617264f 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -763,28 +763,13 @@ bool 
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
   module_spec.GetUUID() = m_uuid;
   module_spec.GetArchitecture() = target.GetArchitecture();
 
-  // For the kernel, we really do need an on-disk file copy of the binary
-  // to do anything useful. This will force a call to dsymForUUID if it
-  // exists, instead of depending on the DebugSymbols preferences being
-  // set.
-  Status kernel_search_error;
-  if (IsKernel()) {
-if (Symbols::DownloadObjectAndSymbolFile(module_spec,
- kernel_search_error, true)) {
-  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
-m_module_sp = std::make_shared(module_spec.GetFileSpec(),
-   target.GetArchitecture());
-  }
-}
-  }
-
   // If the current platform is PlatformDarwinKernel, create a ModuleSpec
   // with the filename set to be the bundle ID for this kext, e.g.
   // "com.apple.filesystems.msdosfs", and ask the platform to find it.
   // PlatformDarwinKernel does a special scan for kexts on the local
   // system.
   PlatformSP platform_sp(target.GetPlatform());
-  if (!m_module_sp && platform_sp) {
+  if (platform_sp) {
 static ConstString g_platform_name(
 PlatformDarwinKernel::GetPluginNameStatic());
 if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) {
@@ -807,6 +792,22 @@ bool 
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
 m_module_sp = target.GetOrCreateModule(module_spec, true /* notify */);
   }
 
+  // For the kernel, we really do need an on-disk file copy of the binary
+  // to do anything useful. This will force a call to dsymForUUID if it
+  // exists, instead of depending on the DebugSymbols preferences being
+  // set.
+  Status kernel_search_error;
+  if (IsKernel() &&
+  (!m_module_sp || !m_module_sp->GetSymbolFileFileSpec())) {
+if (Symbols::DownloadObjectAndSymbolFile(module_spec,
+ kernel_search_error, true)) {
+  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
+m_module_sp = std::make_shared(module_spec.GetFileSpec(),
+   target.GetArchitecture());
+  }
+}
+  }
+
   if (IsKernel() && !m_module_sp) {
 Stream &s = target.GetDebugger().GetErrorStream();
 s.Printf("WARNING: Unable to locate kernel binary on the debugger "



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


[Lldb-commits] [PATCH] D157165: [lldb] [darwin kernel debug] When looking for a Darwin kernel symbol file, call GetSharedModules before DownloadObjectAndSymbolFile

2023-08-08 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda updated this revision to Diff 548414.
jasonmolenda added a comment.

Rebase patch on current top of tree sources.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157165

Files:
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp


Index: 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
===
--- 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -763,28 +763,13 @@
   module_spec.GetUUID() = m_uuid;
   module_spec.GetArchitecture() = target.GetArchitecture();
 
-  // For the kernel, we really do need an on-disk file copy of the binary
-  // to do anything useful. This will force a call to dsymForUUID if it
-  // exists, instead of depending on the DebugSymbols preferences being
-  // set.
-  Status kernel_search_error;
-  if (IsKernel()) {
-if (Symbols::DownloadObjectAndSymbolFile(module_spec,
- kernel_search_error, true)) {
-  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
-m_module_sp = std::make_shared(module_spec.GetFileSpec(),
-   target.GetArchitecture());
-  }
-}
-  }
-
   // If the current platform is PlatformDarwinKernel, create a ModuleSpec
   // with the filename set to be the bundle ID for this kext, e.g.
   // "com.apple.filesystems.msdosfs", and ask the platform to find it.
   // PlatformDarwinKernel does a special scan for kexts on the local
   // system.
   PlatformSP platform_sp(target.GetPlatform());
-  if (!m_module_sp && platform_sp) {
+  if (platform_sp) {
 static ConstString g_platform_name(
 PlatformDarwinKernel::GetPluginNameStatic());
 if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) {
@@ -807,6 +792,22 @@
 m_module_sp = target.GetOrCreateModule(module_spec, true /* notify */);
   }
 
+  // For the kernel, we really do need an on-disk file copy of the binary
+  // to do anything useful. This will force a call to dsymForUUID if it
+  // exists, instead of depending on the DebugSymbols preferences being
+  // set.
+  Status kernel_search_error;
+  if (IsKernel() &&
+  (!m_module_sp || !m_module_sp->GetSymbolFileFileSpec())) {
+if (Symbols::DownloadObjectAndSymbolFile(module_spec,
+ kernel_search_error, true)) {
+  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
+m_module_sp = std::make_shared(module_spec.GetFileSpec(),
+   target.GetArchitecture());
+  }
+}
+  }
+
   if (IsKernel() && !m_module_sp) {
 Stream &s = target.GetDebugger().GetErrorStream();
 s.Printf("WARNING: Unable to locate kernel binary on the debugger "


Index: lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
===
--- lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -763,28 +763,13 @@
   module_spec.GetUUID() = m_uuid;
   module_spec.GetArchitecture() = target.GetArchitecture();
 
-  // For the kernel, we really do need an on-disk file copy of the binary
-  // to do anything useful. This will force a call to dsymForUUID if it
-  // exists, instead of depending on the DebugSymbols preferences being
-  // set.
-  Status kernel_search_error;
-  if (IsKernel()) {
-if (Symbols::DownloadObjectAndSymbolFile(module_spec,
- kernel_search_error, true)) {
-  if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
-m_module_sp = std::make_shared(module_spec.GetFileSpec(),
-   target.GetArchitecture());
-  }
-}
-  }
-
   // If the current platform is PlatformDarwinKernel, create a ModuleSpec
   // with the filename set to be the bundle ID for this kext, e.g.
   // "com.apple.filesystems.msdosfs", and ask the platform to find it.
   // PlatformDarwinKernel does a special scan for kexts on the local
   // system.
   PlatformSP platform_sp(target.GetPlatform());
-  if (!m_module_sp && platform_sp) {
+  if (platform_sp) {
 static ConstString g_platform_name(
 PlatformDarwinKernel::GetPluginNameStatic());
 if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) {
@@ -80

[Lldb-commits] [PATCH] D157460: [lldb] Sink StreamFile into lldbHost

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, jingham, mib, jasonmolenda.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

StreamFile subclasses Stream (from lldbUtility) and is backed by a File
(from lldbHost). It does not depend on anything from lldbCore or any of its
sibling libraries, so I think it makes sense for this to live in
lldbHost instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157460

Files:
  lldb/include/lldb/Core/Debugger.h
  lldb/include/lldb/Core/StreamFile.h
  lldb/include/lldb/Host/StreamFile.h
  lldb/include/lldb/Interpreter/CommandReturnObject.h
  lldb/include/lldb/Interpreter/ScriptInterpreter.h
  lldb/source/API/SBBreakpoint.cpp
  lldb/source/API/SBBreakpointLocation.cpp
  lldb/source/API/SBBreakpointOptionCommon.cpp
  lldb/source/API/SBDebugger.cpp
  lldb/source/API/SBEvent.cpp
  lldb/source/API/SBFrame.cpp
  lldb/source/API/SBInstruction.cpp
  lldb/source/API/SBInstructionList.cpp
  lldb/source/API/SBProcess.cpp
  lldb/source/API/SBSourceManager.cpp
  lldb/source/API/SBStream.cpp
  lldb/source/API/SBThread.cpp
  lldb/source/API/SBThreadPlan.cpp
  lldb/source/API/SBValue.cpp
  lldb/source/API/SBWatchpoint.cpp
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/EmulateInstruction.cpp
  lldb/source/Core/IOHandler.cpp
  lldb/source/Core/IOHandlerCursesGUI.cpp
  lldb/source/Core/StreamFile.cpp
  lldb/source/Expression/LLVMUserExpression.cpp
  lldb/source/Expression/REPL.cpp
  lldb/source/Expression/UserExpression.cpp
  lldb/source/Expression/UtilityFunction.cpp
  lldb/source/Host/CMakeLists.txt
  lldb/source/Host/common/StreamFile.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
  lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
  lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
  
lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Symbol/CompilerType.cpp
  lldb/source/Target/DynamicRegisterInfo.cpp
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/StackFrameList.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/ThreadPlanTracer.cpp

Index: lldb/source/Target/ThreadPlanTracer.cpp
===
--- lldb/source/Target/ThreadPlanTracer.cpp
+++ lldb/source/Target/ThreadPlanTracer.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/DumpRegisterValue.h"
 #include "lldb/Core/Module.h"
-#include "lldb/Core/StreamFile.h"
 #include "lldb/Core/Value.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeSystem.h"
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -23,7 +23,6 @@
 #include "lldb/Core/SearchFilter.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Core/SourceManager.h"
-#include "lldb/Core/StreamFile.h"
 #include "lldb/Core/StructuredDataImpl.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
@@ -34,6 +33,7 @@
 #include "lldb/Expression/UtilityFunction.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/PosixApi.h"
+#include "lldb/Host/StreamFile.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Interpreter/OptionGroupWatchpoint.h"
Index: lldb/source/Target/StackFrameList.cpp
===
--- lldb/source/Target/StackFrameList.cpp
+++ lldb/source/Target/StackFrameList.cpp
@@

[Lldb-commits] [PATCH] D157160: Surface error messages from the DebugSymbols DBGShellCommands external agent; add logging for LC_NOTEs in Mach-O corefiles

2023-08-08 Thread Jason Molenda via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1290869ef2f7: Show error messages from DebugSymbols 
DBGShellCommand agent (authored by jasonmolenda).

Changed prior to commit:
  https://reviews.llvm.org/D157160?vs=548015&id=548409#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157160

Files:
  lldb/source/Core/DynamicLoader.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Symbol/LocateSymbolFileMacOSX.cpp

Index: lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
===
--- lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
+++ lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
@@ -330,7 +330,8 @@
 
 static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
 ModuleSpec &module_spec,
-Status &error) {
+Status &error,
+const std::string &command) {
   Log *log = GetLog(LLDBLog::Host);
   bool success = false;
   if (uuid_dict != NULL && CFGetTypeID(uuid_dict) == CFDictionaryGetTypeID()) {
@@ -342,7 +343,10 @@
CFSTR("DBGError"));
 if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
   if (CFCString::FileSystemRepresentation(cf_str, str)) {
-error.SetErrorString(str);
+std::string errorstr = command;
+errorstr += ":\n";
+errorstr += str;
+error.SetErrorString(errorstr);
   }
 }
 
@@ -652,7 +656,8 @@
 CFCString uuid_cfstr(uuid_str.c_str());
 CFDictionaryRef uuid_dict =
 (CFDictionaryRef)CFDictionaryGetValue(plist.get(), uuid_cfstr.get());
-return GetModuleSpecInfoFromUUIDDictionary(uuid_dict, module_spec, error);
+return GetModuleSpecInfoFromUUIDDictionary(uuid_dict, module_spec, error,
+   command.GetData());
   }
 
   if (const CFIndex num_values = ::CFDictionaryGetCount(plist.get())) {
@@ -661,13 +666,14 @@
 ::CFDictionaryGetKeysAndValues(plist.get(), NULL,
(const void **)&values[0]);
 if (num_values == 1) {
-  return GetModuleSpecInfoFromUUIDDictionary(values[0], module_spec, error);
+  return GetModuleSpecInfoFromUUIDDictionary(values[0], module_spec, error,
+ command.GetData());
 }
 
 for (CFIndex i = 0; i < num_values; ++i) {
   ModuleSpec curr_module_spec;
   if (GetModuleSpecInfoFromUUIDDictionary(values[i], curr_module_spec,
-  error)) {
+  error, command.GetData())) {
 if (module_spec.GetArchitecture().IsCompatibleMatch(
 curr_module_spec.GetArchitecture())) {
   module_spec = curr_module_spec;
Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===
--- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -5414,6 +5414,8 @@
 
 std::string ObjectFileMachO::GetIdentifierString() {
   std::string result;
+  Log *log(
+  GetLog(LLDBLog::Symbols | LLDBLog::Process | LLDBLog::DynamicLoader));
   ModuleSP module_sp(GetModule());
   if (module_sp) {
 std::lock_guard guard(module_sp->GetMutex());
@@ -5449,6 +5451,8 @@
 result = buf;
 if (buf)
   free(buf);
+LLDB_LOGF(log, "LC_NOTE 'kern ver str' found with text '%s'",
+  result.c_str());
 return result;
   }
 }
@@ -5472,6 +5476,7 @@
   buf) == ident_command.cmdsize) {
   buf[ident_command.cmdsize - 1] = '\0';
   result = buf;
+  LLDB_LOGF(log, "LC_IDENT found with text '%s'", result.c_str());
 }
 if (buf)
   free(buf);
@@ -5484,6 +5489,7 @@
 
 addr_t ObjectFileMachO::GetAddressMask() {
   addr_t mask = 0;
+  Log *log(GetLog(LLDBLog::Process));
   ModuleSP module_sp(GetModule());
   if (module_sp) {
 std::lock_guard guard(module_sp->GetMutex());
@@ -5511,6 +5517,10 @@
   if (num_addr_bits != 0) {
 mask = ~((1ULL << num_addr_bits) - 1);
   }
+  LLDB_LOGF(log,
+"LC_NOTE 'addrable bits' found, value %d bits, "
+"mask 0x%" PRIx64,
+num_addr_bits, mask);
   break;
 }
   }
@@ -5526,6 +5536,8 @@
 

[Lldb-commits] [lldb] 1290869 - Show error messages from DebugSymbols DBGShellCommand agent

2023-08-08 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2023-08-08T17:10:20-07:00
New Revision: 1290869ef2f72b7d59a92fa3cd48e6da29686c71

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

LOG: Show error messages from DebugSymbols DBGShellCommand agent

The DebugSymbols DBGShellsCommand, which can find the symbols
for binaries, has a mechanism to return error messages when
it cannot find a symbol file.  Those errors were not printed
to the user for several corefile use case scenarios; this
patch fixes that.

Also add dyld/process logging for the LC_NOTE metadata parsers
in ObjectFileMachO, to help in seeing what lldb is basing its
searches on.

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

Added: 


Modified: 
lldb/source/Core/DynamicLoader.cpp

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Symbol/LocateSymbolFileMacOSX.cpp

Removed: 




diff  --git a/lldb/source/Core/DynamicLoader.cpp 
b/lldb/source/Core/DynamicLoader.cpp
index 0d138d7bb34584..ce6a84e4e02269 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -8,6 +8,7 @@
 
 #include "lldb/Target/DynamicLoader.h"
 
+#include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -235,6 +236,9 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
force_symbol_search);
   if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) {
 module_sp = std::make_shared(module_spec);
+  } else if (force_symbol_search && error.AsCString("") &&
+ error.AsCString("")[0] != '\0') {
+target.GetDebugger().GetErrorStream() << error.AsCString();
   }
 }
 
@@ -267,8 +271,8 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
 if (value != LLDB_INVALID_ADDRESS) {
   LLDB_LOGF(log,
 "DynamicLoader::LoadBinaryWithUUIDAndAddress Loading "
-"binary UUID %s at %s 0x%" PRIx64,
-uuid.GetAsString().c_str(),
+"binary %s UUID %s at %s 0x%" PRIx64,
+name.str().c_str(), uuid.GetAsString().c_str(),
 value_is_offset ? "offset" : "address", value);
   module_sp->SetLoadAddress(target, value, value_is_offset, changed);
 } else {
@@ -276,8 +280,8 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
   // offset 0.
   LLDB_LOGF(log,
 "DynamicLoader::LoadBinaryWithUUIDAndAddress Loading "
-"binary UUID %s at file address",
-uuid.GetAsString().c_str());
+"binary %s UUID %s at file address",
+name.str().c_str(), uuid.GetAsString().c_str());
   module_sp->SetLoadAddress(target, 0, true /* value_is_slide */,
 changed);
 }
@@ -285,8 +289,8 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
 // In-memory image, load at its true address, offset 0.
 LLDB_LOGF(log,
   "DynamicLoader::LoadBinaryWithUUIDAndAddress Loading binary "
-  "UUID %s from memory at address 0x%" PRIx64,
-  uuid.GetAsString().c_str(), value);
+  "%s UUID %s from memory at address 0x%" PRIx64,
+  name.str().c_str(), uuid.GetAsString().c_str(), value);
 module_sp->SetLoadAddress(target, 0, true /* value_is_slide */,
   changed);
   }
@@ -298,10 +302,26 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
   target.ModulesDidLoad(added_module);
 }
   } else {
-LLDB_LOGF(log, "Unable to find binary with UUID %s and load it at "
-  "%s 0x%" PRIx64,
-  uuid.GetAsString().c_str(),
-  value_is_offset ? "offset" : "address", value);
+if (force_symbol_search) {
+  Stream &s = target.GetDebugger().GetErrorStream();
+  s.Printf("Unable to find file");
+  if (!name.empty())
+s.Printf(" %s", name.str().c_str());
+  if (uuid.IsValid())
+s.Printf(" with UUID %s", uuid.GetAsString().c_str());
+  if (value != LLDB_INVALID_ADDRESS) {
+if (value_is_offset)
+  s.Printf(" with slide 0x%" PRIx64, value);
+else
+  s.Printf(" at address 0x%" PRIx64, value);
+  }
+  s.Printf("\n");
+}
+LLDB_LOGF(log,
+  "Unable to find binary %s with UUID %s and load it at "
+  "%s 0x%" PRIx64,
+  name.str().c_str(), uuid.GetAsString().c_str(),
+  value_is_offset ? "offset" : "addres

[Lldb-commits] [PATCH] D157455: [lldb][NFCI] Remove MappedHash.h

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, jasonmolenda, jingham.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This is no longer used as of 8e71d14972b48df8c5b701a9aec19af3194f9a5e 
.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157455

Files:
  lldb/include/lldb/Core/MappedHash.h
  lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp

Index: lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
===
--- lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
+++ lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
@@ -10,7 +10,6 @@
 #include "ObjCLanguageRuntime.h"
 
 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
-#include "lldb/Core/MappedHash.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/ValueObject.h"
Index: lldb/include/lldb/Core/MappedHash.h
===
--- lldb/include/lldb/Core/MappedHash.h
+++ /dev/null
@@ -1,308 +0,0 @@
-//===-- MappedHash.h *- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef LLDB_CORE_MAPPEDHASH_H
-#define LLDB_CORE_MAPPEDHASH_H
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Utility/Stream.h"
-#include "llvm/Support/DJB.h"
-
-class MappedHash {
-public:
-  enum HashFunctionType {
-eHashFunctionDJB = 0u // Daniel J Bernstein hash function that is also used
-  // by the ELF GNU_HASH sections
-  };
-
-  static uint32_t HashString(uint32_t hash_function, llvm::StringRef s) {
-switch (hash_function) {
-case MappedHash::eHashFunctionDJB:
-  return llvm::djbHash(s);
-
-default:
-  break;
-}
-llvm_unreachable("Invalid hash function index");
-  }
-
-  static const uint32_t HASH_MAGIC = 0x48415348u;
-  static const uint32_t HASH_CIGAM = 0x48534148u;
-
-  template  struct Header {
-typedef T HeaderData;
-
-uint32_t
-magic; // HASH_MAGIC or HASH_CIGAM magic value to allow endian detection
-uint16_t version = 1; // Version number
-uint16_t hash_function =
-eHashFunctionDJB;  // The hash function enumeration that was used
-uint32_t bucket_count = 0; // The number of buckets in this hash table
-uint32_t hashes_count = 0; // The total number of unique hash values and
-   // hash data offsets in this table
-uint32_t header_data_len; // The size in bytes of the "header_data" template
-  // member below
-HeaderData header_data;   //
-
-Header() : magic(HASH_MAGIC), header_data_len(sizeof(T)), header_data() {}
-
-virtual ~Header() = default;
-
-size_t GetByteSize() const {
-  return sizeof(magic) + sizeof(version) + sizeof(hash_function) +
- sizeof(bucket_count) + sizeof(hashes_count) +
- sizeof(header_data_len) + header_data_len;
-}
-
-virtual size_t GetByteSize(const HeaderData &header_data) = 0;
-
-void SetHeaderDataByteSize(uint32_t header_data_byte_size) {
-  header_data_len = header_data_byte_size;
-}
-
-void Dump(lldb_private::Stream &s) {
-  s.Printf("header.magic  = 0x%8.8x\n", magic);
-  s.Printf("header.version= 0x%4.4x\n", version);
-  s.Printf("header.hash_function  = 0x%4.4x\n", hash_function);
-  s.Printf("header.bucket_count   = 0x%8.8x %u\n", bucket_count,
-   bucket_count);
-  s.Printf("header.hashes_count   = 0x%8.8x %u\n", hashes_count,
-   hashes_count);
-  s.Printf("header.header_data_len= 0x%8.8x %u\n", header_data_len,
-   header_data_len);
-}
-
-virtual lldb::offset_t Read(lldb_private::DataExtractor &data,
-lldb::offset_t offset) {
-  if (data.ValidOffsetForDataOfSize(
-  offset, sizeof(magic) + sizeof(version) + sizeof(hash_function) +
-  sizeof(bucket_count) + sizeof(hashes_count) +
-  sizeof(header_data_len))) {
-magic = data.GetU32(&offset);
-if (magic != HASH_MAGIC) {
-  if (magic == HASH_CIGAM) {
-switch (data.GetByteOrder()) {
-case lldb::eByteOrderBig:
-  data.SetByteOrder(lldb::eByteOrderLittle);
-  break;
-case lldb::eByteOrderLittl

[Lldb-commits] [PATCH] D157450: [lldb][NFCI] Remove unused IOStreamMacros

2023-08-08 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.

Cool


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157450

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


[Lldb-commits] [PATCH] D157450: [lldb][NFCI] Remove unused IOStreamMacros

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, jasonmolenda, jingham.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

These are unused AFAICT.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157450

Files:
  lldb/include/lldb/Core/IOStreamMacros.h


Index: lldb/include/lldb/Core/IOStreamMacros.h
===
--- lldb/include/lldb/Core/IOStreamMacros.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- IOStreamMacros.h *- C++ 
-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef liblldb_IOStreamMacros_h_
-#define liblldb_IOStreamMacros_h_
-#if defined(__cplusplus)
-
-#include 
-
-#define RAW_HEXBASE std::setfill('0') << std::hex << std::right
-#define HEXBASE '0' << 'x' << RAW_HEXBASE
-#define RAWHEX8(x) RAW_HEXBASE << std::setw(2) << ((uint32_t)(x))
-#define RAWHEX16 RAW_HEXBASE << std::setw(4)
-#define RAWHEX32 RAW_HEXBASE << std::setw(8)
-#define RAWHEX64 RAW_HEXBASE << std::setw(16)
-#define HEX8(x) HEXBASE << std::setw(2) << ((uint32_t)(x))
-#define HEX16 HEXBASE << std::setw(4)
-#define HEX32 HEXBASE << std::setw(8)
-#define HEX64 HEXBASE << std::setw(16)
-#define RAW_HEX(x) RAW_HEXBASE << std::setw(sizeof(x) * 2) << (x)
-#define HEX(x) HEXBASE << std::setw(sizeof(x) * 2) << (x)
-#define HEX_SIZE(x, sz) HEXBASE << std::setw((sz)) << (x)
-#define STRING_WIDTH(w) std::setfill(' ') << std::setw(w)
-#define LEFT_STRING_WIDTH(s, w)
\
-  std::left << std::setfill(' ') << std::setw(w) << (s) << std::right
-#define DECIMAL std::dec << std::setfill(' ')
-#define DECIMAL_WIDTH(w) DECIMAL << std::setw(w)
-//#define FLOAT(n, d)   std::setfill(' ') << std::setw((n)+(d)+1) <<
-//std::setprecision(d) << std::showpoint << std::fixed
-#define INDENT_WITH_SPACES(iword_idx)  
\
-  std::setfill(' ') << std::setw((iword_idx)) << ""
-#define INDENT_WITH_TABS(iword_idx)
\
-  std::setfill('\t') << std::setw((iword_idx)) << ""
-
-#endif // #if defined(__cplusplus)
-#endif // liblldb_IOStreamMacros_h_


Index: lldb/include/lldb/Core/IOStreamMacros.h
===
--- lldb/include/lldb/Core/IOStreamMacros.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- IOStreamMacros.h *- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef liblldb_IOStreamMacros_h_
-#define liblldb_IOStreamMacros_h_
-#if defined(__cplusplus)
-
-#include 
-
-#define RAW_HEXBASE std::setfill('0') << std::hex << std::right
-#define HEXBASE '0' << 'x' << RAW_HEXBASE
-#define RAWHEX8(x) RAW_HEXBASE << std::setw(2) << ((uint32_t)(x))
-#define RAWHEX16 RAW_HEXBASE << std::setw(4)
-#define RAWHEX32 RAW_HEXBASE << std::setw(8)
-#define RAWHEX64 RAW_HEXBASE << std::setw(16)
-#define HEX8(x) HEXBASE << std::setw(2) << ((uint32_t)(x))
-#define HEX16 HEXBASE << std::setw(4)
-#define HEX32 HEXBASE << std::setw(8)
-#define HEX64 HEXBASE << std::setw(16)
-#define RAW_HEX(x) RAW_HEXBASE << std::setw(sizeof(x) * 2) << (x)
-#define HEX(x) HEXBASE << std::setw(sizeof(x) * 2) << (x)
-#define HEX_SIZE(x, sz) HEXBASE << std::setw((sz)) << (x)
-#define STRING_WIDTH(w) std::setfill(' ') << std::setw(w)
-#define LEFT_STRING_WIDTH(s, w)\
-  std::left << std::setfill(' ') << std::setw(w) << (s) << std::right
-#define DECIMAL std::dec << std::setfill(' ')
-#define DECIMAL_WIDTH(w) DECIMAL << std::setw(w)
-//#define FLOAT(n, d)   std::setfill(' ') << std::setw((n)+(d)+1) <<
-//std::setprecision(d) << std::showpoint << std::fixed
-#define INDENT_WITH_SPACES(iword_idx)  \
-  std::setfill(' ') << std::setw((iword_idx)) << ""
-#define INDENT_WITH_TABS(iword_idx)\
-  std::setfill('\t') << std::setw((iword_idx)) << ""
-
-#endif // #if defined(__cplusplus)
-#endif // liblldb_IOStreamMacros_h_
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D157168: [lldb] [mach-o corefiles] If we have LC_NOTE metadata and can't find a binary, don't fall back to an exhaustive scan

2023-08-08 Thread Jason Molenda via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc5f81100e447: When ProcessMachCore has metadata for a 
binary, don't scan (authored by jasonmolenda).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157168

Files:
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.h

Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
===
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
@@ -86,7 +86,13 @@
 
 private:
   void CreateMemoryRegions();
-  void LoadBinariesViaMetadata();
+
+  /// \return
+  ///   True if any metadata were found indicating the binary that should
+  ///   be loaded, regardless of whether the specified binary could be found.
+  ///   False if no metadata were present.
+  bool LoadBinariesViaMetadata();
+
   void LoadBinariesViaExhaustiveSearch();
   void LoadBinariesAndSetDYLD();
   void CleanupMemoryRegionPermissions();
Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
===
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -223,16 +223,20 @@
   }
 }
 
-void ProcessMachCore::LoadBinariesViaMetadata() {
+bool ProcessMachCore::LoadBinariesViaMetadata() {
   Log *log(GetLog(LLDBLog::DynamicLoader | LLDBLog::Process));
   ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
-  bool found_main_binary_definitively = false;
 
   addr_t objfile_binary_value;
   bool objfile_binary_value_is_offset;
   UUID objfile_binary_uuid;
   ObjectFile::BinaryType type;
 
+  // This will be set to true if we had a metadata hint
+  // specifying a UUID or address -- and we should not fall back
+  // to doing an exhaustive search.
+  bool found_binary_spec_in_metadata = false;
+
   if (core_objfile->GetCorefileMainBinaryInfo(objfile_binary_value,
   objfile_binary_value_is_offset,
   objfile_binary_uuid, type)) {
@@ -244,6 +248,7 @@
   objfile_binary_uuid.GetAsString().c_str(),
   objfile_binary_value, objfile_binary_value_is_offset, type);
 }
+found_binary_spec_in_metadata = true;
 
 // If this is the xnu kernel, don't load it now.  Note the correct
 // DynamicLoader plugin to use, and the address of the kernel, and
@@ -251,7 +256,6 @@
 if (type == ObjectFile::eBinaryTypeKernel) {
   m_mach_kernel_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
-  found_main_binary_definitively = true;
 } else if (type == ObjectFile::eBinaryTypeUser) {
   m_dyld_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
@@ -265,7 +269,6 @@
   objfile_binary_value, objfile_binary_value_is_offset,
   force_symbol_search, notify, set_address_in_target,
   allow_memory_image_last_resort)) {
-found_main_binary_definitively = true;
 m_dyld_plugin_name = DynamicLoaderStatic::GetPluginNameStatic();
   }
 }
@@ -276,7 +279,6 @@
   // load command is present, let's use the contents.
   UUID ident_uuid;
   addr_t ident_binary_addr = LLDB_INVALID_ADDRESS;
-  if (!found_main_binary_definitively) {
 std::string corefile_identifier = core_objfile->GetIdentifierString();
 
 // Search for UUID= and stext= strings in the identifier str.
@@ -287,6 +289,7 @@
   if (log)
 log->Printf("Got a UUID from LC_IDENT/kern ver str LC_NOTE: %s",
 ident_uuid.GetAsString().c_str());
+  found_binary_spec_in_metadata = true;
 }
 if (corefile_identifier.find("stext=") != std::string::npos) {
   size_t p = corefile_identifier.find("stext=") + strlen("stext=");
@@ -297,6 +300,7 @@
   log->Printf("Got a load address from LC_IDENT/kern ver str "
   "LC_NOTE: 0x%" PRIx64,
   ident_binary_addr);
+found_binary_spec_in_metadata = true;
   }
 }
 
@@ -309,7 +313,7 @@
 "ProcessMachCore::LoadBinariesViaMetadata: Found kernel binary via "
 "LC_IDENT/kern ver str LC_NOTE");
   m_mach_kernel_addr = ident_binary_addr;
-  found_main_binary_definitively = true;
+  found_binary_spec_in_metadata = true;
 } else if (ident_uuid.IsValid()) {
   // We have no address specified, only a UUID.  Load it at the file
   // address.
@@ -322,16 +326,15 @@
   this, llvm::StringRef(), ident_uuid, ident_binary_addr,
   value_is_offset, force_symbol_search, notify,
   set_address_in_target, allow_me

[Lldb-commits] [lldb] c5f8110 - When ProcessMachCore has metadata for a binary, don't scan

2023-08-08 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2023-08-08T15:49:53-07:00
New Revision: c5f81100e4471dfc2a802afb9333ca2684e02f8e

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

LOG: When ProcessMachCore has metadata for a binary, don't scan

Mach-O corefiles have several possible types of metadata for the
binaries that were running when the corefile was written.
ProcessMachCore will try to find these binaries, and load them.
When we have a hint, but could not find the binary, this change
makes ProcessMachCore not fall back to scanning the corefile looking
for ANY binary that it could load.  We sometimes have multiple binaries
present in the memory in a corefile, but only the correct binary
should be loaded, the others are data.

Differential Revision: https://reviews.llvm.org/D157168
rdar://112602508

Added: 


Modified: 
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp 
b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index e989c1b0bb7c90..c93a2a2479aa6b 100644
--- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -223,16 +223,20 @@ void ProcessMachCore::CreateMemoryRegions() {
   }
 }
 
-void ProcessMachCore::LoadBinariesViaMetadata() {
+bool ProcessMachCore::LoadBinariesViaMetadata() {
   Log *log(GetLog(LLDBLog::DynamicLoader | LLDBLog::Process));
   ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
-  bool found_main_binary_definitively = false;
 
   addr_t objfile_binary_value;
   bool objfile_binary_value_is_offset;
   UUID objfile_binary_uuid;
   ObjectFile::BinaryType type;
 
+  // This will be set to true if we had a metadata hint
+  // specifying a UUID or address -- and we should not fall back
+  // to doing an exhaustive search.
+  bool found_binary_spec_in_metadata = false;
+
   if (core_objfile->GetCorefileMainBinaryInfo(objfile_binary_value,
   objfile_binary_value_is_offset,
   objfile_binary_uuid, type)) {
@@ -244,6 +248,7 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
   objfile_binary_uuid.GetAsString().c_str(),
   objfile_binary_value, objfile_binary_value_is_offset, type);
 }
+found_binary_spec_in_metadata = true;
 
 // If this is the xnu kernel, don't load it now.  Note the correct
 // DynamicLoader plugin to use, and the address of the kernel, and
@@ -251,7 +256,6 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
 if (type == ObjectFile::eBinaryTypeKernel) {
   m_mach_kernel_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
-  found_main_binary_definitively = true;
 } else if (type == ObjectFile::eBinaryTypeUser) {
   m_dyld_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
@@ -265,7 +269,6 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
   objfile_binary_value, objfile_binary_value_is_offset,
   force_symbol_search, notify, set_address_in_target,
   allow_memory_image_last_resort)) {
-found_main_binary_definitively = true;
 m_dyld_plugin_name = DynamicLoaderStatic::GetPluginNameStatic();
   }
 }
@@ -276,7 +279,6 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
   // load command is present, let's use the contents.
   UUID ident_uuid;
   addr_t ident_binary_addr = LLDB_INVALID_ADDRESS;
-  if (!found_main_binary_definitively) {
 std::string corefile_identifier = core_objfile->GetIdentifierString();
 
 // Search for UUID= and stext= strings in the identifier str.
@@ -287,6 +289,7 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
   if (log)
 log->Printf("Got a UUID from LC_IDENT/kern ver str LC_NOTE: %s",
 ident_uuid.GetAsString().c_str());
+  found_binary_spec_in_metadata = true;
 }
 if (corefile_identifier.find("stext=") != std::string::npos) {
   size_t p = corefile_identifier.find("stext=") + strlen("stext=");
@@ -297,6 +300,7 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
   log->Printf("Got a load address from LC_IDENT/kern ver str "
   "LC_NOTE: 0x%" PRIx64,
   ident_binary_addr);
+found_binary_spec_in_metadata = true;
   }
 }
 
@@ -309,7 +313,7 @@ void ProcessMachCore::LoadBinariesViaMetadata() {
 "ProcessMachCore::LoadBinariesViaMetadata: Found kernel binary via 
"
 "LC_IDENT/kern ver str LC_NOTE");
   m_mach_kernel_addr

[Lldb-commits] [PATCH] D157361: [lldb] FIx data race in ThreadedCommunication

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord accepted this revision.
bulbazord added a comment.
This revision is now accepted and ready to land.

Looks straightforward and makes sense. Thanks!


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

https://reviews.llvm.org/D157361

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


[Lldb-commits] [PATCH] D157168: [lldb] [mach-o corefiles] If we have LC_NOTE metadata and can't find a binary, don't fall back to an exhaustive scan

2023-08-08 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda updated this revision to Diff 548364.
jasonmolenda added a comment.

Rebase on current TOT sources, and add a comment to the 
ProcessMachCore::LoadBinariesViaMetadata prototype in the header documenting 
the meaning of the return value, I agree with Alex I should make this a little 
clearer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157168

Files:
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.h

Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
===
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
@@ -86,7 +86,13 @@
 
 private:
   void CreateMemoryRegions();
-  void LoadBinariesViaMetadata();
+
+  /// \return
+  ///   True if any metadata were found indicating the binary that should
+  ///   be loaded, regardless of whether the specified binary could be found.
+  ///   False if no metadata were present.
+  bool LoadBinariesViaMetadata();
+
   void LoadBinariesViaExhaustiveSearch();
   void LoadBinariesAndSetDYLD();
   void CleanupMemoryRegionPermissions();
Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
===
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -223,16 +223,20 @@
   }
 }
 
-void ProcessMachCore::LoadBinariesViaMetadata() {
+bool ProcessMachCore::LoadBinariesViaMetadata() {
   Log *log(GetLog(LLDBLog::DynamicLoader | LLDBLog::Process));
   ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
-  bool found_main_binary_definitively = false;
 
   addr_t objfile_binary_value;
   bool objfile_binary_value_is_offset;
   UUID objfile_binary_uuid;
   ObjectFile::BinaryType type;
 
+  // This will be set to true if we had a metadata hint
+  // specifying a UUID or address -- and we should not fall back
+  // to doing an exhaustive search.
+  bool found_binary_spec_in_metadata = false;
+
   if (core_objfile->GetCorefileMainBinaryInfo(objfile_binary_value,
   objfile_binary_value_is_offset,
   objfile_binary_uuid, type)) {
@@ -244,6 +248,7 @@
   objfile_binary_uuid.GetAsString().c_str(),
   objfile_binary_value, objfile_binary_value_is_offset, type);
 }
+found_binary_spec_in_metadata = true;
 
 // If this is the xnu kernel, don't load it now.  Note the correct
 // DynamicLoader plugin to use, and the address of the kernel, and
@@ -251,7 +256,6 @@
 if (type == ObjectFile::eBinaryTypeKernel) {
   m_mach_kernel_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
-  found_main_binary_definitively = true;
 } else if (type == ObjectFile::eBinaryTypeUser) {
   m_dyld_addr = objfile_binary_value;
   m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
@@ -265,7 +269,6 @@
   objfile_binary_value, objfile_binary_value_is_offset,
   force_symbol_search, notify, set_address_in_target,
   allow_memory_image_last_resort)) {
-found_main_binary_definitively = true;
 m_dyld_plugin_name = DynamicLoaderStatic::GetPluginNameStatic();
   }
 }
@@ -276,7 +279,6 @@
   // load command is present, let's use the contents.
   UUID ident_uuid;
   addr_t ident_binary_addr = LLDB_INVALID_ADDRESS;
-  if (!found_main_binary_definitively) {
 std::string corefile_identifier = core_objfile->GetIdentifierString();
 
 // Search for UUID= and stext= strings in the identifier str.
@@ -287,6 +289,7 @@
   if (log)
 log->Printf("Got a UUID from LC_IDENT/kern ver str LC_NOTE: %s",
 ident_uuid.GetAsString().c_str());
+  found_binary_spec_in_metadata = true;
 }
 if (corefile_identifier.find("stext=") != std::string::npos) {
   size_t p = corefile_identifier.find("stext=") + strlen("stext=");
@@ -297,6 +300,7 @@
   log->Printf("Got a load address from LC_IDENT/kern ver str "
   "LC_NOTE: 0x%" PRIx64,
   ident_binary_addr);
+found_binary_spec_in_metadata = true;
   }
 }
 
@@ -309,7 +313,7 @@
 "ProcessMachCore::LoadBinariesViaMetadata: Found kernel binary via "
 "LC_IDENT/kern ver str LC_NOTE");
   m_mach_kernel_addr = ident_binary_addr;
-  found_main_binary_definitively = true;
+  found_binary_spec_in_metadata = true;
 } else if (ident_uuid.IsValid()) {
   // We have no address specified, only a UUID.  Load it at the file
   // address.
@@ -322,16 +326,15 @@
   this, llvm::StringRef(), ident_uuid, ident_binary_a

[Lldb-commits] [PATCH] D157160: Surface error messages from the DebugSymbols DBGShellCommands external agent; add logging for LC_NOTEs in Mach-O corefiles

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

LGTM




Comment at: lldb/source/Core/DynamicLoader.cpp:241-242
+ error.AsCString("")[0] != '\0') {
+Stream &s = target.GetDebugger().GetErrorStream();
+s << error.AsCString();
   }

If you don't need the Stream anymore you could do 

```
target.GetDebugger().GetErrorStream() << error.AsCString();
```



Comment at: lldb/source/Core/DynamicLoader.cpp:273-277
   LLDB_LOGF(log,
 "DynamicLoader::LoadBinaryWithUUIDAndAddress Loading "
-"binary UUID %s at %s 0x%" PRIx64,
-uuid.GetAsString().c_str(),
+"binary %s UUID %s at %s 0x%" PRIx64,
+name.str().c_str(), uuid.GetAsString().c_str(),
 value_is_offset ? "offset" : "address", value);

LLDB_LOG could simplify this a lot ;-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157160

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


[Lldb-commits] [PATCH] D157347: [lldb] Fix data race in NativeFile

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord added inline comments.



Comment at: lldb/include/lldb/Host/File.h:425-433
+  ValueGuard DescriptorIsValid() const {
+m_descriptor_mutex.lock();
+return ValueGuard(m_descriptor_mutex,
+  File::DescriptorIsValid(m_descriptor));
+  }
+
+  ValueGuard StreamIsValid() const {

Hmm, this should be okay since URVO is mandatory as of C++17 (meaning this will 
not perform a copy and potentially screw up the locking mechanism).



Comment at: lldb/source/Host/common/File.cpp:222
+size_t written = s.size();
+;
 Write(s.data(), written);

nit: delete this stray semicolon.



Comment at: lldb/source/Host/common/File.cpp:316
   Status error;
-  if (StreamIsValid()) {
-if (m_own_stream) {
-  if (::fclose(m_stream) == EOF)
-error.SetErrorToErrno();
-} else {
-  File::OpenOptions rw =
-  m_options & (File::eOpenOptionReadOnly | File::eOpenOptionWriteOnly |
-   File::eOpenOptionReadWrite);
 
+  {

I think you need to grab both mutexes before you can modify either one of them 
in `Close`. As an example:
Thread 1 calls Close.
Thread 2 calls GetStream.
Thread 1 grabs the stream_guard and does all the relevant work with it. 
Thread 2 grabs the stream_guard and subsequently grabs the descriptor_guard. It 
opens the stream again and sets the descriptor to unowned.
Thread 1 resumes, grabs the descriptor_guard, but does nothing with it because 
it's unowned. However, it does reset the state of the other member variables.

In this case, the work that Thread 1 did to close the stream was undone by 
Thread 2. The File is not closed and is left is a strange half-initialized 
state.

Reading through this and thinking about it more, I wonder if `Close` is the 
right abstraction for a File that can be touched by multiple threads. If one 
thread closes it and the other is still trying to work with it, you could end 
up in a weird state no matter what else is going on. Maybe it would make more 
sense to have a File have a reference count? Users wouldn't call `File::Close` 
directly but just let it go out of scope and allow the destructor to handle 
resource management. That might be out of the scope of this patch though.


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

https://reviews.llvm.org/D157347

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


[Lldb-commits] [PATCH] D157168: [lldb] [mach-o corefiles] If we have LC_NOTE metadata and can't find a binary, don't fall back to an exhaustive scan

2023-08-08 Thread Alex Langford via Phabricator via lldb-commits
bulbazord accepted this revision.
bulbazord added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157168

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


[Lldb-commits] [lldb] d5cad05 - [lldb] Remve old CODE_OWNERS.txt

2023-08-08 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2023-08-08T08:55:00-07:00
New Revision: d5cad055062672689efac8395d3f1543c22ba569

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

LOG: [lldb] Remve old CODE_OWNERS.txt

Added: 


Modified: 


Removed: 
lldb/CODE_OWNERS.txt



diff  --git a/lldb/CODE_OWNERS.txt b/lldb/CODE_OWNERS.txt
deleted file mode 100644
index e69de29bb2d1d6..00



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


[Lldb-commits] [PATCH] D156949: [lldb] Update LLDB Code Ownership

2023-08-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG013a8fc26ef8: [lldb] Update LLDB Code Ownership (authored by 
JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156949

Files:
  lldb/CODE_OWNERS.txt
  lldb/CodeOwners.rst

Index: lldb/CodeOwners.rst
===
--- /dev/null
+++ lldb/CodeOwners.rst
@@ -0,0 +1,252 @@
+
+LLDB Code Owners
+
+
+This file is a list of the `code owners `_ for LLDB.
+
+.. contents::
+   :depth: 2
+   :local:
+
+Current Code Owners
+===
+The following people are the active code owners for the project. Please reach
+out to them for code reviews, questions about their area of expertise, or other
+assistance.
+
+All parts of LLDB not covered by someone else
+--
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere (GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+Components
+--
+These code owners are responsible for particular high-level components within
+LLDB.
+
+ABI
+~~~
+| Jason Molenda
+| jmolenda\@apple.com (email), jasonmolenda (Phabricator), jasonmolenda (GitHub), jasonmolenda (Discourse), jasonmolenda (Discord)
+
+| David Spickett
+| david.spickett\@linaro.org (email), DavidSpickett (Phabricator), DavidSpickett (GitHub), DavidSpickett (Discourse), davidspickett (Discord)
+
+
+Breakpoint
+~~
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+CMake & Build System
+
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere (GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+| Alex Langford
+| alangford\@apple.com (email), bulbazord (Phabricator), bulbazord (GitHub), bulbazord (Discourse), bulba_zord (Discord)
+
+Commands
+
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+Expression Parser
+~
+| Michael Buch
+| michaelbuch12\@gmail.com (email), Michael137 (Phabricator), Michael137 (GitHub), Michael137 (Discourse)
+
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+Interpreter
+~~~
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+| Greg Clayton
+| gclayton\@fb.com (email), clayborg (Phabricator), clayborg (GitHub), clayborg (Discourse)
+
+
+Lua
+~~~
+| Jonas Delvieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere (GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+Python
+~~
+| Med Ismail Bennani
+| ismail\@bennani.ma (email), mib (Phabricator), medismailben (GitHub), mib (Discourse), mib#8727 (Discord)
+
+Target/Process Control
+~~
+| Med Ismail Bennani
+| ismail\@bennani.ma (email), mib (Phabricator), medismailben (GitHub), mib (Discourse), mib#8727 (Discord)
+
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+Test Suite
+~~
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere (GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+| Pavel Labath
+| pavel\@labath.sk (email), labath (Phabricator), labath (GitHub), labath (Discourse)
+
+Trace
+~
+| Walter Erquinigo
+| a20012251\@gmail.com (email), wallace (Phabricator), walter-erquinigo (GitHub), wallace (Discourse), werquinigo (Discord)
+
+Unwinding
+~
+| Jason Molenda
+| jmolenda\@apple.com (email), jasonmolenda (Phabricator), jasonmolenda (GitHub), jasonmolenda (Discourse), jasonmolenda (Discord)
+
+Utility
+~~~
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere (GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+| Pavel Labath
+| pavel\@labath.sk (email), labath (Phabricator), labath (GitHub), labath (Discourse)
+
+ValueObject
+~~~
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), jingham (Discourse)
+
+Watchpoints
+~~~
+| Jason Molenda
+| jmolenda\@apple.com (email), jasonmolenda (Phabricator), jasonmolenda (GitHub), jasonmolenda (Discourse), jasonmolenda (Discord)
+
+File Formats
+
+The following people are responsible for decisions involving file and debug
+info formats.
+
+(PE)COFF
+
+| Saleem Abdulrasool
+| compnerd\@compnerd.org (email), compnerd (Phabricator), compnerd (GitHub), compnerd (Discourse), compnerd (Discord)
+
+Breakpad
+
+| Zequan Wu
+| zequanwu\@google.com (email), zequanwu (Phabricator), ZequanWu

[Lldb-commits] [lldb] 013a8fc - [lldb] Update LLDB Code Ownership

2023-08-08 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2023-08-08T08:54:03-07:00
New Revision: 013a8fc26ef8f953dbc715be433e70b2b5c906fa

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

LOG: [lldb] Update LLDB Code Ownership

Discourse discussion: 
https://discourse.llvm.org/t/rfc-update-lldb-code-ownership/72253

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

Added: 
lldb/CodeOwners.rst

Modified: 
lldb/CODE_OWNERS.txt

Removed: 




diff  --git a/lldb/CODE_OWNERS.txt b/lldb/CODE_OWNERS.txt
index c62c5ade7634db..e69de29bb2d1d6 100644
--- a/lldb/CODE_OWNERS.txt
+++ b/lldb/CODE_OWNERS.txt
@@ -1,54 +0,0 @@
-This file is a list of the people responsible for ensuring that patches for a
-particular part of LLDB are reviewed, either by themself or by someone else.
-They are also the gatekeepers for their part of LLDB, with the final word on
-what goes in or not.
-
-The list is sorted by surname and formatted to allow easy grepping and
-beautification by scripts.  The fields are: name (N), email (E), web-address
-(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
-(S).
-
-N: Greg Clayton
-E: clayb...@gmail.com
-D: Overall LLDB architecture, Host (common+macosx), Symbol, API, ABI, 
Mac-specific code,
-D: DynamicLoader, ObjectFile, IOHandler, EditLine, Core/Value*, Watchpoints, 
debugserver
-D: Build scripts, Test suite, Platform, gdb-remote, Anything not covered by 
this file
-
-N: Jim Ingham
-E: jing...@apple.com
-D: Overall LLDB architecture, Thread plans, Expression parser, ValueObject, 
Breakpoints, ABI
-D: Watchpoints, Trampolines, Target, Command Interpreter, C++ / Objective-C 
Language runtime
-D: Expression evaluator, IR interpreter, Clang integration, Data Formatters
-
-N: Ed Maste
-E: ema...@freebsd.org
-D: FreeBSD
-
-N: Jason Molenda
-E: jmole...@apple.com
-D: ABI, Disassembler, Unwinding, iOS, debugserver, Platform, ObjectFile, 
SymbolFile,
-D: SymbolVendor, DWARF, gdb-remote
-
-N: Kamil Rytarowski
-E: ka...@netbsd.org
-D: NetBSD
-
-N: Zachary Turner
-E: ztur...@google.com
-D: CMake build, Host (common+windows), Plugins/Process/Windows, Anything 
Windows-specific
-D: Test suite
-
-N: Pavel Labath
-E: lab...@google.com
-D: Linux, Android
-
-N: Walter Erquinigo
-E: a20012...@gmail.com
-E: walterme...@fb.com
-D: Trace, TraceCursor, TraceExport, intel-pt, lldb-vscode, Data Formatters
-
-N: Med Ismail Bennani
-E: ism...@bennani.ma
-E: m@apple.com
-D: Breakpoints, Target, General Process Execution, Command Interpreter
-D: Script Interpreter, API, Data Formatters, CrashLog, Scripted Process

diff  --git a/lldb/CodeOwners.rst b/lldb/CodeOwners.rst
new file mode 100644
index 00..5635f186fad391
--- /dev/null
+++ b/lldb/CodeOwners.rst
@@ -0,0 +1,252 @@
+
+LLDB Code Owners
+
+
+This file is a list of the `code owners 
`_ for LLDB.
+
+.. contents::
+   :depth: 2
+   :local:
+
+Current Code Owners
+===
+The following people are the active code owners for the project. Please reach
+out to them for code reviews, questions about their area of expertise, or other
+assistance.
+
+All parts of LLDB not covered by someone else
+--
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere 
(GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+Components
+--
+These code owners are responsible for particular high-level components within
+LLDB.
+
+ABI
+~~~
+| Jason Molenda
+| jmolenda\@apple.com (email), jasonmolenda (Phabricator), jasonmolenda 
(GitHub), jasonmolenda (Discourse), jasonmolenda (Discord)
+
+| David Spickett
+| david.spickett\@linaro.org (email), DavidSpickett (Phabricator), 
DavidSpickett (GitHub), DavidSpickett (Discourse), davidspickett (Discord)
+
+
+Breakpoint
+~~
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), 
jingham (Discourse)
+
+CMake & Build System
+
+| Jonas Devlieghere
+| jonas\@devlieghere.com (email), jdevlieghere (Phabricator), jdevlieghere 
(GitHub), jdevlieghere (Discourse), jdevlieghere (Discord)
+
+| Alex Langford
+| alangford\@apple.com (email), bulbazord (Phabricator), bulbazord (GitHub), 
bulbazord (Discourse), bulba_zord (Discord)
+
+Commands
+
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), 
jingham (Discourse)
+
+Expression Parser
+~
+| Michael Buch
+| michaelbuch12\@gmail.com (email), Michael137 (Phabricator), Michael137 
(GitHub), Michael137 (Discourse)
+
+| Jim Ingham
+| jingham\@apple.com (email), jingham (Phabricator), jimingham (GitHub), 
jingham (Discourse)
+
+Interpreter
+~~~
+| Jim I

[Lldb-commits] [PATCH] D156949: [lldb] Update LLDB Code Ownership

2023-08-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Alright, seems like we have consensus. The only person that hasn't chimed in 
yet is Greg, but based on a comment in another thread he might be OOO. We can 
alway address concerns post-commit.


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

https://reviews.llvm.org/D156949

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