Author Topic: Debugger Call Stack missing File and Line data  (Read 421 times)

Offline bead-v

  • Single posting newcomer
  • *
  • Posts: 2
Debugger Call Stack missing File and Line data
« on: January 27, 2019, 11:08:22 am »
Hi!

I recently got a new computer, I installed Code::Blocks there and moved my files to the new computer. But now when I use the debugger, the call stack does not contain the information about the file and line, which then also doesn't let me jump to the relevant location and thus makes debugging a pain.

I thought the problem might be some old paths in the project files, so I did a search and replace on all my project files to fix all the paths. Unfortunately the problem persists.

Can somebody please direct me towards what could possibly be wrong? I really don't know what to try anymore.

Thanks for your help!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5221
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger Call Stack missing File and Line data
« Reply #1 on: January 27, 2019, 02:29:09 pm »
Hi!
I recently got a new computer, I installed Code::Blocks there and moved my files to the new computer. But now when I use the debugger, the call stack does not contain the information about the file and line, which then also doesn't let me jump to the relevant location and thus makes debugging a pain.
Can you show more details? Which compiler do you use? Which debugger do you use? Any sample code? Can you show us a screen shot or the full debugging log? (the full debugging log can be enabled in the debugger settings)
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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2379
Re: Debugger Call Stack missing File and Line data
« Reply #2 on: January 27, 2019, 02:50:16 pm »
Have you made a full rebuild of every library and your main program? Normally debugger symbols, where the source line is stored, use absolute paths. So you have to rebuild everything on the new machine to be able to debug it. Or you add the folder to gdb by hand:
Code: [Select]
(gdb) directory /path/to/src/type this in the debugger command line at the bottom... You can also add the source directories to the additional debugger search paths in the Project->Properties->Debugger->additional debugger search dirs

Offline bead-v

  • Single posting newcomer
  • *
  • Posts: 2
Re: Debugger Call Stack missing File and Line data
« Reply #3 on: January 27, 2019, 05:48:22 pm »
Thank you both for your replies!

While I was gathering screenshots of all my options I noticed the compiler option "Produce debugging symbols" was off on my compiler (*facepalm*). I could have sworn I tried turning it on, but apparently something must have gone wrong because now it did the trick!

Thanks again for helping me out!

I'm just gonna leave the other information here anyway, maybe it will be useful to someone.

--------------

I have rebuilt everything entirely on the new machine ().

I have added the paths to the additional debugger search dirs.

I'm using the Mingw-w64 compiler, and also their debugger. Same on the old machine.

Here is the full debug log:
Quote
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Files\Coding\libbeadtlk\
Adding source dir: D:\Files\Coding\libbeadtlk\
Adding source dir: D:\Files\Coding\libbeadfile\
Adding source dir: D:\Files\Coding\libbeadfile\
Adding source dir: D:\Files\Coding\libbeadgff\
Adding source dir: D:\Files\Coding\libbeadgff\
Adding source dir: D:\Files\Coding\
Adding source dir: D:\Files\Coding\dlgedit\
Adding source dir: D:\Files\Coding\dlgedit\
Adding source dir: D:\Files\Coding\dlgedit\
Adding file: D:\Files\Coding\dlgedit\bin\Debug\dlgedit.exe
Changing directory to: D:/Files/Coding/dlgedit/.
Set variable: PATH=.;D:\Files\Coding\libbeadfile\bin\Debug;D:\Files\Coding\libbeadgff\bin\Debug;D:\Files\Coding\libbeadtlk\bin\Debug;C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\bin;C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\Miha\AppData\Local\Microsoft\WindowsApps

[debug]Command-line: C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\bin\gdb.exe -nx -fullname -quiet  -args D:/Files/Coding/dlgedit/bin/Debug/dlgedit.exe
[debug]Working dir : D:\Files\Coding\dlgedit

Starting debugger: C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\bin\gdb.exe -nx -fullname -quiet  -args D:/Files/Coding/dlgedit/bin/Debug/dlgedit.exe
done

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

Setting breakpoints

[debug]Reading symbols from D:/Files/Coding/dlgedit/bin/Debug/dlgedit.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[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 "i686-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:/Files/Coding/libbeadtlk/
[debug]Source directories searched: D:/Files/Coding/libbeadtlk;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Files/Coding/libbeadfile/
[debug]Source directories searched: D:/Files/Coding/libbeadfile;D:/Files/Coding/libbeadtlk;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Files/Coding/libbeadgff/
[debug]Source directories searched: D:/Files/Coding/libbeadgff;D:/Files/Coding/libbeadfile;D:/Files/Coding/libbeadtlk;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Files/Coding/
[debug]Source directories searched: D:/Files/Coding;D:/Files/Coding/libbeadgff;D:/Files/Coding/libbeadfile;D:/Files/Coding/libbeadtlk;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Files/Coding/dlgedit/
[debug]Source directories searched: D:/Files/Coding/dlgedit;D:/Files/Coding;D:/Files/Coding/libbeadgff;D:/Files/Coding/libbeadfile;D:/Files/Coding/libbeadtlk;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\Files\Coding\dlgedit\bin\Debug\dlgedit.exe

Child process PID: 17764

[debug][New Thread 17764.0x3dc8]
[debug][New Thread 17764.0x30a0]
[debug][New Thread 17764.0x48d8]
[debug][New Thread 17764.0x38e8]
[debug][New Thread 17764.0x526c]
[debug][New Thread 17764.0x2808]
[debug][New Thread 17764.0x5738]
[debug][New Thread 17764.0x33f0]
[debug][New Thread 17764.0x4068]
[debug][New Thread 17764.0x55f8]
[debug][New Thread 17764.0x3890]
[debug][New Thread 17764.0x2eb0]
[debug][New Thread 17764.0x4c7c]
[debug][New Thread 17764.0x38d0]
[debug][New Thread 17764.0x1fe8]
[debug][New Thread 17764.0x1e38]
[debug][Thread 17764.0x1fe8 exited with code 0]
[debug][New Thread 17764.0x45d4]
[debug][New Thread 17764.0x4d80]
[debug][New Thread 17764.0x6e8]
[debug][New Thread 17764.0x1e94]
[debug][New Thread 17764.0x3ca8]
[debug][New Thread 17764.0x5454]
[debug]    CallContext:[\PickerModalLoop]
[debug][Thread 17764.0x4c7c exited with code 0]
[debug][Thread 17764.0x2eb0 exited with code 0]
[debug]Thread 1 hit Catchpoint 1 (exception thrown), 0x0052d790 in __cxa_throw ()
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Stack level 0, frame at 0x8fe1fc:
[debug] eip = 0x52d790 in __cxa_throw; saved eip = 0x52452a
[debug] called by frame at 0x8fe4bc
[debug] Arglist at 0x8fe1f4, args:
[debug] Locals at 0x8fe1f4, Previous frame's sp is 0x8fe1fc
[debug] Saved registers:
[debug]  eip at 0x8fe1f8
[debug]>>>>>>cb_gdb:

In  ()

[debug]> bt 30
[debug]#0  0x0052d790 in __cxa_throw ()
[debug]#1  0x0052452a in std::__throw_out_of_range_fmt(char const*, ...) ()
[debug]#2  0x00476d1a in std::vector<Tlk::Entry, std::allocator<Tlk::Entry> >::_M_range_check(unsigned int) const ()
[debug]#3  0x004f7a85 in std::vector<Tlk::Entry, std::allocator<Tlk::Entry> >::at(unsigned int) ()
[debug]#4  0x0045b9f0 in DialogDisplay::GenerateDisplayString(bool) ()
[debug]#5  0x00401a3f in RecursiveFillDisplay(bead::integer<unsigned int>, bead::integer<unsigned int>, bead::integer<unsigned int>&, bead::integer<unsigned int>, bool, unsigned int) ()
[debug]#6  0x00402919 in FillRootDisplay(bead::integer<unsigned int>&) ()
[debug]#7  0x004037ed in FillDisplays() ()
[debug]#8  0x0041b066 in FileEditor(int) ()
[debug]#9  0x00425ae9 in Frame::FrameProc(HWND__*, unsigned int, unsigned int, long)@16 ()
[debug]#10 0x753ce0bb in USER32!AddClipboardFormatListener () from C:\windows\System32\user32.dll
[debug]#11 0x753d8849 in USER32!EndTask () from C:\windows\System32\user32.dll
[debug]#12 0x004220f0 in SetMenuItemChecked(unsigned int, bool) ()
[debug]#13 0x753db145 in USER32!EndTask () from C:\windows\System32\user32.dll
[debug]#14 0x00000111 in ?? ()
[debug]#15 0x000000cb in ?? ()
[debug]#16 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:

Here is the call stack. Notice the File and Line fields are mostly empty: