Author Topic: [OT] unofficial MinGW GDB gdb with python released  (Read 270892 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0 is released
« Reply #45 on: October 12, 2009, 01:41:16 pm »
You can try like this:
Code
file F:/cb_svn/src/devel/share/CodeBlocks/plugins/codecompletion.dll


Thanks, but it still doesn't work.

Code
>>>>>>cb_gdb:
> file F:/cb_svn/src/devel/share/CodeBlocks/plugins/codecompletion.dll
warning: (Internal error: pc 0x4295cc in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4295cc in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4295cc in read in psymtab, but not in symtab.)
Error in re-setting breakpoint 2: No source file named F:/cb_svn/src/src/main.cpp.
warning: (Internal error: pc 0x4295cc in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4295cc in read in psymtab, but not in symtab.)
>>>>>>cb_gdb:

Note: I have one breakpoint in F:/cb_svn/src/src/main.cpp already.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0 is released
« Reply #46 on: October 14, 2009, 07:36:26 am »
Hi, all, from the MinGW mail list, the new updated GDB.exe 7.02 is released, and the "setting bp issue on dll" is gone.

Quote
I've uploaded a new GDB 7.0 release with XML parsing enabled via
linking to libexpat.  It's available here:

http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/GDB-7.0/gdb-7.0-2-mingw32-bin.tar.gz/download

For this release you will need libexpat-2.0.1-1-mingw32-dll-1.tar.gz,
available here:

http://sourceforge.net/projects/mingw/files/MinGW%20expat/expat-2.0.1-1/libexpat-2.0.1-1-mingw32-dll-1.tar.gz/download

As before, please report any issues to the MinGW-users list.

Chris

also:

Quote
I've dug in to this and managed to add a break point in a DLL using
C::B.  I built my DLL with debug symbols and set a breakpoint in the
source for the DLL.  I then selected and executable that calls the DLL
and hit the 'Debug / Continue' button and it hit the DLL breakpoint.

I'm using a self compiled (using the official MinGW GCC 4.4.0) C::B
from svn trunk, GDB 7.0-2 and a DLL and app compiled with the official
MinGW GCC.

Cheers!

Chris

Now, I have confirm that the new gdb.exe 7.02 and TDM GCC 4.4.1 can works perfectly!!!

And if you want to build a C::B that support the new GDB 7.0, you should apply this patch by jens.

http://forums.codeblocks.org/index.php/topic,11301.msg77156.html#msg77156
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #47 on: October 14, 2009, 08:31:32 am »
Another question, can somebody explain that what's these warning means?

Code
> bt 30
#0  Tokenizer::DoGetToken (this=0x5b21a38) at F:\cb_svn\src\plugins\codecompletion\parser\tokenizer.cpp:809
#1  0x65ee7987 in Tokenizer::GetToken (this=0x5b21a38) at F:\cb_svn\src\plugins\codecompletion\parser\tokenizer.cpp:568
warning: (Internal error: pc 0x6279c950 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279c950 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279c950 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279c950 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279c950 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e28a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e28a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e28a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e28a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e28a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e35b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e35b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e35b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e35b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279e35b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279dc92 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279dc92 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279dc92 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279dc92 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x6279dc92 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62701507 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62701507 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62701507 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62701507 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62701507 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62bd7254 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62bd7254 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62bd7254 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62bd7254 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x62bd7254 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22fb0b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22fb0b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22fb0b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22fb0b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x22fb0b in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2f in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x2f 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 0x627dbe61 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x627dbe61 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x627dbe61 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x627dbe61 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x627dbe61 in read in psymtab, but not in symtab.)
#2  0x65ed55e7 in ParserThread::HandleIncludes (this=0x5b21a30) at F:\cb_svn\src\plugins\codecompletion\parser\parserthread.cpp:919
#3  0x65ed35e0 in ParserThread::DoParse (this=0x5b21a30) at F:\cb_svn\src\plugins\codecompletion\parser\parserthread.cpp:505
#4  0x65ed2cf1 in ParserThread::Parse (this=0x5b21a30) at F:\cb_svn\src\plugins\codecompletion\parser\parserthread.cpp:369
#5  0x65ece3f8 in Parser::ParseBufferForFunctions (this=0x22f168, buffer=...) at F:\cb_svn\src\plugins\codecompletion\parser\parser.cpp:569
#6  0x65eb0e6d in CodeCompletion::ParseFunctionsAndFillToolbar (this=0x4044ce8, force=false) at F:\cb_svn\src\plugins\codecompletion\codecompletion.cpp:1410
#7  0x65eb026f in CodeCompletion::OnWorkspaceChanged (this=0x4044ce8, event=...) at F:\cb_svn\src\plugins\codecompletion\codecompletion.cpp:1180
#8  0x65ef5794 in cbEventFunctor<CodeCompletion, CodeBlocksEvent>::Call (this=0x599bf60, event=...) at F:/cb_svn/src/include/cbfunctor.h:35
#9  0x00c32f2c in Manager::ProcessEvent (this=0x36e0c58, event=...) at F:\cb_svn\src\sdk\manager.cpp:179
#10 0x00c4eb4a in PluginManager::NotifyPlugins (this=0x4042038, event=...) at F:\cb_svn\src\sdk\pluginmanager.cpp:1466
#11 0x00c80992 in ProjectManager::WorkspaceChanged (this=0x3e76008) at F:\cb_svn\src\sdk\projectmanager.cpp:2630
#12 0x00c81c6e in ProjectManager::EndLoadingProject (this=0x3e76008, project=0x5aebff8) at F:\cb_svn\src\sdk\projectmanager.cpp:2831
#13 0x00c75c93 in ProjectManager::LoadProject (this=0x3e76008, filename=..., activateIt=true) at F:\cb_svn\src\sdk\projectmanager.cpp:857
#14 0x0043284e in MainFrame::DoOpenProject (this=0x37473d8, filename=..., addToHistory=true) at F:\cb_svn\src\src\main.cpp:1610
#15 0x0043231c in MainFrame::OpenGeneric (this=0x37473d8, filename=..., addToHistory=true) at F:\cb_svn\src\src\main.cpp:1559
#16 0x00435e65 in MainFrame::OnStartHereLink (this=0x37473d8, event=...) at F:\cb_svn\src\src\main.cpp:1880
#17 0x6279c951 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#18 0x6279e28b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#19 0x6279e35c in wxEvtHandler::ProcessEvent(wxEvent&) () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#20 0x6279dc93 in wxEvtHandler::ProcessPendingEvents() () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#21 0x62701508 in wxAppConsole::ProcessPendingEvents() () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#22 0x62bd7255 in wxIdleWakeUpModule::MsgHookProc () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
#23 0x7e41ead2 in USER32!EnableMenuItem () from C:\WINDOWS\system32\user32.dll
#24 0x7e41ea7e in USER32!EnableMenuItem () from C:\WINDOWS\system32\user32.dll
#25 0x7e41ebd3 in USER32!CallNextHookEx () from C:\WINDOWS\system32\user32.dll
#26 0x7c90e473 in ntdll!LdrDestroyOutOfProcessImage () from C:\WINDOWS\system32\ntdll.dll
#27 0x0022fb0c in ?? ()
#28 0x00000030 in ?? () at F:/cb_svn/src/include/blockallocated.h:80
#29 0x627dbe62 in wxEventLoop::Dispatch() () from F:\cb_svn\src\devel\wxmsw28u_gcc_custom.dll
>>>>>>cb_gdb:
> delete breakpoints 2
>>>>>>cb_gdb:
> cont

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #48 on: October 14, 2009, 09:26:56 am »
Ollydbg: try asking the gdb devs directly (#gdb at freenode will be the fastest).
This seems to be a gdb problem...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #49 on: October 14, 2009, 09:48:07 am »
Ollydbg: try asking the gdb devs directly (#gdb at freenode will be the fastest).
This seems to be a gdb problem...
thanks, currently, I just asked in MinGW user mail list, I haven't heard http://freenode.net/ before.. :shock:
So, I will learn to use it then.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #50 on: October 14, 2009, 06:26:23 pm »
Ollydbg: try asking the gdb devs directly (#gdb at freenode will be the fastest).
This seems to be a gdb problem...
thanks, currently, I just asked in MinGW user mail list, I haven't heard http://freenode.net/ before.. :shock:
So, I will learn to use it then.

It's an irc service (irc.freenode.net).  Alternately, perhaps follow-up on the GDB mailing list.  I'll try to recreate the issue later today and follow up accordingly.  When I do a backtrace using using GDB command line I don't see these messages.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5517
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #51 on: October 14, 2009, 07:28:34 pm »
Quote
And if you want to build a C::B that support the new GDB 7.0, you should apply this patch by jens.

http://forums.codeblocks.org/index.php/topic,11301.msg77156.html#msg77156

Applied in trunk.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #52 on: October 15, 2009, 02:37:18 am »
Ollydbg: try asking the gdb devs directly (#gdb at freenode will be the fastest).
This seems to be a gdb problem...
thanks, currently, I just asked in MinGW user mail list, I haven't heard http://freenode.net/ before.. :shock:
So, I will learn to use it then.

It's an irc service (irc.freenode.net).  Alternately, perhaps follow-up on the GDB mailing list.  I'll try to recreate the issue later today and follow up accordingly.  When I do a backtrace using using GDB command line I don't see these messages.


hello, thanks.
I just test a simple exe and dll project, then I don't see any such warnings.

But these warning is exist when I'm debugging the C::B's plugin dll. :D, so, I'm not sure there is the something wrong with C::B plugin or others. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline olelukoie

  • Single posting newcomer
  • *
  • Posts: 7
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #53 on: October 20, 2009, 04:21:31 pm »
hello, thanks.
I just test a simple exe and dll project, then I don't see any such warnings.

But these warning is exist when I'm debugging the C::B's plugin dll. :D, so, I'm not sure there is the something wrong with C::B plugin or others. :(
I see the same warnings with different hex values when debugging Qt4-based app with TDM-GCC+GDB7+Eclipse+CDT+Qt eclipse integration. And I don't see them when I revert back to GDB 6.8 that comes in the TDM's installer. So I think it's not a CB-related problem (at least not CB-specific one).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #54 on: October 20, 2009, 04:29:39 pm »
hello, thanks.
I just test a simple exe and dll project, then I don't see any such warnings.

But these warning is exist when I'm debugging the C::B's plugin dll. :D, so, I'm not sure there is the something wrong with C::B plugin or others. :(
I see the same warnings with different hex values when debugging Qt4-based app with TDM-GCC+GDB7+Eclipse+CDT+Qt eclipse integration. And I don't see them when I revert back to GDB 6.8 that comes in the TDM's installer. So I think it's not a CB-related problem (at least not CB-specific one).
Agreed, but I have no idea how to solve this problem, we need a GDB developer's help. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: [OT] MinGW GDB 7.0 is released
« Reply #55 on: November 17, 2009, 03:12:58 am »
Hi, all, from the MinGW mail list, the new updated GDB.exe 7.02 is released, and the "setting bp issue on dll" is gone.


The GDB 7.02 can not work well with my project (a exe with named Demo2 and a dll named Tutorial04):

Code
> set prompt >>>>>>cb_gdb:
Reading symbols from F:\TC_Project\presearch\Demo2/bin/Debug/Demo2.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 disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source E:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> handle SIGTRAP noprint
>>>>>>cb_gdb:
> directory F:/TC_Project/presearch/Tutorial04/
>>>>>>cb_gdb:
> directory F:/TC_Project/presearch/Demo2/
>>>>>>cb_gdb:
> break "F:/TC_Project/presearch/Demo2/Demo2Main.cpp:541"
Breakpoint 2 at 0x4082dc: file F:\TC_Project\presearch\Demo2\Demo2Main.cpp, line 541.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 920.0x404]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

sometime ,I got :
Code
/*same as about*/
> run
gdb: windows_init_thread_list
[New Thread 4364.0x17b4]
WINDOWS\system32\winmm.dll" at 0x76b10000.
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

--------
I have test It work well if use gdb-6.8 .

--------
code::blocks 5911 + mingw32 gcc 4.4.0 /windows xp / gdb 7.02
« Last Edit: November 17, 2009, 03:19:50 am by nanyu »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0 is released
« Reply #56 on: November 17, 2009, 03:20:43 am »
Hi, all, from the MinGW mail list, the new updated GDB.exe 7.02 is released, and the "setting bp issue on dll" is gone.


The GDB 7.02 can not work well with my project (a exe with named Demo2 and a dll named Tutorial04):

Code
> set prompt >>>>>>cb_gdb:
Reading symbols from F:\TC_Project\presearch\Demo2/bin/Debug/Demo2.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 disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source E:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> handle SIGTRAP noprint
>>>>>>cb_gdb:
> directory F:/TC_Project/presearch/Tutorial04/
>>>>>>cb_gdb:
> directory F:/TC_Project/presearch/Demo2/
>>>>>>cb_gdb:
> break "F:/TC_Project/presearch/Demo2/Demo2Main.cpp:541"
Breakpoint 2 at 0x4082dc: file F:\TC_Project\presearch\Demo2\Demo2Main.cpp, line 541.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 920.0x404]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

--------
I have test It work well if use gdb-6.8 .

--------
code::blocks 5911 + mingw32 gcc 4.4.0 /windows xp / gdb 7.02


So, what's the problem? From the debugger log, it seems the GDB exit abnormally? Could you supply a test case?
At least it works on my test case of EXE and DLL project.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: [OT] MinGW GDB 7.0 is released
« Reply #57 on: November 17, 2009, 04:12:13 am »
...
So, what's the problem? From the debugger log, it seems the GDB exit abnormally? Could you supply a test case?
At least it works on my test case of EXE and DLL project.

1, New a  "SDL project" (by c::b's project template), named the project "SDL_WinMM_GDBTest" .

2, Add a new target named "DLL_Debug", and add the complie option -D_BUILD_DLL_.

3, modify the main.cpp, and build the "DLL_Debug" target.
Code
#if defined(_BUILD_DLL_)
int dll_main( int argc, char** argv )
#else
int main ( int argc, char** argv )
#endif
{
   ...
}

4, Create a C++ Console Project (by c::b's project template) , named "CallSDL_WinMM_GDBTest".

5, Add  a new  "Virtual target" to "CallSDL_WinMM_GDBTest" which alials is "DLL_Debug" and "Build targets contained": Debug.

6, the main.cpp for "CallSDL_WinMM..."
Quote
#include <iostream>
using namespace std;

int dll_main( int argc, char** argv );
int main(int argc, char** argv )
{
    dll_main(argc, argv);
   
    return 0;
}

7, Add two lib to CallDLL_WinMM_GDBTest's "Link libraries "
   SDL_WinMM_GDBTest.dll
   SDL

8, then add the linke search path...

9, build CallDLL_Win_GDBTest.exe , run it. It looks everythink OK, now.

10, Prerss F8, then the error message occurrences in Debugger(debug) log panel :
   
Code
Command-line: E:\MinGW\bin\gdb.exe -nx -fullname  -quiet -args bin/Debug/CallSDL_WinMM_GDBTest.exe
Working dir : C:\Documents and Settings\ZhuangYanDell\My Documents\CodeBlocks Projects\CallSDL_WinMM_GDBTest\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\Documents and Settings\ZhuangYanDell\My Documents\CodeBlocks Projects\CallSDL_WinMM_GDBTest/bin/Debug/CallSDL_WinMM_GDBTest.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:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source E:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> handle SIGTRAP noprint
>>>>>>cb_gdb:
> directory C:/DOCUME~1/ZHUANG~1/MYDOCU~1/CODEBL~1/SDL_WI~1/
>>>>>>cb_gdb:
> directory C:/DOCUME~1/ZHUANG~1/MYDOCU~1/CODEBL~1/CALLSD~1/
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 5708.0x114c]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

EDIT : I guess:  CallSDL_WinMM_GDBTest---call-->SDL_WinMM_GDBTest---call-->SDL.dll---call--->WinMM.dll. then the error occurrence.
« Last Edit: November 17, 2009, 04:20:08 am by nanyu »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #58 on: November 17, 2009, 04:22:23 am »
Ok, too many steps. :? In fact, I have no experience of "SDL"...

I will test it.

By the way:would you mind to upload your project?

You can also try the project I uploaded in this message:
http://forums.codeblocks.org/index.php/topic,11301.msg77123.html#msg77123

Edit: Oh, my God, I need to setup a SDL build environment(headers, libraries...), tough for me...
« Last Edit: November 17, 2009, 04:27:46 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: [OT] MinGW GDB 7.0.2 is released updated[2009-10-14]
« Reply #59 on: November 17, 2009, 05:58:20 am »
Ok, too many steps. :? In fact, I have no experience of "SDL"...

I will test it.

By the way:would you mind to upload your project?

You can also try the project I uploaded in this message:
http://forums.codeblocks.org/index.php/topic,11301.msg77123.html#msg77123

Edit: Oh, my God, I need to setup a SDL build environment(headers, libraries...), tough for me...

1. download the sdl source here and unzip it.
2. starut msys , cd the sdl source dir
3. ./configure  -> make -> make install
4. in c::b, add a new global var : sdl
   copy include to $sdl.include
   copy /local/bin and local/lib  to $sdl.lib   

EDIT here is the test project package : sdl_gdb_dll_test

thanks you!
« Last Edit: November 17, 2009, 06:17:29 am by nanyu »