[Lldb-commits] [lldb] [lldb] Add comma separator in watchpoint description (PR #209176)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 13 07:08:52 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
I find it easier to read this way, especially the last "state = enabled type = m" which looks like "enabled type = m" at a glance:
Watchpoint 1: addr = 0xaaaaaaab1018 size = 20 state = enabled type = m
With commas:
Watchpoint 1: addr = 0xaaaaaaab1018, size = 20, state = enabled, type = m
Code breakpoints include commas already:
1: name = 'main', locations = 1, resolved = 1, hit count = 1
1.1: where = test.o`main at test.c:13:15, address = 0x0000aaaaaaaa0714, resolved, hit count = 1
Used the regex "Watchpoint [0-9]+:" to find tests and docs that needed updating.
---
Full diff: https://github.com/llvm/llvm-project/pull/209176.diff
4 Files Affected:
- (modified) lldb/bindings/interface/SBTargetDocstrings.i (+1-1)
- (modified) lldb/docs/use/tutorial.md (+3-3)
- (modified) lldb/source/Breakpoint/Watchpoint.cpp (+1-1)
- (modified) lldb/test/Shell/Register/x86-db-read.test (+4-4)
``````````diff
diff --git a/lldb/bindings/interface/SBTargetDocstrings.i b/lldb/bindings/interface/SBTargetDocstrings.i
index 57d881d663979..de03f8ea24b40 100644
--- a/lldb/bindings/interface/SBTargetDocstrings.i
+++ b/lldb/bindings/interface/SBTargetDocstrings.i
@@ -32,7 +32,7 @@ and, ::
produces: ::
- Watchpoint 1: addr = 0x1034ca048 size = 4 state = enabled type = rw
+ Watchpoint 1: addr = 0x1034ca048, size = 4, state = enabled, type = rw
declare @ '/Volumes/data/lldb/svn/trunk/test/python_api/watchpoint/main.c:12'
hit_count = 2 ignore_count = 0"
) lldb::SBTarget;
diff --git a/lldb/docs/use/tutorial.md b/lldb/docs/use/tutorial.md
index f535be4b74d04..e2403e8e0c959 100644
--- a/lldb/docs/use/tutorial.md
+++ b/lldb/docs/use/tutorial.md
@@ -399,12 +399,12 @@ a variable called `global` for write operation, but only stop if the condition
```
(lldb) watch set var global
-Watchpoint created: Watchpoint 1: addr = 0x100001018 size = 4 state = enabled type = w
+Watchpoint created: Watchpoint 1: addr = 0x100001018, size = 4, state = enabled, type = w
declare @ '/Volumes/data/lldb/svn/ToT/test/functionalities/watchpoint/watchpoint_commands/condition/main.cpp:12'
(lldb) watch modify -c '(global==5)'
(lldb) watch list
Current watchpoints:
-Watchpoint 1: addr = 0x100001018 size = 4 state = enabled type = w
+Watchpoint 1: addr = 0x100001018, size = 4, state = enabled, type = w
declare @ '/Volumes/data/lldb/svn/ToT/test/functionalities/watchpoint/watchpoint_commands/condition/main.cpp:12'
condition = '(global==5)'
(lldb) c
@@ -433,7 +433,7 @@ Process 15562 stopped
(int32_t) global = 5
(lldb) watch list -v
Current watchpoints:
-Watchpoint 1: addr = 0x100001018 size = 4 state = enabled type = w
+Watchpoint 1: addr = 0x100001018, size = 4, state = enabled, type = w
declare @ '/Volumes/data/lldb/svn/ToT/test/functionalities/watchpoint/watchpoint_commands/condition/main.cpp:12'
condition = '(global==5)'
hit_count = 5 ignore_count = 0
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index f1366ca538075..6fbe02d9161ab 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -350,7 +350,7 @@ void Watchpoint::DumpWithLevel(Stream *s,
description_level <= lldb::eDescriptionLevelVerbose);
s->Printf("Watchpoint %u: addr = 0x%8.8" PRIx64
- " size = %u state = %s type = %s%s%s",
+ ", size = %u, state = %s, type = %s%s%s",
GetID(), GetLoadAddress(), m_byte_size,
IsEnabled() ? "enabled" : "disabled", m_watch_read ? "r" : "",
m_watch_write ? "w" : "", m_watch_modify ? "m" : "");
diff --git a/lldb/test/Shell/Register/x86-db-read.test b/lldb/test/Shell/Register/x86-db-read.test
index 85cdcd1cb8104..a1959b2864e44 100644
--- a/lldb/test/Shell/Register/x86-db-read.test
+++ b/lldb/test/Shell/Register/x86-db-read.test
@@ -7,13 +7,13 @@ process launch
# CHECK: Process {{[0-9]+}} stopped
watchpoint set variable -w write g_8w
-# CHECK: Watchpoint created: Watchpoint 1: addr = 0x{{[0-9a-f]*}} size = 1 state = enabled type = w
+# CHECK: Watchpoint created: Watchpoint 1: addr = 0x{{[0-9a-f]*}}, size = 1, state = enabled, type = w
watchpoint set variable -w read_write g_16rw
-# CHECK: Watchpoint created: Watchpoint 2: addr = 0x{{[0-9a-f]*}} size = 2 state = enabled type = rw
+# CHECK: Watchpoint created: Watchpoint 2: addr = 0x{{[0-9a-f]*}}, size = 2, state = enabled, type = rw
watchpoint set variable -w write g_32w
-# CHECK: Watchpoint created: Watchpoint 3: addr = 0x{{[0-9a-f]*}} size = 4 state = enabled type = w
+# CHECK: Watchpoint created: Watchpoint 3: addr = 0x{{[0-9a-f]*}}, size = 4, state = enabled, type = w
watchpoint set variable -w read_write g_32rw
-# CHECK: Watchpoint created: Watchpoint 4: addr = 0x{{[0-9a-f]*}} size = 4 state = enabled type = rw
+# CHECK: Watchpoint created: Watchpoint 4: addr = 0x{{[0-9a-f]*}}, size = 4, state = enabled, type = rw
expression &g_8w
# CHECK: (uint8_t *) $0 = [[VAR8W:0x[0-9a-f]*]]
``````````
</details>
https://github.com/llvm/llvm-project/pull/209176
More information about the lldb-commits
mailing list