Author Topic: debugger broken (cannot open fileops.c)  (Read 4968 times)

Offline Nyap

  • Single posting newcomer
  • *
  • Posts: 4
debugger broken (cannot open fileops.c)
« on: April 17, 2016, 11:22:33 pm »

nothing works. whenever I try to do something with the debugger, it just returns the fileops.c error

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger broken (cannot open fileops.c)
« Reply #1 on: April 18, 2016, 01:06:58 am »
Sorry but you'll have to provide more details, not just a vague screenshot.
Like: Do you have fileops.c in your project?
(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 Nyap

  • Single posting newcomer
  • *
  • Posts: 4
Re: debugger broken (cannot open fileops.c)
« Reply #2 on: April 18, 2016, 08:56:50 am »
Sorry but you'll have to provide more details, not just a vague screenshot.
Like: Do you have fileops.c in your project?
nope, pretty sure I don't

heres the log:
Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/nyap/Projects/Chapter 1 comprehensive quiz/
Adding source dir: /home/nyap/Projects/Chapter 1 comprehensive quiz/
Adding file: /home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz
Changing directory to: "/home/nyap/Projects/Chapter 1 comprehensive quiz/."
Set variable: LD_LIBRARY_PATH=.:
Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args "/home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz"
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Program received signal SIGINT, Interrupt.
In __read_nocancel () at ../sysdeps/unix/syscall-template.S:81 ()
Cannot open file: fileops.c
At fileops.c:615

this has been happening ever since I first tried the debugger
I'm on elementary os (ubuntu 14.04 based)
not sure what else to say really

edit: here's a link to my project: http://pastebin.com/uxapHBHP
its been happening to me on every project so i'm pretty sure this isn't needed, but just in case
« Last Edit: April 18, 2016, 09:00:37 am by Nyap »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger broken (cannot open fileops.c)
« Reply #3 on: April 18, 2016, 09:51:44 am »
Please enable the full log in the settings of the debugger and then post the log again.
(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 Nyap

  • Single posting newcomer
  • *
  • Posts: 4
Re: debugger broken (cannot open fileops.c)
« Reply #4 on: April 18, 2016, 04:45:07 pm »
Please enable the full log in the settings of the debugger and then post the log again.
Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/nyap/Projects/Chapter 1 comprehensive quiz/
Adding source dir: /home/nyap/Projects/Chapter 1 comprehensive quiz/
Adding file: /home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz
Changing directory to: "/home/nyap/Projects/Chapter 1 comprehensive quiz/."
Set variable: LD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args "/home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz"
[debug]Working dir : /home/nyap/Projects/Chapter 1 comprehensive quiz

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args "/home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz"
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 /home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
[debug]Copyright (C) 2014 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-linux-gnu".
[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 (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.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 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]Queued:[tty /dev/pts/2]
[debug]>>>>>>cb_gdb:
[debug]> directory "/home/nyap/Projects/Chapter 1 comprehensive quiz/"
[debug]Source directories searched: /home/nyap/Projects/Chapter 1 comprehensive quiz:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/2
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/nyap/Projects/Chapter 1 comprehensive quiz/bin/Debug/Chapter 1 comprehensive quiz
[debug]Code::Blocks is trying to interrupt process with pid: 2372; child pid: 0 gdb pid: 2372
[debug]81 ../sysdeps/unix/syscall-template.S: No such file or directory.
[debug]Program received signal SIGINT, Interrupt.
[debug]0x00007ffff77fc810 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81
[debug]>>>>>>cb_gdb:

Program received signal SIGINT, Interrupt.
In __read_nocancel () at ../sysdeps/unix/syscall-template.S:81 ()

[debug]> bt 30
[debug]#0  0x00007ffff77fc810 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81
[debug]#1  0x00007ffff778b6a0 in _IO_new_file_underflow (fp=0x7ffff7ad0640 <_IO_2_1_stdin_>) at fileops.c:613
[debug]#2  0x00007ffff778c62e in __GI__IO_default_uflow (fp=0x7ffff7ad0640 <_IO_2_1_stdin_>) at genops.c:435
[debug]#3  0x00007ffff7782bae in _IO_getc (fp=0x7ffff7ad0640 <_IO_2_1_stdin_>) at getc.c:39
[debug]#4  0x00007ffff7b6968d in __gnu_cxx::stdio_sync_filebuf<char, std::char_traits<char> >::underflow() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
[debug]#5  0x00007ffff7b54092 in std::istream::sentry::sentry(std::istream&, bool) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
[debug]#6  0x00007ffff7b5423b in std::istream::operator>>(int&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
[debug]#7  0x000000000040098b in readNumber () at /home/nyap/Projects/Chapter 1 comprehensive quiz/src/io.cpp:13
[debug]#8  0x00000000004009ef in main () at /home/nyap/Projects/Chapter 1 comprehensive quiz/src/main.cpp:8
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]615 fileops.c: No such file or directory.
[debug]_IO_new_file_underflow (fp=0x7ffff7ad0640 <_IO_2_1_stdin_>) at fileops.c:615
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Stack level 0, frame at 0x7fffffffe3f0:
[debug] rip = 0x7ffff778b6a0 in _IO_new_file_underflow (fileops.c:615); saved rip = 0x7ffff778c62e
[debug] called by frame at 0x7fffffffe400
[debug] source language c.
[debug] Arglist at 0x7fffffffe3d0, args: fp=0x7ffff7ad0640 <_IO_2_1_stdin_>
[debug] Locals at 0x7fffffffe3d0, Previous frame's sp is 0x7fffffffe3f0
[debug] Saved registers:
[debug]  rbx at 0x7fffffffe3d8, rbp at 0x7fffffffe3e0, rip at 0x7fffffffe3e8
[debug]>>>>>>cb_gdb:

Cannot open file: fileops.c
At fileops.c:615

[debug]> quit

Debugger finished with status 0

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger broken (cannot open fileops.c)
« Reply #5 on: April 18, 2016, 07:31:50 pm »
As far as I can see the debugger works fine.
The problem is that you've installed the debug symbols for glibc or libstdc++.

The debugger has correct callstack and reports file/line information for frames inside glibc/libstdc++.
C::B uses this to decide which frame to select. In your case it fails.
To debug the program just open the callstack window and switch to the correct frame #7.
(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 Nyap

  • Single posting newcomer
  • *
  • Posts: 4
Re: debugger broken (cannot open fileops.c)
« Reply #6 on: April 18, 2016, 07:50:50 pm »
As far as I can see the debugger works fine.
The problem is that you've installed the debug symbols for glibc or libstdc++.

The debugger has correct callstack and reports file/line information for frames inside glibc/libstdc++.
C::B uses this to decide which frame to select. In your case it fails.
To debug the program just open the callstack window and switch to the correct frame #7.
forgot to mention that I'm new to C++  ;D can you please re-explain in the noobiest way possible

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger broken (cannot open fileops.c)
« Reply #7 on: April 18, 2016, 08:00:22 pm »
Debug -> Debugging windows -> Callstack -> Double click on the frame with your function
(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!]