Author Topic: Debug  (Read 4724 times)

Offline jtsite

  • Single posting newcomer
  • *
  • Posts: 2
Debug
« on: October 06, 2020, 08:37:26 pm »
I am one week into teaching my self the CodeBlocks IDE. When trying the debug mode, I can get my sample code to run up to my breakpoint OR run to the cursor. When the debug stops I cannot single step or continue from that line. Below is the debugger log:

What am I missing? I am running V20.03

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\jtsite\Documents\CodeBlocksWorkspace\DebugDemo\
Adding source dir: C:\Users\jtsite\Documents\CodeBlocksWorkspace\DebugDemo\
Adding file: C:\Users\jtsite\Documents\CodeBlocksWorkspace\DebugDemo\bin\Debug\DebugDemo.exe
Changing directory to: C:/Users/jtsite/Documents/CodeBlocksWorkspace/DebugDemo/.
Set variable: PATH=.;c:\MinGW\bin;c:\MinGW;C:\Program Files\Python37\Scripts;C:\Program Files\Python37;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Windows\CCM;C:\Program Files\CrashPlan\jre\bin\server;C:\Program Files\CrashPlan\jre\bin;C:\Program Files\PowerShell\7;C:\Program Files\CodeBlocks\MinGW\bin
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/jtsite/Documents/CodeBlocksWorkspace/DebugDemo/bin/Debug/DebugDemo.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 12968
In ?? () ()
Cannot find bounds of current function
Cannot find bounds of current function
Cannot find bounds of current function
Continuing...
[Inferior 1 (process 12968) exited with code 0377]
Debugger finished with status 0

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Debug
« Reply #1 on: October 06, 2020, 09:20:47 pm »
Code
Set variable: PATH=.;c:\MinGW\bin;c:\MinGW;C:\Program Files\Python37\Scripts;C:\Program Files\Python37;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Windows\CCM;C:\Program Files\CrashPlan\jre\bin\server;C:\Program Files\CrashPlan\jre\bin;C:\Program Files\PowerShell\7;C:\Program Files\CodeBlocks\MinGW\bin
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args

You have "c:\MinGW" in your path this likely means you built your program using it!
The GCC in "c:\MinGW" tends to be 32 bit; the debugger in "C:\Program Files\CodeBlocks\MINGW\bin" tends to be 64 bit.

The mix of 32 bit and 64 bit might be causing your problem. Or the mix of the two compiler toolchains might be causing the problem.

Decide which MinGW GCC compiler you are using and remove the other ones from the path.
Verify Code::Blocks toolchain is set to use the one you want to use.
Post Operating System Info if you still have the problem (You need to post if OS is 32 bit or 64 bit).
Post if you are  trying to build an 32 bit or an 64 bit application.

Edit: Add link that gives how to use code tags http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
« Last Edit: October 07, 2020, 12:46:43 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jtsite

  • Single posting newcomer
  • *
  • Posts: 2
Re: Debug
« Reply #2 on: October 07, 2020, 05:19:05 pm »
Thank You stahta01. Yes I am very much a newbie. I took me several minutes to find my own post. This is the version I downloaded and installed: The codeblocks-20.03mingw-setup.exe file includes additionally the GCC/G++/GFortran compiler and GDB debugger from MinGW-W64 project (version 8.1.0, 32/64 bit, SEH).

The tasks I intend to do on Code::Blocks are all procedural C++ with some basic uses of the string class. So I don't know which would be better for me a 32 or 64 bit version.

I believe that I have the 64 bit version installed.

I watched a youtube video that had me modify a system environment variable  and path to use C:\Program Files\CodeBlocks\MinGW\bin could that be my problem?

Here is the format you requested

I am running Code::Blocks version Code::20.03 on Windows 10
(version OperatingSystemVersionNumber). The compiler I use is DEBUGGER GDB/CDB
version C:\Users\jtsite>gcc --version
gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc..

When I ...
Steps to reproduce problem.

Description of problem.
... happens.

Build log:
Code
Paste full build log here. (It is found in the 'Build log' tab). Please make always a 'rebuild' (Menu: Build->Rebuild) or a 'clean' and 'build' before you copy the full build log. 

Crash report:
Code
Paste the contents of codeblocks.RPT here (if Code::Blocks crashed).

    (Although the following is not necessary, showing that you
     have tried increases the probability of a response.)
I have already tried ...
List of attempted solutions.
... but none of them worked.
Code
[code]
[/code]

Am I using the format correctly?

Todd