Author Topic: CB 20.03 for windows, debug problems  (Read 7738 times)

Offline i386

  • Single posting newcomer
  • *
  • Posts: 8
CB 20.03 for windows, debug problems
« on: April 04, 2021, 09:24:46 am »
I found 2 problems:
1) when using "Debug" functions, a dialog box with title "gdborig.exe has stopped working" prompted sometimes. Then the debug session stopped.
2) In the "Debug mode" with default GCC  and options, I open watch window and find the pointer's address is NOT 64-bit cononical address format, but a normal 32-bit address such as "0x3131b80". But the built out executable is a 64-bti applicaiton according to the file's attribute info.  I think in 64-bit mode, the pointer's address should be "0xFFFFxxxxxxxxxxxx" format.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB 20.03 for windows, debug problems
« Reply #1 on: April 04, 2021, 10:19:14 am »
1. The debugger shipped as part of the 20.03 is not very well working. You should find better one. It is best to use 64bit CB to debug 64bit executables. And the debugger exe should also be 64bit.
2. Most probably this is the output from the debugger. Can you enable full logging and check if the values differ?
(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 i386

  • Single posting newcomer
  • *
  • Posts: 8
Re: CB 20.03 for windows, debug problems
« Reply #2 on: April 04, 2021, 10:44:54 am »
I am using 64-bit win10, and add "-m64" option.
In the code add lines:
    unsigned long long ua = (unsigned long long)pt;
    printf("ua = 0x%016llx\n", ua);
Then compile(no error and warning) and run:
   ua = 0x00000000029924b0
It's just a normal 32-bit address.

1. The debugger shipped as part of the 20.03 is not very well working. You should find better one. It is best to use 64bit CB to debug 64bit executables. And the debugger exe should also be 64bit.
2. Most probably this is the output from the debugger. Can you enable full logging and check if the values differ?

Offline i386

  • Single posting newcomer
  • *
  • Posts: 8
Re: CB 20.03 for windows, debug problems
« Reply #3 on: April 10, 2021, 01:50:20 pm »
I am sorry! The cannonical address form is OK. Because application runs in ring 3, the upper 16bits is always 0x0000H.

Now left questin 1.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(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 i386

  • Single posting newcomer
  • *
  • Posts: 8
Re: CB 20.03 for windows, debug problems
« Reply #5 on: April 11, 2021, 03:31:15 am »
I download the 64bit version 'gdb-10.1.90.20201024-x86_64.7z', and extract to codeblocks installation directory. Setup the debugger as the link says.
Then setup a breakpiont and run Debugging...

Starting debugger: C:\Program Files\CodeBlocks\gdb-10.1.90.20201024-x86_64\bin\gdb.exe -nx -fullname -quiet  -args D:/devel/cb/vulkan/bin/Debug/vulkan.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (ssbssa-1) 10.1.90.20201024-git
Child process PID: 9436
[Inferior 1 (process 9436) exited normally]
Debugger finished with status 0

----------->
The breakpoint was skipped, and the application 'vulkan' run to the end normally[judging from 'vulkan' app log]. The break point has no effect. I am sure the breakpoint is a VALID point. why?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB 20.03 for windows, debug problems
« Reply #6 on: April 11, 2021, 10:14:31 am »
Post the full rebuild and debug logs.
(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 i386

  • Single posting newcomer
  • *
  • Posts: 8
Re: CB 20.03 for windows, debug problems
« Reply #7 on: April 11, 2021, 11:57:35 am »
I uninstall th CB 20.03. Then re-install it and setup the new gdb as above. After that I find all the debug process is OK.

These are the debug boot up log, the debugger stops at the breakpoint as expected:
---------------------
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\cb\vulkan\
Adding source dir: D:\cb\vulkan\
Adding file: D:\cb\vulkan\bin\Debug\vulkan.exe
Changing directory to: D:/cb/vulkan/.
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0
Starting debugger: C:\Program Files\CodeBlocks\gdb-10.1.90.20201024-x86_64\bin\gdb.exe -nx -fullname -quiet  -args D:/devel/cb/vulkan/bin/Debug/vulkan.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (ssbssa-1) 10.1.90.20201024-git
Child process PID: 8956
At D:\cb\vulkan\entry.cpp:30

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB 20.03 for windows, debug problems
« Reply #8 on: April 11, 2021, 05:50:23 pm »
The uninstall/install cycle doesn't change anything in your settings.
You still don't have a clue where the problem was...
Just a note.
(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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: CB 20.03 for windows, debug problems
« Reply #9 on: August 08, 2021, 04:34:12 am »
@i386 I have just downloaded the https://github.com/ssbssa/gdb/releases/download/gdb-10.2.90.20210425/gdb-10.2.90.20210425-i686.7z file and copied the files over the MING32 installation files.
I was able to set a breakpoint and it stooped on the breakpoint.

I suggest trying the later GDB.