summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDmitry.Neverov <dmitry.neverov@jetbrains.com>2023-10-24 08:44:22 (GMT)
committerBrad King <brad.king@kitware.com>2023-10-26 13:51:32 (GMT)
commitc028425df969ef741de366cc2b765727b8e59c2c (patch)
tree70dc702f9493cf93b8fa3db2b23b0ba03c1dc11f /Source
parenta2c4b234f27423edbe5f2e0bb17b8275cf393017 (diff)
downloadCMake-c028425df969ef741de366cc2b765727b8e59c2c.zip
CMake-c028425df969ef741de366cc2b765727b8e59c2c.tar.gz
CMake-c028425df969ef741de366cc2b765727b8e59c2c.tar.bz2
Debugger: report function name in DAP stackframes
Before a file name and a line were returned, but they can be obtained by other means. Fixes: #25091
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDebuggerStackFrame.h4
-rw-r--r--Source/cmDebuggerThread.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmDebuggerStackFrame.h b/Source/cmDebuggerStackFrame.h
index dc3b2ab..f4e6612 100644
--- a/Source/cmDebuggerStackFrame.h
+++ b/Source/cmDebuggerStackFrame.h
@@ -28,6 +28,10 @@ public:
std::string const& GetFileName() const noexcept { return this->FileName; }
int64_t GetLine() const noexcept;
cmMakefile* GetMakefile() const noexcept { return this->Makefile; }
+ cmListFileFunction const& GetFunction() const noexcept
+ {
+ return this->Function;
+ }
};
} // namespace cmDebugger
diff --git a/Source/cmDebuggerThread.cxx b/Source/cmDebuggerThread.cxx
index fd52f5a..f7a1778 100644
--- a/Source/cmDebuggerThread.cxx
+++ b/Source/cmDebuggerThread.cxx
@@ -13,6 +13,7 @@
#include "cmDebuggerVariables.h"
#include "cmDebuggerVariablesHelper.h"
#include "cmDebuggerVariablesManager.h"
+#include "cmListFileCache.h"
namespace cmDebugger {
@@ -135,8 +136,7 @@ dap::StackTraceResponse GetStackTraceResponse(
#endif
stackFrame.line = thread->Frames[i]->GetLine();
stackFrame.column = 1;
- stackFrame.name = thread->Frames[i]->GetFileName() + " Line " +
- std::to_string(stackFrame.line);
+ stackFrame.name = thread->Frames[i]->GetFunction().OriginalName();
stackFrame.id = thread->Frames[i]->GetId();
stackFrame.source = source;