Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: jvl on September 18, 2013, 12:46:38 pm

Title: Debugger backtrace configurable (bt 30 in debugger.dll)
Post by: jvl on September 18, 2013, 12:46:38 pm
Hi

thought to suggest a fix, since I've been hacking this in manually after every install.
The bt 30 command in the debugger.dll, is it or could it be configurable in the Debugger settings?
I usually hex edit it to 99 and mostly works, but could it be useful if it was user configurable?

Options here:
http://sourceware.org/gdb/onlinedocs/gdb/Backtrace.html

Dummy code to test it:
Code
#include <iostream>

using namespace std;

void test( int counter )
{
    int* null = 0;
    int error = 1;
    if( --counter ) test(counter);
    else *null = error;
}

int main()
{
    cout << "Hello world!" << endl;
    test(999);
    return 0;
}

Tested with: CB 12.11 & svn 9295, Win8, MinGW

Best regards,
J
Title: Re: Debugger backtrace configurable (bt 30 in debugger.dll)
Post by: oBFusCATed on September 18, 2013, 01:09:01 pm
I usually hex edit it to 99 and mostly works, but could it be useful if it was user configurable?
Patches welcome...
Probably it should be done in the backtrace dialog, so it is general for all plugins.
But keep in mind that long backtraces slow down the stepping through the code.
So I've thought of adding buttons in the backtrace window for showing the prev and next 30 frames or probably a range.
Title: Re: Debugger backtrace configurable (bt 30 in debugger.dll)
Post by: eranon on November 01, 2013, 07:35:03 pm
Hello. Does this has been implemented ? I'm in an OSX porting and I often fall in case where the provided trace is too short to retrieve the origin of a failure in my own code (I only see the imbricated OSX's internal)... So, it would be great to be able to go back deeper on demand.
Title: Re: Debugger backtrace configurable (bt 30 in debugger.dll)
Post by: oBFusCATed on November 02, 2013, 12:21:37 am
You can manually execute bt or bt 100, or even bt -50 in the command's combobox at the bottom of the debugger's log.
Title: Re: Debugger backtrace configurable (bt 30 in debugger.dll)
Post by: eranon on November 02, 2013, 12:40:38 am
Effectively... I didn't noticed this until now ::) Thanks Obfuscated ! I'll use it awaiting an eventual button in the backtrace window (because an IDE is primarily GUI oriented, otherwise we can compile from cmdline, debug from cmdline and edit the code in any text editor) ;)