Author Topic: A bug for Code::Blocks to work with CDB X64  (Read 15607 times)

Offline geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
A bug for Code::Blocks to work with CDB X64
« on: April 07, 2013, 10:49:37 pm »
CB ver: 12.11, rev. 8629
OS: Win 7 x64
Win SDK 7.1 & 8, both x64
Compiler: extracted from MS VS Express 2012

After days of fiddling around, here is my problem:

CB's debugger now works perfectly with MinGW32, MinGW64, MS VC++ Express 2012 32-bit.

When I switch all settings to VC++ Express 64 bit, including the 64-bit cdb, all the buttons, e.g., "Debug/Continue", "Run to Cursor", "Next Line" still works, and console outputs as expected.

However, the only problem is that the yellow pointer showing which line the program stops at on the left margin is gone. By saying gone, I mean it doesn't show up at all. Callstack view has nothing in it either. It makes debugging actually impossible in this setting, as we will for sure lose track of where we are after several steps' tracing.

I'm new to this forum and to Code::Blocks. Since I failed to find any solution for this issue for some time, I assume this problem is unsolved. I haven't figure out how to effectively submit this bug to development team. If this concerns anyone other than me here, please help. Thanks!
 

« Last Edit: April 08, 2013, 12:04:47 am by geoffzou »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #1 on: April 07, 2013, 11:33:11 pm »
Can you post full debug log (make sure you enable it) from debug sessions with both cdb 32 and 64 bit, so we can see what are the differences.
Please try to follow the same steps for both sessions.

Also have you tried the plugin developed in this topic: http://forums.codeblocks.org/index.php?topic=16885.0 ?
(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 geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #2 on: April 08, 2013, 12:10:09 am »
Can you post full debug log (make sure you enable it) from debug sessions with both cdb 32 and 64 bit, so we can see what are the differences.
Please try to follow the same steps for both sessions.

Also have you tried the plugin developed in this topic: http://forums.codeblocks.org/index.php?topic=16885.0 ?

This must be a naive question. How do I enable debug log for CB?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #3 on: April 08, 2013, 12:14:46 am »
Settings -> Debugger -> Full log or something like this...
(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 geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #4 on: April 08, 2013, 12:29:22 am »
Under X64 setting

Code
[debug]Command-line: D:\QQDownload\software\Microsoft SDKs\Windows\8.0\Debuggers\x64\cdb.exe -G -lines -2 -y D:/QQDownload/software/HelloW/; -srcpath D:/QQDownload/software/HelloW/; D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
[debug]Working dir : D:\QQDownload\software\HelloW

Starting debugger: D:\QQDownload\software\Microsoft SDKs\Windows\8.0\Debuggers\x64\cdb.exe -G -lines -2 -y D:/QQDownload/software/HelloW/; -srcpath D:/QQDownload/software/HelloW/; D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
done
Setting breakpoints

[debug]Microsoft (R) Windows Debugger Version 6.2.9200.20512 AMD64
[debug]Copyright (c) Microsoft Corporation. All rights reserved.
[debug]CommandLine: D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
[debug]Symbol search path is: D:/QQDownload/software/HelloW/;D:\QQDownload\software\Win7Symbols;SRV*D:\QQDownload\software\Win7Symbols*http://msdl.microsoft.com/download/symbols
[debug]Executable search path is:
[debug]ModLoad: 00000001`3f170000 00000001`3f21b000   HelloW.exe
[debug]ModLoad: 00000000`77060000 00000000`77209000   ntdll.dll
[debug]ModLoad: 00000000`76ad0000 00000000`76bef000   C:\Windows\system32\kernel32.dll
[debug]ModLoad: 000007fe`fcb00000 000007fe`fcb6b000   C:\Windows\system32\KERNELBASE.dll
[debug](fc8.e98): Break instruction exception - code 80000003 (first chance)
[debug]ntdll!LdrpDoDebuggerBreak+0x30:
[debug]00000000`7710cb60 cc              int     3
[debug]0:000>
[debug]> |.
[debug].  0 id: fc8 create name: HelloW.exe
[debug]0:000>
[debug]> bc *
[debug]0:000>
[debug]> bu1 `D:/QQDownload/software/HelloW/main.cpp:21`
[debug]*** WARNING: Unable to verify checksum for HelloW.exe
[debug]0:000>

*** WARNING: Unable to verify checksum for HelloW.exe

[debug]> l+t
[debug]Source options are 1:
[debug]     1/t - Step/trace by source line
[debug]0:000>
[debug]> l+s
[debug]Source options are 5:
[debug]     1/t - Step/trace by source line
[debug]     4/s - List source code at prompt
[debug]0:000>
[debug]> l+o
[debug]Source options are d:
[debug]     1/t - Step/trace by source line
[debug]     4/s - List source code at prompt
[debug]     8/o - Only show source code at prompt
[debug]0:000>
[debug]> g
[debug]Breakpoint 1 hit
[debug]>   21:    testLoop();
[debug]0:000>
[debug]> k n

Breakpoint 1 hit

[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd50 00000001`3f1aa2f6 HelloW!main+0x42 [d:\qqdownload\software\hellow\main.cpp @ 21]
[debug]01 00000000`0015fd90 00000000`76ae652d HelloW!__tmainCRTStartup+0x136 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c @ 240]
[debug]02 00000000`0015fdd0 00000000`7708c521 kernel32!BaseThreadInitThunk+0xd
[debug]03 00000000`0015fe00 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
[debug]0:000>
[debug]> k n
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd50 00000001`3f1aa2f6 HelloW!main+0x42 [d:\qqdownload\software\hellow\main.cpp @ 21]
[debug]01 00000000`0015fd90 00000000`76ae652d HelloW!__tmainCRTStartup+0x136 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c @ 240]
[debug]02 00000000`0015fdd0 00000000`7708c521 kernel32!BaseThreadInitThunk+0xd
[debug]03 00000000`0015fe00 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
[debug]0:000>
[debug]> bu4 /1 `D:/QQDownload/software/HelloW/main.cpp:12`

Continuing...

[debug]0:000>
[debug]> g
[debug]Breakpoint 4 hit
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>

Breakpoint 4 hit

[debug]> k n
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x37 [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]01 00000000`0015fd50 00000001`3f1aa2f6 HelloW!main+0x47 [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 00000000`0015fd90 00000000`76ae652d HelloW!__tmainCRTStartup+0x136 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c @ 240]
[debug]03 00000000`0015fdd0 00000000`7708c521 kernel32!BaseThreadInitThunk+0xd
[debug]04 00000000`0015fe00 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x7b [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>
[debug]> p
[debug]>   10:         var += i;
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x27 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]0:000>
[debug]> p
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x37 [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x7b [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>
[debug]> p
[debug]>   10:         var += i;
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x27 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]0:000>
[debug]> p
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x37 [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x7b [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # Child-SP          RetAddr           Call Site
[debug]00 00000000`0015fd10 00000001`3f171b07 HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>
[debug]> q
[debug]quit:

Debugger finished with status 0
« Last Edit: April 08, 2013, 03:27:54 am by geoffzou »

Offline geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #5 on: April 08, 2013, 12:32:14 am »
Under X86 setting

Code
[debug]Command-line: D:\QQDownload\software\Microsoft SDKs\Windows\8.0\Debuggers\x86\cdb.exe -G -lines -2 -y D:/QQDownload/software/HelloW/; -srcpath D:/QQDownload/software/HelloW/; D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
[debug]Working dir : D:\QQDownload\software\HelloW

Starting debugger: D:\QQDownload\software\Microsoft SDKs\Windows\8.0\Debuggers\x86\cdb.exe -G -lines -2 -y D:/QQDownload/software/HelloW/; -srcpath D:/QQDownload/software/HelloW/; D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
done
Setting breakpoints

[debug]Microsoft (R) Windows Debugger Version 6.2.9200.20512 X86
[debug]Copyright (c) Microsoft Corporation. All rights reserved.
[debug]CommandLine: D:/QQDownload/software/HelloW/bin/Debug/HelloW.exe
[debug]Symbol search path is: D:/QQDownload/software/HelloW/;D:\QQDownload\software\Win7Symbols;SRV*D:\QQDownload\software\Win7Symbols*http://msdl.microsoft.com/download/symbols
[debug]Executable search path is:
[debug]ModLoad: 00b70000 00bf2000   HelloW.exe
[debug]ModLoad: 77240000 773c0000   ntdll.dll
[debug]ModLoad: 74a40000 74b50000   C:\Windows\syswow64\kernel32.dll
[debug]ModLoad: 74c50000 74c97000   C:\Windows\syswow64\KERNELBASE.dll
[debug](118c.1b18): Break instruction exception - code 80000003 (first chance)
[debug]eax=00000000 ebx=00000000 ecx=0aba0000 edx=000fdd58 esi=fffffffe edi=00000000
[debug]eip=772e0fab esp=0036f934 ebp=0036f960 iopl=0         nv up ei pl zr na pe nc
[debug]cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
[debug]ntdll!LdrpDoDebuggerBreak+0x2c:
[debug]772e0fab cc              int     3
[debug]0:000>
[debug]> |.
[debug].  0 id: 118c create name: HelloW.exe
[debug]0:000>
[debug]> bc *
[debug]0:000>
[debug]> bu1 `D:/QQDownload/software/HelloW/main.cpp:21`
[debug]*** WARNING: Unable to verify checksum for HelloW.exe
[debug]0:000>

*** WARNING: Unable to verify checksum for HelloW.exe

[debug]> l+t
[debug]Source options are 1:
[debug]     1/t - Step/trace by source line
[debug]0:000>
[debug]> l+s
[debug]Source options are 5:
[debug]     1/t - Step/trace by source line
[debug]     4/s - List source code at prompt
[debug]0:000>
[debug]> l+o
[debug]Source options are d:
[debug]     1/t - Step/trace by source line
[debug]     4/s - List source code at prompt
[debug]     8/o - Only show source code at prompt
[debug]0:000>
[debug]> g
[debug]Breakpoint 1 hit
[debug]>   21:    testLoop();
[debug]0:000>
[debug]> k n

Breakpoint 1 hit

[debug] # ChildEBP RetAddr  
[debug]00 0036fd6c 00b9781d HelloW!main+0x39 [d:\qqdownload\software\hellow\main.cpp @ 21]
[debug]01 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]02 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]03 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]04 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:21

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd6c 00b9781d HelloW!main+0x39 [d:\qqdownload\software\hellow\main.cpp @ 21]
[debug]01 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]02 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]03 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]04 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd6c 00b9781d HelloW!main+0x39 [d:\qqdownload\software\hellow\main.cpp @ 21]
[debug]01 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]02 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]03 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]04 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> bu5 /1 `D:/QQDownload/software/HelloW/main.cpp:12`

Continuing...

[debug]0:000>
[debug]> g
[debug]Breakpoint 5 hit
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>

Breakpoint 5 hit

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:12

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:13

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:8

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   10:         var += i;
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x25 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:10

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x25 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:12

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:13

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:8

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   10:         var += i;
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x25 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:10

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x25 [d:\qqdownload\software\hellow\main.cpp @ 10]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   12:         cout<<"i: "<<i<<' '<<var<<endl;
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:12

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x2e [d:\qqdownload\software\hellow\main.cpp @ 12]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>   13:     }
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:13

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x6d [d:\qqdownload\software\hellow\main.cpp @ 13]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> p
[debug]>    8:     for(int i=0; i<100; i++)
[debug]0:000>
[debug]> k n 1
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]0:000>

At d:\qqdownload\software\hellow\main.cpp:8

[debug]> k n
[debug] # ChildEBP RetAddr  
[debug]00 0036fd60 00b71aee HelloW!testLoop+0x16 [d:\qqdownload\software\hellow\main.cpp @ 8]
[debug]01 0036fd6c 00b9781d HelloW!main+0x3e [d:\qqdownload\software\hellow\main.cpp @ 23]
[debug]02 0036fdb4 74a533aa HelloW!__tmainCRTStartup+0xf2 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 240]
[debug]03 0036fdc0 77279ef2 kernel32!BaseThreadInitThunk+0xe
[debug]04 0036fe00 77279ec5 ntdll!__RtlUserThreadStart+0x70
[debug]05 0036fe18 00000000 ntdll!_RtlUserThreadStart+0x1b
[debug]0:000>
[debug]> q
[debug]quit:

Debugger finished with status 0
« Last Edit: April 08, 2013, 03:28:57 am by geoffzou »

Offline geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #6 on: April 08, 2013, 12:33:57 am »
Settings -> Debugger -> Full log or something like this...

Here we go. X64 is the problem one, while X86 works fine. Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #7 on: April 08, 2013, 12:54:26 am »
Please edit your posts to and use [ code ] tags, to make them a bit more readable.

Edit:
It seems that the output from CDB is different.
I have no time to fix this but you can try to play with this (adjusting reg expressions here and there).
If you search for ChildEBP you probably find all the places, where the output is checked.
« Last Edit: April 08, 2013, 01:02:26 am by oBFusCATed »
(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 geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #8 on: April 08, 2013, 03:31:24 am »
Please edit your posts to and use [ code ] tags, to make them a bit more readable.

Edit:
It seems that the output from CDB is different.
I have no time to fix this but you can try to play with this (adjusting reg expressions here and there).
If you search for ChildEBP you probably find all the places, where the output is checked.

I am simply a user. I don't know about the underlying mechanism of debugger at all. Okay, shame on me :( Can anyone kindly enough to look into it?

Offline geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #9 on: April 08, 2013, 04:05:24 am »
Please edit your posts to and use [ code ] tags, to make them a bit more readable.

Edit:
It seems that the output from CDB is different.
I have no time to fix this but you can try to play with this (adjusting reg expressions here and there).
If you search for ChildEBP you probably find all the places, where the output is checked.

I am simply a user. I don't know about the underlying mechanism of debugger at all. Okay, shame on me :( Can anyone kindly enough to look into it?

OK, I just can't give it a break. Considering I am new to the whole CB things, please give me more detailed advice on how to get it fixed. Where is the related source code located? How is it integrated with CB IDE. If I only want to look into the local piece of code, is it possible for me to rid compiling the whole code base from svn?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: A bug for Code::Blocks to work with CDB X64
« Reply #10 on: April 08, 2013, 05:34:48 am »
OK, I just can't give it a break. Considering I am new to the whole CB things, please give me more detailed advice on how to get it fixed. Where is the related source code located? How is it integrated with CB IDE. If I only want to look into the local piece of code, is it possible for me to rid compiling the whole code base from svn?
I'm not a CDB user, so I can't give much suggest, but at least some:
1, I think you need to lean how to build C::B, you can see a wiki page in Wiki
2, modify the debugger plugin source code, especially the files: cb_trunk\src\plugins\debuggergdb\cdb_driver.cpp
3, please note that all the debugger do is either parsing the messages from the CDB command line or send some command to CDB

Good luck!
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 geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #11 on: April 08, 2013, 04:07:10 pm »
OK, I just can't give it a break. Considering I am new to the whole CB things, please give me more detailed advice on how to get it fixed. Where is the related source code located? How is it integrated with CB IDE. If I only want to look into the local piece of code, is it possible for me to rid compiling the whole code base from svn?
I'm not a CDB user, so I can't give much suggest, but at least some:
1, I think you need to lean how to build C::B, you can see a wiki page in Wiki
2, modify the debugger plugin source code, especially the files: cb_trunk\src\plugins\debuggergdb\cdb_driver.cpp
3, please note that all the debugger do is either parsing the messages from the CDB command line or send some command to CDB

Good luck!

Are plugins of CB working with the IDE at the executable(process) level or source code level? I hope the debugger and the IDE interact as separate processes. If my hypothesis is valid, is there a sub-project for the CDB debugger integration that I can focus on?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #12 on: April 08, 2013, 04:39:12 pm »
Are plugins of CB working with the IDE at the executable(process) level or source code level? I hope the debugger and the IDE interact as separate processes. If my hypothesis is valid, is there a sub-project for the CDB debugger integration that I can focus on?
The parser for the CDB's output is working in process and the code is in the debugger plugin (separate dll).
(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 geoffzou

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: A bug for Code::Blocks to work with CDB X64
« Reply #13 on: May 14, 2013, 04:23:18 am »
Are plugins of CB working with the IDE at the executable(process) level or source code level? I hope the debugger and the IDE interact as separate processes. If my hypothesis is valid, is there a sub-project for the CDB debugger integration that I can focus on?
The parser for the CDB's output is working in process and the code is in the debugger plugin (separate dll).

Here is my cbp file. This cbp compiles all the source code, but somehow, when I replace the original debugger.dll with my one, CB doesn't load it at all. Any magic here?
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Project_cb" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="default">
<Option output="debugger" prefix_auto="1" extension_auto="1" />
<Option type="3" />
<Option compiler="gcc" />
<Option host_application="$(#cb)/devel/codeblocks.exe" />
<Option run_host_application_in_terminal="0" />
<Compiler>
<Add option="-O2" />
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-fmessage-length=0" />
<Add option="-fexceptions" />
<Add option="-Winvalid-pch" />
<Add option="-DBUILDING_PLUGIN" />
<Add option="-DHAVE_W32API_H" />
<Add option="-D__WXMSW__" />
<Add option="-DWXUSINGDLL" />
<Add option="-DcbDEBUG" />
<Add option="-DCB_PRECOMP" />
<Add option="-DWX_PRECOMP" />
<Add option="-DwxUSE_UNICODE" />
<Add directory="$(#cb)/include" />
<Add directory="$(#cb)/sdk/wxscintilla/include" />
<Add directory="$(#wx.include)" />
<Add directory="$(#wx.lib)/gcc_dll/mswu" />
<Add directory="$(#cb)/include/scripting/include" />
<Add directory="$(#cb)/include/scripting/sqplus" />
</Compiler>
<Linker>
<Add option="-mthreads" />
<Add library="codeblocks" />
<Add library="wxmsw28u" />
<Add directory="$(#cb)/devel" />
<Add directory="$(#wx.lib)/gcc_dll" />
</Linker>
<ExtraCommands>
<Add after="zip -j9 debugger.zip manifest.xml" />
<Add after="zip -j9 debugger.cbplugin debugger.dll debugger.zip" />
</ExtraCommands>
</Target>
</Build>
<ResourceCompiler>
<Add directory="../resources/Project_cb/" />
</ResourceCompiler>
<Unit filename="../cdb_commands.h" />
<Unit filename="../cdb_driver.cpp" />
<Unit filename="../cdb_driver.h" />
<Unit filename="../databreakpointdlg.cpp" />
<Unit filename="../databreakpointdlg.h" />
<Unit filename="../debugger_defs.cpp" />
<Unit filename="../debugger_defs.h" />
<Unit filename="../debuggerdriver.cpp" />
<Unit filename="../debuggerdriver.h" />
<Unit filename="../debuggergdb.cpp" />
<Unit filename="../debuggergdb.h" />
<Unit filename="../debuggeroptionsdlg.cpp" />
<Unit filename="../debuggeroptionsdlg.h" />
<Unit filename="../debuggeroptionsprjdlg.cpp" />
<Unit filename="../debuggeroptionsprjdlg.h" />
<Unit filename="../debuggerstate.cpp" />
<Unit filename="../debuggerstate.h" />
<Unit filename="../editbreakpointdlg.cpp" />
<Unit filename="../editbreakpointdlg.h" />
<Unit filename="../editwatchdlg.cpp" />
<Unit filename="../editwatchdlg.h" />
<Unit filename="../gdb_commands.h" />
<Unit filename="../gdb_driver.cpp" />
<Unit filename="../gdb_driver.h" />
<Unit filename="../parsewatchvalue.cpp" />
<Unit filename="../parsewatchvalue.h" />
<Unit filename="../remotedebugging.h" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #14 on: May 14, 2013, 08:42:58 pm »
Any magic here?
You need to use the same compiler and libraries used to compile codeblocks.exe failing to do so might cause this error.
(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!]

mikluha

  • Guest
Re: A bug for Code::Blocks to work with CDB X64
« Reply #15 on: June 22, 2013, 01:48:39 am »
I'm facing the same problem.

CDB 64bit works but no current line pointer

Are there any updates? Really appreciate any help

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A bug for Code::Blocks to work with CDB X64
« Reply #16 on: June 22, 2013, 09:55:38 am »
No, have you tried the other CDB plugin? (search the forum for details)
(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!]