diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-03-16 19:19:32 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-03-17 09:55:57 -0700 |
commit | 2a76429778768ed29404f0396194636e2bc11b90 (patch) | |
tree | d62d5bf8254482e9ee5d0cd6f5cc71328a54f854 /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | 3132c78aea5ec78acc1dfa8f5e487c89ebec5a8c (diff) | |
download | llvm-2a76429778768ed29404f0396194636e2bc11b90.zip llvm-2a76429778768ed29404f0396194636e2bc11b90.tar.gz llvm-2a76429778768ed29404f0396194636e2bc11b90.tar.bz2 |
[lldb] Set the watchpoint spec for expression watchpoints
When setting a variable watchpoint, the watchpoint stores the variable
name in the watchpoint spec. For expression variables we should store
the expression in the watchpoint spec. This patch adds that
functionality.
rdar://106096860
Differential revision: https://reviews.llvm.org/D146262
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 7aa9614..9463050 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -949,9 +949,8 @@ protected: uint32_t watch_type = m_option_watchpoint.watch_type; error.Clear(); - Watchpoint *wp = - target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error) - .get(); + WatchpointSP wp = + target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error); if (wp) { wp->SetWatchSpec(command.GetArgumentAtIndex(0)); wp->SetWatchVariable(true); @@ -1117,10 +1116,10 @@ protected: CompilerType compiler_type(valobj_sp->GetCompilerType()); Status error; - Watchpoint *wp = - target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error) - .get(); + WatchpointSP wp = + target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error); if (wp) { + wp->SetWatchSpec(std::string(expr)); Stream &output_stream = result.GetOutputStream(); output_stream.Printf("Watchpoint created: "); wp->GetDescription(&output_stream, lldb::eDescriptionLevelFull); |