User forums > Help
Debugger Step-Into with multiple calls on same line
vid512:
Tried the debugger nightly (7550) for the first time now. I can't make it work, that's probably another unrelated problem. The Global Compiler Settings dialog, compiler "Microsoft Visual C++ 2010", tab "Toolchain executables", instead of letting me specify debugger name (cdb.exe), only has list of two options "--- Invalid debugger ---" and "GDB". This may be caused by some bad heuristics, when one uses MS Visual C++ Express (which doesn't have cdb.exe), and cdb.exe from separate package "Debugging Tools for Windows (x86)". My guess would be, there is some checking for existence of cdb.exe only in Compiler's installation directory, not in Additional paths.
oBFusCATed:
You have to add a debug config for CDB in the Settings->Debugger for the GDB debugger.
Then you can choose it in the toolchain settings.
vid512:
Still, the debugger in lastest nigthly debugger branch doesn't work for me. It issues following command to CDB:
--- Code: ---> bu-1 /1 `F:/_temp/test_cb/testdbg/main.cpp:16`
--- End code ---
The "bu-1" makes CDB try to set breakpoint at 0xFFFFFFFF.
Full debugger log:
--- Code: ---PATH=.;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;c:\Program Files (x86)\Debugging Tools for Windows (x86);c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;C:\Program Files (x86)\CollabNet\Subversion Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;f:\dev\_tools\_path;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\doxygen\bin;f:\dev\_tools\python
Command-line: C:\Program Files (x86)\Debugging Tools for Windows (x86)\cdb.exe -G -lines -2 -y F:/_temp/test_cb/testdbg/; -srcpath F:/_temp/test_cb/testdbg/; F:/_temp/test_cb/testdbg/testdbg.exe
Working dir : F:\_temp\test_cb\testdbg
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: F:/_temp/test_cb/testdbg/testdbg.exe
Symbol search path is: F:/_temp/test_cb/testdbg/;srv*f:\dev\_tools\winsym*http://msdl.microsoft.com/download/symbols
Executable search path is:
ModLoad: 01050000 01055000 testdbg.exe
ModLoad: 77770000 778f0000 ntdll.dll
ModLoad: 76090000 761a0000 C:\Windows\syswow64\kernel32.dll
ModLoad: 76ac0000 76b06000 C:\Windows\syswow64\KERNELBASE.dll
(f38.eb8): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=008c0000 edx=000fe2b8 esi=fffffffe edi=00000000
eip=77810f3b esp=0027f6c8 ebp=0027f6f4 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246
ntdll!LdrpDoDebuggerBreak+0x2c:
77810f3b cc int 3
0:000>
> |.
. 0 id: f38 create name: testdbg.exe
0:000>
> bc *
0:000>
> bu-1 /1 `F:/_temp/test_cb/testdbg/main.cpp:16`
*** WARNING: Unable to verify checksum for testdbg.exe
0:000>
> l+t
Source options are 1:
1/t - Step/trace by source line
0:000>
> l+s
Source options are 5:
1/t - Step/trace by source line
4/s - List source code at prompt
0:000>
> l+o
Source options are d:
1/t - Step/trace by source line
4/s - List source code at prompt
8/o - Only show source code at prompt
0:000>
> g
Unable to insert breakpoint 0 at ffffffff, Win32 error 0n299
"Only part of a ReadProcessMemory or WriteProcessMemory request was completed."
bp0 at ffffffff failed
WaitForEvent failed, Win32 error 0n299
"Only part of a ReadProcessMemory or WriteProcessMemory request was completed."
ntdll!LdrpDoDebuggerBreak+0x2d:
77810f3c 8975fc mov dword ptr [ebp-4],esi ss:002b:0027f6f0=00000000
0:000>
> k n
# ChildEBP RetAddr
00 0027f6f4 777f1323 ntdll!LdrpDoDebuggerBreak+0x2d
01 0027f870 777c0bda ntdll!LdrpInitializeProcess+0x12cc
02 0027f8c0 777a9e59 ntdll!_LdrpInitialize+0x78
03 0027f8d0 00000000 ntdll!LdrInitializeThunk+0x10
0:000>
> k n
# ChildEBP RetAddr
00 0027f6f4 777f1323 ntdll!LdrpDoDebuggerBreak+0x2d
01 0027f870 777c0bda ntdll!LdrpInitializeProcess+0x12cc
02 0027f8c0 777a9e59 ntdll!_LdrpInitialize+0x78
03 0027f8d0 00000000 ntdll!LdrInitializeThunk+0x10
0:000>
--- End code ---
Attached is the CodeBlocks project and source, on which latest debugger nightly (7550) fails as described.
[attachment deleted by admin]
oBFusCATed:
So it doesn't work at all or the problem is the same as the normal nightly build?
Can you post the same log from the normal nightly build?
p.s. keep in mind that debugging 64bit executables with 32bit cdb.exe will fail miserably, at least it failed for me.
vid512:
On nightly debug branch, debugging with CDB doesn't work at all, it issues the "bu-1" command which causes error (as can be seen in the last log), and even the error returned by CDB is handled badly by C::B (Displays nonsensical error with something like "File name:").
In regular nightly, debugging with CDB works, but I have the problem with multiple function calls on same line.
Following is debugger log showing the original problem from this thread (post #1, #2) on regular (not debug) C::B nightly. What I did to get this log: I skip to to line with two function calls (F4), step into func2 (shift-F7), get out of func2 (ctrl-shift-F7). Here I'd expect to still be on same line and be given chance to enter also func1, but instead I am on following line. You can see that Code::Blocks explicitly issues "p" command after "gu", which is probably the source of problem.
--- Code: ---PATH=.;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;c:\Program Files (x86)\Debugging Tools for Windows (x86);c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;C:\Program Files (x86)\CollabNet\Subversion Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;f:\dev\_tools\_path;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\doxygen\bin;f:\dev\_tools\python
Command-line: c:\Program Files (x86)\Debugging Tools for Windows (x86)\cdb.exe -G -lines -y F:/_temp/test_cb/testdbg/; -srcpath F:/_temp/test_cb/testdbg/; testdbg.exe
Working dir : F:\_temp\test_cb\testdbg\
> bc *
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: testdbg.exe
Symbol search path is: F:/_temp/test_cb/testdbg/;srv*f:\dev\_tools\winsym*http://msdl.microsoft.com/download/symbols
Executable search path is:
ModLoad: 003a0000 003a5000 testdbg.exe
ModLoad: 77770000 778f0000 ntdll.dll
ModLoad: 76090000 761a0000 C:\Windows\syswow64\kernel32.dll
ModLoad: 76ac0000 76b06000 C:\Windows\syswow64\KERNELBASE.dll
(b48.e14): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=75070000 edx=000de248 esi=fffffffe edi=00000000
eip=77810f3b esp=002af70c ebp=002af738 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246
ntdll!LdrpDoDebuggerBreak+0x2c:
77810f3b cc int 3
0:000> 0:000>
> bu1 /1 `F:/_temp/test_cb/testdbg/main.cpp:16`
*** WARNING: Unable to verify checksum for testdbg.exe
0:000>
> l+t
Source options are 1:
1/t - Step/trace by source line
0:000>
> l+s
Source options are 5:
1/t - Step/trace by source line
4/s - List source code at prompt
0:000>
> l+o
Source options are d:
1/t - Step/trace by source line
4/s - List source code at prompt
8/o - Only show source code at prompt
0:000>
> g
ModLoad: 73540000 7358c000 C:\Windows\SysWOW64\apphelp.dll
Breakpoint 1 hit
> 16: func1(func2());
0:000>
> dv
0:000>
> k n
# ChildEBP RetAddr
00 002afb8c 760a339a testdbg!main+0x3 [f:\_temp\test_cb\testdbg\main.cpp @ 16]
01 002afb98 777a9ed2 kernel32!BaseThreadInitThunk+0xe
02 002afbd8 777a9ea5 ntdll!__RtlUserThreadStart+0x70
03 002afbf0 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000>
> dv
0:000>
> k n
# ChildEBP RetAddr
00 002afb8c 760a339a testdbg!main+0x3 [f:\_temp\test_cb\testdbg\main.cpp @ 16]
01 002afb98 777a9ed2 kernel32!BaseThreadInitThunk+0xe
02 002afbd8 777a9ea5 ntdll!__RtlUserThreadStart+0x70
03 002afbf0 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000>
> t
testdbg!ILT+5(?func2YAHXZ):
003a100a e931000000 jmp testdbg!func2 (003a1040)
0:000>
> p
> 8: {
0:000>
> k n 1
# ChildEBP RetAddr
00 002afb84 003a1068 testdbg!func2 [f:\_temp\test_cb\testdbg\main.cpp @ 8]
0:000>
> dv
a = 0
0:000>
> k n
# ChildEBP RetAddr
00 002afb84 003a1068 testdbg!func2 [f:\_temp\test_cb\testdbg\main.cpp @ 8]
01 002afb8c 760a339a testdbg!main+0x8 [f:\_temp\test_cb\testdbg\main.cpp @ 16]
02 002afb98 777a9ed2 kernel32!BaseThreadInitThunk+0xe
03 002afbd8 777a9ea5 ntdll!__RtlUserThreadStart+0x70
04 002afbf0 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000>
> gu
> 16: func1(func2());
0:000>
> p
> 17: return 5;
0:000>
> k n 1
# ChildEBP RetAddr
00 002afb8c 760a339a testdbg!main+0x11 [f:\_temp\test_cb\testdbg\main.cpp @ 17]
0:000>
> dv
0:000>
> k n
# ChildEBP RetAddr
00 002afb8c 760a339a testdbg!main+0x11 [f:\_temp\test_cb\testdbg\main.cpp @ 17]
01 002afb98 777a9ed2 kernel32!BaseThreadInitThunk+0xe
02 002afbd8 777a9ea5 ntdll!__RtlUserThreadStart+0x70
03 002afbf0 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000>
--- End code ---
Of course, I am using 32-bit Code::Blocks, 32-bit Visual C++, 32-bit CDB and building 32-bit executable.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version