Code::Blocks Forums

User forums => Help => Topic started by: Totoxa on February 05, 2012, 02:59:21 am

Title: Problems debugging in Codeblocks
Post by: Totoxa on February 05, 2012, 02:59:21 am
Hello, when i remove a breakpoint the debugger still stop where the breakpoint was set, to remove it i have to use the command bar, i use Ubuntu 10.04, Codeblocks 10.05 release and SVN, compiled by myself, what can be wrong? also when the debug process start the terminal show something like "GDB: failed to set controlling terminal.."
Title: Re: Problems debugging in Codeblocks
Post by: ollydbg on February 05, 2012, 09:25:11 am
Suggestions:
1, You can try a "debugger branch", see:The 07 January 2012 build (7678) DEBUGGER BRANCH version is out. (http://forums.codeblocks.org/index.php/topic,15777.msg106097.html#msg106097)
2, Please post your debugger's log here. (check on the option: Display debugger's log in debugger setting dialog)


It looks like you have the same issue as me, see
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out. (http://forums.codeblocks.org/index.php/topic,15777.msg106905.html#msg106905) and the following discussion. (I have a workaround here).
Title: Re: Problems debugging in Codeblocks
Post by: oBFusCATed on February 05, 2012, 10:41:26 am
It looks like you have the same issue as me, see
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out. (http://forums.codeblocks.org/index.php/topic,15777.msg106905.html#msg106905) and the following discussion. (I have a workaround here).
No, in 10.05 or trunk setting breakpoints while the debuggee is running just doesn't work.
Your problem is way more complex.
Title: Re: Problems debugging in Codeblocks
Post by: Totoxa on February 05, 2012, 09:22:28 pm
Code
Breakpoint 2, getfamilypart::getparts (this=0x804d008, pic12=0x804d028, pic14=0x804d140, pic16=0x804d258, pic18=0x804d370, pic24=0x804d488, pic30=0x804d5a0, pic33=0x804d6b8) at /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141
/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141:3310:beg:0x8049589
>>>>>>cb_gdb:
> info locals
strlen = 9
partname = "PIC16F917\000d Part\000\367\377\277(\367\377\277\064\367\377\277\061\250-\000\230\371\377\267\000\000\000\000\vy-\000\000\000\000\000 \000\000\000\020\001\000\000T\367\377\277 \000\000\000\374\000\000\000\363\272\071\000\370\003<\000߹9\000ͼ9\000\060\000\000\000\000\001\000\000\b\215\023\000\n\273\071\000\300\003<\000\070\t\002\000\360\003<\000\364\357;\000\300\003<\000\000\000\000\000h\367\377\277\234\217-\000\363\272\071\000\370\003<\000߹9\000\364\277!\000\374\000\000\000\000\000\000\000\230\367\377\277\a\274\036\000\374\000\000\000P\t\002\000\360\003<\000\364\357;\000\300\003<\000\000\000\000\000\250\367\377\277\364\277!\000\000\000\000\000\000\000\000\000\270\367\377\277=\275\036\000\374\000\000\000\000\000\000\000\330\367\377\277\a\274\036\000)\275\036\000\270\326\004\b\330\367\377\277\f\214\004\b\374\000\000\000\060\062\022\000\001\000\000"
k = 2
fsize = 156449
internalId = 4992
tempoffset = 344
offset = 1775
>>>>>>cb_gdb:
> info args
this = 0x804d008
pic12 = 0x804d028
pic14 = 0x804d140
pic16 = 0x804d258
pic18 = 0x804d370
pic24 = 0x804d488
pic30 = 0x804d5a0
pic33 = 0x804d6b8
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 3 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 4 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 5 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 6 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 7 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 8 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 9 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 10 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.
>>>>>>cb_gdb:
> break "/home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp:141"
Punto de interrupción 11 at 0x8049589: file /home/fabian/Escritorio/temp/pruebas/getfamilypart.cpp, line 141.

between each ">break" i was enabling and disabling the same breakpoint in the gui
Title: Re: Problems debugging in Codeblocks
Post by: oBFusCATed on February 05, 2012, 10:59:18 pm
1. This is not the debugger's branch
2. Don't use localized versions of gdb, it will break debugging 100% guaranteed.
Title: Re: Problems debugging in Codeblocks
Post by: Totoxa on February 06, 2012, 02:24:07 am
I think that the reason of this is at the file "gdb_commands.h":

Code
class GdbCmd_AddBreakpoint : public DebuggerCmd
{
        DebuggerBreakpoint* m_BP;
    public:
        /** @param bp The breakpoint to set. */
        GdbCmd_AddBreakpoint(DebuggerDriver* driver, DebuggerBreakpoint* bp)
            : DebuggerCmd(driver),
            m_BP(bp)
        {
            // gdb doesn't allow setting the bp number.
            // instead, we must read it back in ParseOutput()...
            m_BP->index = -1;

here the index of the breakpoint is set to -1, and it appears that it is never changed, so when the function "RemoveBreakpoint"
Code
void GDB_driver::RemoveBreakpoint(DebuggerBreakpoint* bp)
{
    if (bp && bp->index != -1)
        QueueCommand(new GdbCmd_RemoveBreakpoint(this, bp));
}
is called the breakpoint doesnt get removed. i dont know how to solve it(if it is the cause).

EDIT: OK, now i understand..., thanks
Title: Re: Problems debugging in Codeblocks
Post by: ollydbg on February 06, 2012, 02:41:26 am
2. Don't use localized versions of gdb, it will break debugging 100% guaranteed.
@Totoxa
The debugger plugin just parses the message returned from gdb command line, and sends some command also. So, if you use a localized gdb, it will definitely fail this handshake. So, please use an original (English language) gdb.
Title: Re: Problems debugging in Codeblocks
Post by: Totoxa on February 06, 2012, 02:56:10 am
2. Don't use localized versions of gdb, it will break debugging 100% guaranteed.
@Totoxa
The debugger plugin just parses the message returned from gdb command line, and sends some command also. So, if you use a localized gdb, it will definitely fail this handshake. So, please use an original (English language) gdb.

Yes, yes, because that was the edit in my last post. thanks!
Title: Re: Problems debugging in Codeblocks
Post by: Totoxa on February 06, 2012, 05:47:49 am
renaming the file /usr/share/locale-langpack/es/LC_MESSAGES/gdb.mo gdb display messages in english, so the problem has gone, thanks