@@ -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" ));
@@ -1925,6 +1927,8 @@ void request_launch(const llvm::json::Object &request) {
19251927 GetBoolean (arguments, " enableAutoVariableSummaries" , false );
19261928 g_dap.enable_synthetic_child_debugging =
19271929 GetBoolean (arguments, " enableSyntheticChildDebugging" , false );
1930+ g_dap.enable_display_extended_backtrace =
1931+ GetBoolean (arguments, " enableDisplayExtendedBacktrace" , false );
19281932 g_dap.command_escape_prefix =
19291933 GetString (arguments, " commandEscapePrefix" , " `" );
19301934 g_dap.SetFrameFormat (GetString (arguments, " customFrameFormat" ));
@@ -3111,17 +3115,20 @@ void request_stackTrace(const llvm::json::Object &request) {
31113115 // This will always return an invalid thread when
31123116 // libBacktraceRecording.dylib is not loaded or if there is no extended
31133117 // backtrace.
3114- lldb::SBThread queue_backtrace_thread =
3115- thread.GetExtendedBacktraceThread (" libdispatch" );
3118+ lldb::SBThread queue_backtrace_thread;
3119+ if (g_dap.enable_display_extended_backtrace )
3120+ queue_backtrace_thread = thread.GetExtendedBacktraceThread (" libdispatch" );
31163121 if (queue_backtrace_thread.IsValid ()) {
31173122 // One extra frame as a label to mark the enqueued thread.
31183123 totalFrames += queue_backtrace_thread.GetNumFrames () + 1 ;
31193124 }
31203125
31213126 // This will always return an invalid thread when there is no exception in
31223127 // the current thread.
3123- lldb::SBThread exception_backtrace_thread =
3124- thread.GetCurrentExceptionBacktrace ();
3128+ lldb::SBThread exception_backtrace_thread;
3129+ if (g_dap.enable_display_extended_backtrace )
3130+ exception_backtrace_thread = thread.GetCurrentExceptionBacktrace ();
3131+
31253132 if (exception_backtrace_thread.IsValid ()) {
31263133 // One extra frame as a label to mark the exception thread.
31273134 totalFrames += exception_backtrace_thread.GetNumFrames () + 1 ;
0 commit comments