Skip to content

Commit 29c8977

Browse files
committed
[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. (cherry picked from commit 65a4d11)
1 parent df7f870 commit 29c8977

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,8 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
22732273
StreamString ostr;
22742274
ostr.Printf("%" PRIu64, wp_addr);
22752275
description = std::string(ostr.GetString());
2276+
} else if (key.compare("swbreak") == 0 || key.compare("hwbreak") == 0) {
2277+
reason = "breakpoint";
22762278
} else if (key.compare("library") == 0) {
22772279
auto error = LoadModules();
22782280
if (error) {

0 commit comments

Comments
 (0)