Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Splitting debugger in two - specific debugger and common GUI

<< < (23/136) > >>

oBFusCATed:
Here is another patch for the debugger: http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0004.patch

What it does:
1. Improvements to the backtrace window - the inactive stack frames are not shown as "??" any more
2. Fixed bug https://developer.berlios.de/bugs/?func=detailbug&bug_id=16146&group_id=5358
3. Some cleaning

Best regards

oBFusCATed:
Yet another patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0005.patch
This one includes the changes from the previous one plus:

1. Fixed bug 13972 ( http://developer.berlios.de/bugs/?func=detailbug&bug_id=13972&group_id=5358 )
2. Modified one of the regexpr for matching lines of the backtrace (case #0)
3. Added two menu options to choose the default action on double click in the backtrace window ("jump to" or "switch to")

ollydbg:
Hi, oBF, thanks!!!!! :D

I just apply this patch, and find a small bug.

The test code is the attachment of this message
http://forums.codeblocks.org/index.php/topic,11301.msg77123.html#msg77123

In debugger branch, I can set breakpoint in the function body.


--- Code: ---void __declspec(dllexport) MyFunction(const LPCSTR sometext)
{
    /** SET BREAK POINT HERE VVVVVVVVVVV **/
    MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION); *************breakpoint set here.
    /** SET BREAK POINT HERE ^^^^^^^^^^^^ **/
}

--- End code ---

when the debugger hit the bp, cursor jumped to the wrong place,

--- Code: ---        if ( NULL != ProcAdd )
            {
            fRunTimeLinkSuccess = TRUE;
            ( ProcAdd ) ( TEXT( "Message via DLL function\n" ) ); *********when bp hit, the cursor always jump here.
            }

--- End code ---

I think this is wrong behavior.

It works fine in the trunk version.

My environment: TDM-MinGW GCC 4.4.1 and GDB 7.02
and with patch from jens:
http://forums.codeblocks.org/index.php/topic,11301.msg77156.html#msg77156

thanks.


Edit

I just found that if the Call stack window was not opened during debugging, the cursor can jump to the right place. :D, so, this is an issue of interpreting the backtrack output.

oBFusCATed:
Uau, you are quite fast :)

Can you provide a platform independent test case? (probably not because I'm sure it breaks because of the "__declspec(dllexport)" )
Can you paste here the output in the debugger log window after the "bt 30" command..
Unfortunately the output of that command is made for users not parsers and so it is quite unreliable :(

Thanks for the feadback

ollydbg:

--- Quote from: oBFusCATed on October 19, 2009, 09:35:28 am ---Uau, you are quite fast :)

Can you provide a platform independent test case? (probably not because I'm sure it breaks because of the "__declspec(dllexport)" )
Can you paste here the output in the debugger log window after the "bt 30" command..
Unfortunately the output of that command is made for users not parsers and so it is quite unreliable :(

Thanks for the feadback



--- End quote ---

Ok, but I can only supply a windows test case, because I only have windows. I haven't tried linux till now. :(

Log with no call stack window:

--- Code: ---(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source F:\debugger_branch\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory D:/codeblocks_opencv/call_DLL_wxDebugTest/
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestApp/main.cpp:63"
Breakpoint 2 at 0x401438: file D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp, line 63.
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp:10"
No source file named D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp.
Breakpoint 3 ("D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp:10) pending.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 1844.0x260]
[New Thread 1844.0x2c8]
Breakpoint 2, WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63:2773:beg:0x401438
Current language:  auto
The current source language is "auto; currently c++".
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> whatis szClassName
type = char [21]
>>>>>>cb_gdb:
> output &szClassName
(char (*)[21]) 0x402000>>>>>>cb_gdb:
> output szClassName
"CodeBlocksWindowsApp">>>>>>cb_gdb:
> cont
Breakpoint 3, MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10:192:beg:0x684c11de
>>>>>>cb_gdb:
> cont
warning: Temporarily disabling breakpoints for unloaded shared library "D:\codeblocks_opencv\call_DLL_wxDebugTest\bin\TestDLL.dll"
Program exited normally.
>>>>>>cb_gdb:
> quit

--- End code ---

Log with call stack window opened.

--- Code: ---> bt 30
#0  WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#1  0x00401a86 in main ()
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestApp/main.cpp:65"
Breakpoint 4 at 0x40143d: file D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp, line 65.
>>>>>>cb_gdb:
> cont
Breakpoint 3, MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10:192:beg:0x684c11de
>>>>>>cb_gdb:
> bt 30
#0  MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1  0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2  0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3  0x00401a86 in main ()
>>>>>>cb_gdb:
> frame 1
#1  0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127:4719:beg:0x40156b
>>>>>>cb_gdb:
> bt 30
#0  MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1  0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2  0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3  0x00401a86 in main ()
>>>>>>cb_gdb:
> frame 1
#1  0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127:4719:beg:0x40156b
>>>>>>cb_gdb:
> cont
warning: Temporarily disabling breakpoints for unloaded shared library "D:\codeblocks_opencv\call_DLL_wxDebugTest\bin\TestDLL.dll"
Breakpoint 4, WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65:2799:beg:0x40143d
>>>>>>cb_gdb:
> bt 30
#0  WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65
#1  0x00401a86 in main ()
>>>>>>cb_gdb:
> cont
Program exited normally.
>>>>>>cb_gdb:
> quit

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version