From 58e2a36f79646283b60ff4e853ef2a67ce30f5c1 Mon Sep 17 00:00:00 2001 From: klugier Date: Fri, 29 Jun 2018 23:11:25 +0000 Subject: [PATCH] Gdb: Gdb now informs that stack has been trimed. git-svn-id: svn://ultimatepp.org/upp/trunk@12030 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Debuggers/Debuggers.h | 3 +++ uppsrc/ide/Debuggers/Gdb.cpp | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/uppsrc/ide/Debuggers/Debuggers.h b/uppsrc/ide/Debuggers/Debuggers.h index 33f605876..0dcf4e6d7 100644 --- a/uppsrc/ide/Debuggers/Debuggers.h +++ b/uppsrc/ide/Debuggers/Debuggers.h @@ -227,6 +227,9 @@ public: private: bool CreateDbg(One& host, const String& exeFile, bool console); + +private: + const int max_stack_trace_size; }; #include "Gdb_MI2.h" diff --git a/uppsrc/ide/Debuggers/Gdb.cpp b/uppsrc/ide/Debuggers/Gdb.cpp index d032f5e13..f8d00c6fe 100644 --- a/uppsrc/ide/Debuggers/Gdb.cpp +++ b/uppsrc/ide/Debuggers/Gdb.cpp @@ -387,8 +387,6 @@ void Gdb::DisasFocus() void Gdb::DropFrames() { - const int max_stack_trace_size = 200; - int i = 0; int q = ~frame; frame.Clear(); @@ -419,7 +417,11 @@ String Gdb::ObtainFrame(int frame_idx) void Gdb::SwitchFrame() { - int i = (int)~frame; + auto i = static_cast(~frame); + if (i == max_stack_trace_size) { + i = 0; + } + Cmdp(Sprintf("frame %d", i), i); } @@ -510,6 +512,7 @@ void Gdb::Periodic() } Gdb::Gdb() + : max_stack_trace_size(200) { locals.NoHeader(); locals.AddColumn("", 1);