Skip to content

Commit 65a4d11

Browse files
authored
[lldb] Set the stop reason when receiving swbreak/hwbreak (llvm#108518)
xusheng added support for swbreak/hwbreak a month ago, and no special support was needed in ProcessGDBRemote when they're received because lldb already marks a thread as having hit a breakpoint when it stops at a breakpoint site. However, with changes I am working on, we need to know the real stop reason a thread stopped or the breakpoint hit will not be recognized. This is similar to how lldb processes the "watch/rwatch/awatch" keys in a thread stop packet -- we set the `reason` to `watchpoint`, and these set it to `breakpoint` so we set the stop reason correctly later in these methods.
1 parent 213c59d commit 65a4d11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,8 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
23172317
StreamString ostr;
23182318
ostr.Printf("%" PRIu64, wp_addr);
23192319
description = std::string(ostr.GetString());
2320+
} else if (key.compare("swbreak") == 0 || key.compare("hwbreak") == 0) {
2321+
reason = "breakpoint";
23202322
} else if (key.compare("library") == 0) {
23212323
auto error = LoadModules();
23222324
if (error) {

0 commit comments

Comments
 (0)