From 3b263156230948bda82bf1fd243150f47c3e1acf Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 25 Feb 2021 11:14:00 +0100 Subject: [PATCH] Fixed debug stop status message for newer liblldb versions --- src/project.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index d48af3e..397a303 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -437,9 +437,9 @@ void Project::LLDB::debug_start() { if(state == lldb::StateType::eStateStopped) { char buffer[100]; auto thread = process.GetSelectedThread(); - auto n = thread.GetStopDescription(buffer, 100); + auto n = thread.GetStopDescription(buffer, 100); // Returns number of bytes read. Might include null termination... Although maybe on newer versions only. if(n > 0) - status += " (" + std::string(buffer, n <= 100 ? n : 100) + ")"; + status += " (" + std::string(buffer, n <= 100 ? (buffer[n - 1] == '\0' ? n - 1 : n) : 100) + ")"; auto line_entry = thread.GetSelectedFrame().GetLineEntry(); if(line_entry.IsValid()) { lldb::SBStream stream;