Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Frame issue with the debugger plugin

<< < (3/14) > >>

oBFusCATed:
2. Yes, it should be more portable. Otherwise why they'll add a macro. Probably it is not implemented by vc++, but we don't care much about it anyway.
3. This will require more changes. Probably track where the original value for the frame index is taken from and see why it is a long instead of uint32.

scarphin:

--- Quote from: oBFusCATed on March 31, 2015, 11:44:08 pm ---3. This will require more changes. Probably track where the original value for the frame index is taken from and see why it is a long instead of uint32.

--- End quote ---
Well, I think that is what needs to be done. I think I spoke too soon that it worked, it's broken again for no obvious reason. Another issue, looking at the wxstring documentation, it has an 'operator<<' defined for a 'wxlonglong_t' type. From my understanding of 'wxlonglong_t' definition, it is defined as 'long long' for 64-bit compilers matching the definition of 'size_t'. That means 'operator<<' with an argument of 'size_t' should work correctly on a wxstring object. Can you please point me to the piece of code where the frame info is parsed, is it 'GDB_driver::ParseOutput'?

oBFusCATed:
Have you tried using a debugger to trace where bad value is generated from?

It is perfectly possible to debug cb, while debugging another application. It is a little odd, but works:)

scarphin:
Yes, many times but I quit after getting errors like:

--- Code: ---Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--- End code ---
I don't know if it's CB related or something else but I can't deal with it. If you want to see the debug log:

--- Code: ---Active debugger config: GDB/CDB debugger:GDB
Building to ensure sources are up-to-date
Selecting target:
Debugger
Adding source dir: D:\coding\projects\sw\codeblocks\trunk\src\
Adding source dir: D:\coding\projects\sw\codeblocks\trunk\src\
Adding file: .\codeblocks.exe
Changing directory to: D:/coding/projects/sw/codeblocks/trunk/src/devel_64
Set variable: PATH=.;D:\coding\projects\sw\codeblocks\trunk\src\base\tinyxml;D:\coding\lib\wxwidgets\2.8.12\x64_tdm-4.9.2_seh\lib\gcc_dll;D:\coding\projects\sw\codeblocks\trunk\src\devel_64;C:\Tools\tdm\4.9.2\x64_seh\bin;C:\Tools\tdm\4.9.2\x64_seh;C:\Tools\mingw\4.9.2\x64_seh\bin;C:\Tools\mingw\x64_seh\bin;C:\Tools\mingw\x64_seh;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files\MATLAB\R2011b\runtime\win64;C:\Program Files\MATLAB\R2011b\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Git\cmd;C:\Tools\msys64\bin;C:\Tools\python\2.7\x64;C:\Tools\python\2.7\x64\Scripts;C:\Tools\perl\5.20.1\x64\bin;C:\Tools\perl\5.20.1\x64\site\bin;D:\coding\lib\qt\4.8.6\x64_mingw-4.9.2_seh\bin;D:\coding\lib\opencv\2.4.10\x64_mingw-4.9.2_seh\bin;C:\Program Files\MiKTeX\miktex\bin\x64;C:\Program Files\Doxygen\bin;C:\Program Files (x86)\Graphviz\bin;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\GPAC

[debug]Command-line: C:\Tools\tdm\4.9.2\x64_seh\bin\gdb.exe -fullname -quiet  -args ./codeblocks.exe
[debug]Working dir : D:\coding\projects\sw\codeblocks\trunk\src\devel_64

Starting debugger: C:\Tools\tdm\4.9.2\x64_seh\bin\gdb.exe -fullname -quiet  -args ./codeblocks.exe
done

[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!

Setting breakpoints

[debug]Reading symbols from ./codeblocks.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.8.1
[debug]Copyright (C) 2014 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.8.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/coding/projects/sw/codeblocks/trunk/src/
[debug]Source directories searched: D:/coding/projects/sw/codeblocks/trunk/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args --debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen --verbose -p debug
[debug]>>>>>>cb_gdb:
[debug]> source D:\coding\lib\pprinters\wx28.gdb
[debug]>>>>>>cb_gdb:
[debug]> break "D:/coding/projects/sw/codeblocks/trunk/src/plugins/debuggergdb/gdb_driver.cpp:779"
[debug]No source file named D:/coding/projects/sw/codeblocks/trunk/src/plugins/debuggergdb/gdb_driver.cpp.
[debug]Breakpoint 2 ("D:/coding/projects/sw/codeblocks/trunk/src/plugins/debuggergdb/gdb_driver.cpp:779") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\coding\projects\sw\codeblocks\trunk\src\devel_64\codeblocks.exe --debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen --verbose -p debug

Child process PID: 4820

[debug][New Thread 4820.0x14c4]
[debug][New Thread 4820.0x4e4]
[debug][New Thread 4820.0xf30]
[debug][New Thread 4820.0x794]
[debug][New Thread 4820.0x15f8]
[debug][New Thread 4820.0x1718]
[debug][New Thread 4820.0x1748]
[debug][New Thread 4820.0x156c]
[debug][New Thread 4820.0x2bc]
[debug][New Thread 4820.0x1320]
[debug][Thread 4820.0x1320 exited with code 0]
[debug][New Thread 4820.0x1508]
[debug][Thread 4820.0x1508 exited with code 0]
[debug][New Thread 4820.0x1654]
[debug][Thread 4820.0x1654 exited with code 0]
[debug][New Thread 4820.0x4b8]
[debug][Thread 4820.0x4b8 exited with code 0]
[debug][New Thread 4820.0x13c0]
[debug][Thread 4820.0x13c0 exited with code 0]
[debug][New Thread 4820.0x1120]
[debug][Thread 4820.0x1120 exited with code 0]
[debug][New Thread 4820.0x1158]
[debug][Thread 4820.0x1158 exited with code 0]
[debug][New Thread 4820.0x1500]
[debug][Thread 4820.0x1500 exited with code 0]
[debug][New Thread 4820.0x1698]
[debug][Thread 4820.0x1698 exited with code 0]
[debug][New Thread 4820.0x16d8]
[debug][Thread 4820.0x16d8 exited with code 0]
[debug][New Thread 4820.0x11a0]
[debug][Thread 4820.0x11a0 exited with code 0]
[debug][New Thread 4820.0xcec]
[debug][Thread 4820.0xcec exited with code 0]
[debug][New Thread 4820.0xca8]
[debug][Thread 4820.0xca8 exited with code 0]
[debug][New Thread 4820.0xfdc]
[debug][Thread 4820.0xfdc exited with code 0]
[debug][New Thread 4820.0x110c]
[debug][Thread 4820.0x110c exited with code 0]
[debug][New Thread 4820.0x1150]
[debug][Thread 4820.0x1150 exited with code 0]
[debug][New Thread 4820.0x330]
[debug][Thread 4820.0x330 exited with code 0]
[debug][New Thread 4820.0x17ac]
[debug][Thread 4820.0x17ac exited with code 0]
[debug][New Thread 4820.0xc5c]
[debug][Thread 4820.0xc5c exited with code 0]
[debug][New Thread 4820.0x1528]
[debug][New Thread 4820.0xbc8]
[debug][Thread 4820.0xbc8 exited with code 0]
[debug][New Thread 4820.0x1358]
[debug][New Thread 4820.0x1098]
[debug][Thread 4820.0x1098 exited with code 0]
[debug][New Thread 4820.0x103c]
[debug][Thread 4820.0x103c exited with code 0]
[debug][New Thread 4820.0x1674]
[debug][Thread 4820.0x1674 exited with code 0]
[debug][Thread 4820.0x15f8 exited with code 0]
[debug][New Thread 4820.0x14ec]
[debug]Breakpoint 2, GDB_driver::ParseOutput (this=0x161122d0, output="Reading symbols from D:/coding/projects/misc/exCpp/bin/Debug/exCpp.exe...done.") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779
[debug]D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779:27381:beg:0xafee15b
[debug]>>>>>>cb_gdb:

At D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779

[debug]> info args
[debug]this = 0x161122d0
[debug]output = "Reading symbols from D:/coding/projects/misc/exCpp/bin/Debug/exCpp.exe...done."
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0  GDB_driver::ParseOutput (this=0x161122d0, output="Reading symbols from D:/coding/projects/misc/exCpp/bin/Debug/exCpp.exe...done.") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779
[debug]#1  0x000000000afdecf2 in DebuggerGDB::ParseOutput (this=0x70a6880, output="Reading symbols from D:/coding/projects/misc/exCpp/bin/Debug/exCpp.exe...done.") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb.cpp:1691
[debug]#2  0x000000000afdfc91 in DebuggerGDB::OnGDBOutput (this=0x70a6880, event=...) at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb.cpp:1826
[debug]#3  0x0000000062786541 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#4  0x0000000062786603 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#5  0x00000000627869b7 in wxEvtHandler::ProcessEvent(wxEvent&) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#6  0x000000006278645e in wxEvtHandler::ProcessPendingEvents() () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#7  0x00000000627016d9 in wxAppConsole::ProcessPendingEvents() () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#8  0x0000000062b553e0 in wxIdleWakeUpModule::MsgHookProc(int, unsigned long long, long long) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#9  0x00000000770d797c in USER32!GetKeyboardLayoutList () from C:\Windows\system32\user32.dll
[debug]#10 0x00000000770df5fb in USER32!SystemParametersInfoW () from C:\Windows\system32\user32.dll
[debug]#11 0x00000000770e4895 in USER32!IsProcessDPIAware () from C:\Windows\system32\user32.dll
[debug]#12 0x00000000773411f5 in ntdll!KiUserCallbackDispatcher () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#13 0x00000000770eef0a in USER32!GetClipboardData () from C:\Windows\system32\user32.dll
[debug]#14 0x00000000770d5466 in USER32!LockWindowStation () from C:\Windows\system32\user32.dll
[debug]#15 0x00000000055e90f0 in ?? ()
[debug]Backtrace stopped: previous frame inner to this frame (corrupt stack?)
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> cont
[debug]Continuing.
[debug]Breakpoint 2, GDB_driver::ParseOutput (this=0x161122d0, output="(gdb) >>>>>>cb_gdb:") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779
[debug]> info frame
[debug]D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779:27381:beg:0xafee15b
[debug]>>>>>>cb_gdb:

At D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779

[debug]> info args
[debug]Stack level 0, frame at 0x22f5c0:
[debug] rip = 0xafee15b in GDB_driver::ParseOutput (D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779); saved rip = 0xafdecf2
[debug] called by frame at 0x22f5f0
[debug] source language c++.
[debug] Arglist at 0x22f120, args: this=0x161122d0, output="(gdb) >>>>>>cb_gdb:"
[debug]> bt 30
[debug] Locals at 0x22f120, Previous frame's sp is 0x22f5c0
[debug] Saved registers:
[debug]  rbx at 0x22f598, rsi at 0x22f5a0, rdi at 0x22f5a8, rbp at 0x22f5b0, rip at 0x22f5b8, xmm15 at 0x22f5b8
[debug]>>>>>>cb_gdb:this = 0x161122d0
[debug]output = "(gdb) >>>>>>cb_gdb:"
[debug]>>>>>>cb_gdb:#0  GDB_driver::ParseOutput (this=0x161122d0, output="(gdb) >>>>>>cb_gdb:") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\gdb_driver.cpp:779
[debug]#1  0x000000000afdecf2 in DebuggerGDB::ParseOutput (this=0x70a6880, output="(gdb) >>>>>>cb_gdb:") at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb.cpp:1691
[debug]#2  0x000000000afdfc91 in DebuggerGDB::OnGDBOutput (this=0x70a6880, event=...) at D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb.cpp:1826
[debug]#3  0x0000000062786541 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#4  0x0000000062786603 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#5  0x00000000627869b7 in wxEvtHandler::ProcessEvent(wxEvent&) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#6  0x000000006278645e in wxEvtHandler::ProcessPendingEvents() () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#7  0x00000000627016d9 in wxAppConsole::ProcessPendingEvents() () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#8  0x0000000062b553e0 in wxIdleWakeUpModule::MsgHookProc(int, unsigned long long, long long) () from D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll
[debug]#9  0x00000000770d797c in USER32!GetKeyboardLayoutList () from C:\Windows\system32\user32.dll
[debug]#10 0x00000000770df5fb in USER32!SystemParametersInfoW () from C:\Windows\system32\user32.dll
[debug]#11 0x00000000770e4895 in USER32!IsProcessDPIAware () from C:\Windows\system32\user32.dll
[debug]#12 0x00000000773411f5 in ntdll!KiUserCallbackDispatcher () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#13 0x00000000770eef0a in USER32!GetClipboardData () from C:\Windows\system32\user32.dll
[debug]#14 0x00000000770d5466 in USER32!LockWindowStation () from C:\Windows\system32\user32.dll
[debug]#15 0x00000000055e90f0 in ?? ()
[debug]Backtrace stopped: previous frame inner to this frame (corrupt stack?)
[debug]>>>>>>cb_gdb:
--- End code ---

And I'm still not sure where to check for the faulty code as I didn't get an answer to my question:

--- Quote from: scarphin on April 01, 2015, 12:10:51 am ---Can you please point me to the piece of code where the frame info is parsed, is it 'GDB_driver::ParseOutput'?

--- End quote ---

ollydbg:

--- Quote from: scarphin on April 07, 2015, 01:15:41 am ---Yes, many times but I quit after getting errors like:

--- Code: ---Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--- End code ---
I don't know if it's CB related or something else but I can't deal with it. If you want to see the debug log:

--- End quote ---
This is definitely an GDB issue. GDB tries to unwind frame through

--- Code: ---USER32!LockWindowStation () from C:\Windows\system32\user32.dll
--- End code ---
But it failed.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version