Author Topic: Problem with debugging  (Read 23868 times)

Offline Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Problem with debugging
« on: June 30, 2013, 01:42:27 pm »
Hi.
I want to debug this part of code and i have problem with it.
https://imageshack.com/scaled/large/713/otp2.jpg
When I try to debug and press F7 few times, debugger stops.
Here you have debugger logs:
https://imageshack.com/scaled/large/812/5tpl.jpg
If I try to stop debbuger (Shift-F8) I obtain message: Trying to pause the running process...
And It doesn't stop!
There is not a problem with integer value or even with float. There is a problem with double, long e.g.
Please help.
I have C::B 12.11 with minGW
« Last Edit: June 30, 2013, 01:48:20 pm by Piotrek_16 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #1 on: June 30, 2013, 01:50:00 pm »
1. enable full logging (see settings -> debugger),
2. then try to debug again
3. then copy-paste the full log using code tags (use the '#' button in the new post interface of the forum)

Have you used the callstack/backtrace window?
Probably gdb is executing step-into instead of next-line, because either you have optimizations enabled or some inlining has happened.
(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 Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem with debugging
« Reply #2 on: June 30, 2013, 02:01:59 pm »
Code: [Select]
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\
Adding source dir: C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\
Adding file: C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\bin\Debug\NewProject.exe
Changing directory to: C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject/.
Set variable: PATH=.;C:\CodeBlocks\MinGW\bin;C:\CodeBlocks\MinGW;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit

[debug]Command-line: C:\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject/bin/Debug/NewProject.exe
[debug]Working dir : C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject

Starting debugger: C:\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject/bin/Debug/NewProject.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\bin\Debug\NewProject.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 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 "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.5

[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 0
[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]> source C:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject/
[debug]Source directories searched: C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Piotrek/Documents/CodeBlocksWorkspace/NewProject/main.cpp:8"
[debug]Breakpoint 2 at 0x40135a: file C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp, line 8.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\bin\Debug\NewProject.exe

Child process PID: 7872

[debug][New Thread 7872.0x1258]
[debug]Breakpoint 2, main () at C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8
[debug]C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8:88:beg:0x40135a
[debug]>>>>>>cb_gdb:

At C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8

[debug]> next
[debug]0x004496c4 in std::ostream::operator<<(double) ()
[debug]>>>>>>cb_gdb:

In std::ostream::operator<<(double) () ()

[debug]> bt 30
[debug]#0  0x004496c4 in std::ostream::operator<<(double) ()
[debug]#1  0x758d1162 in onexit () from C:\Windows\syswow64\msvcrt.dll
[debug]#2  0x75925bc4 in msvcrt!atexit () from C:\Windows\syswow64\msvcrt.dll
[debug]Backtrace stopped: previous frame inner to this frame (corrupt stack?)
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Single stepping until exit from function _ZNSolsEd,
[debug]which has no line number information.
[debug]0x00448018 in std::ostream& std::ostream::_M_insert<double>(double) ()
[debug]>>>>>>cb_gdb:

In std::ostream& std::ostream::_M_insert<double>(double) () ()

[debug]> bt 30
[debug]#0  0x00448018 in std::ostream& std::ostream::_M_insert<double>(double) ()
[debug]#1  0x00401371 in main () at C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8
[debug]>>>>>>cb_gdb:
[debug]> frame 1
[debug]#1  0x00401371 in main () at C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8
[debug]C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8:88:beg:0x401371
[debug]>>>>>>cb_gdb:

#1  0x00401371 in main () at C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8
C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8:88:beg:0x401371
At C:\Users\Piotrek\Documents\CodeBlocksWorkspace\NewProject\main.cpp:8

[debug]> next
[debug]127 ../../../../src/gcc-4.7.1/libgcc/unwind-sjlj.c: No such file or directory.
[debug]Single stepping until exit from function _ZNSo9_M_insertIdEERSoT_,
[debug]which has no line number information.
[debug]_Unwind_SjLj_Register (fc=0x28fe8c) at ../../../../src/gcc-4.7.1/libgcc/unwind-sjlj.c:127
[debug]>>>>>>cb_gdb:
I used only Watches window.
I have this from Callstack window: std::ostream& std::ostream::_M_insert<double>(double) () (??:??)
I don't know what is backtrace window?!
I've installed C::B on my PC yesterday and I was trying to test this IDE and I obtained this problem.
« Last Edit: June 30, 2013, 02:04:55 pm by Piotrek_16 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #3 on: June 30, 2013, 04:30:31 pm »
Do you have optimizations enabled in your target options?

For me this is a problem of gdb/mingw you have installed, not in C::B.
Can you try to use gdb from the command line to see if the problem happens there, too?
(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 Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem with debugging
« Reply #4 on: June 30, 2013, 06:05:58 pm »
Do you have optimizations enabled in your target options?
Can you try to use gdb from the command line to see if the problem happens there, too?
As I mentioned I'm newbie :) Can you tell me what exactly I have to do? I didn't change anything except c++11 option, I set it on in project -> build options.
Where can I find target options?
From the command line I used command
Code: [Select]
c++ main.cpp -o file I obtain executable file which worked.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #5 on: June 30, 2013, 06:16:25 pm »
Where can I find target options?
Project -> Build options -> Your target in the tree

From the command line I used command
Code: [Select]
c++ main.cpp -o file I obtain executable file which worked.
This is not related to the debugger. The debugger is gdb. Search for a command line tutorial.

Also make sure you've setup your project correctly.
See here for details: http://wiki.codeblocks.org/index.php?title=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!]

Offline Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem with debugging
« Reply #6 on: June 30, 2013, 07:00:58 pm »
Code: [Select]
Microsoft Windows [Wersja 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Wszelkie prawa zastrzeżone.

C:\Users\Piotrek>cd ..

C:\Users>cd ..

C:\>cd CodeBlocks

C:\CodeBlocks>cd MinGW

C:\CodeBlocks\MinGW>cd bin

C:\CodeBlocks\MinGW\bin>gdb
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) file plik
Reading symbols from C:\CodeBlocks\MinGW\bin\plik.exe...done.
(gdb) break main
Breakpoint 1 at 0x401342
(gdb) run > outfile.txt
Starting program: C:\CodeBlocks\MinGW\bin\plik.exe > outfile.txt
[New Thread 1664.0x1eec]

Breakpoint 1, 0x00401342 in main ()
(gdb) next
Single stepping until exit from function main,
which has no line number information.
0x004496d4 in std::ostream::operator<<(double) ()
(gdb) next
Single stepping until exit from function _ZNSolsEd,
which has no line number information.
0x00448028 in std::ostream& std::ostream::_M_insert<double>(double) ()
(gdb) next
Single stepping until exit from function _ZNSo9_M_insertIdEERSoT_,
which has no line number information.
_Unwind_SjLj_Register (fc=0x28fe8c)
    at ../../../../src/gcc-4.7.1/libgcc/unwind-sjlj.c:127
127     ../../../../src/gcc-4.7.1/libgcc/unwind-sjlj.c: No such file or director
y.
(gdb) next
129     in ../../../../src/gcc-4.7.1/libgcc/unwind-sjlj.c
I have something like that.
Now I'm going to build options:
I have set on in Debug and Release:
- Produce debugging symbols [-g]
- Enable all compiler warnings [-Wall]
- Have g++ follow the C++11 ISO bla bla bla [-std=c++11]
Nothing more.

I will try on my laptop. If there will be the same issue I don't know what will should I do.
On laptop the same problem. So I don't know what's going on.
« Last Edit: July 03, 2013, 11:52:41 am by Piotrek_16 »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5251
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with debugging
« Reply #7 on: July 03, 2013, 02:10:37 am »
Code: [Select]
...
(gdb) file plik
Reading symbols from C:\CodeBlocks\MinGW\bin\plik.exe...done.
(gdb) break main
Breakpoint 1 at 0x401342
(gdb) run > outfile.txt
Starting program: C:\CodeBlocks\MinGW\bin\plik.exe > outfile.txt
[New Thread 1664.0x1eec]

Breakpoint 1, 0x00401342 in main ()
(gdb) next
Single stepping until exit from function main,
which has no line number information.
0x004496d4 in std::ostream::operator<<(double) ()
...
Looks like a GDB issue, isn't it? Try a newer GDB?

Quote
- Produce debugging symbols [-s]
Typo? should be -g.
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 Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem with debugging
« Reply #8 on: July 03, 2013, 11:55:32 am »
Quote
Typo? should be -g.
Yeah. There should be -g. My fault.

I have gdb which is added to this codeblocks-12.11mingw-setup.exe  from codeblocks.org/download  so is it possible to be down?
 
Maybe someone of you can propose me from which source I have to download new gdb ? Any link ?
« Last Edit: July 03, 2013, 11:58:47 am by Piotrek_16 »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5251
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
« Last Edit: July 04, 2013, 05:19:31 am by ollydbg »
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 Piotrek_16

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem with debugging
« Reply #10 on: July 04, 2013, 05:56:01 pm »
It doesn't work or I do something wrong.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5251
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with debugging
« Reply #11 on: July 10, 2013, 11:27:31 am »
It doesn't work or I do something wrong.
Then you can provide a minimal test code snippet, so I can build it on my PC and debug it to see whether I have the same issue.
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 G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with debugging
« Reply #12 on: July 20, 2013, 12:04:10 am »
I have similar issue. Debugger hangs when I try to step or use breakpoints and no way to stop it except closing whole C::B or killing gdb process.
I wasted some time and found that problem appears when I using Linux line endings in the .cpp file (C::B is running under Windows).
If I convert .cpp to the Windows line endings, problem disappears.

Now I have a question, is I really have to use Windows line endings to debug under Windows, or there is some options could help me?
If I have to use Windows line endings, then how about Linux? Will debugger / gdb work fine with Windows line endings under the Linux?

PS: Don`t sure if it usefull, but my system is: Win8 x64, C::B 12.11 release, GNU gdb (GDB) 7.5 (installed with C::B). Also tried nightly C::B build.
« Last Edit: July 20, 2013, 12:07:55 am by G-Shadow »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #13 on: July 20, 2013, 12:36:34 am »
If I convert .cpp to the Windows line endings, problem disappears.
This is quite strange.
Please post the full log from the debugger in code tags.
(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 G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with debugging
« Reply #14 on: July 20, 2013, 07:11:00 pm »
I`m sorry, looks like I was wrong, it is not Linux line endings. The problem is when CR (0x0D) line endings are used in source file. So, my question about Linux is meaningless. But may be topic starter still has same problem with CR line ends.

Code: [Select]
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: E:\DENIS\Projects\zzzzzzzzzzzz\
Adding source dir: E:\DENIS\Projects\zzzzzzzzzzzz\
Adding file: E:\DENIS\Projects\zzzzzzzzzzzz\bin\Debug\zzzzzzzzzzzz.exe
Changing directory to: E:/DENIS/Projects/zzzzzzzzzzzz/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Resource\bin;C:\Program Files\TortoiseSVN\bin

[debug]Command-line: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args E:/DENIS/Projects/zzzzzzzzzzzz/bin/Debug/zzzzzzzzzzzz.exe
[debug]Working dir : E:\DENIS\Projects\zzzzzzzzzzzz

Starting debugger: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args E:/DENIS/Projects/zzzzzzzzzzzz/bin/Debug/zzzzzzzzzzzz.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from E:\DENIS\Projects\zzzzzzzzzzzz\bin\Debug\zzzzzzzzzzzz.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 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 "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.5

[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 0
[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]> source C:\Program Files (x86)\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory E:/DENIS/Projects/zzzzzzzzzzzz/
[debug]Source directories searched: E:/DENIS/Projects/zzzzzzzzzzzz;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "E:/DENIS/Projects/zzzzzzzzzzzz/main.cpp:7"
[debug]Breakpoint 2 at 0x40134a: file E:\DENIS\Projects\zzzzzzzzzzzz\main.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: E:\DENIS\Projects\zzzzzzzzzzzz\bin\Debug\zzzzzzzzzzzz.exe

Child process PID: 732

[debug][New Thread 732.0x12c8]
[debug]Breakpoint 2, main () at E:\DENIS\Projects\zzzzzzzzzzzz\main.cpp:7
[debug]>>>>>>cb_gdb:

And in case of good source file, changes are only in those last lines:

Code: [Select]
Child process PID: 4820

[debug][New Thread 4820.0xf70]
[debug]Breakpoint 2, main () at E:\DENIS\Projects\zzzzzzzzzzzz\main.cpp:7
[debug]E:\DENIS\Projects\zzzzzzzzzzzz\main.cpp:7:62:beg:0x40134a
[debug]>>>>>>cb_gdb:

At E:\DENIS\Projects\zzzzzzzzzzzz\main.cpp:7

So, added only one line "... main.cpp:7:62:beg:0x40134a", and successfull "at ...\main.cpp:7" in the end.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Problem with debugging
« Reply #15 on: July 21, 2013, 01:57:47 am »
I can confirm this (fedora 19 64bit with gcc 4.8.1 and gdb 7.6).
It does not work from commandline either.
Or more exactly, it stops at the bp, but it does not print that it has stopped:

Quote from: all lines end with cr
$ gdb bin/Debug/test
GNU gdb (GDB) Fedora (7.6-32.fc19)
[...]
This GDB was configured as "x86_64-redhat-linux-gnu".
[...]
Reading symbols from /tmp/test/bin/Debug/test...done.
(gdb) break main.cpp:7
Breakpoint 1 at 0x400874: file /tmp/test/main.cpp, line 7.
(gdb) run
Starting program: /tmp/test/bin/Debug/test

Breakpoint 1, main () at /tmp/test/main.cpp:7
Missing separate debuginfos, use: debuginfo-install glibc-2.17-11.fc19.x86_64 libgcc-4.8.1-1.fc19.x86_64 libstdc++-4.8.1-1.fc19.x86_64
(gdb) n
Hello world!
(gdb)

Quote from: all lines end with lf
$ gdb bin/Debug/test
[...]
Reading symbols from /tmp/test/bin/Debug/test...done.
(gdb) break main.cpp:7
Breakpoint 1 at 0x400874: file /tmp/test/main.cpp, line 7.
(gdb) run
Starting program: /tmp/test/bin/Debug/test

Breakpoint 1, main () at /tmp/test/main.cpp:7
7       cout << "Hello world!" << endl;
Missing separate debuginfos, use: debuginfo-install glibc-2.17-11.fc19.x86_64 libgcc-4.8.1-1.fc19.x86_64 libstdc++-4.8.1-1.fc19.x86_64
(gdb) n
Hello world!
8       return 0;
(gdb)

Didn't we haveusers reporting similar issues on mac ?
Might this be related or do the (more or less) new (more or less linux based) mac's use lf (or crlf, that works also) all the time ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #16 on: July 21, 2013, 10:32:50 am »
Didn't we haveusers reporting similar issues on mac ?
I don't think so. But there are other similar reports where we fail to detect when the debugger has stopped (after stepping into, set next statement and so on).
I've reproduced it, too, and I'll try to fix it.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #17 on: July 21, 2013, 10:33:32 pm »
OK, I have a patch that should fix this and many similar problems.
The patch can be downloaded from here: http://cmpt.benbmp.org/codeblocks/patches/dbg/cb.dbg.stop.on.break.patch

Please try and report if there are any regressions introduced with this patch.

The patch should fix:
1. The problem reported in this topic
2. Executing step into and the code is inavailable
3. Set next statement, where there are errors

@Morten: I think this should fix stepping problem you've reported in the past.

I won't commit it for a while to see if it works with my workflows at least. :)
(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 G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with debugging
« Reply #18 on: August 03, 2013, 08:41:34 pm »
I confirm, in that version (svn 9232) bug is fixed. Sorry for such late answer.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #19 on: August 03, 2013, 10:41:08 pm »
With or without the patch?
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: Problem with debugging
« Reply #20 on: August 05, 2013, 08:59:45 pm »
In svn...
(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 G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with debugging
« Reply #21 on: August 06, 2013, 06:56:54 pm »
Ah, sorry ::). With patch, of course.
I have checked out from svn, applied patch, build everything and run.
Compared this patched version vs installed official release to make sure I reproduce correctly.

Offline bangorme

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Problem with debugging
« Reply #22 on: July 14, 2014, 03:32:43 pm »
I'm in ver 12.11.  Is this fix in my version?  I'm having this same problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6789
    • My Best Post
Re: Problem with debugging
« Reply #23 on: July 14, 2014, 04:35:25 pm »
I'm in ver 12.11.  Is this fix in my version?  I'm having this same problem.

Unlikely, the date on the fix was 2013-08-05, the 12.11 release was in 2012.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org