================
@@ -8,14 +8,105 @@
#include "DAP.h"
#include "EventHelper.h"
-#include "JSONUtils.h"
+#include "LLDBUtils.h"
+#include "Protocol/ProtocolRequests.h"
+#include "ProtocolUtils.h"
#include "RequestHandler.h"
+#include "lldb/API/SBStream.h"
-namespace lldb_dap {
+using namespace lldb_dap;
+using namespace lldb_dap::protocol;
-/// Page size used for reporting addtional frames in the 'stackTrace' request.
+/// Page size used for reporting additional frames in the 'stackTrace' request.
static constexpr int StackPageSize = 20;
+// Create a "StackFrame" object for a LLDB frame object.
+static StackFrame CreateStackFrame(DAP &dap, lldb::SBFrame &frame,
+ lldb::SBFormat &format) {
+ StackFrame stack_frame;
+ stack_frame.id = MakeDAPFrameID(frame);
+
+ lldb::SBStream stream;
+ if (format && frame.GetDescriptionWithFormat(format, stream).Success()) {
+ stack_frame.name = stream.GetData();
+
+ // `function_name` can be a nullptr, which throws an error when assigned to
+ // an `std::string`.
+ } else if (const char *name = frame.GetDisplayFunctionName()) {
----------------
da-viper wrote:
what I meant instead of char* use stringRef for name. for `Protocols POD types`
we should leave that as std::string.
https://github.com/llvm/llvm-project/pull/173226
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits