[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [Inclusive Language] migrate "sanity" checks to "soundness" checks (PR #156995)
cor3ntin wrote: As @philnik777 said, regardless of outcome on the RFC, please split in multiple PR (one per subproject), once consensus is reached on the RFC. https://github.com/llvm/llvm-project/pull/156995 ___ 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)
tstellar wrote: There is still one failing test, but the implementation is complete (including sccache setup). https://github.com/llvm/llvm-project/pull/155274 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)
https://github.com/royitaqi edited https://github.com/llvm/llvm-project/pull/156803 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)
royitaqi wrote: @JDevlieghere: Thank you for your reply. I appreciate it a lot. I will: 1. Learn about the memory monitor in DAP. * Context: It's not failing - We are just starting to experiment with the server mode. This connection timeout feature is a precaution before we can do large scale rollout. Some folks liked the concept of auto-cleanup of the lldb-dap process, just to have the peace of mind that the memory issue isn't caused by the debugger. Good to know about the memory monitor in DAP. That adds more confidence. 3. Rename the option to "connection-timeout". I like this name a lot, esp. because the other option is "--connection", so this has a nice synergy in the names. 4. Catch that case of --connection-timeout is given while --connection isn't. Print a warning. 5. Add tests. -- (minor clarification:) > I do think this should be configurable from the extension, like how folks can > pick server mode there. I wonder if you have any preference about whether this should be in this same patch, or should be a separate follow-up. I have no strong opinion (shouldn't be too much work), so I will just go with whichever you prefer. https://github.com/llvm/llvm-project/pull/156803 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] ensure that dap_symbol is always initialized (PR #156956)
walter-erquinigo wrote: This change is not ideal. Instead, just define a default constructor for the struct. Otherwise every time someone creates a new Symbol object, they'll have to initialize it manually. https://github.com/llvm/llvm-project/pull/156956 ___ 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)
@@ -30,9 +30,14 @@ class ArchitecturePPC64 : public Architecture {
void AdjustBreakpointAddress(const Symbol &func,
Address &addr) const override;
+ lldb::ByteOrder GetVectorElementOrder() const override;
+
private:
static std::unique_ptr Create(const ArchSpec &arch);
- ArchitecturePPC64() = default;
+ ArchitecturePPC64(lldb::ByteOrder vector_element_order)
Michael137 wrote:
Why was PPC64 important to address as part of this PR? Is it because it's the
only big-endian architecture plugin and you want to ensure we error out
appropriately?
https://github.com/llvm/llvm-project/pull/155000
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] f88eadd - [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (#153585)
Author: Felipe de Azevedo Piovezan
Date: 2025-09-04T13:05:10-07:00
New Revision: f88eadda357b0429b390ec0bcf64c361ad1a8f28
URL:
https://github.com/llvm/llvm-project/commit/f88eadda357b0429b390ec0bcf64c361ad1a8f28
DIFF:
https://github.com/llvm/llvm-project/commit/f88eadda357b0429b390ec0bcf64c361ad1a8f28.diff
LOG: [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (#153585)
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).
Added:
lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile
lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
lldb/test/API/macosx/arm-pointer-metadata-stripping/extra_symbols.json
lldb/test/API/macosx/arm-pointer-metadata-stripping/main.c
Modified:
lldb/source/Expression/IRMemoryMap.cpp
Removed:
diff --git a/lldb/source/Expression/IRMemoryMap.cpp
b/lldb/source/Expression/IRMemoryMap.cpp
index 150699352a2e3..26e59b76a4dac 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -640,6 +640,15 @@ 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. An address belongs to the process if the Allocation policy is
not
+ /// eAllocationPolicyHostOnly.
+ auto it = FindAllocation(address, 1);
+ if (it == m_allocations.end() ||
+ it->second.m_policy != AllocationPolicy::eAllocationPolicyHostOnly)
+if (auto process_sp = GetProcessWP().lock())
+ address = process_sp->FixAnyAddress(address);
+
Scalar scalar(address);
WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);
diff --git a/lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile
b/lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile
new file mode 100644
index 0..c9319d6e6888a
--- /dev/null
+++ b/lldb/test/API/macosx/arm-pointer-metadata-stripping/Makefile
@@ -0,0 +1,2 @@
+C_SOURCES := main.c
+include Makefile.rules
diff --git
a/lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
b/lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
new file mode 100644
index 0..f61945b3eb4c9
--- /dev/null
+++
b/lldb/test/API/macosx/arm-pointer-metadata-stripping/TestArmPointerMetadataStripping.py
@@ -0,0 +1,48 @@
+import lldb
+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
+# contains non-zero high order bits set.
+def create_symbols_file(self):
+template_path = os.path.join(self.getSourceDir(), "extra_symbols.json")
+with open(template_path, "r") as f:
+symbols_data = json.load(f)
+
+target = self.dbg.GetSelectedTarget()
+symbols_data["triple"] = target.GetTriple()
+
+module = target.GetModuleAtIndex(0)
+symbols_data["uuid"] = module.GetUUIDString()
+
+json_filename = self.getBuildArtifact("extra_symbols.json")
+with open(json_filename, "w") as file:
+json.dump(symbols_data, file, indent=4)
+
+return json_filename
+
+def test(self):
+self.build()
+src = lldb.SBFileSpec("main.c")
+target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+self, "break here", src
+)
+
+symbols_file = self.create_symbols_file()
+self.runCmd(f"target module add {symbols_file}")
+
+# The high order bits should be stripped.
+self.expect_expr("get_high_bits(&myglobal_json)", result_value="0")
+
+# Mark all bits as used for addresses and ensure bits are no longer
stripped.
+self.runCmd("settings set target.process.virtual-addressable-bits 64")
+self.expect_expr(
+"get_high_bits(&myglobal_json)",
result_value=str(0x1200
[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [Inclusive Language] migrate "sanity" checks to "soundness" checks (PR #156995)
philnik777 wrote: Also, please split this up. It's super hard to review, and these massive cross-project patches tend to go nowhere. https://github.com/llvm/llvm-project/pull/156995 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)
https://github.com/royitaqi edited https://github.com/llvm/llvm-project/pull/156803 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct style of error messages (PR #156774)
medismailben wrote:
Great! May be we should do this for:
- `Status::Status(std::string err_str)`
- `static Status FromErrorString(const char *str)`
- `static Status FromErrorStringWithFormat(const char *format, ...)`
- ` template static Status FromErrorStringWithFormatv(const
char *format, Args &&...args) {`
https://github.com/llvm/llvm-project/pull/156774
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)
@@ -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();
+ }
walter-erquinigo wrote:
remove these braces
https://github.com/llvm/llvm-project/pull/156803
___
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)
Michael137 wrote:
> The other scenario is accessing an extant C global variable (maybe even one
> you don't have debug info for) called "class" or "namespace". But more
> importantly, having this sort of secret out that is applied inconsistently
> will just make lldb more confusing. It's fine to say "the support for the 'C'
> language is incomplete" but to treat it inconsistently just makes it harder
> to understand how lldb is working for you.
That's a fair point. If we don't want to break this use-case, perhaps we should
then think about not requiring C++ for expression evaluation. Once we do that,
we can safely start rejecting any non-supported languages (and remove the C
expression evaluation workarounds). The most notable feature we rely on is the
`using` declaration to bring local variables into scope.
I wonder the Swift plugin handles those. This is an example wrapper expression
it generates:
```
func $__lldb_expr(_ $__lldb_arg : UnsafeMutablePointer) {
do {
/*__LLDB_USER_START__*/
z = 50
/*__LLDB_USER_END__*/
} catch (let __lldb_tmp_error) {
var $__lldb_error_result = __lldb_tmp_error
}
}
```
So it has some other hook to bring the local variables into scope that's not
dependent on injecting something into the source
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-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)
walter-erquinigo wrote: connection-timeout seems to be a better name. I'll wait for the current discussions to finish before reviewing again https://github.com/llvm/llvm-project/pull/156803 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add more mnemonics (PR #156987)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Jonas Devlieghere (JDevlieghere)
Changes
Add a few more command option mnemonics.
---
Full diff: https://github.com/llvm/llvm-project/pull/156987.diff
1 Files Affected:
- (modified) lldb/source/Commands/Options.td (+64-60)
``diff
diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index ad393efa3f4c0..595b3d08abec5 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -18,9 +18,10 @@ let Command = "target modules dump separate debug info" in {
: 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 in${f}o files.">;
+ def tm_force_load_all_debug_info
+ : Option<"force-load-all-debug-info", "f">,
+Group<1>,
+Desc<"${F}orce load all debug info files.">;
}
let Command = "help" in {
@@ -124,20 +125,20 @@ let Command = "breakpoint modify" in {
: Option<"thread-name", "T">,
Group<1>,
Arg<"ThreadName">,
-Desc<"The breakpoint stops only for the thread whose thread name "
+Desc<"The breakpoint stops only for the ${t}hread whose thread name "
"matches this argument.">;
def breakpoint_modify_queue_name
: Option<"queue-name", "q">,
Group<1>,
Arg<"QueueName">,
-Desc<"The breakpoint stops only for threads in the queue whose name is
"
- "given by this argument.">;
+Desc<"The breakpoint stops only for threads in the ${q}ueue whose name
"
+ "is given by this argument.">;
def breakpoint_modify_condition
: Option<"condition", "c">,
Group<1>,
Arg<"Expression">,
-Desc<"The breakpoint stops only if this condition expression evaluates
"
- "to true.">;
+Desc<"The breakpoint stops only if this ${c}ondition expression "
+ "evaluates to true.">;
def breakpoint_modify_condition_language
: Option<"condition-language", "Y">,
Group<1>,
@@ -241,7 +242,7 @@ let Command = "breakpoint set" in {
Arg<"FullName">,
Required,
Completion<"Symbol">,
-Desc<"Set the breakpoint by ${F}ully qualified function names. For C++
"
+Desc<"Set the breakpoint by ${f}ully qualified function names. For C++
"
"this means namespaces and all arguments, and for Objective-C "
"this means a full function prototype with class and selector. "
"Can be repeated multiple times to make one breakpoint for "
@@ -362,13 +363,13 @@ let Command = "breakpoint clear" in {
Arg<"Filename">,
Completion<"SourceFile">,
Desc<"Specify the breakpoint by source location "
- "in this particular file.">;
+ "in this particular ${f}ile.">;
def breakpoint_clear_line : Option<"line", "l">,
Group<1>,
Arg<"LineNum">,
Required,
Desc<"Specify the breakpoint by source location "
- "at this particular line.">;
+ "at this particular ${l}ine.">;
}
let Command = "breakpoint delete" in {
@@ -437,7 +438,7 @@ let Command = "breakpoint read" in {
Arg<"Filename">,
Required,
Completion<"DiskFile">,
-Desc<"The file from which to read the breakpoints.">;
+Desc<"The ${f}ile from which to read the breakpoints.">;
def breakpoint_read_breakpoint_name
: Option<"breakpoint-name", "N">,
Arg<"BreakpointName">,
@@ -450,10 +451,10 @@ let Command = "breakpoint write" in {
Arg<"Filename">,
Required,
Completion<"DiskFile">,
-Desc<"The file into which to write the breakpoints.">;
+Desc<"The ${f}ile into which to write the breakpoints.">;
def breakpoint_write_append
: Option<"append", "a">,
-Desc<"Append to saved breakpoints file if it exists.">;
+Desc<"${A}ppend to saved breakpoints file if it exists.">;
}
let Command = "breakpoint command add" in {
@@ -461,7 +462,7 @@ let Command = "breakpoint command add" in {
: Option<"one-liner", "o">,
Group<1>,
Arg<"OneLiner">,
-Desc<"Specify a one-line breakpoint command inline. Be sure to "
+Desc<"Specify a ${o}ne-line breakpoint command inline. Be sure to "
"surround it with quotes.">;
def breakpoint_add_stop_on_error
: Option<"stop-on-error", "e">,
@@ -488,32 +489,33 @@ let Command = "breakpoint command delete" in {
}
let Comm
[Lldb-commits] [lldb] [lldb] Add utility to create Mach-O corefile from YAML desc (PR #153911)
jasonmolenda wrote: > [lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197/builds/8706) > and > [lldb-x86_64-win](https://lab.llvm.org/buildbot/#/builders/211/builds/1871) > are still broken. @slydiman @skipIfWindows fixed the lldb-x86_64-win bot, but lldb-remote-linux-win is still failing. I'm not sure I understand what this bot is, do you? It looks like the tests are executing on a windows system, but I guess skipIfWindows isn't matching that. I've never run afoul of this one before and had to work around it, maybe i'll just skip this if it's not Darwin again. That's a bummer. https://github.com/llvm/llvm-project/pull/153911 ___ 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)
Michael137 wrote: /cherry-pick 4b362f152e58abd6aeed5d603a6dfc10115ed1ab https://github.com/llvm/llvm-project/pull/156050 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix deterministic-build.cpp post #156931 (PR #156983)
https://github.com/boomanaiden154 updated
https://github.com/llvm/llvm-project/pull/156983
>From aa1a12795ee11d48cf0df8c58058a3a36992e6b2 Mon Sep 17 00:00:00 2001
From: Aiden Grossman
Date: Thu, 4 Sep 2025 16:41:15 -0700
Subject: [PATCH 1/2] [LLDB] Fix deterministic-build.cpp post #156931
This test was brokem by migrating to the lit internal shell due to a
lack of env prefix for setting environment variables. This was fixed in
prevented the breakpoint in the test from mapping to anything, causing
the test to file. This patch restores the original line numbering.
---
lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
index 13fe3898e50aa..a45f794c73a43 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
@@ -7,4 +7,5 @@
// RUN: %lldb %t -o "breakpoint set -f %s -l 11" -o run -o exit | FileCheck %s
// CHECK: stop reason = breakpoint
+
int main() { return 0; }
>From e7dced4b769ee3260095fc1f7e620a06f42dd02e Mon Sep 17 00:00:00 2001
From: Aiden Grossman
Date: Thu, 4 Sep 2025 16:48:18 -0700
Subject: [PATCH 2/2] Fix formatting
---
lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
index a45f794c73a43..0c86107fc9632 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
@@ -4,8 +4,7 @@
// REQUIRES: system-darwin
// RUN: %clang_host %s -g -c -o %t.o
// RUN: env ZERO_AR_DATE=1 %clang_host %t.o -g -o %t
-// RUN: %lldb %t -o "breakpoint set -f %s -l 11" -o run -o exit | FileCheck %s
+// RUN: %lldb %t -o "breakpoint set -f %s -l 10" -o run -o exit | FileCheck %s
// CHECK: stop reason = breakpoint
-
int main() { return 0; }
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
