Author Topic: debugger not stopping at breakpoint  (Read 5012 times)

anmol goel

  • Guest
debugger not stopping at breakpoint
« on: May 30, 2021, 10:43:11 am »
Hello I am newbie programmer and i am facing problems using debugger (i am using a debugger for the first time). the problem i was facing was that the debugger was running in some codes and was popping up a issue in the others  - not able to find 'target exec' . So I reinstalled codeblocks now it is not working properly in any now the debugger runs but it doesn't stop on the breakpoints.


this is the code. the breakpoint is in the 14th line (    cout<<"How much money you want to pay"<<endl;)

Code
#include <iostream>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int start,a,denomination[15],money,rem=10,notes,temp;
char waste;

int main()
{


    cout<<"How much money you want to pay"<<endl;
    cin>>money;

    x:
    //system("cls");
    cout << "How many denomination of notes you have" << endl;
    cin >> a;

    if(a>15){
        cout<<"Invalid input"<<endl;
        cout<<"Enter any key"<<endl;
        cin>>waste;

        goto x;
    }

    cout<<"Enter the denominations you have: "<<endl;

    for(int b =0;b<a;b++){
         int y=b+1;
         cout<<y;
         cout<<": ";
         cin>>denomination;
    }

    int temp_1;

    for(int l =0;l<a-1;l++){
        for(int m=l+1;m<a;m++){
            if(denomination[l]<denomination[m]){
                temp_1=denomination[l];
                denomination[l]=denomination[m];
                denomination[m]=temp_1;
            }
        }
    }

    int temp_2=0;

    //system("cls");
    cout<<"Min notes required: "<<endl;

    for(int e=0 ; e<a && rem!=0; e++){
             if(money>=denomination[e]){
             temp_1=money;
             rem=money%denomination[e];
             money=money-rem;
             notes =money/denomination[e];
             money=temp_1-money;

             cout<<denomination[e];
             cout<<": ";
             cout<<notes<<endl;

         }
         temp_2=1;
    }
    if(!temp_2)cout<<"0 " ;
    return 0;
}








and i think this is the debug log


Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Release
Adding source dir: D:\Projects\c++\Denomination\
Adding source dir: D:\Projects\c++\Denomination\
Adding file: D:\Projects\c++\Denomination\bin\Release\denomination.exe
Changing directory to: D:/Projects/c++/Denomination/.
Set variable: PATH=.;C:\MinGW\bin;C:\MinGW;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:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\anmol goel\AppData\Local\Microsoft\WindowsApps;C:\Users\anmol goel\AppData\Local\Programs\Microsoft VS Code\bin


[debug]Command-line: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args D:/Projects/c++/Denomination/bin/Release/denomination.exe
[debug]Working dir : D:\Projects\c++\Denomination


Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args D:/Projects/c++/Denomination/bin/Release/denomination.exe
done


[debug]Reading symbols from D:/Projects/c++/Denomination/bin/Release/denomination.exe...(no debugging symbols found)...done.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:


Setting breakpoints


[debug]>>>>>>cb_gdb:
[debug]> show version


Reading symbols from D:/Projects/c++/Denomination/bin/Release/denomination.exe...(no debugging symbols found)...done.


[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 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) 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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Projects/c++/Denomination/
[debug]Source directories searched: D:/Projects/c++/Denomination;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "D:/Projects/c++/Denomination/main.cpp:14"
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Breakpoint 2 ("D:/Projects/c++/Denomination/main.cpp:14") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\Projects\c++\Denomination\bin\Release\denomination.exe


Child process PID: 26608


[debug][New Thread 26608.0x54ec]
[debug][New Thread 26608.0x4e78]
[debug][New Thread 26608.0x6978]
[debug][New Thread 26608.0x2f24]
[debug][New Thread 26608.0x2d14]
[debug][Thread 26608.0x2f24 exited with code 3221225786]
[debug][Thread 26608.0x6978 exited with code 3221225786]
[debug][Thread 26608.0x4e78 exited with code 3221225786]
[debug][Inferior 1 (process 26608) exited with code 030000000472]
[debug]>>>>>>cb_gdb:


[Inferior 1 (process 26608) exited with code 030000000472]


[debug]> quit


Debugger finished with status 0



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger not stopping at breakpoint
« Reply #1 on: May 30, 2021, 02:55:57 pm »
Quote
Reading symbols from D:/Projects/c++/Denomination/bin/Release/denomination.exe...(no debugging symbols found)...done.
https://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks
(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!]