User forums > General (but related to Code::Blocks)
[OT] unofficial MinGW GDB gdb with python released
ollydbg:
--- Quote from: oBFusCATed on October 08, 2009, 04:48:34 pm ---main should be in src/src/main.cpp not in the console runner :)
--- End quote ---
My god... Big mistake...
Thanks, I will try this tomorrow, it's time to go to bed now. :wink:
Edit
But for gdb.exe 6.8.3, I don't need to firstly set a breakpoint in the main(), I can directly set a breakpoint any where(for example tokenizer.cpp). :D
MortenMacFly:
--- Quote from: ollydbg on October 08, 2009, 05:01:51 pm ---But for gdb.exe 6.8.3, I don't need to firstly set a breakpoint in the main(), I can directly set a breakpoint any where(for example tokenizer.cpp). :D
--- End quote ---
The same applied for GDB7. "main" was just an example. ;-) Good night! :P
ollydbg:
@morten
Setting breakpoing at src\src\main.cpp, CreateIDE() works.
When the breakpoint above hitted. I still can't set breakpoint in tokenizer.cpp DoGetToken(). :(
Here is the log:
--- Code: ---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 intel
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source D:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> cd devel
>>>>>>cb_gdb:
> directory F:/cb_svn/src/
>>>>>>cb_gdb:
> set args --debug-log --no-check-associations -ns -nd
>>>>>>cb_gdb:
> break "F:/cb_svn/src/src/main.cpp:631"
Breakpoint 2 at 0x429658: file F:\cb_svn\src\src\main.cpp, line 631.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
gdb: kernel event for pid=3348 tid=3508 code=CREATE_PROCESS_DEBUG_EVENT)
[New Thread 3348.0xdb4]
.......
ContinueDebugEvent (cpid=3348, ctid=3496, DBG_CONTINUE);
gdb: kernel event for pid=3348 tid=3508 code=EXCEPTION_DEBUG_EVENT)
Breakpoint 2, MainFrame::CreateIDE (this=0x3718af0) at F:\cb_svn\src\src\main.cpp:631
F:\cb_svn\src\src\main.cpp:631:32181:beg:0x429658
Current language: auto
The current source language is "auto; currently c++".
>>>>>>cb_gdb:
> info locals
leftW = 200
clientsize = {
x = 65055748,
y = 62728
}
>>>>>>cb_gdb:
> info args
this = 0x3718af0
>>>>>>cb_gdb:
> whatis actual
No symbol "actual" in current context.
>>>>>>cb_gdb:
> output actual
No symbol "actual" in current context.
>>>>>>cb_gdb:
> whatis cashed_results_count
No symbol "cashed_results_count" in current context.
>>>>>>cb_gdb:
> output cashed_results_count
No symbol "cashed_results_count" in current context.
>>>>>>cb_gdb:
> whatis line
No symbol "line" in current context.
>>>>>>cb_gdb:
> output line
No symbol "line" in current context.
>>>>>>cb_gdb:
> whatis m_TokenIndex
No symbol "m_TokenIndex" in current context.
>>>>>>cb_gdb:
> output m_TokenIndex
No symbol "m_TokenIndex" in current context.
>>>>>>cb_gdb:
> whatis next
No symbol "next" in current context.
>>>>>>cb_gdb:
> output next
No symbol "next" in current context.
>>>>>>cb_gdb:
> whatis res
No symbol "res" in current context.
>>>>>>cb_gdb:
> output res
No symbol "res" in current context.
>>>>>>cb_gdb:
> whatis startAt
No symbol "startAt" in current context.
>>>>>>cb_gdb:
> output startAt
No symbol "startAt" in current context.
>>>>>>cb_gdb:
> bt 30
#0 MainFrame::CreateIDE (this=0x3718af0) at F:\cb_svn\src\src\main.cpp:631
#1 0x0042736d in MainFrame (this=0x3718af0, parent=0x0) at F:\cb_svn\src\src\main.cpp:511
#2 0x004026e3 in CodeBlocksApp::InitFrame (this=0x367bc08) at F:\cb_svn\src\src\app.cpp:401
#3 0x00404c57 in CodeBlocksApp::OnInit (this=0x367bc08) at F:\cb_svn\src\src\app.cpp:625
#4 0x00469b30 in wxAppConsole::CallOnInit (this=0x367bc08) at D:/wxWidgets-2.8.10/include/wx/app.h:76
#5 0x6273bff1 in ?? ()
#6 0x0367bc08 in ?? ()
#7 0x0367b870 in ?? ()
#8 0x40000060 in ?? ()
#9 0x77c2c3ce in ?? ()
#10 0x00460044 in wxWindow::Thaw() ()
#11 0x7ffdfc00 in ?? ()
#12 0x00261f03 in ?? ()
#13 0x0023fe6c in ?? ()
warning: (Internal error: pc 0x261f02 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x261f02 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x261f02 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x261f02 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x261f02 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe6b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe6b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe6b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe6b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe6b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fecb in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fecb in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fecb in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fecb in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fecb in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2ffff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2ffff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2ffff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2ffff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2ffff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe67 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe67 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe67 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe67 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x23fe67 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
#14 0x00000003 in ?? () at F:\cb_svn\src\src\appglobals.cpp:57
#15 0x627a5977 in ?? ()
#16 0x0023fecc in ?? ()
#17 0x0367b870 in ?? ()
#18 0x0367afb0 in ?? ()
#19 0x00030000 in ?? ()
#20 0x0367afa8 in ?? ()
#21 0x0023fe68 in ?? ()
#22 0x7c96e52f in ?? ()
#23 0x0367b870 in ?? ()
#24 0x0367b870 in ?? ()
#25 0x00000005 in ?? () at d:/mingw/bin/../lib/gcc/mingw32/4.4.0/include/c++/ext/new_allocator.h:73
#26 0x00401d58 in WinMain@16 (hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x261f03 "--debug-log --no-check-associations -ns -nd", nCmdShow=10) at F:\cb_svn\src\src\app.cpp:256
#27 0x00465e48 in main ()
>>>>>>cb_gdb:
> whatis MainFrame
Type MainFrame has no component named MainFrame.
>>>>>>cb_gdb:
> output MainFrame
cannot resolve overloaded method `MainFrame': no arguments supplied
>>>>>>cb_gdb:
> output MainFrame
cannot resolve overloaded method `MainFrame': no arguments supplied
>>>>>>cb_gdb:
> output MainFrame
cannot resolve overloaded method `MainFrame': no arguments supplied
>>>>>>cb_gdb:
> break "F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp:588"
No source file named F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp.
Breakpoint 3 ("F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp:588) pending.
>>>>>>cb_gdb:
> cont
--- End code ---
Quite strange, breakpoint on some source file works, but others don't.
--- Code: --->>>>>>cb_gdb:
> break "F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp:588"
No source file named F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp.
Breakpoint 3 ("F:/cb_svn/src/plugins/codecompletion/parser/tokenizer.cpp:588) pending.
--- End code ---
It seems there is still some bug in TDM-MinGW 4.4 or GDB.exe7.0 :(
theOcelot:
It's not working for me. I've always had trouble with hitting breakpoints in headers. Here's a few more datapoints to work with:
I'm on Windows Vista, the official MinGW G++ 4.4.0, and CB 8.02. I started a fresh, C++, CB console project, and added the following file, named "tester1.h":
--- Code: ---#ifndef TESTER1_H
#define TESTER1_H
#include <iostream>
inline void function(){
std::cout << "in function()" << std::endl;
}
struct Foo{
Foo(){
std::cout << "constructing Foo" << std::endl;
}
void bar(){
std::cout << "Foo::bar" << std::endl;
}
};
#endif
--- End code ---
Then in main .cpp:
--- Code: ---int main()
{
cout << "Hello world!" << endl;
Foo foo;
function();
foo.bar();
return 0;
}
--- End code ---
I set breakpoints on all the output lines in tester1.h, and on the return 0. Only the latter was hit, with either GDB 6.8 or 7.0. Same results when I named the header tester.h, in case the number in the filename was screwing things up. There path to my project is C:\Users\Fleenor\Projects\DebugTest, no spaces or anything irregular. Mingw is C:\MinGW.
Here is my debug log with GDB 7.0, tester1.h:
--- Code: ---PATH=.;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\hp\bin\Python;C:\MinGW\bin;C:\Program Files\Subversion\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin
Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args bin/Debug/DebugTest.exe
Working dir : C:\Users\Fleenor\Projects\DebugTest\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\Users\Fleenor\Projects\DebugTest/bin/Debug/DebugTest.exe...
done.
(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 new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> directory C:/Users/Fleenor/Projects/DebugTest/
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/main.cpp:12"
Breakpoint 1 at 0x4013ef: file C:\Users\Fleenor\Projects\DebugTest\main.cpp, line 12.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:15"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 2 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:15) pending.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:12"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 3 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:12) pending.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:7"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 4 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:7) pending.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
gdb: kernel event for pid=2840 tid=3476 code=CREATE_PROCESS_DEBUG_EVENT)
[New Thread 2840.0xd94]
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\ntdll.dll" at 0x76e30000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\kernel32.dll" at 0x76bb0000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\msvcrt.dll" at 0x75720000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\MinGW\bin\libgcc_s_dw2-1.dll" at 0x6e940000.
gdb: kernel event for pid=2840 tid=3476 code=EXCEPTION_DEBUG_EVENT)
warning: Can not parse XML library list; XML support was disabled at compile time
gdb: kernel event for pid=2840 tid=3476 code=EXCEPTION_DEBUG_EVENT)
Breakpoint 1, main () at C:\Users\Fleenor\Projects\DebugTest\main.cpp:12
C:\Users\Fleenor\Projects\DebugTest\main.cpp:12:168:beg:0x4013ef
>>>>>>cb_gdb:
> info locals
foo = {<No data fields>}
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> bt 30
#0 main () at C:\Users\Fleenor\Projects\DebugTest\main.cpp:12
>>>>>>cb_gdb:
> quit
gdb: windows_close, inferior_ptid=2840
--- End code ---
The interesting part of course is where it still says "No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h." I wonder if it could be something to do with the different slash types, but it seems like that would have been fixed a long time ago.
I don't really want to do anything to further confuse my installation, but would TDM help me? Is the only way to know to try? I'll attach my project in 7z format, if anyone wants to see if they can reproduce my behavior, or show non-reproducibility on their system.
[attachment deleted by admin]
oBFusCATed:
Can you try a nightly build?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version