[Lldb-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang updated 
https://github.com/llvm/llvm-project/pull/108870

>From 04daaac0eade25a439856bbb287e15860aba1dfd Mon Sep 17 00:00:00 2001
From: Adrian Vogelsgesang 
Date: Tue, 27 Aug 2024 17:34:11 +
Subject: [PATCH 1/8] [lldb][libc++] Hide all libc++ implementation details
 from stacktraces

This commit changes the libc++ frame recognizer to hide implementation
details of libc++ more aggressively. The applied heuristic is rather
straightforward: We consider every function name starting with `__` as
an implementation detail.

This works pretty neatly for `std::invoke`, `std::function`,
`std::sort`, `std::map::emplace` and many others. Also, this should
align quite nicely with libc++'s general coding convention of using the
`__` for their implementation details, thereby keeping the future
maintenance effort low.

However, it is noteworthy, that this does not work 100% in all cases:
E.g., for `std::ranges::sort`, itself is not really a function call, but
an object with an overloaded `operator()`, which means that there is no
actual call `std::ranges::sort` in the call stack.
---
 libcxx/docs/UserDocumentation.rst | 26 ++
 .../CPlusPlus/CPPLanguageRuntime.cpp  | 27 ++
 .../cpp/libcxx-internals-recognizer/Makefile  |  5 ++
 .../TestLibcxxInternalsRecognizer.py  | 56 
 .../cpp/libcxx-internals-recognizer/main.cpp  | 86 +++
 5 files changed, 181 insertions(+), 19 deletions(-)
 create mode 100644 lldb/test/API/lang/cpp/libcxx-internals-recognizer/Makefile
 create mode 100644 
lldb/test/API/lang/cpp/libcxx-internals-recognizer/TestLibcxxInternalsRecognizer.py
 create mode 100644 lldb/test/API/lang/cpp/libcxx-internals-recognizer/main.cpp

diff --git a/libcxx/docs/UserDocumentation.rst 
b/libcxx/docs/UserDocumentation.rst
index 6659fa54f49df5..8999b4f23e91d2 100644
--- a/libcxx/docs/UserDocumentation.rst
+++ b/libcxx/docs/UserDocumentation.rst
@@ -346,6 +346,32 @@ Third-party Integrations
 
 Libc++ provides integration with a few third-party tools.
 
+Debugging libc++ internals in LLDB
+--
+
+LLDB hides the implementation details of libc++ by default.
+
+E.g., when setting a breakpoint in a comparator passed to ``std::sort``, the
+backtrace will read as
+
+.. code-block::
+
+  (lldb) thread backtrace
+  * thread #1, name = 'a.out', stop reason = breakpoint 3.1
+* frame #0: 0x520e a.out`my_comparator(a=1, b=8) at 
test-std-sort.cpp:6:3
+  frame #7: 0x5615 a.out`void 
std::__1::sort[abi:ne20], bool (*)(int, 
int)>(__first=(item = 8), __last=(item = 0), __comp=(a.out`my_less(int, int) at 
test-std-sort.cpp:5)) at sort.h:1003:3
+  frame #8: 0x531a a.out`main at test-std-sort.cpp:24:3
+
+Note how the caller of ``my_comparator`` is shown as ``std::sort``. Looking at
+the frame numbers, we can see that frames #1 until #6 were hidden. Those frames
+represent internal implementation details such as ``__sort4`` and similar
+utility functions.
+
+To also show those implementation details, use ``thread backtrace -u``.
+Alternatively, to disable those compact backtraces for good, use
+``frame recognizer list`` and ``frame recognizer delete`` to delete the libc++
+frame recognizer.
+
 GDB Pretty printers for libc++
 --
 
diff --git 
a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp 
b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
index faa05e8f834ea1..d0e84bdeb94f01 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
@@ -45,7 +45,7 @@ char CPPLanguageRuntime::ID = 0;
 /// A frame recognizer that is installed to hide libc++ implementation
 /// details from the backtrace.
 class LibCXXFrameRecognizer : public StackFrameRecognizer {
-  std::array m_hidden_regex;
+  std::array m_hidden_regex;
   RecognizedStackFrameSP m_hidden_frame;
 
   struct LibCXXHiddenFrame : public RecognizedStackFrame {
@@ -55,28 +55,17 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
 public:
   LibCXXFrameRecognizer()
   : m_hidden_regex{
-// internal implementation details of std::function
+// internal implementation details in the `std::` namespace
 //std::__1::__function::__alloc_func, void ()>::operator()[abi:ne20]
 //std::__1::__function::__func, void ()>::operator()
 //std::__1::__function::__value_func::operator()[abi:ne20]() const
-RegularExpression{""
-  R"(^std::__[^:]*::)" // Namespace.
-  R"(__function::.*::operator\(\))"},
-// internal implementation details of std::function in ABI v2
 //std::__2::__function::__policy_invoker::__call_impl[abi:ne20]>
-RegularExpression{""
-  R"(^std::__[^:]*::)" // Namespace.
-

[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread Alex Langford via lldb-commits

https://github.com/bulbazord approved this pull request.


https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread via lldb-commits

https://github.com/jimingham approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] ce1f01b - [lldb][NFC] Add the UnwindPlan method for the header update

2024-09-24 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2024-09-24T15:43:34-07:00
New Revision: ce1f01b887ea5945ec3ffb45e05e674804d5d7a7

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

LOG: [lldb][NFC] Add the UnwindPlan method for the header update

In 206408732bca2ef464732a39c8319d47c8a1dbea I updated the
UnwindPlan header to include a new method, but didn't add
the actual implementation.  Fix that.

Added: 


Modified: 
lldb/source/Symbol/UnwindPlan.cpp

Removed: 




diff  --git a/lldb/source/Symbol/UnwindPlan.cpp 
b/lldb/source/Symbol/UnwindPlan.cpp
index b5a9aa2094f54d..a06e7cfd7f5446 100644
--- a/lldb/source/Symbol/UnwindPlan.cpp
+++ b/lldb/source/Symbol/UnwindPlan.cpp
@@ -354,6 +354,17 @@ bool UnwindPlan::Row::SetRegisterLocationToSame(uint32_t 
reg_num,
   return true;
 }
 
+bool UnwindPlan::Row::SetRegisterLocationToIsDWARFExpression(
+uint32_t reg_num, const uint8_t *opcodes, uint32_t len, bool can_replace) {
+  if (!can_replace &&
+  m_register_locations.find(reg_num) != m_register_locations.end())
+return false;
+  AbstractRegisterLocation reg_loc;
+  reg_loc.SetIsDWARFExpression(opcodes, len);
+  m_register_locations[reg_num] = reg_loc;
+  return true;
+}
+
 bool UnwindPlan::Row::SetRegisterLocationToIsConstant(uint32_t reg_num,
   uint64_t constant,
   bool can_replace) {



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


[Lldb-commits] [lldb] [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (PR #109853)

2024-09-24 Thread Zequan Wu via lldb-commits

https://github.com/ZequanWu closed 
https://github.com/llvm/llvm-project/pull/109853
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread via lldb-commits


@@ -510,8 +510,9 @@ def start(self):
 self._thread.start()
 
 def stop(self):
-self._thread.join()
-self._thread = None
+if self._thread is not None:

jimingham wrote:

Ah, cool.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -61,8 +65,50 @@ std::string DiagnosticManager::GetString(char separator) {
   stream << message.drop_front(severity_pos + severity.size());
 stream << separator;
   }
+  return str;
+}
 
-  return ret;
+void DiagnosticManager::Dump(Log *log) {
+  if (!log)
+return;
+
+  std::string str = GetString();
+
+  // We want to remove the last '\n' because log->PutCString will add
+  // one for us.
+
+  if (str.size() && str.back() == '\n')
+str.pop_back();
+
+  log->PutString(str);
+}
+
+llvm::Error Diagnostic::GetAsError() const {
+  return llvm::make_error(m_detail);
+}
+
+llvm::Error
+DiagnosticManager::GetAsError(lldb::ExpressionResults result) const {
+  llvm::Error diags = Status::FromExpressionError(result, "").takeError();
+  for (const auto &diagnostic : m_diagnostics)
+diags = llvm::joinErrors(std::move(diags), diagnostic->GetAsError());
+  return diags;
+}
+
+llvm::Error DiagnosticManager::GetAsError(llvm::Twine msg) const {
+  llvm::Error diags = llvm::createStringError(msg);
+  for (const auto &diagnostic : m_diagnostics)
+diags = llvm::joinErrors(std::move(diags), diagnostic->GetAsError());
+  return diags;
+}
+
+void DiagnosticManager::AddDiagnostic(llvm::StringRef message,
+  lldb::Severity severity,
+  DiagnosticOrigin origin,
+  uint32_t compiler_id) {
+  m_diagnostics.emplace_back(std::make_unique(
+  origin, compiler_id,
+  DiagnosticDetail{{}, severity, message.str(), message.str()}));

medismailben wrote:

It would be nice to have the `SourceLocation` here to pass it to 
`DiagnosticDetail`

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben deleted 
https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -224,6 +224,14 @@ const char *Status::AsCString(const char 
*default_error_str) const {
 if (!m_string.empty() && m_string[m_string.size() - 1] == '\n')
   m_string.pop_back();
 
+  // FIXME: Workaround for ErrorList[ExpressionError, ...].
+  if (m_error.isA()) {
+while (!m_string.empty() && m_string[0] == '\n')
+  m_string = std::string(m_string.data() + 1, m_string.size() - 1);
+if (!m_string.empty() && m_string[m_string.size() - 1] != '\n')
+  m_string += '\n';
+  }

medismailben wrote:

It's not clear what this is trying to do. A comment would be nice here.

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -27,15 +27,15 @@ TEST(StatusTest, Formatv) {
 }
 
 TEST(StatusTest, ErrorConstructor) {
-  EXPECT_TRUE(Status(llvm::Error::success()).Success());
+  EXPECT_TRUE(Status::FromError(llvm::Error::success()).Success());
 
-  Status eagain(
+  Status eagain = Status::FromError(
   llvm::errorCodeToError(std::error_code(EAGAIN, 
std::generic_category(;
   EXPECT_TRUE(eagain.Fail());
   EXPECT_EQ(eErrorTypePOSIX, eagain.GetType());
   EXPECT_EQ(Status::ValueType(EAGAIN), eagain.GetError());
 
-  Status foo(llvm::make_error(
+  Status foo = Status::FromError(llvm::make_error(
   "foo", llvm::inconvertibleErrorCode()));

medismailben wrote:

```suggestion
  Status foo = Status::FromError(llvm::createStringError("foo"));
```

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -254,14 +256,46 @@ class ClangDiagnosticManagerAdapter : public 
clang::DiagnosticConsumer {
   std::string stripped_output =
   std::string(llvm::StringRef(m_output).trim());
 
-  auto new_diagnostic = std::make_unique(
-  stripped_output, severity, Info.getID());
+  // Translate the source location.
+  if (Info.hasSourceManager()) {
+DiagnosticDetail::SourceLocation loc;
+clang::SourceManager &sm = Info.getSourceManager();
+const clang::SourceLocation sloc = Info.getLocation();
+if (sloc.isValid()) {
+  const clang::FullSourceLoc fsloc(sloc, sm);
+  clang::PresumedLoc PLoc = fsloc.getPresumedLoc(true);
+  StringRef filename =
+  PLoc.isValid() ? PLoc.getFilename() : StringRef{};

medismailben wrote:

What about using `m_filename` if `PLoc` is invalid ?

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben edited 
https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -33,16 +33,16 @@ class RemoteAwarePlatformTester : public 
RemoteAwarePlatform {
   MOCK_METHOD0(CalculateTrapHandlerSymbolNames, void());
 
   MOCK_METHOD2(ResolveExecutable,
-   std::pair(const ModuleSpec &,
-   const FileSpecList *));
+   std::pair(const ModuleSpec &,
+ const FileSpecList *));
   Status
   ResolveExecutable(const ModuleSpec &module_spec,
 lldb::ModuleSP &exe_module_sp,
 const FileSpecList *module_search_paths_ptr) /*override*/
   { // NOLINT(modernize-use-override)
 auto pair = ResolveExecutable(module_spec, module_search_paths_ptr);
 exe_module_sp = pair.second;
-return pair.first;
+return pair.first ? Status() : Status::FromErrorString("error");

medismailben wrote:

Can we return `{}` instead of `Status()` ?

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben approved this pull request.

LGTM with comments!

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben deleted 
https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben approved this pull request.

This is pretty cool! LGTM with comment!

https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben edited 
https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -1887,7 +1887,8 @@ bool CommandInterpreter::HandleCommand(const char 
*command_line,
CommandReturnObject &result,
bool force_repeat_command) {
   std::string command_string(command_line);
-  std::string original_command_string(command_line);
+  std::string original_command_string(command_string);
+  std::string real_original_command_string(command_string);

medismailben wrote:

nit: does this makes the variable above not the real original command string :p 
? may be we can find a better name or write a comment explaining the nuance 
between the 2

https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -8,6 +8,7 @@
 
 #include "lldb/Utility/Status.h"
 
+#include "lldb/Expression/DiagnosticManager.h"

medismailben wrote:

Is this addition necessary ? It doesn't look like anything else has been added 
to this file

https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Med Ismail Bennani via lldb-commits


@@ -486,19 +603,37 @@ bool 
CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
 
 result.SetStatus(eReturnStatusSuccessFinishResult);
   } else {
-const char *error_cstr = result_valobj_sp->GetError().AsCString();
-if (error_cstr && error_cstr[0]) {
-  const size_t error_cstr_len = strlen(error_cstr);
-  const bool ends_with_newline = error_cstr[error_cstr_len - 1] == 
'\n';
-  if (strstr(error_cstr, "error:") != error_cstr)
-error_stream.PutCString("error: ");
-  error_stream.Write(error_cstr, error_cstr_len);
-  if (!ends_with_newline)
-error_stream.EOL();
+// Retrieve the diagnostics.
+std::vector details;
+llvm::consumeError(
+llvm::handleErrors(result_valobj_sp->GetError().ToError(),
+   [&](DetailedExpressionError &error) {
+ details.push_back(error.GetDetail());
+   }));
+// Find the position of the expression in the command.
+std::optional expr_pos;
+size_t nchar = m_original_command.find(expr);
+if (nchar != std::string::npos)
+  expr_pos = nchar + GetDebugger().GetPrompt().size();
+
+if (!details.empty()) {
+  bool multiline = expr.contains('\n');
+  RenderDiagnosticDetails(error_stream, expr_pos, multiline, details);
 } else {
-  error_stream.PutCString("error: unknown error\n");
+  const char *error_cstr = result_valobj_sp->GetError().AsCString();
+  if (error_cstr && error_cstr[0]) {
+const size_t error_cstr_len = strlen(error_cstr);
+const bool ends_with_newline =
+error_cstr[error_cstr_len - 1] == '\n';
+if (strstr(error_cstr, "error:") != error_cstr)

medismailben wrote:

Instead of using c-string you could wrap it in an `llvm::StringRef` and 
simplify this part here.

https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Improve type lookup using .debug_names parent chain (PR #108907)

2024-09-24 Thread via lldb-commits

jeffreytan81 wrote:

I have no idea how to do stack PR review well in github. Here is the second PR 
with namespace lookup diffing from my repo:
https://github.com/jeffreytan81/llvm-project/pull/2 if anyone wants to see. 
Unfortunately, if I am diffing from master llvm-project, it is showing both 
combined changes from both PRs instead of only the second changes. 

https://github.com/llvm/llvm-project/pull/108907
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 4494c54 - [lldb] Fix typos in various help messages. (#109851)

2024-09-24 Thread via lldb-commits

Author: Ryan Mansfield
Date: 2024-09-24T16:48:27-07:00
New Revision: 4494c54326fe33d19c14df851188f867b14ded2a

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

LOG: [lldb] Fix typos in various help messages. (#109851)

Added: 


Modified: 
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandObjectScripting.cpp
lldb/source/Commands/Options.td
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Target/TargetProperties.td

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 142f96946ed3d7..e2203292e71e20 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -1223,7 +1223,7 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(interpreter, "frame",
  "Commands for selecting and "
- "examing the current "
+ "examining the current "
  "thread's stack frames.",
  "frame  []") {
   LoadSubCommand("diagnose",

diff  --git a/lldb/source/Commands/CommandObjectProcess.cpp 
b/lldb/source/Commands/CommandObjectProcess.cpp
index 5b0f4f66f248b6..e7c7d07ad47722 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1420,7 +1420,7 @@ class CommandObjectProcessStatus : public 
CommandObjectParsed {
 
   PlatformSP platform_sp = process->GetTarget().GetPlatform();
   if (!platform_sp) {
-result.AppendError("Couldn'retrieve the target's platform");
+result.AppendError("Couldn't retrieve the target's platform");
 return;
   }
 

diff  --git a/lldb/source/Commands/CommandObjectScripting.cpp 
b/lldb/source/Commands/CommandObjectScripting.cpp
index 9a1a2b63c7af0c..1f8ee0a9554ec1 100644
--- a/lldb/source/Commands/CommandObjectScripting.cpp
+++ b/lldb/source/Commands/CommandObjectScripting.cpp
@@ -254,7 +254,7 @@ 
CommandObjectMultiwordScripting::CommandObjectMultiwordScripting(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(
   interpreter, "scripting",
-  "Commands for operating on the scripting functionnalities.",
+  "Commands for operating on the scripting functionalities.",
   "scripting  []") {
   LoadSubCommand("run",
  CommandObjectSP(new CommandObjectScriptingRun(interpreter)));

diff  --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index df906e9d7c808f..4276d9e7f9c8b0 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -1199,7 +1199,7 @@ let Command = "thread trace dump instructions" in {
   def thread_trace_dump_instruction_only_events : Option<"only-events", "E">,
 Group<1>,
 Desc<"Dump only the events that happened during the execution of the "
-"target. No instrutions are dumped.">;
+"target. No instructions are dumped.">;
   def thread_trace_dump_instructions_continue: Option<"continue", "C">,
 Group<1>,
 Desc<"Continue dumping instructions right where the previous invocation of 
"

diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index b93f47a8a8d5ec..acd592c3bd2dbc 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -797,7 +797,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   new CommandObjectRegexCommand(
   *this, "gdb-remote",
   "Connect to a process via remote GDB server.\n"
-  "If no host is specifed, localhost is assumed.\n"
+  "If no host is specified, localhost is assumed.\n"
   "gdb-remote is an abbreviation for 'process connect --plugin "
   "gdb-remote connect://:'\n",
   "gdb-remote [:]", 0, false));

diff  --git a/lldb/source/Target/TargetProperties.td 
b/lldb/source/Target/TargetProperties.td
index 0f68deb543f90e..fb61478fb752dc 100644
--- a/lldb/source/Target/TargetProperties.td
+++ b/lldb/source/Target/TargetProperties.td
@@ -235,7 +235,7 @@ let Definition = "process" in {
   def DisableLangRuntimeUnwindPlans: 
Property<"disable-language-runtime-unwindplans", "Boolean">,
 Global,
 DefaultFalse,
-Desc<"If true, language runtime augmented/overidden backtraces will not be 
used when printing a stack trace.">;
+Desc<"If true, language runtime augmented/overridden backtraces will not 
be used when printing a stack trace.">;
   def DetachKeepsStopped: Property<"detach-keeps-stopped", "Boolean">,

[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread via lldb-commits

jimingham wrote:

I can't delete your branch, however, if you had wanted to do that.

https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread via lldb-commits

https://github.com/jimingham closed 
https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread via lldb-commits

jimingham wrote:

Done.

https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

2024-09-24 Thread Adrian Prantl via lldb-commits

adrian-prantl wrote:

@medismailben @labath I finally worked through remaining platform-specific 
issues with the patch this was depending on. Would you mind taking another look 
at this?

https://github.com/llvm/llvm-project/pull/106442
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)

2024-09-24 Thread Adrian Prantl via lldb-commits

adrian-prantl wrote:

@medismailben @labath Would you mind taking another look at this?

https://github.com/llvm/llvm-project/pull/106470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 2064087 - [lldb][NFC] Add a missing setter method for UnwindPlans (#109751)

2024-09-24 Thread via lldb-commits

Author: Jason Molenda
Date: 2024-09-24T09:08:08-07:00
New Revision: 206408732bca2ef464732a39c8319d47c8a1dbea

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

LOG: [lldb][NFC] Add a missing setter method for UnwindPlans (#109751)

The UnwindPlan class has getter and setter methods for specifying an
abstract register location, but it doesn't have a setter for a DWARF
Expression register location. This hasn't been needed for any of the
UnwindPlans that we do in mainline lldb yet, but it is used in the Swift
language SwiftLanguageRuntime plugin which creates UnwindPlan for async
functions. While it's currently unused on main branch, this is a
straightforward setter in the same form as the others, the only caveat
being that it doesn't own the dwarf expression bytes, it has a pointer
to them.

Added: 


Modified: 
lldb/include/lldb/Symbol/UnwindPlan.h

Removed: 




diff  --git a/lldb/include/lldb/Symbol/UnwindPlan.h 
b/lldb/include/lldb/Symbol/UnwindPlan.h
index a1d00f2d2c0cd1..e1567c7357d0b5 100644
--- a/lldb/include/lldb/Symbol/UnwindPlan.h
+++ b/lldb/include/lldb/Symbol/UnwindPlan.h
@@ -370,6 +370,13 @@ class UnwindPlan {
 
 bool SetRegisterLocationToSame(uint32_t reg_num, bool must_replace);
 
+/// This method does not make a copy of the \a opcodes memory, it is
+/// assumed to have the same lifetime as the Module this UnwindPlan will
+/// be registered in.
+bool SetRegisterLocationToIsDWARFExpression(uint32_t reg_num,
+const uint8_t *opcodes,
+uint32_t len, bool 
can_replace);
+
 bool SetRegisterLocationToIsConstant(uint32_t reg_num, uint64_t constant,
  bool can_replace);
 



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


[Lldb-commits] [lldb] [lldb][docs] Resurrect the information on adding a new language (PR #109427)

2024-09-24 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett updated 
https://github.com/llvm/llvm-project/pull/109427

>From cc4032e58217a01ff414b8d03866a1631f492df8 Mon Sep 17 00:00:00 2001
From: David Spickett 
Date: Fri, 20 Sep 2024 14:00:44 +0100
Subject: [PATCH 1/4] [lldb][docs] Resurrect the information on adding a new
 language

This got deleted in e078c9507c3abb4d9bb2265c366b26557880a3e3,
I presume accidentally, because it didn't have a corresponding rst
file for it.

So I've brought it back and converted it into Markdown. The content
remains accurate, from what I know at least.

It's a bit "now draw the rest of the owl" but if nothing else,
it gives you a bunch of important classes to go and research
as a starting point.

You can see the original content here:
https://github.com/llvm/llvm-project/blob/5d71fc5d7b5ffe2323418a09db6eddaf84d6c662/lldb/www/adding-language-support.html
---
 lldb/docs/index.rst  |  1 +
 lldb/docs/resources/addinglanguagesupport.md | 95 
 2 files changed, 96 insertions(+)
 create mode 100644 lldb/docs/resources/addinglanguagesupport.md

diff --git a/lldb/docs/index.rst b/lldb/docs/index.rst
index d9b8e589eb2ac0..dd44a8430add80 100644
--- a/lldb/docs/index.rst
+++ b/lldb/docs/index.rst
@@ -163,6 +163,7 @@ interesting areas to contribute to lldb.
resources/caveats
resources/projects
resources/lldbdap
+   resources/addinglanguagesupport
Public C++ API 
Private C++ API 
 
diff --git a/lldb/docs/resources/addinglanguagesupport.md 
b/lldb/docs/resources/addinglanguagesupport.md
new file mode 100644
index 00..d92104a0e5e6ec
--- /dev/null
+++ b/lldb/docs/resources/addinglanguagesupport.md
@@ -0,0 +1,95 @@
+# Adding Programming Language Support
+
+LLDB has been architected to make it straightforward to add support for a
+programming language. Only a small enum in core LLDB needs to be modified to
+make LLDB aware of a new programming language. Everything else can be supplied
+in derived classes that need not even be present in the core LLDB repository.
+This makes it convenient for developers adding language support either in
+branches or downstream repositories since it practically eliminates the
+potential for merge conflicts.
+
+The basic steps are:
+* Add the language to the `LanguageType` enum.
+* Add a `TypeSystem` for the language.
+* Add expression evaluation support.
+
+Additionally, you may want to create a `Language` and `LanguageRuntime` plugin
+for your language, which enables support for advanced features like dynamic
+typing and data formatting.
+
+## Add the Language to the LanguageType enum
+
+The `LanguageType` enum
+(see 
[lldb-enumerations.h](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/lldb-enumerations.h))
+contains a list of every language known to LLDB. It is the one place where
+support for a language must live that will need to merge cleanly with upstream
+LLDB if you are developing your language support in a separate branch. When
+adding support for a language previously unknown to LLDB, start by adding an
+enumeration entry to `LanguageType`.
+
+## Add a TypeSystem for the Language
+
+Both 
[Module](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Core/Module.h)
+and 
[Target](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Target/Target.h)
+support the retrieval of a `TypeSystem` instance via 
`GetTypeSystemForLanguage()`.
+For `Module`, this method is directly on the `Module` instance. For `Target`,
+this is retrieved indirectly via the `TypeSystemMap` for the `Target` instance.
+
+The `TypeSystem` instance returned by the `Target` is expected to be capable of
+evaluating expressions, while the `TypeSystem` instance returned by the 
`Module`
+is not. If want to support expression evaluation for your language, you could
+consider one of the following approaches:
+* Implement a single `TypeSystem` class that supports evaluation when given an
+  optional `Target`, implementing all the expression evaluation methods on the
+  `TypeSystem`.
+* Create multiple `TypeSystem` classes, one for evaluation and one for static
+  `Module` usage.
+
+For clang and Swift, the latter approach was chosen. Primarily to make it
+clearer that evaluation with the static `Module`-returned `TypeSystem` 
instances
+make no sense, and have them error out on those calls. But either approach is
+fine.
+
+# Add Expression Evaluation Support
+
+Expression Evaluation support is enabled by implementing the relevant methods 
on
+a `TypeSystem`-derived class. Search for `Expression` in the
+[TypeSystem 
header](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Symbol/TypeSystem.h)
+to find the methods to implement.
+
+# Type Completion
+
+There are three levels of type completion, each requiring more type 
information:
+1. Pointer size: When you have a forward decl or a

[Lldb-commits] [lldb] 04b443e - Add the ability to define custom completers to the parsed_cmd template. (#109062)

2024-09-24 Thread via lldb-commits

Author: jimingham
Date: 2024-09-24T10:00:00-07:00
New Revision: 04b443e77845cd20ab5acc4356cee509316135dd

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

LOG: Add the ability to define custom completers to the parsed_cmd template. 
(#109062)

If your arguments or option values are of a type that naturally uses one
of our common completion mechanisms, you will get completion for free.
But if you have your own custom values or if you want to do fancy things
like have `break set -s foo.dylib -n ba` only complete on symbols
in foo.dylib, you can use this new mechanism to achieve that.

Added: 


Modified: 
lldb/bindings/python/python-wrapper.swig
lldb/docs/use/python-reference.rst
lldb/examples/python/cmdtemplate.py
lldb/examples/python/templates/parsed_cmd.py
lldb/include/lldb/Interpreter/ScriptInterpreter.h
lldb/include/lldb/Utility/CompletionRequest.h
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Interpreter/Options.cpp
lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/test/API/commands/command/script/add/TestAddParsedCommand.py
lldb/test/API/commands/command/script/add/test_commands.py
lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

Removed: 




diff  --git a/lldb/bindings/python/python-wrapper.swig 
b/lldb/bindings/python/python-wrapper.swig
index 961fb2d1a76178..b72a462d04643b 100644
--- a/lldb/bindings/python/python-wrapper.swig
+++ b/lldb/bindings/python/python-wrapper.swig
@@ -667,6 +667,79 @@ 
lldb_private::python::SWIGBridge::LLDBSwigPythonGetRepeatCommandForScriptedComma
   return result.Str().GetString().str();
 }
 
+StructuredData::DictionarySP
+lldb_private::python::SWIGBridge::LLDBSwigPythonHandleArgumentCompletionForScriptedCommand(PyObject
 *implementor,
+std::vector &args_vec, size_t args_pos, size_t 
pos_in_arg) {
+
+  PyErr_Cleaner py_err_cleaner(true);
+
+  PythonObject self(PyRefType::Borrowed, implementor);
+  auto pfunc = self.ResolveName("handle_argument_completion");
+  // If this isn't implemented, return an empty dict to signal falling back to 
default completion:
+  if (!pfunc.IsAllocated())
+return {};
+
+  PythonList args_list(PyInitialValue::Empty);
+  for (auto elem : args_vec)
+args_list.AppendItem(PythonString(elem));
+
+  PythonObject result = pfunc(args_list, PythonInteger(args_pos), 
PythonInteger(pos_in_arg));
+  // Returning None means do the ordinary completion
+  if (result.IsNone())
+return {};
+
+  // Convert the return dictionary to a DictionarySP.
+  StructuredData::ObjectSP result_obj_sp = result.CreateStructuredObject();
+  if (!result_obj_sp)
+return {};
+
+  StructuredData::DictionarySP dict_sp(new 
StructuredData::Dictionary(result_obj_sp));
+  if (dict_sp->GetType() == lldb::eStructuredDataTypeInvalid)
+return {};
+  return dict_sp;
+}
+
+StructuredData::DictionarySP
+lldb_private::python::SWIGBridge::LLDBSwigPythonHandleOptionArgumentCompletionForScriptedCommand(PyObject
 *implementor,
+llvm::StringRef &long_option, size_t pos_in_arg) {
+
+  PyErr_Cleaner py_err_cleaner(true);
+
+  PythonObject self(PyRefType::Borrowed, implementor);
+  auto pfunc = 
self.ResolveName("handle_option_argument_completion");
+  // If this isn't implemented, return an empty dict to signal falling back to 
default completion:
+  if (!pfunc.IsAllocated())
+return {};
+
+  PythonObject result = pfunc(PythonString(long_option), 
PythonInteger(pos_in_arg));
+  // Returning None means do the ordinary completion
+  if (result.IsNone())
+return {};
+
+  // Returning a boolean:
+  // True means the completion was handled, but there were no completions
+  // False means that the completion was not handled, again, do the ordinary 
completion:
+  if (result.GetObjectType() == PyObjectType::Boolean) {
+if (!result.IsTrue())
+  return {};
+// Make up a completion dictionary with the right element:
+StructuredData::DictionarySP dict_sp(new StructuredData::Dictionary());
+dict_sp->AddBooleanItem("no-completion", true);
+return dict_sp;
+  }
+
+
+  // Convert the return dictionary to a DictionarySP.
+  StructuredData::ObjectSP result_obj_sp = result.CreateStructuredObject();
+  if (!result_obj_sp)
+return {};
+
+  StructuredData::DictionarySP dict_sp(new 
StructuredData::Dictionary(result_obj_sp));
+  if (dict_sp->GetType() == lldb::eStructuredDataTypeInvalid)
+return {};
+  return dict_sp;
+}
+
 #include "lldb/Interpreter/CommandReturnObject.h"
 
 bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallParsedCommandObject(

diff  --git a/lldb/docs/use/

[Lldb-commits] [lldb] Add the ability to define custom completers to the parsed_cmd template. (PR #109062)

2024-09-24 Thread via lldb-commits

https://github.com/jimingham closed 
https://github.com/llvm/llvm-project/pull/109062
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)

2024-09-24 Thread via lldb-commits

jimingham wrote:

> @jimingham I agree with everything you wrote. I think you misunderstood the 
> context based on the way GitHub provided you some misleading context in the 
> email notification

Yeah, I should stop trying to read the notifications in the GitHub emails and 
just use them as a link to the website.  Sigh...

Anyway, the real question was "what does an empty string do in these regex's".  
The answer is the one you probably suspected, an empty string means "no regular 
expression to apply", not ".*".

https://github.com/llvm/llvm-project/pull/108870
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix assert frame recognizer for Ubuntu 22.04 (PR #109594)

2024-09-24 Thread via lldb-commits

jimingham wrote:

There are two clients for stack unwinding in general, with different 
performance needs.  There's the users of the `bt` command or it's SB API 
equivalents who are operating on human timescales, and there's the execution 
control machinery, which gets invoked much more frequently in an algorithmic 
fashion.

For execution control, we need to be careful never to unwind more frames than 
needed, since you stop a lot to go from place to place, the turnaround time is 
important to keeping stepping lively.  I don't think we want to introduce 
unbounded frame unwinding to the execution control stops.

However, with these new "hiding frame" recognizers, we are using the frame 
hiding recognizers to handle "step out past hidden frames".  So if - as was 
done in the original implementation - we're determining this during execution 
control, its hard to see how we can avoid running these recognizers all the 
time.  That argues for not allowing unbounded backtracing in recognizers.

Another way to do this would be to make the "step out past hidden frames" be 
something we calculate when you issue the "step out" command.  step-out already 
has a settable "step-out-to frame" parameter.  So if you stopped "to the user" 
and then they said "step out" - at that point it would be fine to run the 
recognizer (you probably already have) and then directly issue "step out to 
frame ".  That would save the execution 
control machinery from having to do this.

I don't have a detailed plan for this, but I think given the kinds of ambitions 
people seem likely to have for the recognizers, we need to separate these two 
use cases.  We should add a distinction to the stack backtracking machinery 
between "partial stack requests from the execution control" and "full stack 
requests from users".  The former should never do extra work for the 
recognizers, whereas the latter can trade off speed for richer information.  

I don't think that would be all that hard to do.  One somewhat ham-fisted way 
to do it is only run the recognizers if someone asks for N frames, and we find 
the full stack is less than N, then run the recognizers.  The execution control 
machinery never asks for more than a couple of frames...  OTOH, a well done GUI 
might only ask for as many frames as it was going to display, which this way 
wouldn't serve.  So it would be better to make this an explicit gesture somehow.

Jim



> On Sep 24, 2024, at 12:36 AM, Adrian Vogelsgesang ***@***.***> wrote:
> 
> 
> This is why I said on the bug that it would be better to match one of the 
> public symbols higher up the stack. How to best to that is the open question
> 
> Is the following correct: Even if the user does not have debug symbols 
> installed, it would always be sufficient to match the first named framed.
> 
> If so, we could change StackFrameList::SelectMostRelevantFrame to match 
> against the first frame which has a name available. Although, that might 
> already cause a lot of unwinding, in case no debug info is available at all...
> 
> —
> Reply to this email directly, view it on GitHub 
> , 
> or unsubscribe 
> .
> You are receiving this because you were mentioned.
> 



https://github.com/llvm/llvm-project/pull/109594
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix assert frame recognizer for Ubuntu 22.04 (PR #109594)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

vogelsgesang wrote:

> However, with these new "hiding frame" recognizers, we are using the frame 
> hiding recognizers to handle "step out past hidden frames".  So if - as was 
> done in the original implementation - we're determining this during execution 
> control, its hard to see how we can avoid running these recognizers all the 
> time.  That argues for not allowing unbounded backtracing in recognizers.

Good point, that's something which probably should be changed... CC 
@adrian-prantl 

> [...] So it would be better to make this an explicit gesture somehow.

`StackFrameList::GetSelectedFrameIndex` already takes a parameter 
`select_most_relevant` which enables the frame recognizers only for 
user-visible stops. At least from a cursory look over all its callers, it looks 
like what you are proposing?

(Not sure if I missed anything, though. Still new to the lldb code base...)


https://github.com/llvm/llvm-project/pull/109594
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB][Minidump] Have Minidumps save off and properly read TLS data (PR #109477)

2024-09-24 Thread Jacob Lalonde via lldb-commits

Jlalond wrote:

> > [This 
> > codepath](https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp#L118)
> >  results in none of the modules being loaded, or rebased, and I don't why 
> > this should apply without checking all modules.
> 
> Yeah, I don't like that code either, which is why I'm leaning more and more 
> towards deleting it. Judging by the patch which introduced it, I believe this 
> check is basically a proxy for "have the modules been loaded by the process 
> class", and the intention more-or-less was to make the dynamic loader plugin 
> a no-op in this case. What the other of the patch probably did not realize 
> (just like I did not realize it when I was implementing module loading in 
> ProcessMinidump) is that this makes thread local data access impossible (in 
> fairness, it's quite possible that, at that point, thread-local access was 
> not implemented yet).

Great context.

In my mind, I think every core file format will have to handle loading it's own 
modules that are from the core file. We will still want the dynamic loader 
plugin to do it's own book keeping. I haven't tested it, but I think we should 
allow the DYLD to do it's own book keeping but just not handle 
loading/unloading modules owned by the CoreProcess. This will likely require 
some extension of Process, but I think this a good evolution of the patch you 
linked

https://github.com/llvm/llvm-project/pull/109477
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -142,6 +142,9 @@ class StopInfo : public 
std::enable_shared_from_this {
   static lldb::StopInfoSP
   CreateStopReasonProcessorTrace(Thread &thread, const char *description);
 
+  static lldb::StopInfoSP

rocallahan wrote:

Adding a comment.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -510,8 +510,9 @@ def start(self):
 self._thread.start()
 
 def stop(self):
-self._thread.join()
-self._thread = None
+if self._thread is not None:

rocallahan wrote:

This is not an LLDB stop or an LLDB thread. `thread_`  is the `MockGdbServer`'s 
Python worker thread, and `stop()` is the method you call to shut down the 
server. I'm making this method work in the case where you call `stop()` before 
`start()` has been called, in the `GDBProxyTestBase.tearDown()` test 
scaffolding.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -3271,6 +3273,11 @@ Status Process::PrivateResume() {
   if (!GetModID().IsLastResumeForUserExpression())
 ResetExtendedCrashInfoDict();
 
+  if (m_last_run_direction != direction) {

rocallahan wrote:

Done.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan edited 
https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan edited 
https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

rocallahan wrote:

> Ack, sorry I'm bad at the formalities.

No problem. Thank you for your time.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -158,7 +158,7 @@ class LLDB_API SBProcess {
 
   lldb::SBError Destroy();
 
-  lldb::SBError Continue();
+  lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward);

rocallahan wrote:

I have made this change.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid,
   return error;
 }
 
-Status ProcessWindows::DoResume() {
+Status ProcessWindows::DoResume(RunDirection direction) {
   Log *log = GetLog(WindowsLog::Process);
   llvm::sys::ScopedLock lock(m_mutex);
   Status error;
 
+  if (direction == RunDirection::eRunReverse) {

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -3139,6 +3146,7 @@ void PruneThreadPlans();
// m_currently_handling_do_on_removals are true,
// Resume will only request a resume, using this
// flag to check.
+  lldb::RunDirection m_last_run_direction;

rocallahan wrote:

Jim indicated that he doesn't want it initialized inline here.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -402,9 +402,16 @@ lldb_private::DynamicLoader 
*ProcessKDP::GetDynamicLoader() {
 
 Status ProcessKDP::WillResume() { return Status(); }
 
-Status ProcessKDP::DoResume() {
+Status ProcessKDP::DoResume(RunDirection direction) {

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan edited 
https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -874,10 +874,10 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  Status Resume();
+  Status Resume(lldb::RunDirection direction = lldb::eRunForward);

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -52,7 +52,7 @@ class ProcessWindows : public Process, public ProcessDebugger 
{
   Status DoAttachToProcessWithID(
   lldb::pid_t pid,
   const lldb_private::ProcessAttachInfo &attach_info) override;
-  Status DoResume() override;
+  Status DoResume(lldb::RunDirection direction) override;

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -52,7 +52,7 @@ class ScriptedProcess : public Process {
 
   void DidResume() override;
 
-  Status DoResume() override;
+  Status DoResume(lldb::RunDirection direction) override;

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -90,7 +90,7 @@ class ProcessKDP : public lldb_private::Process {
   // Process Control
   lldb_private::Status WillResume() override;
 
-  lldb_private::Status DoResume() override;
+  lldb_private::Status DoResume(lldb::RunDirection direction) override;

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -111,7 +111,7 @@ class ProcessGDBRemote : public Process,
   // Process Control
   Status WillResume() override;
 
-  Status DoResume() override;
+  Status DoResume(lldb::RunDirection direction) override;

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -182,10 +182,17 @@ void ScriptedProcess::DidResume() {
   m_pid = GetInterface().GetProcessID();
 }
 
-Status ScriptedProcess::DoResume() {
+Status ScriptedProcess::DoResume(RunDirection direction) {

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -3169,6 +3176,7 @@ void PruneThreadPlans();
// m_currently_handling_do_on_removals are true,
// Resume will only request a resume, using this
// flag to check.
+  lldb::RunDirection m_last_run_direction;

rocallahan wrote:

Ah I see. @clayborg suggested I initialize `m_last_run_direction` inline but 
fortunately I never got around to doing that :-).

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -1129,10 +1129,15 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  virtual Status DoResume() {
+  virtual Status DoResume(lldb::RunDirection direction) {

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid,
   return error;
 }
 
-Status ProcessWindows::DoResume() {
+Status ProcessWindows::DoResume(RunDirection direction) {

rocallahan wrote:

The decision was to use a direction flag.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 18b9d49 - lldb: get lldb API tests working with newer Android NDKs

2024-09-24 Thread via lldb-commits

Author: Andrew Rogers
Date: 2024-09-24T20:00:34-07:00
New Revision: 18b9d49ce3370c012fdd04ec87d854d53293f6a6

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

LOG: lldb: get lldb API tests working with newer Android NDKs

## Purpose
Running the LLDB API tests against a remote Android target with NDK
version r22 or later fails to compile the test inferiors. NDK r21 from
2021 is the most recent NDK that still works with the LLDB API tests.
This PR updates the Android make rules to support newer Android NDK
versions (r19 and later).

## Overview
* Updates and simplifies `Android.rules` to match the newer Android NDK
unified toolchain layout introduced in NDK r19
* Sets `OBJCOPY` and `ARCHIVER` env vars, required by a few test cases,
to their `llvm-` versions in the unified toolchain
* Drops support for pre-2019 Android NDK versions to keep the rules
simple
* Provides an error message if the tests are run using an incompatible
NDK layout

## Problem Details
Android introduced a unified tools layout in NDK r19 (2019) and removed
the old layout in r22 (2021). Releases r19, r20, and r21 support both
the old and new layout side-by-side. More details are in #106270.

## Validation
Ran a sub-set of the LLDB API tests against remote Android targets for
the four primary architectures i386, x86_64, arm, and aarch64. No
validation was done against riscv targets.

For each case, ran the copy of `lldb-server` from the Android NDK on the
device with the latest LLDB test cases in llvm-project

Ran tests with both r19 (the oldest supported) and r26 (more recent,
unified layout only) NDK versions.

Example test command for aarch64:
```
./build/bin/lldb-dotest --out-of-tree-debugserver --arch aarch64 
--platform-name remote-android --platform-url connect://localhost:5432 
--platform-working-dir /data/local/tmp 
--compiler=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang 
lldb/test/API/android/
```
**NOTE: there are a lot of test failures when running the full suite
(especially against 32-bit ARM target). These failures occur independent
of this change.**

Verified the expected error message appears when attempting to run using
NDK r18
```
Build Command Output:
make: Entering directory 
'/home/andrew/src/llvm/llvm-project/build/lldb-test-build.noindex/android/platform/TestDefaultCacheLineSize.test_cache_line_size'
/home/andrew/src/llvm/llvm-project/lldb/packages/Python/lldbsuite/test/make/Android.rules:16:
 *** "No unified toolchain sysroot found in 
/home/andrew/Android/Sdk/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/../../../../...
 NDK must be r19 or later.".  Stop.
make: Leaving directory 
'/home/andrew/src/llvm/llvm-project/build/lldb-test-build.noindex/android/platform/TestDefaultCacheLineSize.test_cache_line_size'
```

## Impact
**This change explicitly removes support for the pre-2019 NDK
structure.** Only NDK r19 (from 2019) and later can be used when running
the LLDB API tests. If the maintainers object, we can easily support
both the old and new NDK toolchain layouts side-by-side at the cost of
readability/maintainability. Since this change only impacts tests, I
don't see much value in supporting NDKs that are over 5 years old.

## Guidance to Reviewers
* I am not an expert on `clang` arguments so if anything looks off let
me know.
* While I personally thing supporting 5+ year old NDKs for testing seems
unnecessary, please chime-in if you are concerned with dropping that
support. I can easily revise to support both old and new layouts
side-by-side.
* If there are any specific tests you'd like me to run I will do my best
to accommodate. It doesn't look like there's much (any?) Android LLDB CI
coverage.

Added: 


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

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/make/Android.rules 
b/lldb/packages/Python/lldbsuite/test/make/Android.rules
index cd7d8ae74d6bf3..44aedf7248419e 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -1,81 +1,59 @@
 NDK_ROOT := $(shell dirname $(CC))/../../../../..
 
-ifeq "$(findstring 64, $(ARCH))" "64"
-   # lowest 64-bit API level
-   API_LEVEL := 21
-else ifeq "$(ARCH)" "i386"
-   # clone(2) declaration is present only since this api level
-   API_LEVEL := 17
+ifeq "$(HOST_OS)" "Linux"
+   HOST_TAG := linux-x86_64
+else ifeq "$(HOST_OS)" "Darwin"
+   HOST_TAG := darwin-x86_64
 else
-   # lowest supported 32-bit API level
-   API_LEVEL := 16
+   HOST_TAG := windows-x86_64
+endif
+
+TOOLCHAIN_ROOT := $(NDK_ROOT)/toolchains/llvm/prebuilt/$(HOST_TAG)
+TOOLCHAIN_SYSROOT := $(TOOLCHAIN_ROOT)/sysroot
+
+OBJCOPY ?= $(TOOLCHAIN_ROOT)/bin/llvm-o

[Lldb-commits] [lldb] lldb: get lldb API tests working with newer Android NDKs (PR #106443)

2024-09-24 Thread Saleem Abdulrasool via lldb-commits

https://github.com/compnerd closed 
https://github.com/llvm/llvm-project/pull/106443
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] lldb: get lldb API tests working with newer Android NDKs (PR #106443)

2024-09-24 Thread Saleem Abdulrasool via lldb-commits

compnerd wrote:

Going to go ahead and merge this since there/s not been any additional feedback.

https://github.com/llvm/llvm-project/pull/106443
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] df4f828 - [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (#109853)

2024-09-24 Thread via lldb-commits

Author: Zequan Wu
Date: 2024-09-24T17:27:09-04:00
New Revision: df4f828938db807fc7c4611896fe9659af482e81

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

LOG: [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (#109853)

Added: 


Modified: 
lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h

Removed: 




diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index e1f73f1997e369..f58c6262349c6f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -25,7 +25,7 @@ using namespace lldb_private::plugin::dwarf;
 void DWARFFormValue::Clear() {
   m_unit = nullptr;
   m_form = dw_form_t(0);
-  m_value = ValueTypeTag();
+  m_value = ValueType();
 }
 
 bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
@@ -44,68 +44,68 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 switch (m_form) {
 case DW_FORM_addr:
   assert(m_unit);
-  m_value.value.uval =
+  m_value.uval =
   data.GetMaxU64(offset_ptr, DWARFUnit::GetAddressByteSize(m_unit));
   break;
 case DW_FORM_block1:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_data16:
-  m_value.value.uval = 16;
+  m_value.uval = 16;
   is_block = true;
   break;
 case DW_FORM_exprloc:
 case DW_FORM_block:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_string:
-  m_value.value.cstr = data.GetCStr(offset_ptr);
+  m_value.cstr = data.GetCStr(offset_ptr);
   break;
 case DW_FORM_sdata:
-  m_value.value.sval = data.GetSLEB128(offset_ptr);
+  m_value.sval = data.GetSLEB128(offset_ptr);
   break;
 case DW_FORM_strp:
 case DW_FORM_line_strp:
 case DW_FORM_sec_offset:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 4);
+  m_value.uval = data.GetMaxU64(offset_ptr, 4);
   break;
 case DW_FORM_addrx1:
 case DW_FORM_strx1:
 case DW_FORM_ref1:
 case DW_FORM_data1:
 case DW_FORM_flag:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   break;
 case DW_FORM_addrx2:
 case DW_FORM_strx2:
 case DW_FORM_ref2:
 case DW_FORM_data2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   break;
 case DW_FORM_addrx3:
 case DW_FORM_strx3:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 3);
+  m_value.uval = data.GetMaxU64(offset_ptr, 3);
   break;
 case DW_FORM_addrx4:
 case DW_FORM_strx4:
 case DW_FORM_ref4:
 case DW_FORM_data4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   break;
 case DW_FORM_data8:
 case DW_FORM_ref8:
 case DW_FORM_ref_sig8:
-  m_value.value.uval = data.GetU64(offset_ptr);
+  m_value.uval = data.GetU64(offset_ptr);
   break;
 case DW_FORM_addrx:
 case DW_FORM_loclistx:
@@ -115,7 +115,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 case DW_FORM_ref_udata:
 case DW_FORM_GNU_str_index:
 case DW_FORM_GNU_addr_index:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   break;
 case DW_FORM_ref_addr:
   assert(m_unit);
@@ -123,14 +123,14 @@ bool DWARFFormValue::ExtractValue(const 
DWARFDataExtractor &data,
 ref_addr_size = m_unit->GetAddressByteSize();
   else
 ref_addr_size = 4;
-  m_value.value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
+  m_value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
   break;
 case DW_FORM_indirect:
   m_form = static_cast(data.GetULEB128(offset_ptr));
   indirect = true;
   break;
 case DW_FORM_flag_present:
-  m_value.value.uval = 1;
+  m_value.uval = 1;
   break;
 default:
   return false;
@@ -138,9 +138,9 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
   } while (indirect);
 
   if (is_block) {
-m_value.data = data.PeekData(*offse

[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread Ryan Mansfield via lldb-commits

rjmansfield wrote:

Could someone with commit access please merge on my behalf? Thanks.

https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 497759e - [lldb][AArch64] Create Neon subregs when XML only includes SVE (#108365)

2024-09-24 Thread via lldb-commits

Author: David Spickett
Date: 2024-09-24T12:40:42+01:00
New Revision: 497759e872a53964a54db941f3a1ed74446c5ed4

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

LOG: [lldb][AArch64] Create Neon subregs when XML only includes SVE (#108365)

Fixes #107864

QEMU decided that when SVE is enabled it will only tell us about SVE
registers in the XML, and not include Neon registers. On the grounds
that the Neon V registers can be read from the bottom 128 bits of a SVE
Z register (SVE's vector length is always >= 128 bits).

To support this we create sub-registers just as we do for S and D
registers of the V registers. Except this time we use part of the Z
registers.

This change also updates our fallback for registers with unknown types
that are > 128 bit. This is detailed in
https://github.com/llvm/llvm-project/issues/87471, though that covers
more than this change fixes.

We'll now treat any register of unknown type that is >= 128 bit as a
vector of bytes. So that the user gets to see something
even if the order might be wrong.

And until lldb supports vector and union types for registers, this is
also the only way we can get a value to apply the sub-reg to, to make
the V registers.

Added: 

lldb/test/API/functionalities/gdb_remote_client/TestAArch64XMLRegistersSVEOnly.py

Modified: 
lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Removed: 




diff  --git a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp 
b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
index 256c1f828feb38..7d8d0a4d3d6711 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
@@ -136,6 +136,8 @@ void ABIAArch64::AugmentRegisterInfo(
 
   std::array, 32> x_regs;
   std::array, 32> v_regs;
+  std::array, 32> z_regs;
+  std::optional z_byte_size;
 
   for (auto it : llvm::enumerate(regs)) {
 lldb_private::DynamicRegisterInfo::Register &info = it.value();
@@ -157,16 +159,44 @@ void ABIAArch64::AugmentRegisterInfo(
   x_regs[reg_num] = it.index();
 else if (get_reg("v"))
   v_regs[reg_num] = it.index();
+else if (get_reg("z")) {
+  z_regs[reg_num] = it.index();
+  if (!z_byte_size)
+z_byte_size = info.byte_size;
+}
 // if we have at least one subregister, abort
 else if (get_reg("w") || get_reg("s") || get_reg("d"))
   return;
   }
 
-  // Create aliases for partial registers: wN for xN, and sN/dN for vN.
+  // Create aliases for partial registers.
+
+  // Wn for Xn.
   addPartialRegisters(regs, x_regs, 8, "w{0}", 4, lldb::eEncodingUint,
   lldb::eFormatHex);
-  addPartialRegisters(regs, v_regs, 16, "s{0}", 4, lldb::eEncodingIEEE754,
-  lldb::eFormatFloat);
-  addPartialRegisters(regs, v_regs, 16, "d{0}", 8, lldb::eEncodingIEEE754,
-  lldb::eFormatFloat);
+
+  auto bool_predicate = [](const auto ®_num) { return bool(reg_num); };
+  bool saw_v_regs = std::any_of(v_regs.begin(), v_regs.end(), bool_predicate);
+  bool saw_z_regs = std::any_of(z_regs.begin(), z_regs.end(), bool_predicate);
+
+  // Sn/Dn for Vn.
+  if (saw_v_regs) {
+addPartialRegisters(regs, v_regs, 16, "s{0}", 4, lldb::eEncodingIEEE754,
+lldb::eFormatFloat);
+addPartialRegisters(regs, v_regs, 16, "d{0}", 8, lldb::eEncodingIEEE754,
+lldb::eFormatFloat);
+  } else if (saw_z_regs && z_byte_size) {
+// When SVE is enabled, some debug stubs will not describe the Neon V
+// registers because they can be read from the bottom 128 bits of the SVE
+// registers.
+
+// The size used here is the one sent by the debug server. This only needs
+// to be correct right now. Later we will rely on the value of vg instead.
+addPartialRegisters(regs, z_regs, *z_byte_size, "v{0}", 16,
+lldb::eEncodingVector, lldb::eFormatVectorOfUInt8);
+addPartialRegisters(regs, z_regs, *z_byte_size, "s{0}", 4,
+lldb::eEncodingIEEE754, lldb::eFormatFloat);
+addPartialRegisters(regs, z_regs, *z_byte_size, "d{0}", 8,
+lldb::eEncodingIEEE754, lldb::eFormatFloat);
+  }
 }

diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 9e8c6046179631..3e09c316d74f44 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4716,9 +4716,14 @@ bool ParseRegisters(
   reg_info.encoding = eEncodingIEEE754;
 } else if (gdb_type == "aarch64v" ||
llvm::StringRef(gdb_type).starts_with("vec") ||
-

[Lldb-commits] [lldb] [lldb][AArch64] Create Neon subregs when XML only includes SVE (PR #108365)

2024-09-24 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett closed 
https://github.com/llvm/llvm-project/pull/108365
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][AArch64] Create Neon subregs when XML only includes SVE (PR #108365)

2024-09-24 Thread David Spickett via lldb-commits

DavidSpickett wrote:

Landing this, post commit comments welcome as usual.

https://github.com/llvm/llvm-project/pull/108365
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix error reporting in SBTarget::ReadMemory (PR #109764)

2024-09-24 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett approved this pull request.


https://github.com/llvm/llvm-project/pull/109764
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)

2024-09-24 Thread Michael Buch via lldb-commits

https://github.com/Michael137 approved this pull request.


https://github.com/llvm/llvm-project/pull/108870
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix error reporting in SBTarget::ReadMemory (PR #109764)

2024-09-24 Thread Pavel Labath via lldb-commits

https://github.com/labath created 
https://github.com/llvm/llvm-project/pull/109764

The function should use the by-ref SBError argument instead of creating a new 
one. This code has been here since ~forever, and was probably copied from 
methods which return an SBError result (where one needs to create a local 
variable).

>From 671ca69cdd7e5b6ce5e4563a38c5af25f4c36fe9 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Tue, 24 Sep 2024 09:57:50 +0200
Subject: [PATCH] [lldb] Fix error reporting in SBTarget::ReadMemory

The function should use the by-ref SBError argument instead of creating
a new one. This code has been here since ~forever, and was probably
copied from methods which return an SBError result (where one needs to
create a local variable).
---
 lldb/source/API/SBTarget.cpp | 5 ++---
 lldb/test/API/python_api/target/TestTargetAPI.py | 5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 1c1f7e2a03def8..d5017ad6bff166 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -662,15 +662,14 @@ size_t SBTarget::ReadMemory(const SBAddress addr, void 
*buf, size_t size,
 lldb::SBError &error) {
   LLDB_INSTRUMENT_VA(this, addr, buf, size, error);
 
-  SBError sb_error;
   size_t bytes_read = 0;
   TargetSP target_sp(GetSP());
   if (target_sp) {
 std::lock_guard guard(target_sp->GetAPIMutex());
 bytes_read =
-target_sp->ReadMemory(addr.ref(), buf, size, sb_error.ref(), true);
+target_sp->ReadMemory(addr.ref(), buf, size, error.ref(), true);
   } else {
-sb_error.SetErrorString("invalid target");
+error.SetErrorString("invalid target");
   }
 
   return bytes_read;
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py 
b/lldb/test/API/python_api/target/TestTargetAPI.py
index 2e8d6a5b1e53f6..155a25b576b03a 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -153,6 +153,11 @@ def test_read_memory(self):
 self.assertSuccess(error, "Make sure memory read succeeded")
 self.assertEqual(len(content), 1)
 
+# Make sure reading from 0x0 fails
+sb_addr = lldb.SBAddress(0, target)
+self.assertIsNone(target.ReadMemory(sb_addr, 1, error))
+self.assertTrue(error.Fail())
+
 @skipIfWindows  # stdio manipulation unsupported on Windows
 @skipIfRemote  # stdio manipulation unsupported on remote iOS 
devices
 @skipIf(oslist=["linux"], archs=["arm", "aarch64"])

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


[Lldb-commits] [lldb] [lldb] Fix error reporting in SBTarget::ReadMemory (PR #109764)

2024-09-24 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)


Changes

The function should use the by-ref SBError argument instead of creating a new 
one. This code has been here since ~forever, and was probably copied from 
methods which return an SBError result (where one needs to create a local 
variable).

---
Full diff: https://github.com/llvm/llvm-project/pull/109764.diff


2 Files Affected:

- (modified) lldb/source/API/SBTarget.cpp (+2-3) 
- (modified) lldb/test/API/python_api/target/TestTargetAPI.py (+5) 


``diff
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 1c1f7e2a03def8..d5017ad6bff166 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -662,15 +662,14 @@ size_t SBTarget::ReadMemory(const SBAddress addr, void 
*buf, size_t size,
 lldb::SBError &error) {
   LLDB_INSTRUMENT_VA(this, addr, buf, size, error);
 
-  SBError sb_error;
   size_t bytes_read = 0;
   TargetSP target_sp(GetSP());
   if (target_sp) {
 std::lock_guard guard(target_sp->GetAPIMutex());
 bytes_read =
-target_sp->ReadMemory(addr.ref(), buf, size, sb_error.ref(), true);
+target_sp->ReadMemory(addr.ref(), buf, size, error.ref(), true);
   } else {
-sb_error.SetErrorString("invalid target");
+error.SetErrorString("invalid target");
   }
 
   return bytes_read;
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py 
b/lldb/test/API/python_api/target/TestTargetAPI.py
index 2e8d6a5b1e53f6..155a25b576b03a 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -153,6 +153,11 @@ def test_read_memory(self):
 self.assertSuccess(error, "Make sure memory read succeeded")
 self.assertEqual(len(content), 1)
 
+# Make sure reading from 0x0 fails
+sb_addr = lldb.SBAddress(0, target)
+self.assertIsNone(target.ReadMemory(sb_addr, 1, error))
+self.assertTrue(error.Fail())
+
 @skipIfWindows  # stdio manipulation unsupported on Windows
 @skipIfRemote  # stdio manipulation unsupported on remote iOS 
devices
 @skipIf(oslist=["linux"], archs=["arm", "aarch64"])

``




https://github.com/llvm/llvm-project/pull/109764
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Simplify `readMemory` (PR #109485)

2024-09-24 Thread Pavel Labath via lldb-commits

labath wrote:

> > [...] it may returned cached data from disk for running processes (which 
> > means it will be faster, but potentially return incorrect data).
> 
> I think the 2nd point shouldn't be an issue because `SBTarget::ReadMemory` 
> sets `force_live_memory` to true when calling `Target::ReadMemory`

I see. SG then.

> 
> > [...] but I don't know how you should come to a decision there
> 
> I think I found a good criterion: Do whatever the `memory read` command is 
> doing. Because users would probably expect the UI view and the results from 
> `memory read` to be in-sync. It turns out `memory read` is using 
> `Target::ReadMemory`. So I would like to do the same here, except if you are 
> aware of good reasons not to do so

No, this sounds pretty convincing to me. This looks good to me, except for the 
test case failure (it fails to fail to read memory). I looked into this (for 
way longer than it should have been necessary), and I tracked it down to a 
somewhat embarrassing bug. I've created #109764 to fix that.

https://github.com/llvm/llvm-project/pull/109485
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix error reporting in SBTarget::ReadMemory (PR #109764)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang approved this pull request.


https://github.com/llvm/llvm-project/pull/109764
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

2024-09-24 Thread Dmitrii Galimzianov via lldb-commits

DmT021 wrote:

@clayborg @Michael137 I've reverted the changes here and rewrote this patch 
pretty much like it was originally presented with a slightly different order of 
operation. The only change is in the `IRExecutionUnit::FindInSymbols` function 
and the order of lookup is described in the comment 
[here](https://github.com/llvm/llvm-project/pull/102835/files#diff-717a850c4315286c025e2739ebe9dacbf27e626b7679c72479b05c996d721112R799).
 If you don't mind let's merge this variant.
In my opinion, [the variant with 
lambda](https://github.com/llvm/llvm-project/commit/c647b26ad534bb998063722f930ddd07162bfee7)
 is too complex for a little win and I'm afraid future changes in this logic 
will be even more complicated.

https://github.com/llvm/llvm-project/pull/102835
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][docs] Resurrect the information on adding a new language (PR #109427)

2024-09-24 Thread Michael Buch via lldb-commits

https://github.com/Michael137 approved this pull request.


https://github.com/llvm/llvm-project/pull/109427
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] a3cf01d - [lldb][docs] Resurrect the information on adding a new language (#109427)

2024-09-24 Thread via lldb-commits

Author: David Spickett
Date: 2024-09-24T11:21:24+01:00
New Revision: a3cf01d58587d81b184d40091a86d6b8bf92d240

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

LOG: [lldb][docs] Resurrect the information on adding a new language (#109427)

This got deleted in e078c9507c3abb4d9bb2265c366b26557880a3e3, I presume
accidentally, because it didn't have a corresponding rst file for it.

So I've brought it back and converted it into Markdown. The content
remains accurate, from what I know at least.

It's a bit "now draw the rest of the owl" but if nothing else, it gives
you a bunch of important classes to go and research as a starting point.

You can see the original content here:
https://github.com/llvm/llvm-project/blob/5d71fc5d7b5ffe2323418a09db6eddaf84d6c662/lldb/www/adding-language-support.html

Added: 
lldb/docs/resources/addinglanguagesupport.md

Modified: 
lldb/docs/index.rst

Removed: 




diff  --git a/lldb/docs/index.rst b/lldb/docs/index.rst
index d9b8e589eb2ac0..dd44a8430add80 100644
--- a/lldb/docs/index.rst
+++ b/lldb/docs/index.rst
@@ -163,6 +163,7 @@ interesting areas to contribute to lldb.
resources/caveats
resources/projects
resources/lldbdap
+   resources/addinglanguagesupport
Public C++ API 
Private C++ API 
 

diff  --git a/lldb/docs/resources/addinglanguagesupport.md 
b/lldb/docs/resources/addinglanguagesupport.md
new file mode 100644
index 00..28789048643d77
--- /dev/null
+++ b/lldb/docs/resources/addinglanguagesupport.md
@@ -0,0 +1,95 @@
+# Adding Programming Language Support
+
+LLDB has been architected to make it straightforward to add support for a
+programming language. Only a small enum in core LLDB needs to be modified to
+make LLDB aware of a new programming language. Everything else can be supplied
+in derived classes that need not even be present in the core LLDB repository.
+This makes it convenient for developers adding language support in downstream
+repositories since it practically eliminates the potential for merge conflicts.
+
+The basic steps are:
+* Add the language to the `LanguageType` enum.
+* Add a `TypeSystem` for the language.
+* Add expression evaluation support.
+
+Additionally, you may want to create a `Language` and `LanguageRuntime` plugin
+for your language, which enables support for advanced features like dynamic
+typing and data formatting.
+
+## Add the Language to the LanguageType enum
+
+The `LanguageType` enum
+(see 
[lldb-enumerations.h](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/lldb-enumerations.h))
+contains a list of every language known to LLDB. It is the one place where
+support for a language must live that will need to merge cleanly with upstream
+LLDB if you are developing your language support in a separate branch. When
+adding support for a language previously unknown to LLDB, start by adding an
+enumeration entry to `LanguageType`.
+
+## Add a TypeSystem for the Language
+
+Both 
[Module](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Core/Module.h)
+and 
[Target](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Target/Target.h)
+support the retrieval of a `TypeSystem` instance via 
`GetTypeSystemForLanguage()`.
+For `Module`, this method is directly on the `Module` instance. For `Target`,
+this is retrieved indirectly via the `TypeSystemMap` for the `Target` instance.
+
+The `TypeSystem` instance returned by the `Target` is expected to be capable of
+evaluating expressions, while the `TypeSystem` instance returned by the 
`Module`
+is not. If you want to support expression evaluation for your language, you 
could
+consider one of the following approaches:
+* Implement a single `TypeSystem` class that supports evaluation when given an
+  optional `Target`, implementing all the expression evaluation methods on the
+  `TypeSystem`.
+* Create multiple `TypeSystem` classes, one for evaluation and one for static
+  `Module` usage.
+
+For clang and Swift, the latter approach was chosen. Primarily to make it
+clearer that evaluation with the static `Module`-returned `TypeSystem` 
instances
+make no sense, and have them error out on those calls. But either approach is
+fine.
+
+# Creating Types
+
+Your `TypeSystem` will need an approach for creating types based on a set of
+`Module`s. If your type info is going to come from DWARF info, you will want to
+subclass 
[DWARFASTParser](https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h).
+
+
+# Add Expression Evaluation Support
+
+Expression Evaluation support is enabled by implementing the relevant methods 
on
+a `TypeSystem`-derived clas

[Lldb-commits] [lldb] [lldb][docs] Resurrect the information on adding a new language (PR #109427)

2024-09-24 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett closed 
https://github.com/llvm/llvm-project/pull/109427
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)

2024-09-24 Thread Michael Buch via lldb-commits


@@ -90,9 +79,26 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
 if (!sc.function)
   return {};
 
+// Check if we have a regex match
+bool matches_regex = false;
 for (RegularExpression &r : m_hidden_regex)
-  if (r.Execute(sc.function->GetNameNoArguments()))
+  if (r.Execute(sc.function->GetNameNoArguments())) {
+matches_regex = true;
+break;
+  }
+
+if (matches_regex) {

Michael137 wrote:

Personally I prefer not having that extra `matches_regex` variable. The first 
time I was reading through it I was trying to figure out if there was more to 
this loop that I was missing. So if you don't mind changing it to:
```
   for (RegularExpression &r : m_hidden_regex) {
  if (!r.Execute(sc.function->GetNameNoArguments()))
continue;

  // remaining checks
}
```
that would be appreciated

https://github.com/llvm/llvm-project/pull/108870
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB][Minidump] Have Minidumps save off and properly read TLS data (PR #109477)

2024-09-24 Thread Pavel Labath via lldb-commits

labath wrote:

> [This 
> codepath](https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp#L118)
>  results in none of the modules being loaded, or rebased, and I don't why 
> this should apply without checking all modules.

Yeah, I don't like that code either, which is why I'm leaning more and more 
towards deleting it. Judging by the patch which introduced it, I believe this 
check is basically a proxy for "have the modules been loaded by the process 
class", and the intention more-or-less was to make the dynamic loader plugin a 
no-op in this case. What the other of the patch probably did not realize (just 
like I did not realize it when I was implementing module loading in 
ProcessMinidump) is that this makes thread local data access impossible (in 
fairness, it's quite possible that, at that point, thread-local access was not 
implemented yet).

https://github.com/llvm/llvm-project/pull/109477
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFC] Add a missing setter method for UnwindPlans (PR #109751)

2024-09-24 Thread Jason Molenda via lldb-commits

https://github.com/jasonmolenda closed 
https://github.com/llvm/llvm-project/pull/109751
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFC] Add a missing setter method for UnwindPlans (PR #109751)

2024-09-24 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan commented:

good catch! 

https://github.com/llvm/llvm-project/pull/109751
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb]Implement LLDB Telemetry (PR #98528)

2024-09-24 Thread Vy Nguyen via lldb-commits


@@ -682,17 +683,51 @@ PacketStatus DAP::GetNextObject(llvm::json::Object 
&object) {
 }
 
 bool DAP::HandleObject(const llvm::json::Object &object) {
+  auto start_time = std::chrono::steady_clock::now();
   const auto packet_type = GetString(object, "type");
   if (packet_type == "request") {
 const auto command = GetString(object, "command");
 auto handler_pos = request_handlers.find(std::string(command));
+lldb::SBStructuredData telemetry_entry;
+
+// There does not seem to be a direct way to construct an SBStructuredData.
+// So we first create a json::Array object,
+// then we serialize it to a string,
+// and finally call SBStructuredData::SetFromJSON(string).
+//
+// TODO: This seems unnecessarily complex. Ideally, we should be able to

oontvoo wrote:

Thanks - i'll resolve this for now. we can revisit this later

https://github.com/llvm/llvm-project/pull/98528
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb]Implement LLDB Telemetry (PR #98528)

2024-09-24 Thread Vy Nguyen via lldb-commits


@@ -0,0 +1,619 @@
+
+//===-- Telemetry.cpp 
-===//
+//
+// 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
+//
+//===--===//
+#include "lldb/Core/Telemetry.h"
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBProcess.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Statistics.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/UUID.h"
+#include "lldb/Version/Version.h"
+#include "lldb/lldb-enumerations.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LineIterator.h"
+#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/RandomNumberGenerator.h"
+#include "llvm/Telemetry/Telemetry.h"
+
+#ifdef HAS_VENDOR_TELEMETRY_PLUGINS
+// TODO: could make this path a build-variable rather than hard-coded
+#include "lldb/Core/VendorTelemetryPlugin.h"
+
+// This must include definitions for these functions
+extern void ApplyVendorSpecificConfigs(
+llvm::telemetry::TelemetryConfig *config) /* __attribute__((weak))*/;
+extern std::shared_ptr SanitizeSensitiveFields(
+const llvm::telemetry::TelemetryInfo *entry) /*__attribute__((weak))*/;
+extern std::shared_ptr
+CreateVendorSpecificTelemeter(
+llvm::telemetry::TelemetryConfig *config) /*__attribute__((weak))*/;
+#endif
+
+namespace lldb_private {
+
+static std::string GetDuration(const TelemetryEventStats &stats) {
+  if (stats.m_end.has_value())
+return std::to_string((stats.m_end.value() - stats.m_start).count()) +
+   "(nanosec)";
+  return "";
+}
+
+std::string DebuggerTelemetryInfo::ToString() const {
+  std::string duration_desc =
+  (exit_description.has_value() ? "  lldb session duration: "
+: "  lldb startup duration: ") +
+  std::to_string((stats.m_end.value() - stats.m_start).count()) +
+  "(nanosec)\n";
+
+  return TelemetryInfo::ToString() + "\n" + ("[DebuggerTelemetryInfo]\n") +
+ ("  username: " + username + "\n") +
+ ("  lldb_git_sha: " + lldb_git_sha + "\n") +
+ ("  lldb_path: " + lldb_path + "\n") + ("  cwd: " + cwd + "\n") +
+ duration_desc + "\n";
+}
+
+std::string ClientTelemetryInfo::ToString() const {
+  return TelemetryInfo::ToString() + "\n" + ("[DapRequestInfoEntry]\n") +
+ ("  request_name: " + request_name + "\n") +
+ ("  request_duration: " + GetDuration(stats) + "(nanosec)\n") +
+ ("  error_msg: " + error_msg + "\n");
+}
+
+std::string TargetTelemetryInfo::ToString() const {
+  std::string exit_or_load_desc;
+  if (exit_description.has_value()) {
+// If this entry was emitted for an exit
+exit_or_load_desc = "  process_duration: " + GetDuration(stats) +
+"  exit: " + exit_description->ToString() + "\n";
+  } else {
+// This was emitted for a load event.
+// See if it was the start-load or end-load entry
+if (stats.m_end.has_value()) {
+  exit_or_load_desc =
+  "  startup_init_duration: " + GetDuration(stats) + "\n";
+} else {
+  exit_or_load_desc = " startup_init_start\n";
+}
+  }
+  return TelemetryInfo::ToString() + "\n" + ("[TargetTelemetryInfo]\n") +
+ ("  target_uuid: " + target_uuid + "\n") +
+ ("  file_format: " + file_format + "\n") +
+ ("  binary_path: " + binary_path + "\n") +
+ ("  binary_size: " + std::to_string(binary_size) + "\n") +
+ exit_or_load_desc;
+}
+
+static std::string StatusToString(CommandReturnObject *result) {
+  std::string msg;
+  switch (result->GetStatus()) {
+  case lldb::eReturnStatusInvalid:
+msg = "invalid";
+break;
+  case lldb::eReturnStatusSuccessFinishNoResult:
+msg = "success_finish_no_result";
+break;
+  case lldb::eReturnStatusSuccessFinishResult:
+msg = "success_finish_result";
+break;
+  case lldb::eReturnStatusSuccessContinuingNoResult:
+msg = "success_continuing_no_result";
+break;
+  case lldb::eReturnStatusSuccessContinuingResult:
+msg = "success_continuing_result";
+break;
+  case lldb::eReturnStatusStarted:
+msg = "started";
+break;
+  case lldb::eReturnStatusFailed:
+msg = "failed";
+break;
+  case lldb::eReturnStatusQuit:
+  

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits


@@ -3169,6 +3176,7 @@ void PruneThreadPlans();
// m_currently_handling_do_on_removals are true,
// Resume will only request a resume, using this
// flag to check.
+  lldb::RunDirection m_last_run_direction;

rocallahan wrote:

> This should have a doc string. 

OK, will do.

> So I personally wouldn't initialize this one here,

Maybe I'm misunderstanding you, but I'm not initializing `m_last_run_direction` 
here.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread Ryan Mansfield via lldb-commits

https://github.com/rjmansfield created 
https://github.com/llvm/llvm-project/pull/109851

None

>From 7152beddd387b5d4ccef7653edaf2238999a2cfa Mon Sep 17 00:00:00 2001
From: Ryan Mansfield 
Date: Tue, 24 Sep 2024 15:29:05 -0400
Subject: [PATCH] [lldb] Fix typos in various help messages.

---
 lldb/source/Commands/CommandObjectFrame.cpp | 2 +-
 lldb/source/Commands/CommandObjectProcess.cpp   | 2 +-
 lldb/source/Commands/CommandObjectScripting.cpp | 2 +-
 lldb/source/Commands/Options.td | 2 +-
 lldb/source/Interpreter/CommandInterpreter.cpp  | 2 +-
 lldb/source/Target/TargetProperties.td  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 142f96946ed3d7..e2203292e71e20 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -1223,7 +1223,7 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(interpreter, "frame",
  "Commands for selecting and "
- "examing the current "
+ "examining the current "
  "thread's stack frames.",
  "frame  []") {
   LoadSubCommand("diagnose",
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp 
b/lldb/source/Commands/CommandObjectProcess.cpp
index 5b0f4f66f248b6..e7c7d07ad47722 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1420,7 +1420,7 @@ class CommandObjectProcessStatus : public 
CommandObjectParsed {
 
   PlatformSP platform_sp = process->GetTarget().GetPlatform();
   if (!platform_sp) {
-result.AppendError("Couldn'retrieve the target's platform");
+result.AppendError("Couldn't retrieve the target's platform");
 return;
   }
 
diff --git a/lldb/source/Commands/CommandObjectScripting.cpp 
b/lldb/source/Commands/CommandObjectScripting.cpp
index 9a1a2b63c7af0c..1f8ee0a9554ec1 100644
--- a/lldb/source/Commands/CommandObjectScripting.cpp
+++ b/lldb/source/Commands/CommandObjectScripting.cpp
@@ -254,7 +254,7 @@ 
CommandObjectMultiwordScripting::CommandObjectMultiwordScripting(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(
   interpreter, "scripting",
-  "Commands for operating on the scripting functionnalities.",
+  "Commands for operating on the scripting functionalities.",
   "scripting  []") {
   LoadSubCommand("run",
  CommandObjectSP(new CommandObjectScriptingRun(interpreter)));
diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index df906e9d7c808f..4276d9e7f9c8b0 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -1199,7 +1199,7 @@ let Command = "thread trace dump instructions" in {
   def thread_trace_dump_instruction_only_events : Option<"only-events", "E">,
 Group<1>,
 Desc<"Dump only the events that happened during the execution of the "
-"target. No instrutions are dumped.">;
+"target. No instructions are dumped.">;
   def thread_trace_dump_instructions_continue: Option<"continue", "C">,
 Group<1>,
 Desc<"Continue dumping instructions right where the previous invocation of 
"
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index b93f47a8a8d5ec..acd592c3bd2dbc 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -797,7 +797,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   new CommandObjectRegexCommand(
   *this, "gdb-remote",
   "Connect to a process via remote GDB server.\n"
-  "If no host is specifed, localhost is assumed.\n"
+  "If no host is specified, localhost is assumed.\n"
   "gdb-remote is an abbreviation for 'process connect --plugin "
   "gdb-remote connect://:'\n",
   "gdb-remote [:]", 0, false));
diff --git a/lldb/source/Target/TargetProperties.td 
b/lldb/source/Target/TargetProperties.td
index 0f68deb543f90e..fb61478fb752dc 100644
--- a/lldb/source/Target/TargetProperties.td
+++ b/lldb/source/Target/TargetProperties.td
@@ -235,7 +235,7 @@ let Definition = "process" in {
   def DisableLangRuntimeUnwindPlans: 
Property<"disable-language-runtime-unwindplans", "Boolean">,
 Global,
 DefaultFalse,
-Desc<"If true, language runtime augmented/overidden backtraces will not be 
used when printing a stack trace.">;
+Desc<"If true, language runtime augmented/overridden backtraces will not 
be used when printing a stack trace.">;
   def DetachKeepsStopped: Property<"detach-keeps-stopped", "Boolean">,
 Global,
 DefaultFalse,

___
lldb-commits 

[Lldb-commits] [lldb] [lldb] Fix typos in various help messages. (PR #109851)

2024-09-24 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Ryan Mansfield (rjmansfield)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/109851.diff


6 Files Affected:

- (modified) lldb/source/Commands/CommandObjectFrame.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectProcess.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectScripting.cpp (+1-1) 
- (modified) lldb/source/Commands/Options.td (+1-1) 
- (modified) lldb/source/Interpreter/CommandInterpreter.cpp (+1-1) 
- (modified) lldb/source/Target/TargetProperties.td (+1-1) 


``diff
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 142f96946ed3d7..e2203292e71e20 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -1223,7 +1223,7 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(interpreter, "frame",
  "Commands for selecting and "
- "examing the current "
+ "examining the current "
  "thread's stack frames.",
  "frame  []") {
   LoadSubCommand("diagnose",
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp 
b/lldb/source/Commands/CommandObjectProcess.cpp
index 5b0f4f66f248b6..e7c7d07ad47722 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1420,7 +1420,7 @@ class CommandObjectProcessStatus : public 
CommandObjectParsed {
 
   PlatformSP platform_sp = process->GetTarget().GetPlatform();
   if (!platform_sp) {
-result.AppendError("Couldn'retrieve the target's platform");
+result.AppendError("Couldn't retrieve the target's platform");
 return;
   }
 
diff --git a/lldb/source/Commands/CommandObjectScripting.cpp 
b/lldb/source/Commands/CommandObjectScripting.cpp
index 9a1a2b63c7af0c..1f8ee0a9554ec1 100644
--- a/lldb/source/Commands/CommandObjectScripting.cpp
+++ b/lldb/source/Commands/CommandObjectScripting.cpp
@@ -254,7 +254,7 @@ 
CommandObjectMultiwordScripting::CommandObjectMultiwordScripting(
 CommandInterpreter &interpreter)
 : CommandObjectMultiword(
   interpreter, "scripting",
-  "Commands for operating on the scripting functionnalities.",
+  "Commands for operating on the scripting functionalities.",
   "scripting  []") {
   LoadSubCommand("run",
  CommandObjectSP(new CommandObjectScriptingRun(interpreter)));
diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index df906e9d7c808f..4276d9e7f9c8b0 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -1199,7 +1199,7 @@ let Command = "thread trace dump instructions" in {
   def thread_trace_dump_instruction_only_events : Option<"only-events", "E">,
 Group<1>,
 Desc<"Dump only the events that happened during the execution of the "
-"target. No instrutions are dumped.">;
+"target. No instructions are dumped.">;
   def thread_trace_dump_instructions_continue: Option<"continue", "C">,
 Group<1>,
 Desc<"Continue dumping instructions right where the previous invocation of 
"
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index b93f47a8a8d5ec..acd592c3bd2dbc 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -797,7 +797,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   new CommandObjectRegexCommand(
   *this, "gdb-remote",
   "Connect to a process via remote GDB server.\n"
-  "If no host is specifed, localhost is assumed.\n"
+  "If no host is specified, localhost is assumed.\n"
   "gdb-remote is an abbreviation for 'process connect --plugin "
   "gdb-remote connect://:'\n",
   "gdb-remote [:]", 0, false));
diff --git a/lldb/source/Target/TargetProperties.td 
b/lldb/source/Target/TargetProperties.td
index 0f68deb543f90e..fb61478fb752dc 100644
--- a/lldb/source/Target/TargetProperties.td
+++ b/lldb/source/Target/TargetProperties.td
@@ -235,7 +235,7 @@ let Definition = "process" in {
   def DisableLangRuntimeUnwindPlans: 
Property<"disable-language-runtime-unwindplans", "Boolean">,
 Global,
 DefaultFalse,
-Desc<"If true, language runtime augmented/overidden backtraces will not be 
used when printing a stack trace.">;
+Desc<"If true, language runtime augmented/overridden backtraces will not 
be used when printing a stack trace.">;
   def DetachKeepsStopped: Property<"detach-keeps-stopped", "Boolean">,
 Global,
 DefaultFalse,

``




https://github.com/llvm/llvm-project/pull/109851
___
lldb-commits mailing list
lldb-commits@lists

[Lldb-commits] [lldb] [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (PR #109853)

2024-09-24 Thread Zequan Wu via lldb-commits

https://github.com/ZequanWu created 
https://github.com/llvm/llvm-project/pull/109853

None

>From 93754d527df5e1336f63999fded1c7c906891f7f Mon Sep 17 00:00:00 2001
From: Zequan Wu 
Date: Tue, 24 Sep 2024 12:51:33 -0700
Subject: [PATCH] [lldb][NFC] Replace lldb's ValueType with llvm's

---
 .../SymbolFile/DWARF/DWARFFormValue.cpp   | 54 +--
 .../Plugins/SymbolFile/DWARF/DWARFFormValue.h | 24 +++--
 2 files changed, 34 insertions(+), 44 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index e1f73f1997e369..f58c6262349c6f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -25,7 +25,7 @@ using namespace lldb_private::plugin::dwarf;
 void DWARFFormValue::Clear() {
   m_unit = nullptr;
   m_form = dw_form_t(0);
-  m_value = ValueTypeTag();
+  m_value = ValueType();
 }
 
 bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
@@ -44,68 +44,68 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 switch (m_form) {
 case DW_FORM_addr:
   assert(m_unit);
-  m_value.value.uval =
+  m_value.uval =
   data.GetMaxU64(offset_ptr, DWARFUnit::GetAddressByteSize(m_unit));
   break;
 case DW_FORM_block1:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_data16:
-  m_value.value.uval = 16;
+  m_value.uval = 16;
   is_block = true;
   break;
 case DW_FORM_exprloc:
 case DW_FORM_block:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_string:
-  m_value.value.cstr = data.GetCStr(offset_ptr);
+  m_value.cstr = data.GetCStr(offset_ptr);
   break;
 case DW_FORM_sdata:
-  m_value.value.sval = data.GetSLEB128(offset_ptr);
+  m_value.sval = data.GetSLEB128(offset_ptr);
   break;
 case DW_FORM_strp:
 case DW_FORM_line_strp:
 case DW_FORM_sec_offset:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 4);
+  m_value.uval = data.GetMaxU64(offset_ptr, 4);
   break;
 case DW_FORM_addrx1:
 case DW_FORM_strx1:
 case DW_FORM_ref1:
 case DW_FORM_data1:
 case DW_FORM_flag:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   break;
 case DW_FORM_addrx2:
 case DW_FORM_strx2:
 case DW_FORM_ref2:
 case DW_FORM_data2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   break;
 case DW_FORM_addrx3:
 case DW_FORM_strx3:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 3);
+  m_value.uval = data.GetMaxU64(offset_ptr, 3);
   break;
 case DW_FORM_addrx4:
 case DW_FORM_strx4:
 case DW_FORM_ref4:
 case DW_FORM_data4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   break;
 case DW_FORM_data8:
 case DW_FORM_ref8:
 case DW_FORM_ref_sig8:
-  m_value.value.uval = data.GetU64(offset_ptr);
+  m_value.uval = data.GetU64(offset_ptr);
   break;
 case DW_FORM_addrx:
 case DW_FORM_loclistx:
@@ -115,7 +115,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 case DW_FORM_ref_udata:
 case DW_FORM_GNU_str_index:
 case DW_FORM_GNU_addr_index:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   break;
 case DW_FORM_ref_addr:
   assert(m_unit);
@@ -123,14 +123,14 @@ bool DWARFFormValue::ExtractValue(const 
DWARFDataExtractor &data,
 ref_addr_size = m_unit->GetAddressByteSize();
   else
 ref_addr_size = 4;
-  m_value.value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
+  m_value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
   break;
 case DW_FORM_indirect:
   m_form = static_cast(data.GetULEB128(offset_ptr));
   indirect = true;
   break;
 case DW_FORM_flag_present:
-  m_value.value.uval = 1;
+  m_value.uval = 1;
   break;
 default:
   return false;
@@ -138,9 +138,9 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
   } while (indirect);
 
   if (is_block) {
-m_value.data = data.PeekData(*offset_ptr, m_value.value.uval);
+m_value.data = data.PeekData(*offset_ptr, m_value.uval);
 if (m_value.data != nullptr) {
-  *offset_

[Lldb-commits] [lldb] [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (PR #109853)

2024-09-24 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Zequan Wu (ZequanWu)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/109853.diff


2 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (+27-27) 
- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h (+7-17) 


``diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index e1f73f1997e369..f58c6262349c6f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -25,7 +25,7 @@ using namespace lldb_private::plugin::dwarf;
 void DWARFFormValue::Clear() {
   m_unit = nullptr;
   m_form = dw_form_t(0);
-  m_value = ValueTypeTag();
+  m_value = ValueType();
 }
 
 bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
@@ -44,68 +44,68 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 switch (m_form) {
 case DW_FORM_addr:
   assert(m_unit);
-  m_value.value.uval =
+  m_value.uval =
   data.GetMaxU64(offset_ptr, DWARFUnit::GetAddressByteSize(m_unit));
   break;
 case DW_FORM_block1:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_block4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_data16:
-  m_value.value.uval = 16;
+  m_value.uval = 16;
   is_block = true;
   break;
 case DW_FORM_exprloc:
 case DW_FORM_block:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   is_block = true;
   break;
 case DW_FORM_string:
-  m_value.value.cstr = data.GetCStr(offset_ptr);
+  m_value.cstr = data.GetCStr(offset_ptr);
   break;
 case DW_FORM_sdata:
-  m_value.value.sval = data.GetSLEB128(offset_ptr);
+  m_value.sval = data.GetSLEB128(offset_ptr);
   break;
 case DW_FORM_strp:
 case DW_FORM_line_strp:
 case DW_FORM_sec_offset:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 4);
+  m_value.uval = data.GetMaxU64(offset_ptr, 4);
   break;
 case DW_FORM_addrx1:
 case DW_FORM_strx1:
 case DW_FORM_ref1:
 case DW_FORM_data1:
 case DW_FORM_flag:
-  m_value.value.uval = data.GetU8(offset_ptr);
+  m_value.uval = data.GetU8(offset_ptr);
   break;
 case DW_FORM_addrx2:
 case DW_FORM_strx2:
 case DW_FORM_ref2:
 case DW_FORM_data2:
-  m_value.value.uval = data.GetU16(offset_ptr);
+  m_value.uval = data.GetU16(offset_ptr);
   break;
 case DW_FORM_addrx3:
 case DW_FORM_strx3:
-  m_value.value.uval = data.GetMaxU64(offset_ptr, 3);
+  m_value.uval = data.GetMaxU64(offset_ptr, 3);
   break;
 case DW_FORM_addrx4:
 case DW_FORM_strx4:
 case DW_FORM_ref4:
 case DW_FORM_data4:
-  m_value.value.uval = data.GetU32(offset_ptr);
+  m_value.uval = data.GetU32(offset_ptr);
   break;
 case DW_FORM_data8:
 case DW_FORM_ref8:
 case DW_FORM_ref_sig8:
-  m_value.value.uval = data.GetU64(offset_ptr);
+  m_value.uval = data.GetU64(offset_ptr);
   break;
 case DW_FORM_addrx:
 case DW_FORM_loclistx:
@@ -115,7 +115,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
 case DW_FORM_ref_udata:
 case DW_FORM_GNU_str_index:
 case DW_FORM_GNU_addr_index:
-  m_value.value.uval = data.GetULEB128(offset_ptr);
+  m_value.uval = data.GetULEB128(offset_ptr);
   break;
 case DW_FORM_ref_addr:
   assert(m_unit);
@@ -123,14 +123,14 @@ bool DWARFFormValue::ExtractValue(const 
DWARFDataExtractor &data,
 ref_addr_size = m_unit->GetAddressByteSize();
   else
 ref_addr_size = 4;
-  m_value.value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
+  m_value.uval = data.GetMaxU64(offset_ptr, ref_addr_size);
   break;
 case DW_FORM_indirect:
   m_form = static_cast(data.GetULEB128(offset_ptr));
   indirect = true;
   break;
 case DW_FORM_flag_present:
-  m_value.value.uval = 1;
+  m_value.uval = 1;
   break;
 default:
   return false;
@@ -138,9 +138,9 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor 
&data,
   } while (indirect);
 
   if (is_block) {
-m_value.data = data.PeekData(*offset_ptr, m_value.value.uval);
+m_value.data = data.PeekData(*offset_ptr, m_value.uval);
 if (m_value.data != nullptr) {
-  *offset_ptr += m_value.value.uval;
+  *offset_ptr += m_value.uval;
 }
   }
 
@@ -461,23 +461,23 @@ const char *DWARFFormValue::A

[Lldb-commits] [lldb] [llvm] [lldb]Implement LLDB Telemetry (PR #98528)

2024-09-24 Thread Vy Nguyen via lldb-commits

https://github.com/oontvoo ready_for_review 
https://github.com/llvm/llvm-project/pull/98528
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix vFile:open, vFile:unlink error codes (PR #106950)

2024-09-24 Thread Jason Molenda via lldb-commits

https://github.com/jasonmolenda approved this pull request.

Sorry for the delay in reviewing, this looks good to me, thanks for doing this.

https://github.com/llvm/llvm-project/pull/106950
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan updated 
https://github.com/llvm/llvm-project/pull/99736

>From 4bc3e8453a2fffa7c444ed9aa4bdc51e8e54569f Mon Sep 17 00:00:00 2001
From: Robert O'Callahan 
Date: Fri, 19 Jul 2024 22:46:42 +1200
Subject: [PATCH] [lldb] Implement basic support for reverse-continue

This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command
for this will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`)
providing support for the `bc` and `bs` packets. `lldb-server`
does not support those packets, and there is no plan to change that.
So, for testing purposes, `lldbreverse.py` wraps `lldb-server`
with a Python implementation of *very limited* record-and-replay
functionality.
---
 lldb/include/lldb/API/SBProcess.h |   1 +
 lldb/include/lldb/Target/Process.h|  21 +-
 lldb/include/lldb/Target/StopInfo.h   |   6 +
 lldb/include/lldb/lldb-enumerations.h |   6 +
 .../Python/lldbsuite/test/gdbclientutils.py   |   5 +-
 .../Python/lldbsuite/test/lldbgdbproxy.py | 175 
 .../Python/lldbsuite/test/lldbreverse.py  | 418 ++
 .../Python/lldbsuite/test/lldbtest.py |   2 +
 lldb/source/API/SBProcess.cpp |   8 +-
 lldb/source/API/SBThread.cpp  |   2 +
 .../source/Interpreter/CommandInterpreter.cpp |   3 +-
 .../Process/Linux/NativeThreadLinux.cpp   |   3 +
 .../Process/MacOSX-Kernel/ProcessKDP.cpp  |   9 +-
 .../Process/MacOSX-Kernel/ProcessKDP.h|   2 +-
 .../Process/Windows/Common/ProcessWindows.cpp |   8 +-
 .../Process/Windows/Common/ProcessWindows.h   |   2 +-
 .../GDBRemoteCommunicationClient.cpp  |  22 +
 .../gdb-remote/GDBRemoteCommunicationClient.h |   6 +
 .../GDBRemoteCommunicationServerLLGS.cpp  |   1 +
 .../Process/gdb-remote/ProcessGDBRemote.cpp   |  77 +++-
 .../Process/gdb-remote/ProcessGDBRemote.h |   2 +-
 .../Process/scripted/ScriptedProcess.cpp  |   9 +-
 .../Process/scripted/ScriptedProcess.h|   2 +-
 lldb/source/Target/Process.cpp|  29 +-
 lldb/source/Target/StopInfo.cpp   |  29 ++
 lldb/source/Target/Thread.cpp |   8 +-
 .../reverse-execution/Makefile|   3 +
 .../TestReverseContinueBreakpoints.py | 115 +
 .../TestReverseContinueNotSupported.py|  30 ++
 .../functionalities/reverse-execution/main.c  |  14 +
 lldb/tools/lldb-dap/JSONUtils.cpp |   3 +
 lldb/tools/lldb-dap/LLDBUtils.cpp |   1 +
 32 files changed, 978 insertions(+), 44 deletions(-)
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbgdbproxy.py
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbreverse.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/Makefile
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueNotSupported.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/main.c

diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index 1624e02070b1b2..8b8ed830b54cc0 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -159,6 +159,7 @@ class LLDB_API SBProcess {
   lldb::SBError Destroy();
 
   lldb::SBError Continue();
+  lldb::SBError Continue(RunDirection direction);
 
   lldb::SBError Stop();
 
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index b8c53a474ba6b9..fe7fbc50fd5770 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -857,10 +857,10 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  Status Resume();
+  Status Resume(lldb::RunDirection direction = lldb::eRunForward);
 
   /// Resume a process, and wait for it to stop.
-  Status ResumeSynchronous(Stream *stream);
+  Status ResumeSynchronous(Stream *stream, lldb::RunDirection direction = 
lldb::eRunForward);
 
   /// Halts a running process.
   ///
@@ -1104,9 +1104,14 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  virtual Status DoResume() {
-return Status::FromErrorStringWithFormatv(
-"error: {0} does not support resuming processes", GetPluginName());
+  virtual Status DoResume(lldb::RunDirection direction) {
+if (direction == lldb::RunDirection::eRunForward) {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support resuming processes", GetPluginName());
+} else {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support reverse execution of processes", 
GetPluginName());
+}
   }
 
   /// Called after resuming a process.
@

[Lldb-commits] [lldb] Add warning message to `session save` when transcript isn't saved. (PR #109020)

2024-09-24 Thread via lldb-commits


@@ -3306,6 +3306,8 @@ bool CommandInterpreter::SaveTranscript(
   result.SetStatus(eReturnStatusSuccessFinishNoResult);
   result.AppendMessageWithFormat("Session's transcripts saved to %s\n",
  output_file->c_str());
+  if (!GetSaveTranscript())
+result.AppendError("Note: the setting interpreter.save-transcript is set 
to false, so the transcript might not have been recorded.");

jeffreytan81 wrote:

Hmm, one would argue that when `interpreter.save-transcript` is set to false, 
it should clear any internal buffer because the name 
`interpreter.save-transcript = false` implies it should not save transcript. 

For the current behavior, `interpreter.save-transcript` should be renamed to 
"stop-record-commands" or something like this. 

Not say it is important or I care though. 

https://github.com/llvm/llvm-project/pull/109020
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits

rocallahan wrote:

I see @clayborg still has a "change requested" hold on this PR. As far as I can 
tell all his comments have been addressed.

https://github.com/llvm/llvm-project/pull/99736
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][NFC] Replace lldb's DWARFFormValue::ValueType with llvm's (PR #109853)

2024-09-24 Thread Alex Langford via lldb-commits

https://github.com/bulbazord approved this pull request.

LGTM. One thing to note is that llvm's ValueType struct has an additional 
uint64_t element for a section index. I wonder if LLDB can make use of that 
element for something useful after some additional refactors?

https://github.com/llvm/llvm-project/pull/109853
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang updated 
https://github.com/llvm/llvm-project/pull/104589

>From c6962437499858643b8112bcc1c7d155d3c588a9 Mon Sep 17 00:00:00 2001
From: Adrian Vogelsgesang 
Date: Mon, 12 Aug 2024 14:53:31 +
Subject: [PATCH 1/4] [lldb-dap] Implement value locations for function
 pointers

This commit adds `valueLocationReference` to function pointers and
function references. Thereby, users can navigate directly to the
pointed-to function from within the "variables" pane.

In general, it would be useful to also a similar location references
also to member function pointers, `std::source_location`,
`std::function`,  and many more. Doing so would require extending the
formatters to provide such a source code location.

There were two RFCs about this a while ago:
https://discourse.llvm.org/t/rfc-extending-formatters-with-a-source-code-reference/68375
https://discourse.llvm.org/t/rfc-sbvalue-metadata-provider/68377/26

However, both RFCs ended without a conclusion. As such, this commit now
solve the lowest-hanging fruit, i.e. function pointers. If people find
it useful, I will revive the RFC afterwards.
---
 .../API/tools/lldb-dap/locations/Makefile |   2 +-
 .../lldb-dap/locations/TestDAP_locations.py   |  49 +++-
 lldb/test/API/tools/lldb-dap/locations/main.c |   5 -
 .../API/tools/lldb-dap/locations/main.cpp |  11 ++
 lldb/tools/lldb-dap/JSONUtils.cpp |  33 -
 lldb/tools/lldb-dap/JSONUtils.h   |   3 +
 lldb/tools/lldb-dap/lldb-dap.cpp  | 113 +-
 7 files changed, 176 insertions(+), 40 deletions(-)
 delete mode 100644 lldb/test/API/tools/lldb-dap/locations/main.c
 create mode 100644 lldb/test/API/tools/lldb-dap/locations/main.cpp

diff --git a/lldb/test/API/tools/lldb-dap/locations/Makefile 
b/lldb/test/API/tools/lldb-dap/locations/Makefile
index 10495940055b63..8b20bcb050 100644
--- a/lldb/test/API/tools/lldb-dap/locations/Makefile
+++ b/lldb/test/API/tools/lldb-dap/locations/Makefile
@@ -1,3 +1,3 @@
-C_SOURCES := main.c
+CXX_SOURCES := main.cpp
 
 include Makefile.rules
diff --git a/lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py 
b/lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py
index 76d938d3908492..45f836a2fa3c39 100644
--- a/lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py
+++ b/lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py
@@ -19,11 +19,11 @@ def test_locations(self):
 """
 program = self.getBuildArtifact("a.out")
 self.build_and_launch(program)
-source = "main.c"
+source = "main.cpp"
 self.source_path = os.path.join(os.getcwd(), source)
 self.set_source_breakpoints(
 source,
-[line_number(source, "// BREAK HERE")],
+[line_number(source, "break here")],
 )
 self.continue_to_next_stop()
 
@@ -36,5 +36,46 @@ def test_locations(self):
 locals["var1"]["declarationLocationReference"]
 )
 self.assertTrue(loc_var1["success"])
-self.assertTrue(loc_var1["body"]["source"]["path"].endswith("main.c"))
-self.assertEqual(loc_var1["body"]["line"], 2)
+
self.assertTrue(loc_var1["body"]["source"]["path"].endswith("main.cpp"))
+self.assertEqual(loc_var1["body"]["line"], 6)
+
+# func_ptr has both a declaration and a valueLocation
+self.assertIn("declarationLocationReference", 
locals["func_ptr"].keys())
+self.assertIn("valueLocationReference", locals["func_ptr"].keys())
+decl_loc_func_ptr = self.dap_server.request_locations(
+locals["func_ptr"]["declarationLocationReference"]
+)
+self.assertTrue(decl_loc_func_ptr["success"])
+self.assertTrue(
+decl_loc_func_ptr["body"]["source"]["path"].endswith("main.cpp")
+)
+self.assertEqual(decl_loc_func_ptr["body"]["line"], 7)
+val_loc_func_ptr = self.dap_server.request_locations(
+locals["func_ptr"]["valueLocationReference"]
+)
+self.assertTrue(val_loc_func_ptr["success"])
+
self.assertTrue(val_loc_func_ptr["body"]["source"]["path"].endswith("main.cpp"))
+self.assertEqual(val_loc_func_ptr["body"]["line"], 3)
+
+# func_ref has both a declaration and a valueLocation
+self.assertIn("declarationLocationReference", 
locals["func_ref"].keys())
+self.assertIn("valueLocationReference", locals["func_ref"].keys())
+decl_loc_func_ref = self.dap_server.request_locations(
+locals["func_ref"]["declarationLocationReference"]
+)
+self.assertTrue(decl_loc_func_ref["success"])
+self.assertTrue(
+decl_loc_func_ref["body"]["source"]["path"].endswith("main.cpp")
+)
+self.assertEqual(decl_loc_func_ref["body"]["line"], 8)
+val_loc_func_ref = self.dap_server.request_locations(
+locals["func_ref"]["valueLocationReference"]
+)
+s

[Lldb-commits] [lldb] [lldb-dap] Simplify `readMemory` (PR #109485)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

vogelsgesang wrote:

>  I looked into this (for way longer than it should have been necessary), and 
> I tracked it down to a somewhat embarrassing bug

Thanks for looking into this. It would certainly have taken me much longer. I 
will rebase on top of your commit, after your fix is merged, and then merge 
this pull request as soon as the test cases are green on Github

https://github.com/llvm/llvm-project/pull/109485
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Simplify `readMemory` (PR #109485)

2024-09-24 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang edited 
https://github.com/llvm/llvm-project/pull/109485
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits