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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #165 on: February 01, 2016, 07:46:57 am »
Hi, Morten, I guess this is an GCC issue comes from TDM's GCC. I just have those test environment:
1, I have a wx 2.8 release which is built by "MinGW-Build 4.8.1 dw2" (Note MinGW-Build 4.8.1 comes from MinGW-W64 project)
2, I build C::B against this wx 2.8, but I build it with "MinGW-Build 4.9. dw2".
3, I can debug C::B under my build GDB(2016-01-30) without any issue.

This is what I get when debugging the above settings:
Code: [Select]
> info shared

[debug]> info shared
[debug]From        To          Syms Read   Shared Object Library
[debug]0x7c901000  0x7c9b1ee0  Yes (*)     C:\WINDOWS\system32\ntdll.dll
[debug]0x7c801000  0x7c8f5cd8  Yes (*)     C:\WINDOWS\system32\kernel32.dll
[debug]0x617c1000  0x61db59d0  Yes         F:\cb_sf_git\trunk\src\devel\codeblocks.dll
[debug]0x6e941000  0x6e9637bc  Yes (*)     E:\code\gcc\i686-4.9.2-release-posix-dwarf-rt_v3-rev1\mingw32\bin\libgcc_s_dw2-1.dll
[debug]0x77c11000  0x77c67d74  Yes (*)     C:\WINDOWS\system32\msvcrt.dll
[debug]0x64941000  0x64953584  Yes (*)     E:\code\gcc\i686-4.9.2-release-posix-dwarf-rt_v3-rev1\mingw32\bin\libwinpthread-1.dll
[debug]0x77f11000  0x77f58878  Yes (*)     C:\WINDOWS\system32\gdi32.dll
[debug]0x7e411000  0x7e4a0de4  Yes (*)     C:\WINDOWS\system32\user32.dll
[debug]0x6fc41000  0x6fd40f14  Yes (*)     E:\code\gcc\i686-4.9.2-release-posix-dwarf-rt_v3-rev1\mingw32\bin\libstdc++-6.dll
[debug]0x010f1000  0x017b2e84  Yes         E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]0x77dd1000  0x77e6aaf8  Yes (*)     C:\WINDOWS\system32\advapi32.dll
[debug]0x77e71000  0x77f02554  Yes (*)     C:\WINDOWS\system32\rpcrt4.dll
[debug]0x77fe1000  0x77ff0888  Yes (*)     C:\WINDOWS\system32\secur32.dll
[debug]0x5d091000  0x5d12907c  Yes (*)     C:\WINDOWS\system32\comctl32.dll
[debug]0x763b1000  0x763f84dc  Yes (*)     C:\WINDOWS\system32\comdlg32.dll
[debug]0x7c9c1000  0x7d1d6510  Yes (*)     C:\WINDOWS\system32\shell32.dll
[debug]0x77f61000  0x77fd59d4  Yes (*)     C:\WINDOWS\system32\shlwapi.dll
[debug]0x774e1000  0x7761d110  Yes (*)     C:\WINDOWS\system32\ole32.dll
[debug]0x77121000  0x771aa42c  Yes (*)     C:\WINDOWS\system32\oleaut32.dll
[debug]0x76b41000  0x76b6c8b4  Yes (*)     C:\WINDOWS\system32\winmm.dll
[debug]0x73001000  0x7302551c  Yes (*)     C:\WINDOWS\system32\winspool.drv
[debug]0x71ad1000  0x71ad804c  Yes (*)     C:\WINDOWS\system32\wsock32.dll
[debug]0x71ab1000  0x71ac6dc8  Yes (*)     C:\WINDOWS\system32\ws2_32.dll
[debug]0x71aa1000  0x71aa7320  Yes (*)     C:\WINDOWS\system32\ws2help.dll
[debug]0x6e441000  0x6e4e4260  Yes         F:\cb_sf_git\trunk\src\devel\wxpropgrid.dll
[debug]0x76781000  0x767881cc  Yes (*)     C:\WINDOWS\system32\shfolder.dll
[debug]0x66e41000  0x66e4c3d0  Yes (*)     F:\cb_sf_git\trunk\src\devel\exchndl.dll
[debug]0x61541000  0x6157b2fc  Yes (*)     F:\cb_sf_git\trunk\src\devel\mgwhelp.dll
[debug]0x03001000  0x03148ce4  Yes (*)     F:\cb_sf_git\trunk\src\devel\dbghelp.dll
[debug]0x76bf1000  0x76bfa3c4  Yes (*)     C:\WINDOWS\system32\psapi.dll
[debug]0x77c01000  0x77c07300  Yes (*)     C:\WINDOWS\system32\version.dll
[debug]0x76391000  0x763acc6c  Yes (*)     C:\WINDOWS\system32\imm32.dll
[debug]0x019b1000  0x019b828e  Yes (*)     C:\WINDOWS\system32\lpk.dll
[debug]0x74d91000  0x74dfa696  Yes (*)     C:\WINDOWS\system32\usp10.dll
[debug]0x773d1000  0x774d2e2c  Yes (*)     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll
[debug]0x74721000  0x7476bc4c  Yes (*)     C:\WINDOWS\system32\MSCTF.dll
[debug]0x755c1000  0x755edba0  Yes (*)     C:\WINDOWS\system32\MSCTFIME.IME
[debug]0x02611000  0x028d4448  Yes (*)     C:\WINDOWS\system32\xpsp2res.dll
[debug]0x4b401000  0x4b4853c2  Yes (*)     C:\WINDOWS\system32\msftedit.dll
[debug]0x6bd81000  0x6bd9fde8  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\abbreviations.dll
[debug]0x712c1000  0x71329354  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\astyle.dll
[debug]0x64381000  0x64395ae0  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\autosave.dll
[debug]0x6af01000  0x6af20fe0  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\classwizard.dll
[debug]0x65e81000  0x65fb4810  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\codecompletion.dll
[debug]0x64b01000  0x64baf2f4  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\compiler.dll
[debug]0x6d881000  0x6d904160  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\debugger.dll
[debug]0x649c1000  0x649dc300  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\defaultmimehandler.dll
[debug]0x6cc41000  0x6cc61f20  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\OccurrencesHighlighting.dll
[debug]0x69041000  0x69052640  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\openfileslist.dll
[debug]0x70501000  0x705336fc  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\projectsimporter.dll
[debug]0x04671000  0x046bc914  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\scriptedwizard.dll
[debug]0x6bac1000  0x6baeeb6c  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\todo.dll
[debug]0x04911000  0x0491e4cc  Yes         F:\cb_sf_git\trunk\src\devel\share\CodeBlocks\plugins\xpmanifest.dll
[debug]0x76381000  0x7638403c  Yes (*)     C:\WINDOWS\system32\msimg32.dll
[debug](*): Shared library is missing debugging information.

Look, it still have the similar line:

Code: [Select]
0x010f1000  0x017b2e84  Yes         E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
So, I believe your "wxmsw28u_gcc_custom.dll" file has modified(stripped) after build.
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: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #166 on: February 01, 2016, 07:59:18 am »
OK, my guess is not correct. Here is my further test:
Code: [Select]

E:\code\cb\16.01\codeblocks-16.01-nosetup\share>cd ..

E:\code\cb\16.01\codeblocks-16.01-nosetup>which strip
E:\code\common_bin\strip.EXE

E:\code\cb\16.01\codeblocks-16.01-nosetup>strip wxmsw28u_gcc_cb.dll

E:\code\cb\16.01\codeblocks-16.01-nosetup>
I just stip the debug info on the wx dll, and debug codeblocks.exe again. No issue here, and Here is the result:

Code: [Select]
> info shared

[debug]> info shared
[debug]From        To          Syms Read   Shared Object Library
[debug]0x7c901000  0x7c9b1ee0  Yes (*)     C:\WINDOWS\system32\ntdll.dll
[debug]0x7c801000  0x7c8f5cd8  Yes (*)     C:\WINDOWS\system32\kernel32.dll
[debug]0x5d091000  0x5d12907c  Yes (*)     C:\WINDOWS\system32\comctl32.dll
[debug]0x77dd1000  0x77e6aaf8  Yes (*)     C:\WINDOWS\system32\advapi32.dll
[debug]0x77e71000  0x77f02554  Yes (*)     C:\WINDOWS\system32\rpcrt4.dll
[debug]0x77fe1000  0x77ff0888  Yes (*)     C:\WINDOWS\system32\secur32.dll
[debug]0x77f11000  0x77f58878  Yes (*)     C:\WINDOWS\system32\gdi32.dll
[debug]0x7e411000  0x7e4a0de4  Yes (*)     C:\WINDOWS\system32\user32.dll
[debug]0x77c11000  0x77c67d74  Yes (*)     C:\WINDOWS\system32\msvcrt.dll
[debug]0x7c9c1000  0x7d1d6510  Yes (*)     C:\WINDOWS\system32\shell32.dll
[debug]0x77f61000  0x77fd59d4  Yes (*)     C:\WINDOWS\system32\shlwapi.dll
[debug]0x76781000  0x767881cc  Yes (*)     C:\WINDOWS\system32\shfolder.dll
[debug]0x6cc41000  0x6d3dcdc8  Yes (*)     E:\code\cb\16.01\codeblocks-16.01-nosetup\wxmsw28u_gcc_cb.dll
[debug]0x763b1000  0x763f84dc  Yes (*)     C:\WINDOWS\system32\comdlg32.dll
[debug]0x774e1000  0x7761d110  Yes (*)     C:\WINDOWS\system32\ole32.dll
[debug]0x77121000  0x771aa42c  Yes (*)     C:\WINDOWS\system32\oleaut32.dll
[debug]0x76b41000  0x76b6c8b4  Yes (*)     C:\WINDOWS\system32\winmm.dll
[debug]0x73001000  0x7302551c  Yes (*)     C:\WINDOWS\system32\winspool.drv
[debug]0x71ad1000  0x71ad804c  Yes (*)     C:\WINDOWS\system32\wsock32.dll
...

Look, there is a "*" mark on the wxmsw28u_gcc_cb.dll, and still I don't see any error here.

EDIT:
Please clean up your PATH, and make sure you have 32 bit 2.7.x python installed. :)

« Last Edit: February 01, 2016, 08:00:58 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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #167 on: February 01, 2016, 07:59:25 pm »
My setup is TDM/MinGW 5.1.0. I compiled wx28 and C::B with that.
My guess still is, that the debugger is wrong. I'll explain, why:
* I've checked my PATH several times, its correct
* I even override all PATH settings in C::B using the EnvVars plugin

In all cases it works just fine with any previous release of gdb.
It fails with GDM/TDM (of 5.1.0 distro) and your 2016' gdb.

All GDB use the very same Python (2.7, 32 bit) environment.

Because of that what other than the GDB should be the reason? Do you understand what this GDB error message actually means?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #168 on: February 03, 2016, 06:57:20 am »
My setup is TDM/MinGW 5.1.0. I compiled wx28 and C::B with that.
My guess still is, that the debugger is wrong. I'll explain, why:
* I've checked my PATH several times, its correct
* I even override all PATH settings in C::B using the EnvVars plugin

In all cases it works just fine with any previous release of gdb.
It fails with GDM/TDM (of 5.1.0 distro) and your 2016' gdb.

All GDB use the very same Python (2.7, 32 bit) environment.

Because of that what other than the GDB should be the reason? Do you understand what this GDB error message actually means?
I don't know the error message means, maybe, I need to debug the GDB(debug GDB under GDB), but I can't reproduce on my WinXP.


Today, I just did the test on a Win7 64bit computer. GDB works just fine when loading the C::B. It is very simple to do the test.

1, download a 32 bit python installer(2.7.11), and install it.
2, download my gdb achieve, and unzip it
3, download the C::B 16.01 non-setup zip file, and unzip it.
4, copy the installed python files to the GDB's bin folder
5, start cmd
6, just run "gdb.exe E:/cb1601/CBlauncher.exe"
7, enter "r" to start the C::B.
8, I see C::B 16.01 correctly opened, and GDB does not show any error.

I'm not sure what is your system, I guess your system has some issues.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #169 on: February 03, 2016, 07:46:30 am »
4, copy the installed python files to the GDB's bin folder
Do you really mean all the files (and sub-folders)? I only copied the DLL.

So its basically a Python with GDB then, right?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #170 on: February 03, 2016, 07:58:51 am »
4, copy the installed python files to the GDB's bin folder
Do you really mean all the files (and sub-folders)? I only copied the DLL.
I personally copy all the files and sub-folders of the installed python to GDB's bin folder.

Quote
So its basically a Python with GDB then, right?
What does this sentence means?
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.