User forums > Using Code::Blocks
Problem with Debugger when upgrading MinGW
recobb:
I decided to try one of the nightlies (svn 6931) instead of the 10.05/MinGW package I have been using. I installed MinGW from http://sourceforge.net/projects/mingw/files/ using mingw-get-inst-20101030.exe, and put it in a C:\ root folder. I also renamed the MinGW folder in the Codeblocks Program Files folder, and changed my path statement to reflect the new location. I also updated the CB toolchain executable, which, with auto-detect, found the new location.
Next, I cleaned my project and rebuilt it. I was able to start the debugger, and it showed the new version number. I can even set breakpoints. However, when it stops at some of the breakpoints (nothing fancy or inline), I cannot single step, as I get an error message about accessing a memory address:
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.2
Child process PID: 3348
....
At E:\Analysis\wxproj\wxrcplot_data\dataclass.cpp:239
Error accessing memory address 0x7816cd30: Input/output error.
And I am not able to get any useful debugging after that.
So then I changed the name of the C:\mingw root folder, restored the original name of the Code Blocks\MinGW folder, changed the path statement back to the original, and updated the toolchain executable location again. Once again, clean and rebuild. At the same point that I could not debug with the 7.2 version of gdb I was able to with the older 6.8 version. I also checked between the svn and 10.05 version, and there is no problem there - that is, the debugger works in both versions with the older version of MinGW, but not the newer version.
I do get an error message with the older version, but it does not seem to impact on functionality (i.e., breakpoints, stepping, watches, etc all seem to work OK):
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 764
Error while mapping shared library sections:
I don't know how long that error has been there, I never paid much attention to the debugger log when everything seemed to be working.
I'm pretty much a newbie at all this - I could just go back to the canned package and use that, but I'd like to learn to play in the sand box with the bigger boys :(
Here's some version info from the two versions:
--- Code: ------------------------------------------------------
C:\Program Files (x86)\CodeBlocks\MinGW\bin>gcc --version
gcc (TDM-2 mingw32) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\Program Files (x86)\CodeBlocks\MinGW\bin>gdb --version
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-mingw32".
-------------------------------------------
C:\MinGW\bin>gcc --version
gcc (GCC) 4.5.0
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\MinGW\bin>gdb --version
GNU gdb (GDB) 7.2
Copyright (C) 2010 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/>.
-----------------------------------------------
--- End code ---
Thanks for any help/pointers.
Richard
ollydbg:
--- Quote ---Error accessing memory address 0x7816cd30: Input/output error.
--- End quote ---
I meet this kind of warning even with latest gdb(build under msys+mingw myself).
But once I rebuild the project, these error was gone. :D
can you supply a test case??
recobb:
More info - I tried the tdm version ( from http://tdm-gcc.tdragon.net/ ) and have the same single-stepping problem.
Debugger name and version: GNU gdb (GDB) 7.1
Child process PID: 4012
Error while mapping shared library sections:
At E:\Analysis\wxproj\wxrcplot_data\dataclass.cpp:239
Error accessing memory address 0x7816cd30: Input/output error.
Error accessing memory address 0x78594458: Input/output error.
I found that I can put breakpoints every few lines, and it will run to the next breakpoint and stop, but the single-stepping gives me the errors. When it stops at the breakpoints it seems that I can inspect watch variables.
To ollydbg, at this point it is difficult to provide a test case unless I send the entire project. I haven't tried the newer debugger with any other projects yet. I'll dig around and see if I can create the same problem in something simple - probably be tomorrow at this point, though. Thanks...
Richard
recobb:
It's proving harder to come up with a demo case than I thought. Single stepping in the debugger works fine for all my small projects, no matter which version of MinGW I'm using. It's only in a larger, multiple-file project that I have problems, and then not at all points. At some points, early in the program execution, single stepping will work, then start giving me the accessing memory errors at some later point. The points at which it will, or will not work seem to be consistent within a program, whether I'm using the TDM version (gdb version 7.1) or the download from the MinGW site (gdb v 7.2). With the 6.8 version packaged with CB 10.05 single stepping works at the same points.
I have used both Rebuild and Clean followed by Build to make sure all files are compiled by the same version.
oBFusCATed:
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
And enable full logging. Then verify that c::b executes the correct commands (-g should be used everywhere).
Navigation
[0] Message Index
[#] Next page
Go to full version