@@ -701,6 +701,8 @@ void request_attach(const llvm::json::Object &request) {
701701 GetBoolean (arguments, " enableAutoVariableSummaries" , false );
702702 g_dap.enable_synthetic_child_debugging =
703703 GetBoolean (arguments, " enableSyntheticChildDebugging" , false );
704+ g_dap.enable_display_extended_backtrace =
705+ GetBoolean (arguments, " enableDisplayExtendedBacktrace" , false );
704706 g_dap.command_escape_prefix =
705707 GetString (arguments, " commandEscapePrefix" , " `" );
706708 g_dap.SetFrameFormat (GetString (arguments, " customFrameFormat" ));
@@ -3091,17 +3093,20 @@ void request_stackTrace(const llvm::json::Object &request) {
30913093 // This will always return an invalid thread when
30923094 // libBacktraceRecording.dylib is not loaded or if there is no extended
30933095 // backtrace.
3094- lldb::SBThread queue_backtrace_thread =
3095- thread.GetExtendedBacktraceThread (" libdispatch" );
3096+ lldb::SBThread queue_backtrace_thread;
3097+ if (g_dap.enable_display_extended_backtrace )
3098+ queue_backtrace_thread = thread.GetExtendedBacktraceThread (" libdispatch" );
30963099 if (queue_backtrace_thread.IsValid ()) {
30973100 // One extra frame as a label to mark the enqueued thread.
30983101 totalFrames += queue_backtrace_thread.GetNumFrames () + 1 ;
30993102 }
31003103
31013104 // This will always return an invalid thread when there is no exception in
31023105 // the current thread.
3103- lldb::SBThread exception_backtrace_thread =
3104- thread.GetCurrentExceptionBacktrace ();
3106+ lldb::SBThread exception_backtrace_thread;
3107+ if (g_dap.enable_display_extended_backtrace )
3108+ exception_backtrace_thread = thread.GetCurrentExceptionBacktrace ();
3109+
31053110 if (exception_backtrace_thread.IsValid ()) {
31063111 // One extra frame as a label to mark the exception thread.
31073112 totalFrames += exception_backtrace_thread.GetNumFrames () + 1 ;
0 commit comments