[Lldb-commits] [lldb] [lldb] Fix race condition in Process::WaitForProcessToStop() (PR #144919)

2025-09-03 Thread via lldb-commits

athierry-oct wrote:

Sorry for the long delay, I'm back from vacation and tackling this issue in 
parallel with other tasks.

I've started investigating the other failing tests (such as the DAP tests). For 
all failing tests, it seems essentially the root cause is the same: moving 
events between primary and hijacked listeners exposes places where events were 
left unprocessed in the primary listener or hijack listener queue. 

Focusing first on `EvaluateExpression()` and `TestCallThatRestarts`, the test 
failure is due to a stop event being rebroadcast to the primary listener when 
the process stops during expression evaluation, and then being unexpectedly 
consumed by `process.Continue()` (see previous messages)
To solve this, at first I thought maybe this stop event should be manually 
consumed in the test after the call to `frame.EvaluateExpression()` and before 
the call to `process.Continue()`
But now I'm realizing, since the tests are running in sync mode without an 
event loop, it seems this event should not have to be handled explicitly by the 
user (ie. the python test script in our case). 

I also came across the code of `SBDebugger::HandleCommand()`, and noticed that 
in sync mode it consumes events after running the command:

```cpp
void SBDebugger::HandleCommand(const char *command) {
  LLDB_INSTRUMENT_VA(this, command);

  ... // Handle the command

   // In sync mode, consume events produced by the command

if (!m_opaque_sp->GetAsyncExecution()) {
  SBProcess process(GetCommandInterpreter().GetProcess());
  ProcessSP process_sp(process.GetSP());
  if (process_sp) {
EventSP event_sp;
ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
while (lldb_listener_sp->GetEventForBroadcaster(
process_sp.get(), event_sp, std::chrono::seconds(0))) {
  SBEvent event(event_sp);
  HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile());
}
  }
}
  }
}
```

Would it make sense to do something similar for `SBFrame::EvaluateExpression()` 
? This way, events would still be handled transparently when evaluating an 
expression in sync mode.


https://github.com/llvm/llvm-project/pull/144919
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llldb][test] Mark a DWO test unsupported on Darwin and Windows (PR #156306)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)


Changes

This uses split DWARF and from looking at other tests, it should not be running 
on Darwin or Windows.

It does pass using the DIA PDB plugin but I think this is misleading because 
it's not actually testing the intended feature.

When the native PDB plugin is used it fails because it cannot set a breakpoint.

I don't see a point to running this test on Windows at all.

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


1 Files Affected:

- (modified) 
lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test (+3) 


``diff
diff --git 
a/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test 
b/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
index 6e4deae7b9a0d..40d5e90097eb6 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
+++ b/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
@@ -4,6 +4,9 @@
 # a DW_TAG_variable DIE, whose parent DIE is only
 # a forward declaration.
 
+# UNSUPPORTED: system-darwin
+# UNSUPPORTED: system-windows
+
 # RUN: %clangxx_host %S/Inputs/dwo-static-data-member.cpp \
 # RUN:   -g -gdwarf-5 -gsplit-dwarf -flimit-debug-info -o %t
 # RUN: %lldb %t -s %s -o exit 2>&1 | FileCheck %s

``




https://github.com/llvm/llvm-project/pull/156306
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits

felipepiovezan wrote:

Sorry for the delay, long weekend here in the US.

Ok, I think I finally got it working, mostly? I was facing two issues: 1) `v` 
gets confused by what we were doing, but `expr` doesn't; 2) Older versions of 
LLDB would fail to find the symbol -- even with expr -- after `target symbol 
add...`

So I have this:

```
{
"triple": "arm64e-apple-macosx13.0.0",
"uuid": "C8576DD6-9D22-48ED-9890-FB216DEE329F",
"type": "executable",
"sections": [
{   
"name": "__DATA",
"type": "data",
"address": 1297224342667202580,
"size": 16
}   
],  
"symbols": [
{
"name": "myglobal_json",
"size": 8,
"type": "data",
"address": 1297224342667202580
}   
]   
}
```

And this main.c:

```
#include 
#include 
#include 


int myglobal = 0;

uint64_t get_high_bits(void *ptr) {
  uint64_t mask = ~((1ULL << 48) - 1);
  uint64_t ptrtoint = (uint64_t)ptr;
  uint64_t high_bits = ptrtoint & mask;
  printf("Higher bits are = %llx\n", high_bits);
  return high_bits;
}

int main (){
  int x = 42;
  assert(0 == get_high_bits(&x));
  assert(0 == get_high_bits(&myglobal));
  return 0; //breakhere
}
```

The contents of main are irrelevant here, more of a sanity check (the second 
assert should fail on an arm64e target).

So we load the json file, add the new symbol (I opted for a new symbol instead 
of overwriting the existing one), and run it through the expression evaluator.
WITHOUT this patch, this is what we get:

```
(lldb) target module add test.json
(lldb) expr &myglobal_json
(void **) $2 = 0x1200aaab1014
(lldb) expr get_high_bits(&myglobal_json)
Higher bits are = 1200
(uint64_t) $3 = 1297036692682702848
```

WITH this patch:

```
(lldb) target module add test.json
(lldb) expr &myglobal_json
(void **) $2 = 0x2aab1014
(lldb) expr get_high_bits(&myglobal_json)
Higher bits are = 0
(uint64_t) $3 = 0
```

This looks like what we expect, right? If so, I will go ahead and try to make 
this into an API test!

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Use weak pointers instead of shared pointers in DynamicLoader (PR #156446)

2025-09-03 Thread Andrew Savonichev via lldb-commits

asavonic wrote:

@jimingham, @JDevlieghere, thanks to your suggestions in #147289, I was able to 
use existing LLDB API to completely release some modules from the cache, but 
keep other modules intact. However, this approach did not work completely, 
because `DynamicLoaderWindowsDYLD` kept modules from being released. The patch 
is supposed to address this problem. I think it is a corner case, because 
normally modules should be released when they are unloaded. In any case, I 
think using weak pointers here makes sense.

https://github.com/llvm/llvm-project/pull/156446
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DataFormatter] Allow std::string formatters to match against custom allocators (PR #156050)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/156050

>From 35999d8d509864795dd36565d12ddea425a98c22 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Fri, 29 Aug 2025 16:57:35 +0100
Subject: [PATCH 1/2] [lldb][DataFormatter] Allow std::string formatters to
 match against custom allocators

This came up in https://github.com/llvm/llvm-project/issues/155691.

For `std::basic_string` our formatter matching logic required the
allocator template parameter to be a `std::allocator`. There is no
compelling reason (that I know of) why this would be required for us to
apply the existing formatter to the string. We don't check the
`allocator` parameter for other STL containers either. This meant that
`std::string` that used custom allocators wouldn't be formatted. This
patch relaxes the regex for `basic_string`.
---
 .../Language/CPlusPlus/CPlusPlusLanguage.cpp  | 15 --
 .../string/TestDataFormatterStdString.py  |  6 
 .../generic/string/main.cpp   | 30 +++
 3 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index c39b529f7305a..ad3c00a1132d4 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -749,31 +749,27 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP 
cpp_category_sp) {
 lldb_private::formatters::LibcxxStringSummaryProviderASCII,
 "std::string summary provider",
 "^std::__[[:alnum:]]+::basic_string, "
-"std::__[[:alnum:]]+::allocator >$",
+"std::__[[:alnum:]]+::char_traits,.*>$",
 stl_summary_flags, true);
   AddCXXSummary(cpp_category_sp,
 lldb_private::formatters::LibcxxStringSummaryProviderASCII,
 "std::string summary provider",
 "^std::__[[:alnum:]]+::basic_string, "
-"std::__[[:alnum:]]+::allocator >$",
+"std::__[[:alnum:]]+::char_traits,.*>$",
 stl_summary_flags, true);
 
   AddCXXSummary(cpp_category_sp,
 lldb_private::formatters::LibcxxStringSummaryProviderUTF16,
 "std::u16string summary provider",
 "^std::__[[:alnum:]]+::basic_string, "
-"std::__[[:alnum:]]+::allocator >$",
+"std::__[[:alnum:]]+::char_traits,.*>$",
 stl_summary_flags, true);
 
   AddCXXSummary(cpp_category_sp,
 lldb_private::formatters::LibcxxStringSummaryProviderUTF32,
 "std::u32string summary provider",
 "^std::__[[:alnum:]]+::basic_string, "
-"std::__[[:alnum:]]+::allocator >$",
+"std::__[[:alnum:]]+::char_traits,.*>$",
 stl_summary_flags, true);
 
   AddCXXSummary(cpp_category_sp,
@@ -784,8 +780,7 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP 
cpp_category_sp) {
 lldb_private::formatters::LibcxxWStringSummaryProvider,
 "std::wstring summary provider",
 "^std::__[[:alnum:]]+::basic_string, "
-"std::__[[:alnum:]]+::allocator >$",
+"std::__[[:alnum:]]+::char_traits,.*>$",
 stl_summary_flags, true);
 
   AddCXXSummary(cpp_category_sp,
diff --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/TestDataFormatterStdString.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/TestDataFormatterStdString.py
index fec20bae997ef..6a27b5d2f0780 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/TestDataFormatterStdString.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/TestDataFormatterStdString.py
@@ -80,6 +80,8 @@ def cleanup():
 '(%s::string) Q = "quite a long std::strin with lots of info 
inside it"'
 % ns,
 "(%s::string *) null_str = nullptr" % ns,
+'(CustomString) custom_str = "hello!"',
+'(CustomWString) custom_wstr = L"hello!"',
 ],
 )
 
@@ -143,6 +145,10 @@ def do_test_multibyte(self):
 '(%s::u16string) u16_empty = u""' % ns,
 '(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
 '(%s::u32string) u32_empty = U""' % ns,
+'(CustomStringU16) custom_u16 = u"ß水氶"',
+'(CustomStringU16) custom_u16_empty = u""',
+'(CustomStringU32) custom_u32 = U"🍄🍅🍆🍌"',
+'(CustomStringU32) custom_u32_empty = U""',
 ],
 )
 
diff --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/main.cpp
 
b/lldb/test/API/functionalities/data-formatter/data-formatter

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-03 Thread Tom Eccles via lldb-commits

https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/156270
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Destroy debugger when debug session terminates (PR #156231)

2025-09-03 Thread via lldb-commits

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

lgtm just need to clear the test error

https://github.com/llvm/llvm-project/pull/156231
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test] Use lld on Windows in frame format test (PR #156320)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)


Changes

link.exe discards DWARF information. Other linkers on non-Windows do not.

Uses the same solution as TestFrameFunctionInlined.test.

This test was failing with the native PDB plugin but shouldn't have been using 
PDB anyway (see #114906). Passes with DWARF and lld.

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


1 Files Affected:

- (modified) lldb/test/Shell/Settings/TestFrameFormatFunctionReturnObjC.test 
(+4-1) 


``diff
diff --git a/lldb/test/Shell/Settings/TestFrameFormatFunctionReturnObjC.test 
b/lldb/test/Shell/Settings/TestFrameFormatFunctionReturnObjC.test
index 2692c3d9c3e70..55487235ae8cb 100644
--- a/lldb/test/Shell/Settings/TestFrameFormatFunctionReturnObjC.test
+++ b/lldb/test/Shell/Settings/TestFrameFormatFunctionReturnObjC.test
@@ -2,8 +2,11 @@
 # ${function.return-right} in languages that don't implement this frame
 # format variable (in this case Objective-C).
 #
+# link.exe will discard DWARF information.
+# REQUIRES: (system-windows && lld) || !system-windows
+#
 # RUN: split-file %s %t
-# RUN: %clang_host -g -gdwarf %t/main.m -o %t.objc.out
+# RUN: %clang_host -g -gdwarf %t/main.m -o %t.objc.out %if system-windows 
%{-fuse-ld=lld%}
 # RUN: %lldb -x -b -s %t/commands.input %t.objc.out -o exit 2>&1 \
 # RUN:   | FileCheck %s
 

``




https://github.com/llvm/llvm-project/pull/156320
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Complete constant array member types in class members (PR #156370)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Actually, what you want to do is probably just call 
`TypeSystemClang::RequireCompleteType` on the element type. This is basically 
what the PDB plugin does:
```
https://github.com/llvm/llvm-project/blob/6042e090fac8b06d64666348fe4ca6ca6e4f77db/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp#L685-L695
```

But I suspect this code came before `RequireCompleteType` got introduced. We 
can probably just change the PDB plugin to call `RequireCompleteType` instead 
too. Though Since we're removing that plugin anyway, leaving it as-is is fine 
too.

https://github.com/llvm/llvm-project/pull/156370
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add unary plus and minus to DIL (PR #155617)

2025-09-03 Thread Ilia Kuklin via lldb-commits

https://github.com/kuilpd updated 
https://github.com/llvm/llvm-project/pull/155617

>From 4d14bbb31d0411c45b95778d1659ccc416165be1 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin 
Date: Mon, 4 Aug 2025 19:11:55 +0500
Subject: [PATCH 1/6] [LLDB] Add unary plus and minus to DIL

---
 lldb/include/lldb/ValueObject/DILAST.h|   2 +
 lldb/source/ValueObject/DILEval.cpp   | 155 --
 lldb/source/ValueObject/DILLexer.cpp  |   1 -
 lldb/source/ValueObject/DILParser.cpp |  10 +-
 .../frame/var-dil/expr/Arithmetic/Makefile|   3 +
 .../Arithmetic/TestFrameVarDILArithmetic.py   |  40 +
 .../frame/var-dil/expr/Arithmetic/main.cpp|   9 +
 7 files changed, 203 insertions(+), 17 deletions(-)
 create mode 100644 
lldb/test/API/commands/frame/var-dil/expr/Arithmetic/Makefile
 create mode 100644 
lldb/test/API/commands/frame/var-dil/expr/Arithmetic/TestFrameVarDILArithmetic.py
 create mode 100644 
lldb/test/API/commands/frame/var-dil/expr/Arithmetic/main.cpp

diff --git a/lldb/include/lldb/ValueObject/DILAST.h 
b/lldb/include/lldb/ValueObject/DILAST.h
index 1d10755c46e39..900eb8a792a1e 100644
--- a/lldb/include/lldb/ValueObject/DILAST.h
+++ b/lldb/include/lldb/ValueObject/DILAST.h
@@ -32,6 +32,8 @@ enum class NodeKind {
 enum class UnaryOpKind {
   AddrOf, // "&"
   Deref,  // "*"
+  Minus,  // "-"
+  Plus,   // "+"
 };
 
 /// Forward declaration, for use in DIL AST nodes. Definition is at the very
diff --git a/lldb/source/ValueObject/DILEval.cpp 
b/lldb/source/ValueObject/DILEval.cpp
index c6cf41ee9e9ee..595c25085bfed 100644
--- a/lldb/source/ValueObject/DILEval.cpp
+++ b/lldb/source/ValueObject/DILEval.cpp
@@ -21,6 +21,73 @@
 
 namespace lldb_private::dil {
 
+static CompilerType GetBasicTypeFromCU(std::shared_ptr ctx,
+   lldb::BasicType basic_type) {
+  SymbolContext symbol_context =
+  ctx->GetSymbolContext(lldb::eSymbolContextCompUnit);
+  auto language = symbol_context.comp_unit->GetLanguage();
+
+  symbol_context = ctx->GetSymbolContext(lldb::eSymbolContextModule);
+  auto type_system =
+  symbol_context.module_sp->GetTypeSystemForLanguage(language);
+
+  if (type_system)
+if (auto compiler_type = 
type_system.get()->GetBasicTypeFromAST(basic_type))
+  return compiler_type;
+
+  return CompilerType();
+}
+
+static CompilerType GetIntCompilerTypeForSize(uint32_t size, bool is_signed,
+  lldb::TypeSystemSP type_system,
+  std::shared_ptr ctx) 
{
+  lldb::BasicType promote_types[] = {
+  // lldb::eBasicTypeChar, lldb::eBasicTypeUnsignedChar,
+  // lldb::eBasicTypeShort,lldb::eBasicTypeUnsignedShort,
+  lldb::eBasicTypeInt,  lldb::eBasicTypeUnsignedInt,
+  lldb::eBasicTypeLong, lldb::eBasicTypeUnsignedLong,
+  lldb::eBasicTypeLongLong, lldb::eBasicTypeUnsignedLongLong,
+  };
+  for (auto &basic_type : promote_types) {
+uint64_t byte_size = 0;
+CompilerType type = GetBasicType(type_system, basic_type);
+if (auto temp = type.GetByteSize(ctx.get()))
+  byte_size = *temp;
+if (size < byte_size ||
+(size == byte_size &&
+ is_signed == (bool)(type.GetTypeInfo() & lldb::eTypeIsSigned))) {
+  return type;
+}
+  }
+
+  llvm_unreachable("size could not fit into long long");
+  return CompilerType();
+}
+
+static llvm::Expected
+GetScalarFromValueObject(lldb::ValueObjectSP valobj,
+ std::shared_ptr ctx) {
+  auto type = valobj->GetCompilerType();
+  Scalar scalar;
+  bool resolved = valobj->ResolveValue(scalar);
+  if (resolved) {
+if (scalar.GetType() == scalar.e_int) {
+  auto apsint = scalar.GetAPSInt();
+  auto type_bitsize = type.GetBitSize(ctx.get());
+  if (type_bitsize) {
+llvm::APSInt adjusted;
+if (type.IsSigned())
+  adjusted = apsint.sextOrTrunc(*type_bitsize);
+else
+  adjusted = apsint.zextOrTrunc(*type_bitsize);
+return Scalar(adjusted);
+  }
+} else
+  return scalar;
+  }
+  return Scalar();
+}
+
 static lldb::VariableSP DILFindVariable(ConstString name,
 VariableList &variable_list) {
   lldb::VariableSP exact_match;
@@ -175,21 +242,21 @@ Interpreter::Visit(const IdentifierNode *node) {
 llvm::Expected
 Interpreter::Visit(const UnaryOpNode *node) {
   Status error;
-  auto rhs_or_err = Evaluate(node->GetOperand());
-  if (!rhs_or_err)
-return rhs_or_err;
+  auto op_or_err = Evaluate(node->GetOperand());
+  if (!op_or_err)
+return op_or_err;
 
-  lldb::ValueObjectSP rhs = *rhs_or_err;
+  lldb::ValueObjectSP operand = *op_or_err;
 
   switch (node->GetKind()) {
   case UnaryOpKind::Deref: {
-lldb::ValueObjectSP dynamic_rhs = rhs->GetDynamicValue(m_use_dynamic);
-if (dynamic_rhs)
-  rhs = dynamic_rhs;
+lldb::ValueObjectSP dynamic_op = operand->GetDynamicValue(m_use_dynamic);
+if (dyna

[Lldb-commits] [clang] [lldb] [llvm] [lldb][Expression] Add structor variant to LLDB's function call labels (PR #149827)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/149827

>From 5d75d1679d492df1a72c4013afde052f7b6195dd Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Mon, 18 Aug 2025 15:12:45 +0100
Subject: [PATCH 1/6] [llvm][DebugInfo] Support DW_AT_linkage_names that are
 different between declaration and definition

(cherry picked from commit 62641a7cc6b439c747be0a9ae91b9b266d67816e)
---
 llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp |  7 +-
 .../structor-declaration-linkage-names.ll | 68 +++
 2 files changed, 70 insertions(+), 5 deletions(-)
 create mode 100644 
llvm/test/DebugInfo/Generic/structor-declaration-linkage-names.ll

diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp 
b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index b03fac2d22a52..4904ad03199c7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1403,11 +1403,8 @@ bool 
DwarfUnit::applySubprogramDefinitionAttributes(const DISubprogram *SP,
 
   // Add the linkage name if we have one and it isn't in the Decl.
   StringRef LinkageName = SP->getLinkageName();
-  assert(((LinkageName.empty() || DeclLinkageName.empty()) ||
-  LinkageName == DeclLinkageName) &&
- "decl has a linkage name and it is different");
-  if (DeclLinkageName.empty() &&
-  // Always emit it for abstract subprograms.
+  // Always emit linkage name for abstract subprograms.
+  if (DeclLinkageName != LinkageName &&
   (DD->useAllLinkageNames() || DU->getAbstractScopeDIEs().lookup(SP)))
 addLinkageName(SPDie, LinkageName);
 
diff --git a/llvm/test/DebugInfo/Generic/structor-declaration-linkage-names.ll 
b/llvm/test/DebugInfo/Generic/structor-declaration-linkage-names.ll
new file mode 100644
index 0..9b1f2a5b2a186
--- /dev/null
+++ b/llvm/test/DebugInfo/Generic/structor-declaration-linkage-names.ll
@@ -0,0 +1,68 @@
+; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-info - | 
FileCheck %s
+
+; Make sure we attach DW_AT_linkage_name on function declarations but only
+; attach it on definitions if the value is different than on the declaration.
+
+target triple = "arm64-apple-macosx"
+
+define void @_Z11SameLinkagev() !dbg !4 {
+entry:
+  ret void
+}
+
+; CHECK: DW_AT_linkage_name ("_Z11SameLinkagev")
+; CHECK: DW_AT_declaration (true)
+; CHECK-NOT: DW_AT_linkage_name ("_Z11SameLinkagev")
+
+define void @_Z11DiffLinkagev() !dbg !8 {
+entry:
+  ret void
+}
+
+; CHECK: DW_AT_linkage_name ("SomeName")
+; CHECK: DW_AT_declaration (true)
+; CHECK: DW_AT_linkage_name ("_Z11DiffLinkagev")
+
+define void @_Z15EmptyDefLinkagev() !dbg !10 {
+entry:
+  ret void
+}
+
+; CHECK: DW_AT_linkage_name ("_Z15EmptyDefLinkagev")
+; CHECK: DW_AT_declaration (true)
+; CHECK-NOT: DW_AT_linkage_name
+
+define void @_Z16EmptyDeclLinkagev() !dbg !12 {
+entry:
+  ret void
+}
+
+; CHECK: DW_AT_declaration (true)
+; CHECK: DW_AT_linkage_name ("_Z16EmptyDeclLinkagev")
+
+define void @_Z13EmptyLinkagesv() !dbg !14 {
+entry:
+  ret void
+}
+
+; CHECK-NOT: DW_AT_linkage_name
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!2, !3}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, 
producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 
FullDebug, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")
+!1 = !DIFile(filename: "foo.cpp", directory: "/tmp")
+!2 = !{i32 7, !"Dwarf Version", i32 5}
+!3 = !{i32 2, !"Debug Info Version", i32 3}
+!4 = distinct !DISubprogram(name: "SameLinkage", linkageName: 
"_Z11SameLinkagev", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, 
flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !7)
+!5 = !DISubroutineType(types: !6)
+!6 = !{null}
+!7 = !DISubprogram(name: "SameLinkage", linkageName: "_Z11SameLinkagev", 
scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, 
spFlags: 0)
+!8 = distinct !DISubprogram(name: "DiffLinkage", linkageName: 
"_Z11DiffLinkagev", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, 
flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !9)
+!9 = !DISubprogram(name: "DiffLinkage", linkageName: "SomeName", scope: !1, 
file: !1, line: 3, type: !5, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)
+!10 = distinct !DISubprogram(name: "EmptyDefLinkage", linkageName: "", scope: 
!1, file: !1, line: 5, type: !5, scopeLine: 5, flags: DIFlagPrototyped, 
spFlags: DISPFlagDefinition, unit: !0, declaration: !11)
+!11 = !DISubprogram(name: "EmptyDefLinkage", linkageName: 
"_Z15EmptyDefLinkagev", scope: !1, file: !1, line: 3, type: !5, scopeLine: 3, 
flags: DIFlagPrototyped, spFlags: 0)
+!12 = distinct !DISubprogram(name: "EmptyDeclLinkage", linkageName: 
"_Z16EmptyDeclLinkagev", scope: !1, file: !1, line: 5, type: !5, scopeLine: 5, 
flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: 
!13)
+!13 = !DISubprogram(name: "EmptyDeclLinkage", linkageName:

[Lldb-commits] [lldb] [lldb] Fix race condition in Process::WaitForProcessToStop() (PR #144919)

2025-09-03 Thread Pavel Labath via lldb-commits

labath wrote:

I think it'd be better to not do that. HandleCommand does that because it has 
no idea what events are going to be produced by the command it runs. In case of 
EvaluateExpression, it feels like there ought to be a way which events are 
going to be produced and consumed, and I think it'd be better to handle this 
where the events are being processed (when we're listening on the hijack 
listener) -- instead of letting the hijack listener forward events to 
who-knows-where, and then trying to clean up after it.

https://github.com/llvm/llvm-project/pull/144919
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-09-03 Thread Anthony Eid via lldb-commits


@@ -9,6 +9,7 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_JSONUTILS_H
 #define LLDB_TOOLS_LLDB_DAP_JSONUTILS_H
 
+#include "DAP.h"

Anthony-Eid wrote:

I removed it

https://github.com/llvm/llvm-project/pull/124232
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add Pythonic API to SBStructuredData extension (PR #155061)

2025-09-03 Thread Dave Lee via lldb-commits

https://github.com/kastiglione updated 
https://github.com/llvm/llvm-project/pull/155061

>From eff269a2c869b3a3c73ed0198f3b749fd914b2aa Mon Sep 17 00:00:00 2001
From: Dave Lee 
Date: Fri, 22 Aug 2025 19:34:57 -0700
Subject: [PATCH 1/5] [lldb] Add Pythonic API to SBStructuredData extension

* Implements `__getitem__` for array and dictionary subscripting
* Updates `__iter__` to support dictionary instances
* Adds converstion to `str`, `int`, and `float`
* Adds `bool` conversion

Additionally did some cleanup in TestStructuredDataAPI.py.
---
 .../interface/SBStructuredDataExtensions.i| 119 -
 .../sbstructureddata/TestStructuredDataAPI.py | 121 ++
 2 files changed, 210 insertions(+), 30 deletions(-)

diff --git a/lldb/bindings/interface/SBStructuredDataExtensions.i 
b/lldb/bindings/interface/SBStructuredDataExtensions.i
index ca3d0966f9fc1..900dc192df2bb 100644
--- a/lldb/bindings/interface/SBStructuredDataExtensions.i
+++ b/lldb/bindings/interface/SBStructuredDataExtensions.i
@@ -3,16 +3,127 @@ STRING_EXTENSION_OUTSIDE(SBStructuredData)
 %extend lldb::SBStructuredData {
 #ifdef SWIGPYTHON
 %pythoncode%{
-def __int__(self):
-  return self.GetSignedInteger()
-
 def __len__(self):
   '''Return the number of element in a lldb.SBStructuredData object.'''
   return self.GetSize()
 
 def __iter__(self):
 '''Iterate over all the elements in a lldb.SBStructuredData object.'''
-return lldb_iter(self, 'GetSize', 'GetItemAtIndex')
+data_type = self.GetType()
+if data_type == eStructuredDataTypeArray:
+return lldb_iter(self, 'GetSize', 'GetItemAtIndex')
+elif data_type == eStructuredDataTypeDictionary:
+keys = SBStringList()
+self.GetKeys(keys)
+return iter(keys)
+raise TypeError(f"cannot iterate {self.type_name(data_type)} type")
+
+def __getitem__(self, key):
+data_type = self.GetType()
+if data_type == eStructuredDataTypeArray:
+if not isinstance(key, int):
+raise TypeError("subscript index must be an integer")
+count = len(self)
+if -count <= key < count:
+key %= count
+return self.GetItemAtIndex(key)
+raise IndexError("index out of range")
+elif data_type == eStructuredDataTypeDictionary:
+if not isinstance(key, str):
+raise TypeError("subscript key must be a string")
+return self.GetValueForKey(key)
+else:
+raise TypeError(f"cannot subscript {self.type_name(data_type)} 
type")
+
+def __bool__(self):
+data_type = self.GetType()
+if data_type == eStructuredDataTypeBoolean:
+return self.GetBooleanValue()
+elif data_type == eStructuredDataTypeInteger:
+return bool(int(self))
+elif data_type == eStructuredDataTypeSignedInteger:
+return bool(int(self))
+elif data_type == eStructuredDataTypeFloat:
+return bool(float(self))
+elif data_type == eStructuredDataTypeString:
+return bool(str(self))
+elif data_type == eStructuredDataTypeArray:
+return bool(len(self))
+elif data_type == eStructuredDataTypeDictionary:
+return bool(len(self))
+elif data_type == eStructuredDataTypeNull:
+return False
+elif data_type == eStructuredDataTypeInvalid:
+return False
+else:
+raise TypeError(f"cannot convert {self.type_name(data_type)} to 
bool")
+
+def __str__(self):
+data_type = self.GetType()
+if data_type == eStructuredDataTypeString:
+size = len(self) or 1023
+return self.GetStringValue(size + 1)
+elif data_type == eStructuredDataTypeInteger:
+return str(int(self))
+elif data_type == eStructuredDataTypeSignedInteger:
+return str(int(self))
+elif data_type == eStructuredDataTypeFloat:
+return str(float(self))
+else:
+raise TypeError(f"cannot convert {self.type_name(data_type)} to 
string")
+
+def __int__(self):
+data_type = self.GetType()
+if data_type == eStructuredDataTypeInteger:
+return self.GetUnsignedIntegerValue()
+elif data_type == eStructuredDataTypeSignedInteger:
+return self.GetSignedIntegerValue()
+elif data_type == eStructuredDataTypeFloat:
+return int(float(self))
+elif data_type == eStructuredDataTypeString:
+return int(str(self))
+elif data_type == eStructuredDataTypeBoolean:
+return int(bool(self))
+else:
+raise TypeError(f"cannot convert {self.type_name(data_type)} to 
int")
+
+def __float__(self):
+data_type = self.GetType()
+if data_type == eStructuredDataTypeFloat:
+return self.GetFloatV

[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits


@@ -0,0 +1,21 @@
+{
+"triple": "replace me",
+"uuid": "replace me",
+"type": "executable",
+"sections": [
+{   
+"name": "__DATA",
+"type": "data",

felipepiovezan wrote:

I think I need to make this test run only on apple platforms?

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Introduce ScriptedFrame affordance (PR #149622)

2025-09-03 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben edited 
https://github.com/llvm/llvm-project/pull/149622
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [libcxx] [libcxxabi] [libunwind] [lldb] [llvm] [mlir] [openmp] [NFC][CMake] quote ${CMAKE_SYSTEM_NAME} consistently (PR #154537)

2025-09-03 Thread Amy Kwan via lldb-commits

https://github.com/amy-kwan milestoned 
https://github.com/llvm/llvm-project/pull/154537
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits

felipepiovezan wrote:

Your guess is right. Enabling `log enable lldb expr`, we can see the IR 
generated for `expr get_high_bits(&myglobal_json)`

```
@"_ZGVZ12$__lldb_exprPvE19$__lldb_expr_result" = internal global i8 0, align 1

; Function Attrs: convergent noinline nounwind optnone
define void @"_Z12$__lldb_exprPv"(ptr %"$__lldb_arg") #0 {
entry:
  %0 = getelementptr i8, ptr %"$__lldb_arg", i32 8
  %1 = getelementptr i8, ptr %"$__lldb_arg", i32 0
  %2 = load ptr, ptr %1, align 8
  %"$__lldb_arg.addr" = alloca ptr, align 8, !clang.decl.ptr !8
  store ptr %"$__lldb_arg", ptr %"$__lldb_arg.addr", align 8
  %guard.uninitialized = icmp eq i8 0, 0
  br i1 %guard.uninitialized, label %init.check, label %init.end, !prof !9

init.check:   ; preds = %entry
  %3 = load ptr, ptr %0, align 8, !nonnull !10, !align !11
  %call = call i64 @get_high_bits(ptr %3) #2
  store i64 %call, ptr %2, align 8
  br label %init.end

init.end: ; preds = %init.check, %entry
  ret void
}
```

`%"$__lldb_arg` is the memory region allocated by `IRMemoryMap`.
`%0` is the offset where there address of `myglobal_json`'s address was stored 
by `WritePointerToMemory` (after going through `FixAddress`). We load `%0` into 
`%3` and pass the result directly to `get_high_bits`

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-tools-extra

Author: Austin Jiang (AustinBoyuJiang)


Changes

Corrected various spelling mistakes such as 'occurred', 'receiver', 
'initialized', 'length', and others in comments, variable names, function 
names, and documentation throughout the project. These changes improve code 
readability and maintain consistency in naming and documentation.

---

Patch is 84.62 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/156270.diff


96 Files Affected:

- (modified) bolt/lib/Core/DebugNames.cpp (+3-3) 
- (modified) bolt/test/X86/Inputs/dwarf4-gdb-index-types-helper.s (+2-2) 
- (modified) bolt/test/X86/Inputs/dwarf4-gdb-index-types-main.s (+2-2) 
- (modified) clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp 
(+3-3) 
- (modified) clang-tools-extra/clangd/Hover.cpp (+1-1) 
- (modified) clang-tools-extra/clangd/index/FileIndex.cpp (+1-1) 
- (modified) 
clang-tools-extra/test/clang-tidy/checkers/abseil/faster-strsplit-delimiter.cpp 
(+1-1) 
- (modified) 
clang-tools-extra/test/clang-tidy/checkers/readability/function-cognitive-complexity.cpp
 (+2-2) 
- (modified) clang/docs/ReleaseNotes.rst (+1-1) 
- (modified) clang/include/clang/Sema/Sema.h (+1-1) 
- (modified) clang/include/clang/StaticAnalyzer/Checkers/Checkers.td (+2-2) 
- (modified) clang/lib/APINotes/APINotesYAMLCompiler.cpp (+5-5) 
- (modified) clang/lib/Analysis/FlowSensitive/Transfer.cpp (+1-1) 
- (modified) clang/lib/Basic/OpenMPKinds.cpp (+1-1) 
- (modified) clang/lib/CrossTU/CrossTranslationUnit.cpp (+3-3) 
- (modified) clang/lib/Parse/ParseHLSLRootSignature.cpp (+1-1) 
- (modified) clang/lib/Sema/CheckExprLifetime.cpp (+2-2) 
- (modified) clang/lib/Sema/SemaCUDA.cpp (+1-1) 
- (modified) clang/lib/Sema/SemaDeclCXX.cpp (+4-4) 
- (modified) clang/lib/Sema/TreeTransform.h (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp 
(+2-2) 
- (modified) 
clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp (+1-1) 
- (modified) clang/test/Analysis/Checkers/WebKit/unretained-call-args.mm (+1-1) 
- (modified) clang/test/Analysis/csv2json.py (+1-1) 
- (modified) clang/test/Analysis/cxx-uninitialized-object-inheritance.cpp 
(+1-1) 
- (modified) clang/test/Analysis/cxx-uninitialized-object.cpp (+2-2) 
- (modified) clang/test/Analysis/uninit-ps-rdar6145427.m (+2-2) 
- (modified) clang/test/CXX/except/except.spec/p13-friend.cpp (+1-1) 
- (modified) clang/test/CodeGenCXX/ctor-empty-nounique.cpp (+1-1) 
- (modified) clang/unittests/Format/FormatTestCSharp.cpp (+4-4) 
- (modified) compiler-rt/lib/builtins/arm/addsf3.S (+1-1) 
- (modified) compiler-rt/lib/builtins/fp_add_impl.inc (+1-1) 
- (modified) compiler-rt/lib/gwp_asan/tests/backtrace.cpp (+1-1) 
- (modified) flang-rt/unittests/Runtime/NumericalFormatTest.cpp (+3-3) 
- (modified) flang/lib/Lower/ConvertConstant.cpp (+1-1) 
- (modified) flang/lib/Semantics/check-omp-structure.cpp (+3-3) 
- (modified) libc/src/__support/RPC/rpc_server.h (+2-2) 
- (modified) libc/src/__support/math/cbrt.h (+2-2) 
- (modified) libc/src/__support/str_to_float.h (+2-2) 
- (modified) libc/src/stdio/generic/fgets.cpp (+1-1) 
- (modified) libc/src/stdlib/strfroml.cpp (+1-1) 
- (modified) libc/test/integration/startup/gpu/rpc_interface_test.cpp (+1-1) 
- (modified) libcxx/include/__math/special_functions.h (+1-1) 
- (modified) lldb/docs/resources/lldbgdbremote.md (+1-1) 
- (modified) lldb/docs/resources/qemu-testing.rst (+1-1) 
- (modified) lldb/include/lldb/API/SBCommandInterpreter.h (+1-1) 
- (modified) lldb/include/lldb/Target/Platform.h (+1-1) 
- (modified) lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h (+5-5) 
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+1-1) 
- (modified) lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp (+1-1) 
- (modified) lldb/source/Plugins/TraceExporter/common/TraceHTR.h (+1-1) 
- (modified) lldb/source/ValueObject/DILEval.cpp (+1-1) 
- (modified) 
lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py
 (+1-1) 
- (modified) 
lldb/test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py
 (+2-2) 
- (modified) lldb/test/API/macosx/dsym_modules/TestdSYMModuleInit.py (+1-1) 
- (modified) 
lldb/test/Shell/SymbolFile/DWARF/split-dwarf-expression-eval-bug.cpp (+1-1) 
- (modified) lldb/unittests/Utility/StreamTest.cpp (+2-2) 
- (modified) llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h (+1-1) 
- (modified) llvm/include/llvm/Support/LEB128.h (+2-2) 
- (modified) llvm/include/llvm/Support/raw_socket_stream.h (+1-1) 
- (modified) llvm/lib/CodeGen/RegisterPressure.cpp (+1-1) 
- (modified) llvm/lib/DebugInfo/DWARF/DWARFContext.cpp (+1-1) 
- (modified) llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp (+2-2) 
- (modified) llvm/lib/Support/TextEncoding.cpp (+3-3) 
- (modified) llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp (+1-1) 
- (modified) llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp (+1-1)

[Lldb-commits] [lldb] [LLDB][NativePDB] Complete array member types in AST builder (PR #156370)

2025-09-03 Thread Michael Buch via lldb-commits

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


https://github.com/llvm/llvm-project/pull/156370
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB][NativePDB] Find global variables in namespaces (PR #156736)

2025-09-03 Thread Zequan Wu via lldb-commits

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

LGTM.

https://github.com/llvm/llvm-project/pull/156736
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB][NativePDB] Find global variables in namespaces (PR #156736)

2025-09-03 Thread Zequan Wu via lldb-commits

https://github.com/ZequanWu edited 
https://github.com/llvm/llvm-project/pull/156736
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add count for errors of DWO files in statistics and combine DWO file count functions (PR #155023)

2025-09-03 Thread Ziyi Wang via lldb-commits

https://github.com/zw3917 updated 
https://github.com/llvm/llvm-project/pull/155023

>From d978cb5b17b7a8450226825a8fd85f2054166059 Mon Sep 17 00:00:00 2001
From: Ziyi Wang 
Date: Fri, 22 Aug 2025 09:17:25 -0700
Subject: [PATCH 1/7] [lldb] Add count for errors of DWO files in statistics

---
 lldb/include/lldb/Symbol/SymbolFile.h |   4 +
 lldb/include/lldb/Target/Statistics.h |   1 +
 .../SymbolFile/DWARF/SymbolFileDWARF.cpp  |  18 +++
 .../SymbolFile/DWARF/SymbolFileDWARF.h|   3 +
 lldb/source/Target/Statistics.cpp |   5 +
 .../commands/statistics/basic/TestStats.py| 115 ++
 .../statistics/basic/dwo_error_foo.cpp|  10 ++
 .../statistics/basic/dwo_error_main.cpp   |   5 +
 8 files changed, 161 insertions(+)
 create mode 100644 lldb/test/API/commands/statistics/basic/dwo_error_foo.cpp
 create mode 100644 lldb/test/API/commands/statistics/basic/dwo_error_main.cpp

diff --git a/lldb/include/lldb/Symbol/SymbolFile.h 
b/lldb/include/lldb/Symbol/SymbolFile.h
index bbc615d9fdc38..7f590fc2e7e64 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -496,6 +496,10 @@ class SymbolFile : public PluginInterface {
   /// symbol file doesn't support DWO files, both counts will be 0.
   virtual std::pair GetDwoFileCounts() { return {0, 0}; }
 
+  /// Calculates the count of dwo load error, return the number of dwo file 
with
+  /// errors, 0 by default.
+  virtual uint32_t CountDwoLoadErrors() { return 0; }
+
   virtual lldb::TypeSP
   MakeType(lldb::user_id_t uid, ConstString name,
std::optional byte_size, SymbolContextScope *context,
diff --git a/lldb/include/lldb/Target/Statistics.h 
b/lldb/include/lldb/Target/Statistics.h
index 55dff8861a9ab..6dd09cac890b8 100644
--- a/lldb/include/lldb/Target/Statistics.h
+++ b/lldb/include/lldb/Target/Statistics.h
@@ -155,6 +155,7 @@ struct ModuleStats {
   bool debug_info_had_incomplete_types = false;
   uint32_t dwo_file_count = 0;
   uint32_t loaded_dwo_file_count = 0;
+  uint32_t dwo_load_error_count = 0;
 };
 
 struct ConstStringStats {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 9958af26379b9..51ad43894d982 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4529,3 +4529,21 @@ std::pair 
SymbolFileDWARF::GetDwoFileCounts() {
 
   return {loaded_dwo_count, total_dwo_count};
 }
+
+uint32_t SymbolFileDWARF::CountDwoLoadErrors() {
+  uint32_t dwo_load_error_count = 0;
+
+  DWARFDebugInfo &info = DebugInfo();
+  const size_t num_cus = info.GetNumUnits();
+  for (size_t cu_idx = 0; cu_idx < num_cus; cu_idx++) {
+DWARFUnit *dwarf_cu = info.GetUnitAtIndex(cu_idx);
+if (dwarf_cu == nullptr)
+  continue;
+
+// Check if this unit has dwo error (False by default).
+const Status &dwo_error = dwarf_cu->GetDwoError();
+if (dwo_error.Fail())
+  dwo_load_error_count++;
+  }
+  return dwo_load_error_count;
+}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index d7db8a3c0869f..349ea9ef8224b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -288,6 +288,9 @@ class SymbolFileDWARF : public SymbolFileCommon {
   // CUs and total DWO CUs. For non-split-dwarf files, this reports 0 for both.
   std::pair GetDwoFileCounts() override;
 
+  /// Count the number of dwo load errors happened.
+  uint32_t CountDwoLoadErrors() override;
+
   DWARFContext &GetDWARFContext() { return m_context; }
 
   const std::shared_ptr &GetDwpSymbolFile();
diff --git a/lldb/source/Target/Statistics.cpp 
b/lldb/source/Target/Statistics.cpp
index 909f335687b21..20ade32f488ea 100644
--- a/lldb/source/Target/Statistics.cpp
+++ b/lldb/source/Target/Statistics.cpp
@@ -75,6 +75,7 @@ json::Value ModuleStats::ToJSON() const {
   module.try_emplace("symbolTableSymbolCount", symtab_symbol_count);
   module.try_emplace("dwoFileCount", dwo_file_count);
   module.try_emplace("loadedDwoFileCount", loaded_dwo_file_count);
+  module.try_emplace("dwoLoadErrorCount", dwo_load_error_count);
 
   if (!symbol_locator_time.map.empty()) {
 json::Object obj;
@@ -326,6 +327,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
   uint32_t symtab_symbol_count = 0;
   uint32_t total_loaded_dwo_file_count = 0;
   uint32_t total_dwo_file_count = 0;
+  uint32_t total_dwo_load_error_count = 0;
   for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
 Module *module = target != nullptr
  ? 
target->GetImages().GetModuleAtIndex(image_idx).get()
@@ -361,6 +363,8 @@ llvm::json::Value DebuggerStats::ReportStatistics(
   sym_file->GetDwoFileCounts();
   total_dwo_file_count += module_stat.dwo_file_count;
   tot

[Lldb-commits] [lldb] [LLDB][NativePDB] Find global variables in namespaces (PR #156736)

2025-09-03 Thread Zequan Wu via lldb-commits


@@ -306,6 +309,9 @@ class SymbolFileNativePDB : public SymbolFileCommon {
   lldb_private::UniqueCStringMap m_func_base_names;
   /// method basename -> Global ID(s)
   lldb_private::UniqueCStringMap m_func_method_names;
+
+  /// basename -> Global ID(s)

ZequanWu wrote:

```suggestion
  /// global variable basename -> Global ID(s)
```

https://github.com/llvm/llvm-project/pull/156736
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add count for errors of DWO files in statistics and combine DWO file count functions (PR #155023)

2025-09-03 Thread Ziyi Wang via lldb-commits

https://github.com/zw3917 updated 
https://github.com/llvm/llvm-project/pull/155023

>From d978cb5b17b7a8450226825a8fd85f2054166059 Mon Sep 17 00:00:00 2001
From: Ziyi Wang 
Date: Fri, 22 Aug 2025 09:17:25 -0700
Subject: [PATCH 1/7] [lldb] Add count for errors of DWO files in statistics

---
 lldb/include/lldb/Symbol/SymbolFile.h |   4 +
 lldb/include/lldb/Target/Statistics.h |   1 +
 .../SymbolFile/DWARF/SymbolFileDWARF.cpp  |  18 +++
 .../SymbolFile/DWARF/SymbolFileDWARF.h|   3 +
 lldb/source/Target/Statistics.cpp |   5 +
 .../commands/statistics/basic/TestStats.py| 115 ++
 .../statistics/basic/dwo_error_foo.cpp|  10 ++
 .../statistics/basic/dwo_error_main.cpp   |   5 +
 8 files changed, 161 insertions(+)
 create mode 100644 lldb/test/API/commands/statistics/basic/dwo_error_foo.cpp
 create mode 100644 lldb/test/API/commands/statistics/basic/dwo_error_main.cpp

diff --git a/lldb/include/lldb/Symbol/SymbolFile.h 
b/lldb/include/lldb/Symbol/SymbolFile.h
index bbc615d9fdc38..7f590fc2e7e64 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -496,6 +496,10 @@ class SymbolFile : public PluginInterface {
   /// symbol file doesn't support DWO files, both counts will be 0.
   virtual std::pair GetDwoFileCounts() { return {0, 0}; }
 
+  /// Calculates the count of dwo load error, return the number of dwo file 
with
+  /// errors, 0 by default.
+  virtual uint32_t CountDwoLoadErrors() { return 0; }
+
   virtual lldb::TypeSP
   MakeType(lldb::user_id_t uid, ConstString name,
std::optional byte_size, SymbolContextScope *context,
diff --git a/lldb/include/lldb/Target/Statistics.h 
b/lldb/include/lldb/Target/Statistics.h
index 55dff8861a9ab..6dd09cac890b8 100644
--- a/lldb/include/lldb/Target/Statistics.h
+++ b/lldb/include/lldb/Target/Statistics.h
@@ -155,6 +155,7 @@ struct ModuleStats {
   bool debug_info_had_incomplete_types = false;
   uint32_t dwo_file_count = 0;
   uint32_t loaded_dwo_file_count = 0;
+  uint32_t dwo_load_error_count = 0;
 };
 
 struct ConstStringStats {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 9958af26379b9..51ad43894d982 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4529,3 +4529,21 @@ std::pair 
SymbolFileDWARF::GetDwoFileCounts() {
 
   return {loaded_dwo_count, total_dwo_count};
 }
+
+uint32_t SymbolFileDWARF::CountDwoLoadErrors() {
+  uint32_t dwo_load_error_count = 0;
+
+  DWARFDebugInfo &info = DebugInfo();
+  const size_t num_cus = info.GetNumUnits();
+  for (size_t cu_idx = 0; cu_idx < num_cus; cu_idx++) {
+DWARFUnit *dwarf_cu = info.GetUnitAtIndex(cu_idx);
+if (dwarf_cu == nullptr)
+  continue;
+
+// Check if this unit has dwo error (False by default).
+const Status &dwo_error = dwarf_cu->GetDwoError();
+if (dwo_error.Fail())
+  dwo_load_error_count++;
+  }
+  return dwo_load_error_count;
+}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index d7db8a3c0869f..349ea9ef8224b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -288,6 +288,9 @@ class SymbolFileDWARF : public SymbolFileCommon {
   // CUs and total DWO CUs. For non-split-dwarf files, this reports 0 for both.
   std::pair GetDwoFileCounts() override;
 
+  /// Count the number of dwo load errors happened.
+  uint32_t CountDwoLoadErrors() override;
+
   DWARFContext &GetDWARFContext() { return m_context; }
 
   const std::shared_ptr &GetDwpSymbolFile();
diff --git a/lldb/source/Target/Statistics.cpp 
b/lldb/source/Target/Statistics.cpp
index 909f335687b21..20ade32f488ea 100644
--- a/lldb/source/Target/Statistics.cpp
+++ b/lldb/source/Target/Statistics.cpp
@@ -75,6 +75,7 @@ json::Value ModuleStats::ToJSON() const {
   module.try_emplace("symbolTableSymbolCount", symtab_symbol_count);
   module.try_emplace("dwoFileCount", dwo_file_count);
   module.try_emplace("loadedDwoFileCount", loaded_dwo_file_count);
+  module.try_emplace("dwoLoadErrorCount", dwo_load_error_count);
 
   if (!symbol_locator_time.map.empty()) {
 json::Object obj;
@@ -326,6 +327,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
   uint32_t symtab_symbol_count = 0;
   uint32_t total_loaded_dwo_file_count = 0;
   uint32_t total_dwo_file_count = 0;
+  uint32_t total_dwo_load_error_count = 0;
   for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
 Module *module = target != nullptr
  ? 
target->GetImages().GetModuleAtIndex(image_idx).get()
@@ -361,6 +363,8 @@ llvm::json::Value DebuggerStats::ReportStatistics(
   sym_file->GetDwoFileCounts();
   total_dwo_file_count += module_stat.dwo_file_count;
   tot

[Lldb-commits] [lldb] [lldb] Reimplement __str__ in SBStructuredDataExtensions.i (PR #156725)

2025-09-03 Thread Dave Lee via lldb-commits

https://github.com/kastiglione created 
https://github.com/llvm/llvm-project/pull/156725

Follow up to #155061 and #156721.

After discussing with @medismailben, the ideal course of to have a `__str__`, 
however,
instead of throwing an exception, the fallback behavior calls `__repr__`
(`GetDescription`).

The main value of this is that `str(string_data)` will produce the string 
itself, not a
quoted string as returned by `__repr__`/`GetDescription`.


>From 209a788919a75e899ab32fb5e815de11d8655dd9 Mon Sep 17 00:00:00 2001
From: Dave Lee 
Date: Wed, 3 Sep 2025 11:18:56 -0700
Subject: [PATCH] [lldb] Reimplement __str__ in SBStructuredDataExtensions.i

Follow up to #155061 and #156721.

After discussing with @medismailben, the ideal course of to have a `__str__`, 
however,
instead of throwing an exception, the fallback behavior calls `__repr__`
(`GetDescription`).

The main value of this is that `str(string_data)` will produce the string 
itself, not a
quoted string as returned by `__repr__`/`GetDescription`.
---
 .../interface/SBStructuredDataExtensions.i  | 12 
 .../sbstructureddata/TestStructuredDataAPI.py   | 17 +++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/lldb/bindings/interface/SBStructuredDataExtensions.i 
b/lldb/bindings/interface/SBStructuredDataExtensions.i
index 9def366a4cf11..35aa2044eb1ac 100644
--- a/lldb/bindings/interface/SBStructuredDataExtensions.i
+++ b/lldb/bindings/interface/SBStructuredDataExtensions.i
@@ -38,6 +38,18 @@ STRING_EXTENSION_OUTSIDE(SBStructuredData)
 else:
 raise TypeError(f"cannot subscript {self.type_name(data_type)} 
type")
 
+def __str__(self):
+data_type = self.GetType()
+if data_type in (
+eStructuredDataTypeString,
+eStructuredDataTypeInteger,
+eStructuredDataTypeSignedInteger,
+eStructuredDataTypeFloat,
+):
+ return str(self.dynamic)
+else:
+return repr(self)
+
 def __bool__(self):
 data_type = self.GetType()
 if data_type == eStructuredDataTypeInvalid:
diff --git a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py 
b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
index 275ac03a5a86d..b55f17c151ad5 100644
--- a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
+++ b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
@@ -2,7 +2,6 @@
 Test some SBStructuredData API.
 """
 
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
@@ -10,6 +9,7 @@
 
 import json
 
+
 class TestStructuredDataAPI(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
@@ -346,7 +346,7 @@ def array_struct_test(self, dict_struct):
 self.fail("wrong output: " + str(output))
 
 def test_round_trip_scalars(self):
-for original in (0, 11, -1, 0.0, 4.5, -0.25, True, False):
+for original in (0, 11, -1, 0.0, 4.5, -0.25, "", "dirk", True, False):
 constructor = type(original)
 data = lldb.SBStructuredData()
 data.SetFromJSON(json.dumps(original))
@@ -359,6 +359,19 @@ def test_dynamic(self):
 data.SetFromJSON(json.dumps(original))
 self.assertEqual(data.dynamic, original)
 
+def test_round_trip_string(self):
+# No 0.0, it inherently does not round trip.
+for original in (0, 11, -1, 4.5, -0.25, "", "dirk", True, False):
+data = lldb.SBStructuredData()
+data.SetFromJSON(json.dumps(original))
+self.assertEqual(str(data), str(original))
+
+def test_str(self):
+for original in ([15], {"id": 23}, None):
+data = lldb.SBStructuredData()
+data.SetFromJSON(json.dumps(original))
+self.assertTrue(str(data))
+
 def test_round_trip_int(self):
 for original in (0, 11, -1):
 data = lldb.SBStructuredData()

___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Reimplement __str__ in SBStructuredDataExtensions.i (PR #156725)

2025-09-03 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/156725
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add count for errors of DWO files in statistics and combine DWO file count functions (PR #155023)

2025-09-03 Thread Ziyi Wang via lldb-commits

https://github.com/zw3917 edited 
https://github.com/llvm/llvm-project/pull/155023
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Revert custom __str__ in SBStructuredDataExtensions.i (PR #156721)

2025-09-03 Thread LLVM Continuous Integration via lldb-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`cross-project-tests-sie-ubuntu-dwarf5` running on `doug-worker-1b` while 
building `lldb` at step 6 "test-build-unified-tree-check-cross-project".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/163/builds/25825


Here is the relevant piece of the build log for the reference

```
Step 6 (test-build-unified-tree-check-cross-project) failure: test (failure)
 TEST 'cross-project-tests :: 
debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp' FAILED 

Exit Code: 2

Command Output (stdout):
--
optnone-struct-and-methods.cpp: (1.)

## BEGIN ##
[1, "main", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 102, 7, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   [2, "(anonymous namespace)::A::A()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 69, 5, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   [3, "(anonymous namespace)::A::A()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 70, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
[4, "main", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 103, 16, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   [5, "(anonymous namespace)::A::getData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 89, 5, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   .   [6, "(anonymous namespace)::A::getOtherData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 46, 47, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   [7, "(anonymous namespace)::A::getData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 89, 5, "StopReason.STEP", "StepKind.SAME", []]
.   [8, "(anonymous namespace)::A::getData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 90, 5, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   .   [9, "(anonymous namespace)::A::setOtherData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 63, 5, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   .   [10, "(anonymous namespace)::A::setOtherData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 64, 32, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   .   [11, "(anonymous namespace)::A::setOtherData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 65, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   [12, "(anonymous namespace)::A::getData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 91, 12, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   .   [13, "(anonymous namespace)::A::getOtherData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 46, 47, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   [14, "(anonymous namespace)::A::getData()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 91, 30, "StopReason.STEP", "StepKind.HORIZONTAL_FORWARD", []]
[15, "main", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 104, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
.   [16, "(anonymous namespace)::A::~A()", 
"/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp",
 82, 6, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
.   .   [17, "(anonymous namespace)::A::ge

[Lldb-commits] [lldb] [lldb] Correct style of error messages (PR #156774)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)


Changes

The LLVM Style Guide says the following about error and warning messages [1]:

> [T]o match error message styles commonly produced by other tools,
> start the first sentence with a lowercase letter, and finish the last
> sentence without a period, if it would end in one otherwise.

I often provide this feedback during code review, but we still have a bunch of 
places where we have inconsistent error message, which bothers me as a user. 
This PR identifies a handful of those places and updates the messages to be 
consistent.

[1] https://llvm.org/docs/CodingStandards.html#error-and-warning-messages

---

Patch is 33.68 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/156774.diff


25 Files Affected:

- (modified) lldb/source/API/SBCommandInterpreter.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectBreakpoint.cpp (+18-18) 
- (modified) lldb/source/Commands/CommandObjectCommands.cpp (+2-2) 
- (modified) lldb/source/Commands/CommandObjectFrame.cpp (+4-4) 
- (modified) lldb/source/Commands/CommandObjectLog.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectMultiword.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectProcess.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectSource.cpp (+3-3) 
- (modified) lldb/source/Commands/CommandObjectTarget.cpp (+3-3) 
- (modified) lldb/source/Commands/CommandObjectThread.cpp (+1-1) 
- (modified) lldb/source/Commands/CommandObjectWatchpoint.cpp (+12-12) 
- (modified) lldb/source/Commands/CommandObjectWatchpointCommand.cpp (+3-3) 
- (modified) lldb/source/Expression/DWARFExpression.cpp (+1-1) 
- (modified) lldb/source/Expression/DWARFExpressionList.cpp (+1-1) 
- (modified) lldb/source/Interpreter/CommandInterpreter.cpp (+3-3) 
- (modified) lldb/source/Interpreter/CommandObject.cpp (+3-3) 
- (modified) lldb/source/Interpreter/Options.cpp (+1-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp (+5-5) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStlVector.cpp (+5-5) 
- (modified) lldb/test/API/commands/command/script/add/TestAddParsedCommand.py 
(+1-1) 
- (modified) lldb/test/API/commands/frame/select/TestFrameSelect.py (+3-3) 
- (modified) 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/invalid-vector/TestDataFormatterLibcxxInvalidVectorSimulator.py
 (+5-5) 
- (modified) 
lldb/test/API/functionalities/multiword-commands/TestMultiWordCommands.py 
(+1-1) 
- (modified) 
lldb/test/API/python_api/interpreter/TestRunCommandInterpreterAPI.py (+1-1) 
- (modified) lldb/unittests/API/SBCommandInterpreterTest.cpp (+2-2) 


``diff
diff --git a/lldb/source/API/SBCommandInterpreter.cpp 
b/lldb/source/API/SBCommandInterpreter.cpp
index 4ea79d336e08d..34323bc5a2c37 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -208,7 +208,7 @@ void SBCommandInterpreter::HandleCommandsFromFile(
   LLDB_INSTRUMENT_VA(this, file, override_context, options, result);
 
   if (!IsValid()) {
-result->AppendError("SBCommandInterpreter is not valid.");
+result->AppendError("SBCommandInterpreter is not valid");
 return;
   }
 
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp 
b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 38ec375c03070..de0a7e7093411 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -609,12 +609,12 @@ class CommandObjectBreakpointSet : public 
CommandObjectParsed {
   const size_t num_files = m_options.m_filenames.GetSize();
   if (num_files == 0) {
 if (!GetDefaultFile(target, file, result)) {
-  result.AppendError("No file supplied and no default file 
available.");
+  result.AppendError("no file supplied and no default file available");
   return;
 }
   } else if (num_files > 1) {
-result.AppendError("Only one file at a time is allowed for file and "
-   "line breakpoints.");
+result.AppendError("only one file at a time is allowed for file and "
+   "line breakpoints");
 return;
   } else
 file = m_options.m_filenames.GetFileSpecAtIndex(0);
@@ -784,7 +784,7 @@ class CommandObjectBreakpointSet : public 
CommandObjectParsed {
   }
   result.SetStatus(eReturnStatusSuccessFinishResult);
 } else if (!bp_sp) {
-  result.AppendError("Breakpoint creation failed: No breakpoint created.");
+  result.AppendError("breakpoint creation failed: no breakpoint created");
 }
   }
 
@@ -940,7 +940,7 @@ class CommandObjectBreakpointEnable : public 
CommandObjectParsed {
 size_t num_breakpoints = breakpoints.GetSize();
 
 if (num_breakpoints == 0) {
-  result.AppendError("No breakpoints exist to be enabled.");
+  result.AppendError("no bre

[Lldb-commits] [lldb] [LLDB][AArch64] Make TPIDR a generic tp register (PR #154444)

2025-09-03 Thread Jacob Lalonde via lldb-commits

Jlalond wrote:

@DavidSpickett Please take a second look when you get a chance

https://github.com/llvm/llvm-project/pull/15
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB][NativePDB] Set IsDynmaicCXXType metadata for records (PR #155853)

2025-09-03 Thread Zequan Wu via lldb-commits


@@ -601,21 +601,26 @@ PdbAstBuilder::CreateModifierType(const ModifierRecord 
&modifier) {
 }
 
 clang::QualType PdbAstBuilder::CreateRecordType(PdbTypeSymId id,
-const TagRecord &record) {
+const CVTagRecord &record) {
   clang::DeclContext *context = nullptr;
   std::string uname;
-  std::tie(context, uname) = CreateDeclInfoForType(record, id.index);
+  std::tie(context, uname) = CreateDeclInfoForType(record.asTag(), id.index);
   if (!context)
 return {};
 
-  clang::TagTypeKind ttk = TranslateUdtKind(record);
+  clang::TagTypeKind ttk = TranslateUdtKind(record.asTag());
   lldb::AccessType access = (ttk == clang::TagTypeKind::Class)
 ? lldb::eAccessPrivate
 : lldb::eAccessPublic;
 
   ClangASTMetadata metadata;
   metadata.SetUserID(toOpaqueUid(id));
-  metadata.SetIsDynamicCXXType(false);
+  // If a class has a vtable, it is dynamic.
+  // Otherwise, we wait until the record is completed - it might have virtual
+  // bases.
+  if (record.contextKind() == CompilerContextKind::ClassOrStruct &&
+  !record.asClass().getVTableShape().isNoneType())
+metadata.SetIsDynamicCXXType(true);

ZequanWu wrote:

Thanks for the explanation. 

https://github.com/llvm/llvm-project/pull/155853
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 milestoned 
https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

/cherry-pick a862225813c251c28b085603b7d32d4b111dbc57

https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Mark scripted frames as synthetic instead of artificial (PR #153117)

2025-09-03 Thread Jonas Devlieghere via lldb-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/153117
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)


Changes

There are some languages for which the `ClangExpressionParser` currently 
switches the language type behind a user's back. Specifically, `C` gets turned 
into `C++` and `ObjC` into `ObjC++`. That's because the Clang expression 
evaluator depends on C++ features. These languages have different semantics, so 
if, e.g., a user forcefully wants to evaluate an expression in `C`, but we 
switch it to `C++`, they will most likely wonder why the expression failed (we 
get reports like this every once in a 
while...https://github.com/llvm/llvm-project/issues/152113 is a variation of 
this).

This patch rejects languages specified with `expression --language` that we 
won't be able to explicitly evaluate.

rdar://159669244

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


3 Files Affected:

- (modified) lldb/source/Commands/CommandObjectExpression.cpp (+17-9) 
- (modified) 
lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py (+1-1) 
- (modified) 
lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py 
(+14-2) 


``diff
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp 
b/lldb/source/Commands/CommandObjectExpression.cpp
index 197bffe9c982f..1b951603563ac 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -44,18 +44,26 @@ Status 
CommandObjectExpression::CommandOptions::SetOptionValue(
   const int short_option = GetDefinitions()[option_idx].short_option;
 
   switch (short_option) {
-  case 'l':
+  case 'l': {
 language = Language::GetLanguageTypeFromString(option_arg);
-if (language == eLanguageTypeUnknown) {
-  StreamString sstr;
-  sstr.Printf("unknown language type: '%s' for expression. "
-  "List of supported languages:\n",
+if (const LanguageSet supported_languages =
+Language::GetLanguagesSupportingTypeSystemsForExpressions();
+supported_languages[language])
+  break;
+
+StreamString sstr;
+if (language == eLanguageTypeUnknown)
+  sstr.Printf("unknown language '%s' for expression. ",
+  option_arg.str().c_str());
+else
+  sstr.Printf("language '%s' is currently not supported for expression "
+  "evaluation. ",
   option_arg.str().c_str());
 
-  Language::PrintSupportedLanguagesForExpressions(sstr, "  ", "\n");
-  error = Status(sstr.GetString().str());
-}
-break;
+sstr.PutCString("List of supported languages for expressions:\n");
+Language::PrintSupportedLanguagesForExpressions(sstr, "  ", "\n");
+error = Status(sstr.GetString().str());
+  } break;
 
   case 'a': {
 bool success;
diff --git 
a/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py 
b/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
index 138027507c7a7..f12b5b0a12814 100644
--- a/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
+++ b/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
@@ -21,7 +21,7 @@ def test__calculator_mode(self):
 )
 # Now try it with a specific language:
 self.expect(
-"expression -l c -- 11 + 22",
+"expression -l c++ -- 11 + 22",
 "11 + 22 didn't get the expected result",
 substrs=["33"],
 )
diff --git 
a/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py 
b/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
index 344aef318d783..f0d1542d783b1 100644
--- 
a/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
+++ 
b/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
@@ -10,8 +10,20 @@ def test_invalid_lang(self):
 "expression -l foo --",
 error=True,
 substrs=[
-"error: unknown language type: 'foo' for expression",
-"List of supported languages:",
+"error: unknown language 'foo' for expression.",
+"List of supported languages for expressions:",
+"c++",
+"c++11",
+"c++14",
+],
+)
+
+self.expect(
+"expression -l c --",
+error=True,
+substrs=[
+"error: language 'c' is currently not supported for expression 
evaluation.",
+"List of supported languages for expressions:",
 "c++",
 "c++11",
 "c++14",

``




https://github.com/llvm/llvm-project/pull/156648
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Reimplement __str__ in SBStructuredDataExtensions.i (PR #156725)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Dave Lee (kastiglione)


Changes

Follow up to #155061 and #156721.

After discussing with @medismailben, the ideal course of to have a 
`__str__`, however, instead of throwing an exception, the fallback behavior 
calls `__repr__` (`GetDescription`).

The main value of this is that `str(string_data)` will produce the string 
itself, not a quoted string as returned by `__repr__`/`GetDescription`.


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


2 Files Affected:

- (modified) lldb/bindings/interface/SBStructuredDataExtensions.i (+12) 
- (modified) lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py 
(+15-2) 


``diff
diff --git a/lldb/bindings/interface/SBStructuredDataExtensions.i 
b/lldb/bindings/interface/SBStructuredDataExtensions.i
index 9def366a4cf11..35aa2044eb1ac 100644
--- a/lldb/bindings/interface/SBStructuredDataExtensions.i
+++ b/lldb/bindings/interface/SBStructuredDataExtensions.i
@@ -38,6 +38,18 @@ STRING_EXTENSION_OUTSIDE(SBStructuredData)
 else:
 raise TypeError(f"cannot subscript {self.type_name(data_type)} 
type")
 
+def __str__(self):
+data_type = self.GetType()
+if data_type in (
+eStructuredDataTypeString,
+eStructuredDataTypeInteger,
+eStructuredDataTypeSignedInteger,
+eStructuredDataTypeFloat,
+):
+ return str(self.dynamic)
+else:
+return repr(self)
+
 def __bool__(self):
 data_type = self.GetType()
 if data_type == eStructuredDataTypeInvalid:
diff --git a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py 
b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
index 275ac03a5a86d..b55f17c151ad5 100644
--- a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
+++ b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
@@ -2,7 +2,6 @@
 Test some SBStructuredData API.
 """
 
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
@@ -10,6 +9,7 @@
 
 import json
 
+
 class TestStructuredDataAPI(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
@@ -346,7 +346,7 @@ def array_struct_test(self, dict_struct):
 self.fail("wrong output: " + str(output))
 
 def test_round_trip_scalars(self):
-for original in (0, 11, -1, 0.0, 4.5, -0.25, True, False):
+for original in (0, 11, -1, 0.0, 4.5, -0.25, "", "dirk", True, False):
 constructor = type(original)
 data = lldb.SBStructuredData()
 data.SetFromJSON(json.dumps(original))
@@ -359,6 +359,19 @@ def test_dynamic(self):
 data.SetFromJSON(json.dumps(original))
 self.assertEqual(data.dynamic, original)
 
+def test_round_trip_string(self):
+# No 0.0, it inherently does not round trip.
+for original in (0, 11, -1, 4.5, -0.25, "", "dirk", True, False):
+data = lldb.SBStructuredData()
+data.SetFromJSON(json.dumps(original))
+self.assertEqual(str(data), str(original))
+
+def test_str(self):
+for original in ([15], {"id": 23}, None):
+data = lldb.SBStructuredData()
+data.SetFromJSON(json.dumps(original))
+self.assertTrue(str(data))
+
 def test_round_trip_int(self):
 for original in (0, 11, -1):
 data = lldb.SBStructuredData()

``




https://github.com/llvm/llvm-project/pull/156725
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] Add AArch64 support to the premerge tests (PR #155274)

2025-09-03 Thread Tom Stellard via lldb-commits

https://github.com/tstellar updated 
https://github.com/llvm/llvm-project/pull/155274

>From 57697a66cfdddf2028c7260f1ce61ecacc550d00 Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 25 Aug 2025 17:15:36 +
Subject: [PATCH 01/57] Add AArch64 support to the premerge tests

---
 .github/workflows/premerge.yaml | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 9d925517a7211..6d83573702a79 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -28,7 +28,13 @@ jobs:
 if: >-
 github.repository_owner == 'llvm' &&
 (github.event_name != 'pull_request' || github.event.action != 
'closed')
-runs-on: llvm-premerge-linux-runners
+matrix:
+  runs-on:
+- llvm-premerge-linux-runners
+- depot-ubuntu-24.04-arm-64
+runs-on: ${{ matrix.runs-on }}
+container:
+  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
"ghcr.io/$GITHUB_REPOSITORY_OWNER/arm64v8/ci-ubuntu-24.04-agent" ) || null }}
 steps:
   - name: Checkout LLVM
 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 
v5.0.0

>From 8ba375b2d80614f4a769af1b417bf21f1712786c Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 25 Aug 2025 17:20:38 +
Subject: [PATCH 02/57] Fix typo

---
 .github/workflows/premerge.yaml | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 6d83573702a79..f88dbc6143ab4 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -28,10 +28,11 @@ jobs:
 if: >-
 github.repository_owner == 'llvm' &&
 (github.event_name != 'pull_request' || github.event.action != 
'closed')
-matrix:
-  runs-on:
-- llvm-premerge-linux-runners
-- depot-ubuntu-24.04-arm-64
+strategy:
+  matrix:
+runs-on:
+  - llvm-premerge-linux-runners
+  - depot-ubuntu-24.04-arm-64
 runs-on: ${{ matrix.runs-on }}
 container:
   image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
"ghcr.io/$GITHUB_REPOSITORY_OWNER/arm64v8/ci-ubuntu-24.04-agent" ) || null }}

>From af39d1af7635196606ceaeff6a2cf1db72e142e4 Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 25 Aug 2025 17:21:51 +
Subject: [PATCH 03/57] Fix quotes

---
 .github/workflows/premerge.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index f88dbc6143ab4..914713bb4a352 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -35,7 +35,7 @@ jobs:
   - depot-ubuntu-24.04-arm-64
 runs-on: ${{ matrix.runs-on }}
 container:
-  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
"ghcr.io/$GITHUB_REPOSITORY_OWNER/arm64v8/ci-ubuntu-24.04-agent" ) || null }}
+  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
'ghcr.io/$GITHUB_REPOSITORY_OWNER/arm64v8/ci-ubuntu-24.04-agent' ) || null }}
 steps:
   - name: Checkout LLVM
 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 
v5.0.0

>From 0330faf41115cab59d8667dbe77bf9414ea3455c Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 25 Aug 2025 17:24:18 +
Subject: [PATCH 04/57] Fix container name

---
 .github/workflows/premerge.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 914713bb4a352..edb7248d792fe 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -35,7 +35,7 @@ jobs:
   - depot-ubuntu-24.04-arm-64
 runs-on: ${{ matrix.runs-on }}
 container:
-  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
'ghcr.io/$GITHUB_REPOSITORY_OWNER/arm64v8/ci-ubuntu-24.04-agent' ) || null }}
+  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
format('ghcr.io/{}/arm64v8/ci-ubuntu-24.04-agent',github.repository_owner) ) || 
null }}
 steps:
   - name: Checkout LLVM
 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 
v5.0.0

>From 0492ee60484cd594f80b6cadcb7ebc5755b6710c Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Mon, 25 Aug 2025 17:29:25 +
Subject: [PATCH 05/57] Fix format string

---
 .github/workflows/premerge.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index edb7248d792fe..28d79518bc1df 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -35,7 +35,7 @@ jobs:
   - depot-ubuntu-24.04-arm-64
 runs-on: ${{ matrix.runs-on }}
 container:
-  image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && 
format('ghcr.io/{}/arm64v8/ci-ub

[Lldb-commits] [lldb] [lldb] Introduce ScriptedFrame affordance (PR #149622)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)


Changes

This patch introduces a new scripting affordance in lldb: `ScriptedFrame`.

This allows user to produce mock stackframes in scripted threads and
scripted processes from a python script.

With this change, StackFrame can be synthetized from different sources:
- Either from a dictionary containing a load address, and a frame index,
  which is the legacy way.
- Or by creating a ScriptedFrame python object.

One particularity of synthezising stackframes from the ScriptedFrame
python object, is that these frame have an optional PC, meaning that
they don't have a report a valid PC and they can act as shells that just
contain static information, like the frame function name, the list of
variables or registers, etc. It can also provide a symbol context.

rdar://157260006

Signed-off-by: Med Ismail Bennani 


---

Patch is 47.64 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/149622.diff


25 Files Affected:

- (modified) lldb/bindings/python/python-wrapper.swig (+1) 
- (modified) lldb/examples/python/templates/scripted_process.py (+136) 
- (modified) lldb/include/lldb/API/SBSymbolContext.h (+1) 
- (added) lldb/include/lldb/Interpreter/Interfaces/ScriptedFrameInterface.h 
(+55) 
- (modified) lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h 
(+10) 
- (modified) lldb/include/lldb/Interpreter/ScriptInterpreter.h (+5) 
- (modified) lldb/include/lldb/Target/StackFrame.h (+17-17) 
- (modified) lldb/include/lldb/lldb-forward.h (+3) 
- (modified) lldb/source/Core/FormatEntity.cpp (+1-1) 
- (modified) lldb/source/Plugins/Process/scripted/CMakeLists.txt (+1) 
- (added) lldb/source/Plugins/Process/scripted/ScriptedFrame.cpp (+191) 
- (added) lldb/source/Plugins/Process/scripted/ScriptedFrame.h (+63) 
- (modified) lldb/source/Plugins/Process/scripted/ScriptedThread.cpp (+71-11) 
- (modified) lldb/source/Plugins/Process/scripted/ScriptedThread.h (+4-1) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt (+1) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h
 (+1) 
- (added) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp
 (+157) 
- (added) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h
 (+59) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
 (+2-1) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp
 (+17) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h
 (+5) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (+5) 
- (modified) 
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h (+2) 
- (modified) lldb/source/Symbol/LineEntry.cpp (+1-3) 
- (modified) 
lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py 
(+74-1) 


``diff
diff --git a/lldb/bindings/python/python-wrapper.swig 
b/lldb/bindings/python/python-wrapper.swig
index 2c30d536a753d..c0ad456bc12e8 100644
--- a/lldb/bindings/python/python-wrapper.swig
+++ b/lldb/bindings/python/python-wrapper.swig
@@ -519,6 +519,7 @@ void 
*lldb_private::python::LLDBSWIGPython_CastPyObjectToSBMemoryRegionInfo(PyOb
   return sb_ptr;
 }
 
+
 void 
*lldb_private::python::LLDBSWIGPython_CastPyObjectToSBExecutionContext(PyObject 
*
 data) {
   lldb::SBExecutionContext *sb_ptr = NULL;
diff --git a/lldb/examples/python/templates/scripted_process.py 
b/lldb/examples/python/templates/scripted_process.py
index b6360b8519077..49059d533f38a 100644
--- a/lldb/examples/python/templates/scripted_process.py
+++ b/lldb/examples/python/templates/scripted_process.py
@@ -383,6 +383,142 @@ def get_extended_info(self):
 """
 return self.extended_info
 
+def get_scripted_frame_plugin(self):
+"""Get scripted frame plugin name.
+
+Returns:
+str: Name of the scripted frame plugin.
+"""
+return None
+
+
+class ScriptedFrame(metaclass=ABCMeta):
+"""
+The base class for a scripted frame.
+
+Most of the base class methods are `@abstractmethod` that need to be
+overwritten by the inheriting class.
+"""
+
+@abstractmethod
+def __init__(self, thread, args):
+"""Construct a scripted frame.
+
+Args:
+thread (ScriptedThread): The thread owning this frame.
+args (lldb.SBStructuredData): A Dictionary holding arbitrary
+key/value pairs used by the scripted frame.
+"""
+self.target = None
+self.originating_thread = None
+self.thread = None
+self.args = None
+self.id = None
+  

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-03 Thread Roy Shi via lldb-commits

https://github.com/royitaqi created 
https://github.com/llvm/llvm-project/pull/156803

# Usage

```
--time-to-live When using --connection, the number of milliseconds to 
wait for new connections
at the beginning and after all clients have 
disconnected. Not specifying this
argument or specifying non-positive values will wait 
indefinitely.
```

# Benefits

Automatic release of resources when lldb-dap is no longer being used (e.g. 
release memory used by module cache).

# Test

TBD. I will find a test file to add tests.


>From 9af1b0029e3e19b521d472d8c94596709f990166 Mon Sep 17 00:00:00 2001
From: Roy Shi 
Date: Wed, 3 Sep 2025 22:23:20 -0700
Subject: [PATCH] [lldb-dap] Add optional TTL argument when using --connection

---
 lldb/tools/lldb-dap/Options.td|  7 
 lldb/tools/lldb-dap/tool/lldb-dap.cpp | 53 ++-
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/lldb/tools/lldb-dap/Options.td b/lldb/tools/lldb-dap/Options.td
index 867753e9294a6..754b8c7d03568 100644
--- a/lldb/tools/lldb-dap/Options.td
+++ b/lldb/tools/lldb-dap/Options.td
@@ -61,3 +61,10 @@ def pre_init_command: S<"pre-init-command">,
 def: Separate<["-"], "c">,
   Alias,
   HelpText<"Alias for --pre-init-command">;
+
+def time_to_live: S<"time-to-live">,
+  MetaVarName<"">,
+  HelpText<"When using --connection, the number of milliseconds to wait "
+"for new connections at the beginning and after all clients have "
+"disconnected. Not specifying this argument or specifying "
+"non-positive values will wait indefinitely.">;
diff --git a/lldb/tools/lldb-dap/tool/lldb-dap.cpp 
b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
index b74085f25f4e2..8b53e4d5cda83 100644
--- a/lldb/tools/lldb-dap/tool/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
@@ -258,7 +258,7 @@ validateConnection(llvm::StringRef conn) {
 static llvm::Error
 serveConnection(const Socket::SocketProtocol &protocol, const std::string 
&name,
 Log *log, const ReplMode default_repl_mode,
-const std::vector &pre_init_commands) {
+const std::vector &pre_init_commands, int ttl) {
   Status status;
   static std::unique_ptr listener = Socket::Create(protocol, status);
   if (status.Fail()) {
@@ -283,6 +283,21 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
 g_loop.AddPendingCallback(
 [](MainLoopBase &loop) { loop.RequestTermination(); });
   });
+  static MainLoopBase::TimePoint ttl_time_point;
+  static std::mutex ttl_mutex;
+  if (ttl > 0) {
+std::scoped_lock lock(ttl_mutex);
+MainLoopBase::TimePoint future =
+std::chrono::steady_clock::now() + std::chrono::milliseconds(ttl);
+ttl_time_point = future;
+g_loop.AddCallback(
+[future](MainLoopBase &loop) {
+  if (ttl_time_point == future) {
+loop.RequestTermination();
+  }
+},
+future);
+  }
   std::condition_variable dap_sessions_condition;
   std::mutex dap_sessions_mutex;
   std::map dap_sessions;
@@ -291,6 +306,12 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
   &dap_sessions_mutex, &dap_sessions,
   &clientCount](
  std::unique_ptr sock) {
+if (ttl > 0) {
+  // Reset the keep alive timer, because we won't be killing the server
+  // while this connection is being served.
+  std::scoped_lock lock(ttl_mutex);
+  ttl_time_point = MainLoopBase::TimePoint();
+}
 std::string client_name = llvm::formatv("client_{0}", clientCount++).str();
 DAP_LOG(log, "({0}) client connected", client_name);
 
@@ -327,6 +348,23 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
   std::unique_lock lock(dap_sessions_mutex);
   dap_sessions.erase(&loop);
   std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+  if (ttl > 0) {
+// Start the countdown to kill the server at the end of each 
connection.
+std::scoped_lock lock(ttl_mutex);
+MainLoopBase::TimePoint future =
+std::chrono::steady_clock::now() + std::chrono::milliseconds(ttl);
+// We don't need to take the max of `keep_alive_up_to` and `future`,
+// because `future` must be the latest.
+ttl_time_point = future;
+g_loop.AddCallback(
+[future](MainLoopBase &loop) {
+  if (ttl_time_point == future) {
+loop.RequestTermination();
+  }
+},
+future);
+  }
 });
 client.detach();
   });
@@ -509,6 +547,17 @@ int main(int argc, char *argv[]) {
   }
 
   if (!connection.empty()) {
+int ttl = 0;
+llvm::opt::Arg *time_to_live = input_args.getLastArg(OPT_time_to_live);
+if (time_to_live

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Roy Shi (royitaqi)


Changes

# Usage

```
--time-to-live When using --connection, the number of 
milliseconds to wait for new connections
at the beginning and after all clients have 
disconnected. Not specifying this
argument or specifying non-positive values will wait 
indefinitely.
```

# Benefits

Automatic release of resources when lldb-dap is no longer being used (e.g. 
release memory used by module cache).

# Test

TBD. I will find a test file to add tests.


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


2 Files Affected:

- (modified) lldb/tools/lldb-dap/Options.td (+7) 
- (modified) lldb/tools/lldb-dap/tool/lldb-dap.cpp (+51-2) 


``diff
diff --git a/lldb/tools/lldb-dap/Options.td b/lldb/tools/lldb-dap/Options.td
index 867753e9294a6..754b8c7d03568 100644
--- a/lldb/tools/lldb-dap/Options.td
+++ b/lldb/tools/lldb-dap/Options.td
@@ -61,3 +61,10 @@ def pre_init_command: S<"pre-init-command">,
 def: Separate<["-"], "c">,
   Alias,
   HelpText<"Alias for --pre-init-command">;
+
+def time_to_live: S<"time-to-live">,
+  MetaVarName<"">,
+  HelpText<"When using --connection, the number of milliseconds to wait "
+"for new connections at the beginning and after all clients have "
+"disconnected. Not specifying this argument or specifying "
+"non-positive values will wait indefinitely.">;
diff --git a/lldb/tools/lldb-dap/tool/lldb-dap.cpp 
b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
index b74085f25f4e2..8b53e4d5cda83 100644
--- a/lldb/tools/lldb-dap/tool/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
@@ -258,7 +258,7 @@ validateConnection(llvm::StringRef conn) {
 static llvm::Error
 serveConnection(const Socket::SocketProtocol &protocol, const std::string 
&name,
 Log *log, const ReplMode default_repl_mode,
-const std::vector &pre_init_commands) {
+const std::vector &pre_init_commands, int ttl) {
   Status status;
   static std::unique_ptr listener = Socket::Create(protocol, status);
   if (status.Fail()) {
@@ -283,6 +283,21 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
 g_loop.AddPendingCallback(
 [](MainLoopBase &loop) { loop.RequestTermination(); });
   });
+  static MainLoopBase::TimePoint ttl_time_point;
+  static std::mutex ttl_mutex;
+  if (ttl > 0) {
+std::scoped_lock lock(ttl_mutex);
+MainLoopBase::TimePoint future =
+std::chrono::steady_clock::now() + std::chrono::milliseconds(ttl);
+ttl_time_point = future;
+g_loop.AddCallback(
+[future](MainLoopBase &loop) {
+  if (ttl_time_point == future) {
+loop.RequestTermination();
+  }
+},
+future);
+  }
   std::condition_variable dap_sessions_condition;
   std::mutex dap_sessions_mutex;
   std::map dap_sessions;
@@ -291,6 +306,12 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
   &dap_sessions_mutex, &dap_sessions,
   &clientCount](
  std::unique_ptr sock) {
+if (ttl > 0) {
+  // Reset the keep alive timer, because we won't be killing the server
+  // while this connection is being served.
+  std::scoped_lock lock(ttl_mutex);
+  ttl_time_point = MainLoopBase::TimePoint();
+}
 std::string client_name = llvm::formatv("client_{0}", clientCount++).str();
 DAP_LOG(log, "({0}) client connected", client_name);
 
@@ -327,6 +348,23 @@ serveConnection(const Socket::SocketProtocol &protocol, 
const std::string &name,
   std::unique_lock lock(dap_sessions_mutex);
   dap_sessions.erase(&loop);
   std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+  if (ttl > 0) {
+// Start the countdown to kill the server at the end of each 
connection.
+std::scoped_lock lock(ttl_mutex);
+MainLoopBase::TimePoint future =
+std::chrono::steady_clock::now() + std::chrono::milliseconds(ttl);
+// We don't need to take the max of `keep_alive_up_to` and `future`,
+// because `future` must be the latest.
+ttl_time_point = future;
+g_loop.AddCallback(
+[future](MainLoopBase &loop) {
+  if (ttl_time_point == future) {
+loop.RequestTermination();
+  }
+},
+future);
+  }
 });
 client.detach();
   });
@@ -509,6 +547,17 @@ int main(int argc, char *argv[]) {
   }
 
   if (!connection.empty()) {
+int ttl = 0;
+llvm::opt::Arg *time_to_live = input_args.getLastArg(OPT_time_to_live);
+if (time_to_live) {
+  llvm::StringRef time_to_live_value = time_to_live->getValue();
+  if (time_to_live_value.getAsInteger(10, ttl)) {
+llvm::errs() << "'" << 

[Lldb-commits] [lldb] [LLDB] Make internal shell the default for running LLDB lit tests. (PR #156729)

2025-09-03 Thread Aiden Grossman via lldb-commits


@@ -13,3 +13,15 @@
 config.name = "lldb"
 config.test_source_root = os.path.dirname(__file__)
 config.test_exec_root = os.path.join(config.lldb_obj_root, "test")
+
+# We prefer the lit internal shell which provides a better user experience on
+# failures and is faster unless the user explicitly disables it with
+# LIT_USE_INTERNAL_SHELL=0 env var.
+
+use_lit_shell = True
+lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if lit_shell_env:
+use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+
+if use_lit_shell:
+os.environ["LIT_USE_INTERNAL_SHELL"] = "1"

boomanaiden154 wrote:

Looks like that's because all of the shell tests override it in 
`lldb/test/Shell/lit.cfg.py`. I think you want to make this modification there.

https://github.com/llvm/llvm-project/pull/156729
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][elf-core][ARM] Add support for VFP registers (PR #155956)

2025-09-03 Thread Igor Kudrin via lldb-commits


@@ -688,6 +688,27 @@ def test_arm_core(self):
 values["lr"] = "0x000e"
 values["pc"] = "0x000f"
 values["cpsr"] = "0x0010"
+for i in range(32):
+values["s" + str(i)] = str(i)
+values["fpscr"] = "0x12345678"
+values["d0"] = "0.0078125"
+values["d1"] = "32.07629394531"
+values["d2"] = "2048.0004920959473"
+values["d3"] = "32768.007904052734"
+values["d4"] = "262144.0634765625"
+values["d5"] = "1048576.2543945313"
+values["d6"] = "4194305.01953125"
+values["d7"] = "16777220.0859375"
+values["d8"] = "50331656.1875"
+values["d9"] = "100663312.390625"
+values["d10"] = "201326624.8125"
+values["d11"] = "402653249.6875"
+values["d12"] = "805306499.5"
+values["d13"] = "1610612999.25"
+values["d14"] = "3221225999"
+values["d15"] = "6442451999"
+for i in range(16, 32):
+values["d" + str(i)] = str(i)

igorkudrin wrote:

Added a source file and a new core file generated from it. PTAL.

https://github.com/llvm/llvm-project/pull/155956
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Introduce ScriptedFrame affordance (PR #149622)

2025-09-03 Thread via lldb-commits

github-actions[bot] wrote:




:warning: Python code formatter, darker found issues in your code. :warning:



You can test this locally with the following command:


``bash
darker --check --diff -r origin/main...HEAD 
lldb/examples/python/templates/scripted_process.py 
lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py
``

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:





View the diff from darker here.


``diff
--- test/API/functionalities/scripted_process/dummy_scripted_process.py 
2025-09-04 01:32:22.00 +
+++ test/API/functionalities/scripted_process/dummy_scripted_process.py 
2025-09-04 01:35:19.715376 +
@@ -75,19 +75,20 @@
 self.frames.append(DummyScriptedFrame(self, args, len(self.frames), 
"foo"))
 
 cwd = os.path.dirname(os.path.abspath(__file__))
 
 le = lldb.SBLineEntry()
-le.SetFileSpec(lldb.SBFileSpec(os.path.join(cwd,"baz.cpp"),  True))
+le.SetFileSpec(lldb.SBFileSpec(os.path.join(cwd, "baz.cpp"), True))
 le.SetLine(9)
 le.SetColumn(10)
 
 sym_ctx = lldb.SBSymbolContext()
 sym_ctx.SetLineEntry(le)
 
-self.frames.append(DummyScriptedFrame(self, args, len(self.frames),
-  "baz", sym_ctx))
+self.frames.append(
+DummyScriptedFrame(self, args, len(self.frames), "baz", sym_ctx)
+)
 
 def get_thread_id(self) -> int:
 return 0x19
 
 def get_name(self) -> str:
@@ -175,14 +176,17 @@
 if not sym_ctx_list.IsValid() or sym_ctx_list.GetSize() == 0:
 return None
 
 return sym_ctx_list.GetContextAtIndex(0)
 
-return self.sym_ctx if self.sym_ctx else 
get_symbol_context_for_function(self.name)
+return (
+self.sym_ctx if self.sym_ctx else 
get_symbol_context_for_function(self.name)
+)
 
 def get_scripted_frame_plugin(self):
 return DummyScriptedFrame.__module__ + "." + 
DummyScriptedFrame.__name__
+
 
 def __lldb_init_module(debugger, dict):
 # This is used when loading the script in an interactive debug session to
 # automatically, register the stop-hook and launch the scripted process.
 if not "SKIP_SCRIPTED_PROCESS_LAUNCH" in os.environ:

``




https://github.com/llvm/llvm-project/pull/149622
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add some vector operations to the IRInterpreter (PR #155000)

2025-09-03 Thread Daniel Sanders via lldb-commits

https://github.com/dsandersllvm updated 
https://github.com/llvm/llvm-project/pull/155000

>From be4ddf49a230b32699df153ecc3b2b3ee62c1c22 Mon Sep 17 00:00:00 2001
From: Daniel Sanders 
Date: Fri, 22 Aug 2025 10:54:52 -0700
Subject: [PATCH 1/7] [lldb] Add some vector operations to the IRInterpreter

This allows the debugger to evaluate expressions without requiring the
expression to be CodeGen'd and executed on the target. This should be more
efficient for many existing targets but is necessary for targets which are
not yet able to evaluate on the target.

As far as I know most targets have a vector memory layout that matches the
IR element order. Most little endian targets choose to use a little endian
element order, and two out of the three big endian targets I know of
(MIPS MSA and ARM NEON) choose to use little endian element order even
when the elements are big endian which matches LLVM-IR's order. The third
is PowerPC Altivec which has the highest indexed element first for
big-endian mode.

I've attempted to implement the correct element ordering on the relevant
operations but I don't really have a means to test the case where the
element order doesn't match LLVM-IR's element order so I've chosen to have
a guard against element order mismatches to ensure that this change can't
break expression evaluation on those targets.
---
 lldb/include/lldb/Core/Architecture.h |  11 +
 lldb/include/lldb/Expression/IRInterpreter.h  |   3 +-
 lldb/source/Expression/IRInterpreter.cpp  | 209 +-
 .../Architecture/PPC64/ArchitecturePPC64.cpp  |   7 +-
 .../Architecture/PPC64/ArchitecturePPC64.h|   7 +-
 .../Clang/ClangExpressionParser.cpp   |   2 +-
 .../vector-types/TestVectorTypesFormatting.py |  39 +++-
 7 files changed, 261 insertions(+), 17 deletions(-)

diff --git a/lldb/include/lldb/Core/Architecture.h 
b/lldb/include/lldb/Core/Architecture.h
index b6fc1a20e1e69..435fe20121869 100644
--- a/lldb/include/lldb/Core/Architecture.h
+++ b/lldb/include/lldb/Core/Architecture.h
@@ -129,6 +129,17 @@ class Architecture : public PluginInterface {
RegisterContext ®_context) const {
 return false;
   }
+
+  // Get the vector element order for this architecture. This determines how
+  // vector elements are indexed. This matters in a few places such as reading/
+  // writing LLVM-IR values to/from target memory. Some architectures use
+  // little-endian element ordering where element 0 is at the lowest address
+  // even when the architecture is otherwise big-endian (e.g. MIPS MSA, ARM
+  // NEON), but some architectures like PowerPC may use big-endian element
+  // ordering where element 0 is at the highest address.
+  virtual lldb::ByteOrder GetVectorElementOrder() const {
+return lldb::eByteOrderLittle;
+  }
 };
 
 } // namespace lldb_private
diff --git a/lldb/include/lldb/Expression/IRInterpreter.h 
b/lldb/include/lldb/Expression/IRInterpreter.h
index 9106f1b4d1c3d..1c0f10aabed21 100644
--- a/lldb/include/lldb/Expression/IRInterpreter.h
+++ b/lldb/include/lldb/Expression/IRInterpreter.h
@@ -37,7 +37,8 @@ class IRInterpreter {
 public:
   static bool CanInterpret(llvm::Module &module, llvm::Function &function,
lldb_private::Status &error,
-   const bool support_function_calls);
+   const bool support_function_calls,
+   lldb_private::ExecutionContext &exe_ctx);
 
   static bool Interpret(llvm::Module &module, llvm::Function &function,
 llvm::ArrayRef args,
diff --git a/lldb/source/Expression/IRInterpreter.cpp 
b/lldb/source/Expression/IRInterpreter.cpp
index 91404831aeb9b..261574321a74e 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -70,6 +70,18 @@ static std::string PrintType(const Type *type, bool truncate 
= false) {
   return s;
 }
 
+static bool
+MemoryMatchesIRElementOrder(lldb_private::ExecutionContext &exe_ctx) {
+  lldb::TargetSP target_sp = exe_ctx.GetTargetSP();
+  if (target_sp) {
+const auto *arch_plugin = target_sp->GetArchitecturePlugin();
+if (arch_plugin) {
+  return arch_plugin->GetVectorElementOrder() == lldb::eByteOrderLittle;
+}
+  }
+  return true; // Default to little-endian (matches IR)
+}
+
 static bool CanIgnoreCall(const CallInst *call) {
   const llvm::Function *called_function = call->getCalledFunction();
 
@@ -124,6 +136,17 @@ class InterpreterStackFrame {
 
   ~InterpreterStackFrame() = default;
 
+  bool MemoryMatchesIRElementOrder() {
+lldb::TargetSP target_sp = m_execution_unit.GetTarget();
+if (target_sp) {
+  const auto *arch_plugin = target_sp->GetArchitecturePlugin();
+  if (arch_plugin) {
+return arch_plugin->GetVectorElementOrder() == lldb::eByteOrderLittle;
+  }
+}
+return true;
+  }
+
   void Jump(const BasicBlock *bb) {
 m_prev_bb = m_bb;
 m_bb = bb;
@@ -36

[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

> BTW, if this patch breaks that feature w/o some test catching it, we should 
> add a test for these allowed keywords.

This patch doesn't break said feature. It only breaks if you explicitly pass 
`expression --language C`, and expect it to work. If it's a C frame, then 
`expression class = 123` will still work.

This is what your example now would look like:
```
(lldb) f
frame #0: 0x00010490 a.out`main at main.c:5:1
   1int main() {
   2  int class = 100;
   3  __builtin_printf("class is: %d.\n", class);
   4  __builtin_debugtrap();
-> 5}
(lldb) expr class
(int) $1 = 100
(lldb) expr -l c -- class
error: invalid language 'c' for expression. List of supported languages:
  c++
  objective-c++
  c++03
  c++11
  c++14
  c++17
  c++20
  objc++
(lldb) expr -l c++ -- class
  ˄
  ╰─ error: declaration of anonymous class must be a 
definition
  ╰─ warning: declaration does not declare anything
```

https://github.com/llvm/llvm-project/pull/156648
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Make internal shell the default for running LLDB lit tests. (PR #156729)

2025-09-03 Thread Aiden Grossman via lldb-commits


@@ -13,3 +13,15 @@
 config.name = "lldb"
 config.test_source_root = os.path.dirname(__file__)
 config.test_exec_root = os.path.join(config.lldb_obj_root, "test")
+
+# We prefer the lit internal shell which provides a better user experience on
+# failures and is faster unless the user explicitly disables it with
+# LIT_USE_INTERNAL_SHELL=0 env var.
+
+use_lit_shell = True
+lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if lit_shell_env:
+use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+
+if use_lit_shell:
+os.environ["LIT_USE_INTERNAL_SHELL"] = "1"

boomanaiden154 wrote:

I'm thinking we can avoid setting the env variable if we set 
`config.test_format` to
`config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)` 
like in the other tests. I'm assuming that's already the default, but not sure.

https://github.com/llvm/llvm-project/pull/156729
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/156648

>From 5689f9e8489c66237097891e98aba93571f8583f Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Wed, 3 Sep 2025 12:19:17 +0100
Subject: [PATCH 1/3] [lldb][Expression] Reject languages not supported by
 TypeSystems for expression evaluation

There are some languages for which the `ClangExpressionParser` currently
switches the language type behind a user's back. Specifically, `C` gets
turned into `C++` and `ObjC` into `ObjC++`. That's because the Clang
expression evaluator depends on C++ features. These languages have
different semantics, so if, e.g., a user forcefully wants to evaluate an
expression in `C`, but we switch it to `C++`, we get reports from users
confused why the expression failed.

This patch rejects languages specified with `expression --language` that
we won't be able to explicitly evaluate.

rdar://159669244
---
 lldb/source/Commands/CommandObjectExpression.cpp | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lldb/source/Commands/CommandObjectExpression.cpp 
b/lldb/source/Commands/CommandObjectExpression.cpp
index 197bffe9c982f..accc46431d927 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -44,18 +44,21 @@ Status 
CommandObjectExpression::CommandOptions::SetOptionValue(
   const int short_option = GetDefinitions()[option_idx].short_option;
 
   switch (short_option) {
-  case 'l':
+  case 'l': {
 language = Language::GetLanguageTypeFromString(option_arg);
-if (language == eLanguageTypeUnknown) {
+
+if (const LanguageSet supported_languages =
+Language::GetLanguagesSupportingTypeSystemsForExpressions();
+!supported_languages[language]) {
   StreamString sstr;
-  sstr.Printf("unknown language type: '%s' for expression. "
+  sstr.Printf("invalid language '%s' for expression. "
   "List of supported languages:\n",
   option_arg.str().c_str());
 
   Language::PrintSupportedLanguagesForExpressions(sstr, "  ", "\n");
   error = Status(sstr.GetString().str());
 }
-break;
+  } break;
 
   case 'a': {
 bool success;

>From 74e869631658d5db48f37faca35f586ab20ef2d2 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Wed, 3 Sep 2025 12:36:57 +0100
Subject: [PATCH 2/3] fixup! tests

---
 .../calculator_mode/TestCalculatorMode.py  |  2 +-
 .../invalid-args/TestInvalidArgsExpression.py  | 14 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git 
a/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py 
b/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
index 138027507c7a7..f12b5b0a12814 100644
--- a/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
+++ b/lldb/test/API/commands/expression/calculator_mode/TestCalculatorMode.py
@@ -21,7 +21,7 @@ def test__calculator_mode(self):
 )
 # Now try it with a specific language:
 self.expect(
-"expression -l c -- 11 + 22",
+"expression -l c++ -- 11 + 22",
 "11 + 22 didn't get the expected result",
 substrs=["33"],
 )
diff --git 
a/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py 
b/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
index 344aef318d783..ef34344627468 100644
--- 
a/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
+++ 
b/lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py
@@ -10,7 +10,19 @@ def test_invalid_lang(self):
 "expression -l foo --",
 error=True,
 substrs=[
-"error: unknown language type: 'foo' for expression",
+"error: invalid language 'foo' for expression.",
+"List of supported languages:",
+"c++",
+"c++11",
+"c++14",
+],
+)
+
+self.expect(
+"expression -l c --",
+error=True,
+substrs=[
+"error: invalid language 'c' for expression.",
 "List of supported languages:",
 "c++",
 "c++11",

>From 9626c2edba3eef8381bdd94e5ce3121bf277b649 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Wed, 3 Sep 2025 19:56:54 +0100
Subject: [PATCH 3/3] fixup! separate error messages for unknown vs. invalid
 language

---
 .../Commands/CommandObjectExpression.cpp  | 21 ---
 .../invalid-args/TestInvalidArgsExpression.py |  8 +++
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/lldb/source/Commands/CommandObjectExpression.cpp 
b/lldb/source/Commands/CommandObjectExpression.cpp
index accc46431d927..1b951603563ac 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjec

[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

2025-09-03 Thread Michael Buch via lldb-commits


@@ -44,18 +44,21 @@ Status 
CommandObjectExpression::CommandOptions::SetOptionValue(
   const int short_option = GetDefinitions()[option_idx].short_option;
 
   switch (short_option) {
-  case 'l':
+  case 'l': {
 language = Language::GetLanguageTypeFromString(option_arg);
-if (language == eLanguageTypeUnknown) {
+
+if (const LanguageSet supported_languages =
+Language::GetLanguagesSupportingTypeSystemsForExpressions();
+!supported_languages[language]) {
   StreamString sstr;
-  sstr.Printf("unknown language type: '%s' for expression. "
+  sstr.Printf("invalid language '%s' for expression. "

Michael137 wrote:

done in latest commit

https://github.com/llvm/llvm-project/pull/156648
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Target] Clear selected frame index after a StopInfo::PerformAction (PR #133078)

2025-09-03 Thread via lldb-commits

jimingham wrote:

The only bad effect I can see just from looking at the patch is if I had 
selected frame 5 of a given thread, and then had run an expression.  I want to 
make sure that when the expression is done running, we don't set the selected 
frame back to 0 (or whatever the most relevant frame machinery would choose).  
It should stay at 5.  I am pretty sure that will work because the expression 
evaluator resets the frame by hand when it's done.  
But we should make sure I'm right about that.
Other than that, this still seems fine to me.

https://github.com/llvm/llvm-project/pull/133078
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Mark scripted frames as synthetic instead of artificial (PR #153117)

2025-09-03 Thread via lldb-commits

jimingham wrote:

LGTM2

https://github.com/llvm/llvm-project/pull/153117
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Make internal shell the default for running LLDB lit tests. (PR #156729)

2025-09-03 Thread Jonas Devlieghere via lldb-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/156729
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 74b7e73 - [llldb][test] Mark a DWO test unsupported on Darwin and Windows (#156306)

2025-09-03 Thread via lldb-commits

Author: David Spickett
Date: 2025-09-01T13:20:30+01:00
New Revision: 74b7e7352b47dd1a5fd8c02bce392027b4c035dc

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

LOG: [llldb][test] Mark a DWO test unsupported on Darwin and Windows (#156306)

This uses split DWARF and from looking at other tests, it should not be
running on Darwin or Windows.

It does pass using the DIA PDB plugin but I think this is misleading
because it's not actually testing the intended feature.

When the native PDB plugin is used it fails because it cannot set a
breakpoint. I don't see a point to running this test on Windows at all.

Native PDB plugin test failures are being tracked in #114906.

Added: 


Modified: 
lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test

Removed: 




diff  --git 
a/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test 
b/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
index 6e4deae7b9a0d..40d5e90097eb6 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
+++ b/lldb/test/Shell/SymbolFile/DWARF/dwo-static-data-member-access.test
@@ -4,6 +4,9 @@
 # a DW_TAG_variable DIE, whose parent DIE is only
 # a forward declaration.
 
+# UNSUPPORTED: system-darwin
+# UNSUPPORTED: system-windows
+
 # RUN: %clangxx_host %S/Inputs/dwo-static-data-member.cpp \
 # RUN:   -g -gdwarf-5 -gsplit-dwarf -flimit-debug-info -o %t
 # RUN: %lldb %t -s %s -o exit 2>&1 | FileCheck %s



___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-03 Thread Carlos Galvez via lldb-commits

carlosgalvezp wrote:

> we shouldn't discourage people from improving the codebase

These are orthogonal issues. People are always welcome to improve the codebase, 
but small PRs are essential for a healthy codebase. And it will actually be 
**less* work for the author, because the patches will be able to merge sooner 
than a mega-patch (quicker review, less conflicts, less CI checks).

Also, issues like the one that was brought up in this patch are less likely to 
be found on a mega-patch.

Last, such a mega-patch generates a lot of review noise for everyone involved 
since every interaction generates a notification/email for everyone, even if 
it's unrelated to their subproject.

Doing this in N patches is trivial and I don't think it's requiring much of the 
author. 

https://github.com/llvm/llvm-project/pull/156270
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-03 Thread Paschalis Mpeis via lldb-commits

https://github.com/paschalis-mpeis approved this pull request.

Thanks for the fixes. Directory `/bolt` LGTM. Please wait on other areas.

https://github.com/llvm/llvm-project/pull/156270
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

https://github.com/dlav-sc updated 
https://github.com/llvm/llvm-project/pull/156506

>From d9ede8035d1786a62375295fdb855fb2a08f0c72 Mon Sep 17 00:00:00 2001
From: Daniil Avdeev 
Date: Wed, 16 Jul 2025 14:52:27 +
Subject: [PATCH 1/2] [lldb][RISCV][test] make atomic region stepping test more
 robust

Currently, the tests that check stepping through atomic sequences use a
hardcoded step distance, which is unreliable because this distance
depends on LLVM's codegeneration.

This patch rewrites the test to avoid this disadvantage. The test now
checks the opcode of the instruction after the step instead of the step
distance.
---
 lldb/test/API/riscv/step/TestSoftwareStep.py | 35 
 lldb/test/API/riscv/step/branch.c|  1 +
 lldb/test/API/riscv/step/main.c  |  1 +
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lldb/test/API/riscv/step/TestSoftwareStep.py 
b/lldb/test/API/riscv/step/TestSoftwareStep.py
index 279c4c1b797e0..0544d2102d0f9 100644
--- a/lldb/test/API/riscv/step/TestSoftwareStep.py
+++ b/lldb/test/API/riscv/step/TestSoftwareStep.py
@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_branch_cas(self):
 """
 LLDB cannot predict the actual state of registers within a critical 
section (i.e., inside an atomic
@@ -51,29 +58,29 @@ def test_branch_cas(self):
 test is nearly identical to the previous one, except for the branch 
condition, which is inverted and
 will result in a taken jump.
 """
-difference = self.do_sequence_test("branch", "branch_cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("branch", "branch_cas")
+self.assertEqual(instruction, "ret")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_lr(self):
 """
 This test verifies the behavior of a standalone sc instruction without 
a preceding lr. Since the sc
 lacks the required lr pairing, LLDB should treat it as a non-atomic 
store rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_lr", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_sc(self):
 """
 This test checks the behavior of a standalone lr instruction without a 
subsequent sc. Since the lr
 lacks its required sc counterpart, LLDB should treat it as a 
non-atomic load rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_sc", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
diff --git a/lldb/test/API/riscv/step/branch.c 
b/lldb/test/API/riscv/step/branch.c
index 79bf0ca005db1..93d6c51ec75e0 100644
--- a/lldb/test/API/riscv/step/branch.c
+++ b/lldb/test/API/riscv/step/branch.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) branch_cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t"
"beqz a5, 1b\n\t"
+   "nop\n\t"
"2:\n\t"
"ret\n\t");
 }
diff --git a/lldb/test/API/riscv/step/main.c b/lldb/test/API/riscv/step/main.c
index 35e8aee2cae4b..5ed2ced87e7b3 100644
--- a/lldb/test/API/riscv/step/main.c
+++ b/lldb/test/API/riscv/step/main.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t

[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff origin/main HEAD --extensions c -- 
lldb/test/API/riscv/step/branch.c lldb/test/API/riscv/step/main.c
``

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:





View the diff from clang-format here.


``diff
diff --git a/lldb/test/API/riscv/step/main.c b/lldb/test/API/riscv/step/main.c
index 6207954b7..6649034aa 100644
--- a/lldb/test/API/riscv/step/main.c
+++ b/lldb/test/API/riscv/step/main.c
@@ -1,7 +1,7 @@
 void __attribute__((naked)) cas(int *a, int *b) {
-  // This atomic sequence implements a copy-and-swap function. This test 
should stop
-  // at the first instruction, and after step instruction, we should stop at 
the
-  // end of the sequence (on the ret instruction).
+  // This atomic sequence implements a copy-and-swap function. This test should
+  // stop at the first instruction, and after step instruction, we should stop
+  // at the end of the sequence (on the ret instruction).
   asm volatile("1:\n\t"
"lr.w a2, (a0)\n\t"
"and a5, a2, a4\n\t"

``




https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread David Spickett via lldb-commits

DavidSpickett wrote:

In `lldb/test/API/riscv/step/incomplete_sequence_without_lr.c` you expect to 
land on `and a5, a2, a4`. There is another `and a5...` but has different 2nd 
and 3rd operands.

There is a comment that refers to this but it almost looks like a typo.
```
  // a step instruction and ensure that execution stops at the next instruction
  // (and).
```

Please change that to include the operands too and/or add an inline comment on 
the instruction we expect to stop on. So then if the test ever does fail, we 
have more chances to realise that `and a5, a5, a4` is in fact different to `and 
a5, a2, a4`.

I was going to say make it some unique thing like a nop, but this test wants it 
to be almost an atomic sequence but not quite. So we shouldn't be modifying the 
rest of the sequence I think.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread David Spickett via lldb-commits


@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))

DavidSpickett wrote:

I assume this regex was never matching and so the test was always skipped, 
probably also skipped on RISC-V until you fixed it here?

Istr updating this riscv regex in another test in the same way.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

https://github.com/dlav-sc updated 
https://github.com/llvm/llvm-project/pull/156506

>From d9ede8035d1786a62375295fdb855fb2a08f0c72 Mon Sep 17 00:00:00 2001
From: Daniil Avdeev 
Date: Wed, 16 Jul 2025 14:52:27 +
Subject: [PATCH 1/2] [lldb][RISCV][test] make atomic region stepping test more
 robust

Currently, the tests that check stepping through atomic sequences use a
hardcoded step distance, which is unreliable because this distance
depends on LLVM's codegeneration.

This patch rewrites the test to avoid this disadvantage. The test now
checks the opcode of the instruction after the step instead of the step
distance.
---
 lldb/test/API/riscv/step/TestSoftwareStep.py | 35 
 lldb/test/API/riscv/step/branch.c|  1 +
 lldb/test/API/riscv/step/main.c  |  1 +
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lldb/test/API/riscv/step/TestSoftwareStep.py 
b/lldb/test/API/riscv/step/TestSoftwareStep.py
index 279c4c1b797e0..0544d2102d0f9 100644
--- a/lldb/test/API/riscv/step/TestSoftwareStep.py
+++ b/lldb/test/API/riscv/step/TestSoftwareStep.py
@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_branch_cas(self):
 """
 LLDB cannot predict the actual state of registers within a critical 
section (i.e., inside an atomic
@@ -51,29 +58,29 @@ def test_branch_cas(self):
 test is nearly identical to the previous one, except for the branch 
condition, which is inverted and
 will result in a taken jump.
 """
-difference = self.do_sequence_test("branch", "branch_cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("branch", "branch_cas")
+self.assertEqual(instruction, "ret")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_lr(self):
 """
 This test verifies the behavior of a standalone sc instruction without 
a preceding lr. Since the sc
 lacks the required lr pairing, LLDB should treat it as a non-atomic 
store rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_lr", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_sc(self):
 """
 This test checks the behavior of a standalone lr instruction without a 
subsequent sc. Since the lr
 lacks its required sc counterpart, LLDB should treat it as a 
non-atomic load rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_sc", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
diff --git a/lldb/test/API/riscv/step/branch.c 
b/lldb/test/API/riscv/step/branch.c
index 79bf0ca005db1..93d6c51ec75e0 100644
--- a/lldb/test/API/riscv/step/branch.c
+++ b/lldb/test/API/riscv/step/branch.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) branch_cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t"
"beqz a5, 1b\n\t"
+   "nop\n\t"
"2:\n\t"
"ret\n\t");
 }
diff --git a/lldb/test/API/riscv/step/main.c b/lldb/test/API/riscv/step/main.c
index 35e8aee2cae4b..5ed2ced87e7b3 100644
--- a/lldb/test/API/riscv/step/main.c
+++ b/lldb/test/API/riscv/step/main.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t

[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread David Spickett via lldb-commits

DavidSpickett wrote:

> Yes, in these tests, execution during the step is inside the inline assembly 
> block, so I hope the mnemonics will be stable.

Understood.

> This patch rewrites the test to avoid this disadvantage. The test now checks 
> the opcode of the instruction after the step instead of the step distance.

So please extend the sentence "This patch rewrites the test to avoid this 
disadvantage." to state that you do this by avoiding checking for any compiler 
generated locations.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-risc-v

Author: None (dlav-sc)


Changes

Currently, the tests that check stepping through atomic sequences use a 
hardcoded step distance, which is unreliable because this distance depends on 
LLVM's codegeneration.

This patch rewrites the test to avoid this disadvantage. The test now checks 
the opcode of the instruction after the step instead of the step distance.

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


3 Files Affected:

- (modified) lldb/test/API/riscv/step/TestSoftwareStep.py (+21-14) 
- (modified) lldb/test/API/riscv/step/branch.c (+1) 
- (modified) lldb/test/API/riscv/step/main.c (+2-1) 


``diff
diff --git a/lldb/test/API/riscv/step/TestSoftwareStep.py 
b/lldb/test/API/riscv/step/TestSoftwareStep.py
index 279c4c1b797e0..0544d2102d0f9 100644
--- a/lldb/test/API/riscv/step/TestSoftwareStep.py
+++ b/lldb/test/API/riscv/step/TestSoftwareStep.py
@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_branch_cas(self):
 """
 LLDB cannot predict the actual state of registers within a critical 
section (i.e., inside an atomic
@@ -51,29 +58,29 @@ def test_branch_cas(self):
 test is nearly identical to the previous one, except for the branch 
condition, which is inverted and
 will result in a taken jump.
 """
-difference = self.do_sequence_test("branch", "branch_cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("branch", "branch_cas")
+self.assertEqual(instruction, "ret")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_lr(self):
 """
 This test verifies the behavior of a standalone sc instruction without 
a preceding lr. Since the sc
 lacks the required lr pairing, LLDB should treat it as a non-atomic 
store rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_lr", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_sc(self):
 """
 This test checks the behavior of a standalone lr instruction without a 
subsequent sc. Since the lr
 lacks its required sc counterpart, LLDB should treat it as a 
non-atomic load rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_sc", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
diff --git a/lldb/test/API/riscv/step/branch.c 
b/lldb/test/API/riscv/step/branch.c
index 79bf0ca005db1..93d6c51ec75e0 100644
--- a/lldb/test/API/riscv/step/branch.c
+++ b/lldb/test/API/riscv/step/branch.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) branch_cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t"
"beqz a5, 1b\n\t"
+   "nop\n\t"
"2:\n\t"
"ret\n\t");
 }
diff --git a/lldb/test/API/riscv/step/main.c b/lldb/test/API/riscv/step/main.c
index 35e8aee2cae4b..6207954b7e1cb 100644
--- a/lldb/test/API/riscv/step/main.c
+++ b/lldb/test/API/riscv/step/main.c
@@ -1,5 +1,5 @@
 void __attribute__((naked)) cas(int *a, int *b) {
-  // This atomic sequence implements a copy-and-swap function. This test should
+  // This atomic sequence implements a copy-and-swap function. This test 
should stop
   // at the first instruction, and after step instruction, we should sto

[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits


@@ -11,6 +11,7 @@ void __attribute__((naked)) cas(int *a, int *b) {
"xor a5, a2, a5\n\t"

dlav-sc wrote:

addressed

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread David Spickett via lldb-commits

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

Assuming the comments are updated, this LGTM. Thanks for explaining the 
rationale, it does make sense to me now.

One of these days I will take inspiration from this and finally fix these 
sequences for AArch64.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread David Spickett via lldb-commits

DavidSpickett wrote:

And btw does this mean you're running RISC-V tests semi-regularly? If so, glad 
to know someone is :)

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits


@@ -0,0 +1,19 @@
+#include 
+#include 
+#include 
+
+int myglobal = 41;

felipepiovezan wrote:

It is used by the python expression evaluation, but given your other comments 
I'll remove it

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/97443

>From 38b7837bcc5da9e89778191654f9552ebccacbd5 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Tue, 2 Jul 2024 18:43:34 +0200
Subject: [PATCH 1/3] [clang][RecordLayoutBuilder] Be stricter about inferring
 packed-ness in ExternalLayouts

This patch is motivated by the LLDB support required for:
https://github.com/llvm/llvm-project/issues/93069

In the presence of `[[no_unique_address]]`, LLDB may ask Clang
to lay out types with overlapping field offsets. Because we don't
have attributes such as `packed` or `no_unique_address` in the LLDB
AST, the `RecordLayoutBuilder` supports an `InferAlignment` mode, which,
in the past, attempted to detect layouts which came from packed
structures in order to provide a conservative estimate of alignment for
it (since `DW_AT_alignment` isn't emitted unless explicitly changed with
`alignas`, etc.).

However, in the presence of overlapping fields due to `no_unique_address`,
`InferAlignment` would set the alignment of structures to `1` for which
that's incorrect. This poses issues in some LLDB formatters that
synthesize new Clang types and rely on the layout builder to get the
`FieldOffset` of structures right that we did have DWARF offsets for.
The result of this is that if we get the alignment wrong, LLDB reads
out garbage data from the wrong field offsets.

There are a couple of solutions to this that we considered:
1. Make LLDB formatters not do the above, and make them more robust
   to inaccurate alignment.
2. Remove `InferAlignment` entirely and rely on Clang emitting
   `DW_AT_alignment` for packed structures.
3. Remove `InferAlignment` and detect packedness from within LLDB.
4. Make the `InferAlignment` logic account for overlapping fields.

Option (1) turned out quite hairy and it's not clear we can achieve
this with the tools available for certain STL formatters (particularly
`std::map`). But I would still very much like to simplify this if we
can.

Option (2) wouldn't help with GCC-compiled binaries, and if we can
get away with LLDB not needing the alignment, then we wouldn't need
to increase debug-info size.

Option (3), AFAICT, would require us to reimplement some of the layout
logic in the layout builder. Would be great if we can avoid this added
complexity.

Option (4) seemed like the best option in the interim. As part of this
change I also removed one of the `InferAlignment` blocks. The test-cases
associated with this code-path pass regardless, and from the description
of the change that introduced it it's not clear why specifically the
base offsets would influence the `Alignment` field, and how it would
imply packedness. But happy to be proven wrong. Ultimately it would be
great if we can get rid of the `InferAlignment` infrastructure and
support our use-cases in LLDB or DWARF instead.
---
 clang/lib/AST/RecordLayoutBuilder.cpp | 34 +--
 .../DWARF/x86/no_unique_address-alignment.cpp |  2 --
 .../x86/no_unique_address-base-alignment.cpp  |  2 --
 3 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp 
b/clang/lib/AST/RecordLayoutBuilder.cpp
index d9bf62c2bbb04..8dbf69c310cbb 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -802,7 +802,8 @@ class ItaniumRecordLayoutBuilder {
   /// \param Field The field whose offset is being queried.
   /// \param ComputedOffset The offset that we've computed for this field.
   uint64_t updateExternalFieldOffset(const FieldDecl *Field,
- uint64_t ComputedOffset);
+ uint64_t ComputedOffset,
+ uint64_t PreviousOffset);
 
   void CheckFieldPadding(uint64_t Offset, uint64_t UnpaddedOffset,
   uint64_t UnpackedOffset, unsigned UnpackedAlign,
@@ -1296,13 +1297,6 @@ ItaniumRecordLayoutBuilder::LayoutBase(const 
BaseSubobjectInfo *Base) {
 bool Allowed = EmptySubobjects->CanPlaceBaseAtOffset(Base, Offset);
 (void)Allowed;
 assert(Allowed && "Base subobject externally placed at overlapping 
offset");
-
-if (InferAlignment && Offset < getDataSize().alignTo(AlignTo)) {
-  // The externally-supplied base offset is before the base offset we
-  // computed. Assume that the structure is packed.
-  Alignment = CharUnits::One();
-  InferAlignment = false;
-}
   }
 
   if (!Base->Class->isEmpty()) {
@@ -1770,7 +1764,8 @@ void ItaniumRecordLayoutBuilder::LayoutBitField(const 
FieldDecl *D) {
   // If we're using external layout, give the external layout a chance
   // to override this information.
   if (UseExternalLayout)
-FieldOffset = updateExternalFieldOffset(D, FieldOffset);
+FieldOffset = updateExternalFieldOffset(
+D, FieldOffset, FieldOffsets.empty() ? 0 : FieldOffsets.back());
 
   // Okay, place the bitfield at the calculated offset.
   FieldOf

[Lldb-commits] [lldb] [WIP][lldb] Use forward decls with redeclared definitions instead of minimal import for records (PR #95100)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/95100
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits


@@ -0,0 +1,19 @@
+#include 
+#include 
+#include 
+
+int myglobal = 41;
+
+uint64_t get_high_bits(void *ptr) {
+  uint64_t mask = ~((1ULL << 48) - 1);
+  uint64_t ptrtoint = (uint64_t)ptr;
+  uint64_t high_bits = ptrtoint & mask;

felipepiovezan wrote:

my bad, I meant to do it but forgot.

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [WIP][lldb][DWARFASTParserClang] Eagerly search definitions for Objective-C classes (PR #119860)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/119860
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxxabi] [lldb] [llvm] [WIP][lldb] Alternative implementation of more reliable function call infrastructure (PR #115245)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/115245
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [WIP][lldb][DWARFASTParserClang] Eagerly search definitions for Objective-C classes (PR #119860)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Not needed, for now..

https://github.com/llvm/llvm-project/pull/119860
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxxabi] [lldb] [llvm] [WIP][lldb] Alternative implementation of more reliable function call infrastructure (PR #115245)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Landed in https://github.com/llvm/llvm-project/pull/148877

https://github.com/llvm/llvm-project/pull/115245
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [WIP] [lldb][TypeSystemClang] Create clang::SourceLocation from DWARF and attach to AST (PR #127829)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 converted_to_draft 
https://github.com/llvm/llvm-project/pull/127829
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Landed in https://github.com/llvm/llvm-project/pull/148877

https://github.com/llvm/llvm-project/pull/114529
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

@efriedma-quic @rjmccall ping

Remembered about this while clearing out open PRs

https://github.com/llvm/llvm-project/pull/97443
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/114529
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan updated 
https://github.com/llvm/llvm-project/pull/153585

>From ce9c2cc6748c22ce4b0f5178b8f5e877d430 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Wed, 13 Aug 2025 18:38:23 -0700
Subject: [PATCH 1/7] [lldb] Call FixUpPointer in WritePointerToMemory (try 2)

In architectures where pointers may contain metadata, such as arm64e,
the metadata may need to be cleaned prior to sending this pointer to be
used in expression evaluation generated code.

This patch is a step towards allowing consumers of pointers to decide
whether they want to keep or remove metadata, as opposed to discarding
metadata at the moment pointers are created. See #150537.

This was tested running the LLDB test suite on arm64e.

(The first attempt at this patch caused a failure in
TestScriptedProcessEmptyMemoryRegion.py. This test exercises a case
where IRMemoryMap uses host memory in its allocations; pointers to such
allocations should not be fixed, which is what the original patch failed
to account for).
---
 lldb/source/Expression/IRMemoryMap.cpp | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 150699352a2e3..3ac42649d0834 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -640,6 +640,13 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
lldb::addr_t address, Status &error) {
   error.Clear();
 
+  /// Only ask the Process to fix the address if this address belongs to the
+  /// process (host allocations are stored in m_data).
+  if (auto it = FindAllocation(process_address, 1);
+  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
+if (auto process_sp = GetProcessWP().lock())
+  address = process_sp->FixAnyAddress(address);
+
   Scalar scalar(address);
 
   WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);

>From 36dcebb09eecd46f649feb4073c4f10b75423699 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Thu, 14 Aug 2025 08:22:44 -0700
Subject: [PATCH 2/7] fixup! Improve comment

---
 lldb/source/Expression/IRMemoryMap.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 3ac42649d0834..7faf6809383eb 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -641,7 +641,8 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   error.Clear();
 
   /// Only ask the Process to fix the address if this address belongs to the
-  /// process (host allocations are stored in m_data).
+  /// process. An address belongs to the process if the Allocation contains a
+  /// non-empty m_data member.
   if (auto it = FindAllocation(process_address, 1);
   it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
 if (auto process_sp = GetProcessWP().lock())

>From 579c985eb3bbce4d10e86de7ff87238541936232 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Thu, 14 Aug 2025 08:22:58 -0700
Subject: [PATCH 3/7] fixup! Add {} to if statement

---
 lldb/source/Expression/IRMemoryMap.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 7faf6809383eb..8b6d87b589c1b 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -644,9 +644,10 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   /// process. An address belongs to the process if the Allocation contains a
   /// non-empty m_data member.
   if (auto it = FindAllocation(process_address, 1);
-  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
+  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0) {
 if (auto process_sp = GetProcessWP().lock())
   address = process_sp->FixAnyAddress(address);
+  }
 
   Scalar scalar(address);
 

>From d098df34532dfc20a2e6b1f566082ce5b9af24d9 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Wed, 27 Aug 2025 14:26:29 -0700
Subject: [PATCH 4/7] fixup! Fix address confusion

---
 lldb/source/Expression/IRMemoryMap.cpp | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 8b6d87b589c1b..26e59b76a4dac 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -641,13 +641,13 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   error.Clear();
 
   /// Only ask the Process to fix the address if this address belongs to the
-  /// process. An address belongs to the process if the Allocation contains a
-  /// non-empty m_data member.
-  if (auto it = FindAllo

[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits


@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))

dlav-sc wrote:

Yeah, I didn't notice that we actually changed the regex for RISCV in 
https://github.com/llvm/llvm-project/pull/130034. Maybe `^rv.*` works somehow 
too, because I was able to run the tests. Or maybe I didn't have the patch on 
my branch.

Anyway, after https://github.com/llvm/llvm-project/pull/130034, we can use 
`riscv32` and `riscv64`. For any RISCV target, I use `^riscv.*` - for example, 
in the software watchpoints tests.

I noticed that `lldb/test/API/riscv/break-undecoded/TestBreakpointIllegal.py` 
has the old regex, we should change it at some point.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits

felipepiovezan wrote:

I've simplified the test as suggested.
Also going to take your offer of testing/porting this on Linux :) It should 
hopefully be a simple platform check inside python followed by a json update 
like what we do for the triple/uuid.

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread via lldb-commits

github-actions[bot] wrote:




:warning: Python code formatter, darker found issues in your code. :warning:



You can test this locally with the following command:


``bash
darker --check --diff -r origin/main...HEAD 
lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
``

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:





View the diff from darker here.


``diff
--- TestArmPointerMetadataStripping.py  2025-09-03 14:20:00.00 +
+++ TestArmPointerMetadataStripping.py  2025-09-03 14:24:49.909486 +
@@ -2,10 +2,11 @@
 import json
 import os
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
+
 
 @skipUnlessDarwin
 @skipIf(archs=no_match(["arm64", "arm64e"]))
 class TestArmPointerMetadataStripping(TestBase):
 # Use extra_symbols.json as a template to add a new symbol whose address

``




https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread David Spickett via lldb-commits

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

LGTM.

@jasonmolenda anything to add?

https://github.com/llvm/llvm-project/pull/153585
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

dlav-sc wrote:

> And btw does this mean you're running RISC-V tests semi-regularly?

Yeah :) We have a close-source fork with ci, where RISCV lldb tests run after 
each commit.

https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 created 
https://github.com/llvm/llvm-project/pull/156681

This upstreams https://github.com/swiftlang/llvm-project/pull/10313.

If we detect a situation where a forward declaration is C++ and the definition 
DIE is Objective-C, then just don't try to complete the type (it would crash 
otherwise). In the long term we might want to add support for completing such 
types.

We've seen real world crashes when debugging WebKit and wxWidgets because of 
this. Both projects forward declare ObjC++ decls in the way shown in the test.

rdar://145959981

>From 26cad4ef1a92939400cea4781661204dab443c16 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Wed, 3 Sep 2025 15:29:40 +0100
Subject: [PATCH] [lldb][DWARFASTParserClang] Don't complete conflicting
 Objective-C++ types

This upstreams https://github.com/swiftlang/llvm-project/pull/10313.

If we detect a situation where a forward declaration is C++ and the
definition DIE is Objective-C, then just don't try to complete the type
(it would crash otherwise). In the long term we might want to add
support for completing such types.

We've seen real world crashes when debugging WebKit and wxWidgets because of 
this.
Both projects forward declare ObjC++ decls in the way shown in the test.

rdar://145959981
---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp  | 12 
 .../DWARF/objcxx-forward-decls.test   | 70 +++
 2 files changed, 82 insertions(+)
 create mode 100644 lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index a429ea848b7f7..0f1f41baced86 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2230,6 +2230,18 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   for (DelayedAddObjCClassProperty &property : delayed_properties)
 property.Finalize();
 }
+  } else if (Language::LanguageIsObjC(
+ static_cast(die.GetAttributeValueAsUnsigned(
+ DW_AT_APPLE_runtime_class, eLanguageTypeUnknown {
+/// The forward declaration was C++ but the definition is Objective-C.
+/// We currently don't handle such situations. In such cases, keep the
+/// forward declaration without a definition to avoid violating Clang AST
+/// invariants.
+LLDB_LOG(GetLog(LLDBLog::Expressions),
+ "WARNING: Type completion aborted because forward declaration for 
"
+ "'{0}' is C++ while definition is Objective-C.",
+ llvm::StringRef(die.GetName()));
+return {};
   }
 
   if (!bases.empty()) {
diff --git a/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test 
b/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test
new file mode 100644
index 0..30109c2943c9b
--- /dev/null
+++ b/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test
@@ -0,0 +1,70 @@
+# REQUIRES: system-darwin
+
+# In this test we have two CUs with conflicting forward declaration
+# depending on the CU language (one is C++ and the other is Objective-C++).
+# We are then stopped in the C++ CU and try to print the type, at which
+# point LLDB will try to make it into an Clang AST node. If LLDB were to
+# interpret the type as C++ instead of Objective-C, we'd violate Clang
+# invariants and crash.
+#
+# RUN: split-file %s %t
+# RUN: %clangxx_host -c -g -x objective-c++ %t/request.m -o %t/request_objc.o
+# RUN: %clangxx_host -c -g %t/main.cpp -o %t/main.o
+# RUN: %clangxx_host %t/main.o %t/request_objc.o -framework Foundation -o 
%t/a.out
+#
+# RUN: %lldb %t/a.out \
+# RUN:-o "breakpoint set -p return -X main" \
+# RUN:-o run \
+# RUN:-o "frame variable r" \
+# RUN:-o exit | FileCheck %s
+#
+# RUN: dsymutil %t/a.out
+#
+# RUN: %lldb %t/a.out \
+# RUN:-o "breakpoint set -p return -X main" \
+# RUN:-o run \
+# RUN:-o "frame variable r" \
+# RUN:-o exit | FileCheck %s --check-prefix=CHECK-DSYM
+
+# CHECK:  (lldb) frame variable r
+# CHECK-NEXT: (Request) ::r = (m_request = "Hello, World!")
+
+# CHECK-DSYM:  (lldb) frame variable r
+# CHECK-DSYM-NEXT: (Request) ::r = (m_request = "Hello, World!")
+
+#--- lib.h
+#ifndef LIB_H_IN
+#define LIB_H_IN
+
+#ifdef __OBJC__
+@class NSString;   
+#else
+class NSString;
+#endif
+
+struct Request {
+  NSString * m_request = nullptr;
+};
+
+#endif // _H_IN
+
+#--- main.cpp
+#include "lib.h"
+
+void process(Request *);
+
+Request r;
+
+int main() {
+process(&r);
+return 0;
+}
+
+#--- request.m
+#import 
+
+#include "lib.h"
+
+void process(Request * r) {
+  r->m_request = @"Hello, World!";
+}

___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Adjust language type for conflicting Objective-C++ forward declarations (PR #130768)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Closing in favour of https://github.com/llvm/llvm-project/pull/156681

https://github.com/llvm/llvm-project/pull/130768
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Adjust language type for conflicting Objective-C++ forward declarations (PR #130768)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/130768
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

2025-09-03 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan updated 
https://github.com/llvm/llvm-project/pull/153585

>From ce9c2cc6748c22ce4b0f5178b8f5e877d430 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Wed, 13 Aug 2025 18:38:23 -0700
Subject: [PATCH 1/8] [lldb] Call FixUpPointer in WritePointerToMemory (try 2)

In architectures where pointers may contain metadata, such as arm64e,
the metadata may need to be cleaned prior to sending this pointer to be
used in expression evaluation generated code.

This patch is a step towards allowing consumers of pointers to decide
whether they want to keep or remove metadata, as opposed to discarding
metadata at the moment pointers are created. See #150537.

This was tested running the LLDB test suite on arm64e.

(The first attempt at this patch caused a failure in
TestScriptedProcessEmptyMemoryRegion.py. This test exercises a case
where IRMemoryMap uses host memory in its allocations; pointers to such
allocations should not be fixed, which is what the original patch failed
to account for).
---
 lldb/source/Expression/IRMemoryMap.cpp | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 150699352a2e3..3ac42649d0834 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -640,6 +640,13 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
lldb::addr_t address, Status &error) {
   error.Clear();
 
+  /// Only ask the Process to fix the address if this address belongs to the
+  /// process (host allocations are stored in m_data).
+  if (auto it = FindAllocation(process_address, 1);
+  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
+if (auto process_sp = GetProcessWP().lock())
+  address = process_sp->FixAnyAddress(address);
+
   Scalar scalar(address);
 
   WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);

>From 36dcebb09eecd46f649feb4073c4f10b75423699 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Thu, 14 Aug 2025 08:22:44 -0700
Subject: [PATCH 2/8] fixup! Improve comment

---
 lldb/source/Expression/IRMemoryMap.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 3ac42649d0834..7faf6809383eb 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -641,7 +641,8 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   error.Clear();
 
   /// Only ask the Process to fix the address if this address belongs to the
-  /// process (host allocations are stored in m_data).
+  /// process. An address belongs to the process if the Allocation contains a
+  /// non-empty m_data member.
   if (auto it = FindAllocation(process_address, 1);
   it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
 if (auto process_sp = GetProcessWP().lock())

>From 579c985eb3bbce4d10e86de7ff87238541936232 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Thu, 14 Aug 2025 08:22:58 -0700
Subject: [PATCH 3/8] fixup! Add {} to if statement

---
 lldb/source/Expression/IRMemoryMap.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 7faf6809383eb..8b6d87b589c1b 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -644,9 +644,10 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   /// process. An address belongs to the process if the Allocation contains a
   /// non-empty m_data member.
   if (auto it = FindAllocation(process_address, 1);
-  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
+  it != m_allocations.end() && it->second.m_data.GetByteSize() == 0) {
 if (auto process_sp = GetProcessWP().lock())
   address = process_sp->FixAnyAddress(address);
+  }
 
   Scalar scalar(address);
 

>From d098df34532dfc20a2e6b1f566082ce5b9af24d9 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Wed, 27 Aug 2025 14:26:29 -0700
Subject: [PATCH 4/8] fixup! Fix address confusion

---
 lldb/source/Expression/IRMemoryMap.cpp | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lldb/source/Expression/IRMemoryMap.cpp 
b/lldb/source/Expression/IRMemoryMap.cpp
index 8b6d87b589c1b..26e59b76a4dac 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -641,13 +641,13 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t 
process_address,
   error.Clear();
 
   /// Only ask the Process to fix the address if this address belongs to the
-  /// process. An address belongs to the process if the Allocation contains a
-  /// non-empty m_data member.
-  if (auto it = FindAllo

[Lldb-commits] [clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-09-03 Thread Corentin Jabot via lldb-commits

cor3ntin wrote:

I'm still happy with this. I did not notice it was not merged

https://github.com/llvm/llvm-project/pull/122265
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)


Changes

This upstreams https://github.com/swiftlang/llvm-project/pull/10313.

If we detect a situation where a forward declaration is C++ and the definition 
DIE is Objective-C, then just don't try to complete the type (it would crash 
otherwise). In the long term we might want to add support for completing such 
types.

We've seen real world crashes when debugging WebKit and wxWidgets because of 
this. Both projects forward declare ObjC++ decls in the way shown in the test.

rdar://145959981

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


2 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (+12) 
- (added) lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test (+70) 


``diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index a429ea848b7f7..0f1f41baced86 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2230,6 +2230,18 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   for (DelayedAddObjCClassProperty &property : delayed_properties)
 property.Finalize();
 }
+  } else if (Language::LanguageIsObjC(
+ static_cast(die.GetAttributeValueAsUnsigned(
+ DW_AT_APPLE_runtime_class, eLanguageTypeUnknown {
+/// The forward declaration was C++ but the definition is Objective-C.
+/// We currently don't handle such situations. In such cases, keep the
+/// forward declaration without a definition to avoid violating Clang AST
+/// invariants.
+LLDB_LOG(GetLog(LLDBLog::Expressions),
+ "WARNING: Type completion aborted because forward declaration for 
"
+ "'{0}' is C++ while definition is Objective-C.",
+ llvm::StringRef(die.GetName()));
+return {};
   }
 
   if (!bases.empty()) {
diff --git a/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test 
b/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test
new file mode 100644
index 0..30109c2943c9b
--- /dev/null
+++ b/lldb/test/Shell/SymbolFile/DWARF/objcxx-forward-decls.test
@@ -0,0 +1,70 @@
+# REQUIRES: system-darwin
+
+# In this test we have two CUs with conflicting forward declaration
+# depending on the CU language (one is C++ and the other is Objective-C++).
+# We are then stopped in the C++ CU and try to print the type, at which
+# point LLDB will try to make it into an Clang AST node. If LLDB were to
+# interpret the type as C++ instead of Objective-C, we'd violate Clang
+# invariants and crash.
+#
+# RUN: split-file %s %t
+# RUN: %clangxx_host -c -g -x objective-c++ %t/request.m -o %t/request_objc.o
+# RUN: %clangxx_host -c -g %t/main.cpp -o %t/main.o
+# RUN: %clangxx_host %t/main.o %t/request_objc.o -framework Foundation -o 
%t/a.out
+#
+# RUN: %lldb %t/a.out \
+# RUN:-o "breakpoint set -p return -X main" \
+# RUN:-o run \
+# RUN:-o "frame variable r" \
+# RUN:-o exit | FileCheck %s
+#
+# RUN: dsymutil %t/a.out
+#
+# RUN: %lldb %t/a.out \
+# RUN:-o "breakpoint set -p return -X main" \
+# RUN:-o run \
+# RUN:-o "frame variable r" \
+# RUN:-o exit | FileCheck %s --check-prefix=CHECK-DSYM
+
+# CHECK:  (lldb) frame variable r
+# CHECK-NEXT: (Request) ::r = (m_request = "Hello, World!")
+
+# CHECK-DSYM:  (lldb) frame variable r
+# CHECK-DSYM-NEXT: (Request) ::r = (m_request = "Hello, World!")
+
+#--- lib.h
+#ifndef LIB_H_IN
+#define LIB_H_IN
+
+#ifdef __OBJC__
+@class NSString;   
+#else
+class NSString;
+#endif
+
+struct Request {
+  NSString * m_request = nullptr;
+};
+
+#endif // _H_IN
+
+#--- main.cpp
+#include "lib.h"
+
+void process(Request *);
+
+Request r;
+
+int main() {
+process(&r);
+return 0;
+}
+
+#--- request.m
+#import 
+
+#include "lib.h"
+
+void process(Request * r) {
+  r->m_request = @"Hello, World!";
+}

``




https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Michael Buch via lldb-commits

Michael137 wrote:

Planning to cherry-pick this to `release/21.x` if this lands

https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

https://github.com/dlav-sc edited 
https://github.com/llvm/llvm-project/pull/156506
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 edited 
https://github.com/llvm/llvm-project/pull/133079
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-03 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)


Changes

When hitting a sanitizer breakpoint, LLDB currently displays the frame in the 
sanitizer dylib (which we usually don't have debug-info for), which isn't very 
helpful to the user. A more helpful frame to display would be the first frame 
not in the sanitizer library (we have a [similar heuristic when we trap inside 
libc++](https://github.com/llvm/llvm-project/pull/108825)). This patch does 
just that, by implementing the `GetSuggestedStackFrameIndex` API

Depends on https://github.com/llvm/llvm-project/pull/133078

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


8 Files Affected:

- (modified) lldb/include/lldb/Target/InstrumentationRuntimeStopInfo.h (+3) 
- (modified) lldb/include/lldb/Target/StackFrameList.h (+2) 
- (modified) lldb/include/lldb/Target/Thread.h (+4) 
- (modified) lldb/source/Target/InstrumentationRuntimeStopInfo.cpp (+42) 
- (modified) lldb/source/Target/Process.cpp (+2) 
- (modified) lldb/test/API/functionalities/asan/TestMemoryHistory.py (+4) 
- (modified) lldb/test/API/functionalities/asan/TestReportData.py (+4) 
- (modified) lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py (+2-2) 


``diff
diff --git a/lldb/include/lldb/Target/InstrumentationRuntimeStopInfo.h 
b/lldb/include/lldb/Target/InstrumentationRuntimeStopInfo.h
index 5345160850914..dafa41c11327a 100644
--- a/lldb/include/lldb/Target/InstrumentationRuntimeStopInfo.h
+++ b/lldb/include/lldb/Target/InstrumentationRuntimeStopInfo.h
@@ -24,6 +24,9 @@ class InstrumentationRuntimeStopInfo : public StopInfo {
 return lldb::eStopReasonInstrumentation;
   }
 
+  std::optional
+  GetSuggestedStackFrameIndex(bool inlined_stack) override;
+
   const char *GetDescription() override;
 
   bool DoShouldNotify(Event *event_ptr) override { return true; }
diff --git a/lldb/include/lldb/Target/StackFrameList.h 
b/lldb/include/lldb/Target/StackFrameList.h
index 8a66296346f2d..be6ec3b09d8aa 100644
--- a/lldb/include/lldb/Target/StackFrameList.h
+++ b/lldb/include/lldb/Target/StackFrameList.h
@@ -36,6 +36,8 @@ class StackFrameList {
   /// Get the frame at index \p idx. Invisible frames cannot be indexed.
   lldb::StackFrameSP GetFrameAtIndex(uint32_t idx);
 
+  void ResetSuggestedStackFrameIndex() { m_selected_frame_idx.reset(); }
+
   /// Get the first concrete frame with index greater than or equal to \p idx.
   /// Unlike \ref GetFrameAtIndex, this cannot return a synthetic frame.
   lldb::StackFrameSP GetFrameWithConcreteFrameIndex(uint32_t unwind_idx);
diff --git a/lldb/include/lldb/Target/Thread.h 
b/lldb/include/lldb/Target/Thread.h
index 1d1e3dcfc1dc6..747d7299025f8 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -433,6 +433,10 @@ class Thread : public std::enable_shared_from_this,
 return GetStackFrameList()->GetFrameAtIndex(idx);
   }
 
+  virtual void ResetSuggestedStackFrameIndex() {
+return GetStackFrameList()->ResetSuggestedStackFrameIndex();
+  }
+
   virtual lldb::StackFrameSP
   GetFrameWithConcreteFrameIndex(uint32_t unwind_idx);
 
diff --git a/lldb/source/Target/InstrumentationRuntimeStopInfo.cpp 
b/lldb/source/Target/InstrumentationRuntimeStopInfo.cpp
index 7f82581cc601e..1daeebdbaf9c7 100644
--- a/lldb/source/Target/InstrumentationRuntimeStopInfo.cpp
+++ b/lldb/source/Target/InstrumentationRuntimeStopInfo.cpp
@@ -8,13 +8,20 @@
 
 #include "lldb/Target/InstrumentationRuntimeStopInfo.h"
 
+#include "lldb/Core/Module.h"
 #include "lldb/Target/InstrumentationRuntime.h"
 #include "lldb/Target/Process.h"
+#include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-private.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+static bool IsStoppedInDarwinSanitizer(Thread &thread, Module &module) {
+  return module.GetFileSpec().GetFilename().GetStringRef().starts_with(
+  "libclang_rt.");
+}
+
 InstrumentationRuntimeStopInfo::InstrumentationRuntimeStopInfo(
 Thread &thread, std::string description,
 StructuredData::ObjectSP additional_data)
@@ -34,3 +41,38 @@ 
InstrumentationRuntimeStopInfo::CreateStopReasonWithInstrumentationData(
   return StopInfoSP(
   new InstrumentationRuntimeStopInfo(thread, description, additionalData));
 }
+
+std::optional
+InstrumentationRuntimeStopInfo::GetSuggestedStackFrameIndex(
+bool inlined_stack) {
+  auto thread_sp = GetThread();
+  if (!thread_sp)
+return std::nullopt;
+
+  // Defensive upper-bound of when we stop walking up the frames in
+  // case we somehow ended up looking at an infinite recursion.
+  const size_t max_stack_depth = 128;
+
+  // Start at parent frame.
+  size_t stack_idx = 1;
+  StackFrameSP most_relevant_frame_sp =
+  thread_sp->GetStackFrameAtIndex(stack_idx);
+
+  while (most_relevant_frame_sp && stack_idx <= max_stack_depth) {
+auto const &sc =
+most_relevant_frame_sp->GetSymbolContext(lldb::eSymbolContextModule);
+
+if (!sc.module_sp)
+ 

[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 edited 
https://github.com/llvm/llvm-project/pull/133079
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-03 Thread Michael Buch via lldb-commits

https://github.com/Michael137 ready_for_review 
https://github.com/llvm/llvm-project/pull/133079
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][RISCV][test] make atomic region stepping test more robust (PR #156506)

2025-09-03 Thread via lldb-commits

https://github.com/dlav-sc updated 
https://github.com/llvm/llvm-project/pull/156506

>From d9ede8035d1786a62375295fdb855fb2a08f0c72 Mon Sep 17 00:00:00 2001
From: Daniil Avdeev 
Date: Wed, 16 Jul 2025 14:52:27 +
Subject: [PATCH 1/3] [lldb][RISCV][test] make atomic region stepping test more
 robust

Currently, the tests that check stepping through atomic sequences use a
hardcoded step distance, which is unreliable because this distance
depends on LLVM's codegeneration.

This patch rewrites the test to avoid this disadvantage. The test now
checks the opcode of the instruction after the step instead of the step
distance.
---
 lldb/test/API/riscv/step/TestSoftwareStep.py | 35 
 lldb/test/API/riscv/step/branch.c|  1 +
 lldb/test/API/riscv/step/main.c  |  1 +
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lldb/test/API/riscv/step/TestSoftwareStep.py 
b/lldb/test/API/riscv/step/TestSoftwareStep.py
index 279c4c1b797e0..0544d2102d0f9 100644
--- a/lldb/test/API/riscv/step/TestSoftwareStep.py
+++ b/lldb/test/API/riscv/step/TestSoftwareStep.py
@@ -26,19 +26,26 @@ def do_sequence_test(self, filename, bkpt_name):
 substrs=["stopped", "stop reason = instruction step into"],
 )
 
-pc = cur_thread.GetFrameAtIndex(0).GetPC()
+# Get the instruction we stopped at
+pc = cur_thread.GetFrameAtIndex(0).GetPCAddress()
+inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
 
-return pc - entry_pc
+inst_mnemonic = inst.GetMnemonic(target)
+inst_operands = inst.GetOperands(target)
+if not inst_operands:
+return inst_mnemonic
 
-@skipIf(archs=no_match("^rv.*"))
+return f"{inst_mnemonic} {inst_operands}"
+
+@skipIf(archs=no_match("^riscv.*"))
 def test_cas(self):
 """
 This test verifies LLDB instruction step handling of a proper lr/sc 
pair.
 """
-difference = self.do_sequence_test("main", "cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("main", "cas")
+self.assertEqual(instruction, "nop")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_branch_cas(self):
 """
 LLDB cannot predict the actual state of registers within a critical 
section (i.e., inside an atomic
@@ -51,29 +58,29 @@ def test_branch_cas(self):
 test is nearly identical to the previous one, except for the branch 
condition, which is inverted and
 will result in a taken jump.
 """
-difference = self.do_sequence_test("branch", "branch_cas")
-self.assertEqual(difference, 0x1A)
+instruction = self.do_sequence_test("branch", "branch_cas")
+self.assertEqual(instruction, "ret")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_lr(self):
 """
 This test verifies the behavior of a standalone sc instruction without 
a preceding lr. Since the sc
 lacks the required lr pairing, LLDB should treat it as a non-atomic 
store rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_lr", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
 
-@skipIf(archs=no_match("^rv.*"))
+@skipIf(archs=no_match("^riscv.*"))
 def test_incomplete_sequence_without_sc(self):
 """
 This test checks the behavior of a standalone lr instruction without a 
subsequent sc. Since the lr
 lacks its required sc counterpart, LLDB should treat it as a 
non-atomic load rather than part of an
 atomic sequence.
 """
-difference = self.do_sequence_test(
+instruction = self.do_sequence_test(
 "incomplete_sequence_without_sc", "incomplete_cas"
 )
-self.assertEqual(difference, 0x4)
+self.assertEqual(instruction, "and a5, a2, a4")
diff --git a/lldb/test/API/riscv/step/branch.c 
b/lldb/test/API/riscv/step/branch.c
index 79bf0ca005db1..93d6c51ec75e0 100644
--- a/lldb/test/API/riscv/step/branch.c
+++ b/lldb/test/API/riscv/step/branch.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) branch_cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t"
"beqz a5, 1b\n\t"
+   "nop\n\t"
"2:\n\t"
"ret\n\t");
 }
diff --git a/lldb/test/API/riscv/step/main.c b/lldb/test/API/riscv/step/main.c
index 35e8aee2cae4b..5ed2ced87e7b3 100644
--- a/lldb/test/API/riscv/step/main.c
+++ b/lldb/test/API/riscv/step/main.c
@@ -11,6 +11,7 @@ void __attribute__((naked)) cas(int *a, int *b) {
"xor a5, a2, a5\n\t"
"sc.w a5, a1, (a3)\n\t

[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (PR #156681)

2025-09-03 Thread Pavel Labath via lldb-commits

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


https://github.com/llvm/llvm-project/pull/156681
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add more command option mnemonics (PR #155705)

2025-09-03 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/155705

>From 6427b12a42c2064d57bc211443a5aa1e59fa81d9 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 3 Sep 2025 08:25:14 -0700
Subject: [PATCH] Add a bunch of mnemonics to the command options now that
 they're highlighted in the help output.

This uncovered two issues:

 - We had an instance where we weren't applying the ANSI formatting.
 - We had a place where we were now incorrectly computing the column
   width.

Both are fixed by this PR.
---
 lldb/include/lldb/Utility/AnsiTerminal.h  |   5 +
 lldb/source/Commands/Options.td   | 440 +++---
 lldb/source/Host/common/Editline.cpp  |  15 +-
 lldb/source/Interpreter/Options.cpp   |  23 +-
 .../completion/TestCompletion.py  |  12 +-
 5 files changed, 316 insertions(+), 179 deletions(-)

diff --git a/lldb/include/lldb/Utility/AnsiTerminal.h 
b/lldb/include/lldb/Utility/AnsiTerminal.h
index 5c99341ad888a..7db184ad67225 100644
--- a/lldb/include/lldb/Utility/AnsiTerminal.h
+++ b/lldb/include/lldb/Utility/AnsiTerminal.h
@@ -260,6 +260,11 @@ inline std::string TrimAndPad(llvm::StringRef str, size_t 
visible_length,
   return result;
 }
 
+inline size_t ColumnWidth(llvm::StringRef str) {
+  std::string stripped = ansi::StripAnsiTerminalCodes(str);
+  return llvm::sys::locale::columnWidth(stripped);
+}
+
 } // namespace ansi
 } // namespace lldb_private
 
diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index 4a70e55d6ad89..12669e278cd4a 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -1,96 +1,122 @@
 include "OptionsBase.td"
 
 let Command = "target modules dump symtab" in {
-  def tm_sort : Option<"sort", "s">, Group<1>,
-Desc<"Supply a sort order when dumping the symbol table.">,
-EnumArg<"SortOrder">;
-  def tm_smn : Option<"show-mangled-names", "m">, Group<1>,
-Desc<"Do not demangle symbol names before showing them.">;
+  def tm_sort : Option<"sort", "s">,
+Group<1>,
+Desc<"${S}upply a sort order when dumping the symbol table.">,
+EnumArg<"SortOrder">;
+  def tm_smn : Option<"show-mangled-names", "m">,
+   Group<1>,
+   Desc<"Do not de${m}angle symbol names before showing them.">;
 }
 
 let Command = "target modules dump separate debug info" in {
-  def tm_json : Option<"json", "j">, Group<1>,
-Desc<"Output the details in JSON format.">;
-  def tm_errors_only : Option<"errors-only", "e">, Group<1>,
-Desc<"Filter to show only debug info files with errors.">;
+  def tm_json : Option<"json", "j">,
+Group<1>,
+Desc<"Output the details in ${J}SON format.">;
+  def tm_errors_only
+  : Option<"errors-only", "e">,
+Group<1>,
+Desc<"Filter to show only debug info files with ${e}rrors.">;
   def tm_force_load_all_debug_info : Option<"force-load-all-debug-info", "f">,
  Group<1>,
- Desc<"Load all debug info files.">;
+ Desc<"Load all debug in${f}o files.">;
 }
 
 let Command = "help" in {
   def help_hide_aliases : Option<"hide-aliases", "a">,
-Desc<"Hide aliases in the command list.">;
+  Desc<"Hide ${a}liases in the command list.">;
   def help_hide_user : Option<"hide-user-commands", "u">,
-Desc<"Hide user-defined commands from the list.">;
+   Desc<"Hide ${u}ser-defined commands from the list.">;
   def help_show_hidden : Option<"show-hidden-commands", "h">,
 Desc<"Include commands prefixed with an underscore.">;
 }
 
 let Command = "settings set" in {
-  def setset_global : Option<"global", "g">,
-Desc<"Apply the new value to the global default value.">;
-  def setset_force : Option<"force", "f">,
-Desc<"Force an empty value to be accepted as the default.">;
+  def setset_global
+  : Option<"global", "g">,
+Desc<"Apply the new value to the ${g}lobal default value.">;
+  def setset_force
+  : Option<"force", "f">,
+Desc<"${F}orce an empty value to be accepted as the default.">;
   def setset_exists : Option<"exists", "e">,
-Desc<"Set the setting if it exists, but do not cause the command to raise "
-"an error if it does not exist.">;
+  Desc<"Set the setting if it ${e}xists, but do not cause "
+   "the command to raise "
+   "an error if it does not exist.">;
 }
 
 let Command = "settings write" in {
-  def setwrite_file : Option<"file", "f">, Required, Arg<"Filename">,
-Completion<"DiskFile">,
-Desc<"The file into which to write the settings.">;
+  def setwrite_file : Option<"file", "f">,
+  Required,
+  Arg<"Filename">,
+  Completion<"DiskFile">,
+  De

[Lldb-commits] [lldb] [WIP][lldb] Use forward decls with redeclared definitions instead of minimal import for records (PR #95100)

2025-09-03 Thread David Blaikie via lldb-commits

dwblaikie wrote:

Any word on this? Dead/can't be done? Lowered priority/might revisit later? Any 
conclusions/lessons that'd be handy to record for posterity?


https://github.com/llvm/llvm-project/pull/95100
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


  1   2   >