Author Topic: Problems with debugger in 16.01  (Read 4303 times)

Offline G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Problems with debugger in 16.01
« on: April 26, 2016, 07:09:43 pm »
Hi!
I faced a several problems while trying to debug my code in C::B 16.01 (there was no such problems in 15.12 and  pre-16.01 nightlies). I`m not sure if all this problems are C::B related, so I post it here instead of bugtarcker.

My system:
C::B:   Release 16.01 rev 10702, windows unicode 32-bit.
OS:     Windwos 7 Pro (x64)
GCC:    tdm64-1 5.1.0
GDB:    GNU gdb (GDB) 7.9.1 (x64)

Problem #1:

While debugging multi-threaded application, when switching stack frame "Threads" window suddenly shows call stack information, and "call stack" window becomes empty. Click on such "threads" actually do switches threads and updates call stack. I mean, if I have 5 threads, I still could switch it clicking on first 5 lines of text (call stack) and other lines do nothing. Just like Threads window works fine but it contents displayed incorrectly.
Sometimes repeated switch of stack frame restores threads list. But, on the other hand, rarely some actions makes "Watches" window show call stack contents as well.

From the debugger log it looks like C::B asks GDB for threads list before previous command output completes. Here is partial log:

Code
-----------------------------------------
[debug]> info args
[debug]>>>>>>cb_gdb:this = 0x1e067b8
[debug]> bt 30
[debug]__in_chrg = <optimized out>
[debug]>>>>>>cb_gdb:
[debug]> info threads
[debug]#0  0x000007fefe945b80 in strlen () from C:\Windows\system32\msvcrt.dll
[debug]#1  0x000000006e519a4e in __pformat_puts (stream=<optimized out>, s=<optimized out>) at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/stdio/mingw_pformat.c:560
[debug]#2  __mingw_pformat (flags=0, dest=<optimized out>, max=<optimized out>, fmt=0x4a810f <std::ignore+146> "\" at [%d;%d]\n", argv=0x22f840 "") at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/stdio/mingw_pformat.c:2394
[debug]#3  0x000000006e514aa7 in __mingw_vsnprintf (buf=0x22f3f0 "Destroying texture in Atlas \"\a", length=1023, fmt=<optimized out>, argv=<optimized out>) at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/stdio/mingw_vsnprintf.c:47
[debug]#4  0x000000006e524d56 in vsnprintf (__stream=0x22f3f0 "Destroying texture in Atlas \"\a", __n=1024, __format=0x4a80f0 <std::ignore+115> "Destroying texture in Atlas \"%s\" at [%d;%d]\n", __local_argv=0x22f838 "оюоюоюою") at D:/gcc/TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:352
[debug]#5  0x000000006e502e90 in SE2D::Logger::Printf (this=0x6e5e0040 <SE2D::LOG>, nLevel=5, pFormat=0x4a80f0 <std::ignore+115> "Destroying texture in Atlas \"%s\" at [%d;%d]\n") at R:\SE2D\src\logger.cpp:387
[debug]#6  0x00000000004249f4 in SE2D::Texture::~Texture (this=0x1e067b8, __in_chrg=<optimized out>) at ../include/texture.h:50
[debug]#7  0x000000000049fbf5 in std::_Destroy<SE2D::Texture> (__pointer=0x1e067b8) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_construct.h:93
[debug]#8  0x000000000047515b in std::_Destroy_aux<false>::__destroy<SE2D::Texture*> (__first=0x1e067b8, __last=0x1e06860) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_construct.h:103
[debug]#9  0x000000000049fc80 in std::_Destroy<SE2D::Texture*> (__first=0x1e06780, __last=0x1e06860) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_construct.h:126
[debug]#10 0x000000000049fcb4 in std::_Destroy<SE2D::Texture*, SE2D::Texture> (__first=0x1e06780, __last=0x1e06860) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_construct.h:151
[debug]#11 0x000000000048f135 in std::vector<SE2D::Texture, std::allocator<SE2D::Texture> >::~vector (this=0x22fa10, __in_chrg=<optimized out>) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/stl_vector.h:424
[debug]#12 0x00000000004035e9 in TEST_Sprites () at R:\SE2D\test\main.cpp:401
[debug]#13 0x00000000004038fc in SDL_main (argc=1, argv=0x2f0010) at R:\SE2D\test\main.cpp:587
[debug]#14 0x00000000004050fa in main_utf8 (argv=0x2f0010, argc=<optimized out>) at ../src/main/windows/SDL_windows_main.c:126
[debug]#15 WinMain (hInst=<optimized out>, hPrev=hPrev@entry=0x0, szCmdLine=<optimized out>, sw=<optimized out>) at ../src/main/windows/SDL_windows_main.c:189
[debug]#16 0x00000000004a5112 in main (flags=<optimized out>, cmdline=<optimized out>, inst=<optimized out>) at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crt0_c.c:18
[debug]#17 0x00000000004013e8 in __tmainCRTStartup () at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crtexe.c:332
[debug]#18 0x000000000040151b in mainCRTStartup () at C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crtexe.c:212
[debug]>>>>>>cb_gdb:
[debug]  Id   Target Id         Frame
[debug]  5    Thread 4540.0x1180 0x000000007778fefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]  4    Thread 4540.0x428 0x000000007778fefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]  3    Thread 4540.0xb78 0x000000007779046a in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SYSTEM32\ntdll.dll
[debug]  2    Thread 4540.0xdb0 0x000000007778fefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]* 1    Thread 4540.0x1040 0x000007fefe945b80 in strlen () from C:\Windows\system32\msvcrt.dll
[debug]>>>>>>cb_gdb:
-----------------------------------------

Problem #2:

When console process is running, it could not be stopped nor paused. If I run it free (no debugger) - "Abort" button just hides its window, but all processes continue to run in background (conhost.exe, cb_console_runner.exe and test.exe).
It I run it under debugger, both "Pause" and "Stop" buttons does nothing. Only message "Trying to interrupt process with pid: 1596; child pid: 1596 gdb pid: 3112" appears. Process tree looks like that:
Code
csrss.exe
  conhost.exe [2976]
  conhost.exe [3156]
codeblocks.exe
  gdb.exe [3112]
    gdb.exe [4872]
      test.exe [1596]

Problem #3:

After debugee stopped on breakpoint and then terminated using stop button, if I run another debug session, it starts with the "Call stack" filled with information from the point it was terminated last time. Note that I use "Do *not* run debugee" setting enabled. After I run it to the some breakpoint in main() call stack refreshed with correct actual data.

Also, may be related: after I close workspace and open another one, "Build log" and "Build messages" not cleared and still contains old logs.


Is all this problems could be a C::B bugs or could be solved somehow? Thanks for your time and help!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Problems with debugger in 16.01
« Reply #1 on: April 27, 2016, 12:54:01 am »
#1 seems like a bug, but I don't know if I can reproduce it. Can you prepare a simple sample project that can be used to reproduce it?
#2 known bug, I have one solution, but it doesn't handle the gdb.exe calling another gdb.exe then calling the debugee. If I can think of a way to detect this case (which is windows only) I can solve this problem.
#3 this is how it works, probably it could be fixed, but I don't think it is some serious issue
(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: Problems with debugger in 16.01
« Reply #2 on: April 27, 2016, 11:53:06 am »
Thanks for your reply. I could stable reproduce #1. I just created simple code (C++11):
Code
#include <iostream>
#include <thread>

void ThreadProc()
{
  std::cout << "I`m a thread!\n";
  *(char*)NULL = 42; // Good bye, cruel world.
}
 
int main()
{
  std::cout << "Hello!\n";
  std::thread Thrd(ThreadProc);
  Thrd.join();
  std::cout << "Good bye\n";
}

You coud catch null pointer dereference as in my project or just set breakpoint somewhere.
1) Run in debug mode and stop on breakpoint or on error when both threads exists.
2) When I switch thread to #1 (main) first time - it looks like it switched (looking on the stack) but still old shows thread #2 as an active one.
3) When I switch it once again - it corrupts threads list and clears stack window.
4) After some more switches of threads and call stack frames I was able to reproduce Watches window corruption.

Debugger log below (I separated with "=====" startup, 1st thread switch and 2nd thread swtich).
Also screenshots available for steps 1..4 above:
Step 1
Step 2
Step 3
Step 4

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Denis\Projects\TEST\GdbTest\
Adding source dir: D:\Denis\Projects\TEST\GdbTest\
Adding file: D:\Denis\Projects\TEST\GdbTest\bin\Debug\GdbTest.exe
Changing directory to: D:/Denis/Projects/TEST/GdbTest/.
Set variable: PATH=.;D:\gcc\TDM-GCC-64\bin;D:\gcc\TDM-GCC-64;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;E:\altera\13.0sp1\quartus\bin;C:\Program Files (x86)\CMake\bin;D:\MICRO\Linux;C:\Program Files\TortoiseHg;C:\Program Files\Git\cmd;D:\Denis\MyTools

[debug]Command-line: D:\gcc\TDM-GCC-64\gdb64\bin\gdb.exe -nx -fullname -quiet  -args D:/Denis/Projects/TEST/GdbTest/bin/Debug/GdbTest.exe
[debug]Working dir : D:\Denis\Projects\TEST\GdbTest

Starting debugger: D:\gcc\TDM-GCC-64\gdb64\bin\gdb.exe -nx -fullname -quiet  -args D:/Denis/Projects/TEST/GdbTest/bin/Debug/GdbTest.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 D:/Denis/Projects/TEST/GdbTest/bin/Debug/GdbTest.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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) 7.9.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 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 D:\Denis\AlienSVN\SDL2\src
directory D:\Denis\AlienSVN\SDL2_image
directory D:\Denis\AlienSVN\SDL2_mixer
directory D:\Denis\AlienSVN\SDL2_net
directory D:\Denis\AlienSVN\SDL2_ttf
[debug]Source directories searched: D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]>>>>>>cb_gdb:Source directories searched: D:DenisAlienSVNSDL2_image;D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]> directory D:/Denis/Projects/TEST/GdbTest/
[debug]>>>>>>cb_gdb:Source directories searched: D:DenisAlienSVNSDL2_mixer;D:DenisAlienSVNSDL2_image;D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]>>>>>>cb_gdb:Source directories searched: D:DenisAlienSVNSDL2_net;D:DenisAlienSVNSDL2_mixer;D:DenisAlienSVNSDL2_image;D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]>>>>>>cb_gdb:Source directories searched: D:DenisAlienSVNSDL2_ttf;D:DenisAlienSVNSDL2_net;D:DenisAlienSVNSDL2_mixer;D:DenisAlienSVNSDL2_image;D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]>>>>>>cb_gdb:Source directories searched: D:/Denis/Projects/TEST/GdbTest;D:DenisAlienSVNSDL2_ttf;D:DenisAlienSVNSDL2_net;D:DenisAlienSVNSDL2_mixer;D:DenisAlienSVNSDL2_image;D:DenisAlienSVNSDL2src;$cdir;$cwd
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> run
[debug]Starting program: D:\Denis\Projects\TEST\GdbTest\bin\Debug\GdbTest.exe

Child process PID: 2884

[debug][New Thread 2884.0xb78]
[debug][New Thread 2884.0xe88]
[debug]Program received signal SIGSEGV, Segmentation fault.
[debug][Switching to Thread 2884.0xe88]
[debug]0x000000000040168e in ThreadProc () at D:\Denis\Projects\TEST\GdbTest\main.cpp:8
[debug]D:\Denis\Projects\TEST\GdbTest\main.cpp:8:118:beg:0x40168e
[debug]>>>>>>cb_gdb:

Program received signal SIGSEGV, Segmentation fault.
At D:\Denis\Projects\TEST\GdbTest\main.cpp:8

[debug]> info locals
[debug]No locals.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No arguments.
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0  0x000000000040168e in ThreadProc () at D:\Denis\Projects\TEST\GdbTest\main.cpp:8
[debug]#1  0x0000000000471668 in std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) (this=0x2d2368) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/functional:1531
[debug]#2  0x00000000004716f7 in std::_Bind_simple<void (*())()>::operator()() (this=0x2d2368) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/functional:1520
[debug]#3  0x0000000000492a2c in std::thread::_Impl<std::_Bind_simple<void (*())()> >::_M_run() (this=0x2d2350) at D:/gcc/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/thread:115
[debug]#4  0x00000000004a8300 in execute_native_thread_routine ()
[debug]#5  0x000000000041d9f7 in pthread_create_wrapper ()
[debug]#6  0x000007fefe4d42bf in sqrt () from C:\Windows\system32\msvcrt.dll
[debug]#7  0x000007fefe4d7459 in msvcrt!_beginthreadex () from C:\Windows\system32\msvcrt.dll
[debug]#8  0x000000007765f56d in KERNEL32!BaseThreadInitThunk () from C:\Windows\system32\kernel32.dll
[debug]#9  0x0000000077793281 in ntdll!RtlUserThreadStart () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#10 0x0000000000000000 in ?? ()
[debug]Backtrace stopped: previous frame inner to this frame (corrupt stack?)
[debug]>>>>>>cb_gdb:
[debug]> info threads
[debug]  Id   Target Id         Frame
[debug]* 2    Thread 2884.0xe88 0x000000000040168e in ThreadProc () at D:\Denis\Projects\TEST\GdbTest\main.cpp:8
[debug]  1    Thread 2884.0xb78 0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]>>>>>>cb_gdb:

===========================================================================

[debug]> thread 1
[debug][Switching to thread 1 (Thread 2884.0xb78)]
[debug]#0  0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0  0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#1  0x000007fefd9810ac in WaitForSingleObjectEx () from C:\Windows\system32\KernelBase.dll
[debug]#2  0x000000000041f73d in pthread_join ()
[debug]#3  0x00000000004929fa in std::thread::join() ()
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]>>>>>>cb_gdb:
[debug]> frame 4
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]D:\Denis\Projects\TEST\GdbTest\main.cpp:15:248:beg:0x4016dd
[debug]>>>>>>cb_gdb:

#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
D:\Denis\Projects\TEST\GdbTest\main.cpp:15:248:beg:0x4016dd

===========================================================================


[debug]> thread 1
[debug][Switching to thread 1 (Thread 3952.0x758)]
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]D:\Denis\Projects\TEST\GdbTest\main.cpp:15:248:beg:0x4016dd
[debug]>>>>>>cb_gdb:
[debug]> bt 30

At D:\Denis\Projects\TEST\GdbTest\main.cpp:15

[debug]> bt 30
[debug]#0  0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#1  0x000007fefd9810ac in WaitForSingleObjectEx () from C:\Windows\system32\KernelBase.dll
[debug]#2  0x000000000041f73d in pthread_join ()
[debug]#3  0x00000000004929fa in std::thread::join() ()
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]>>>>>>cb_gdb:#0  0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]> info locals
[debug]#1  0x000007fefd9810ac in WaitForSingleObjectEx () from C:\Windows\system32\KernelBase.dll
[debug]#2  0x000000000041f73d in pthread_join ()
[debug]#3  0x00000000004929fa in std::thread::join() ()
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]>>>>>>cb_gdb:Thrd = {
[debug]> info args
[debug]  _M_id = {
[debug]    _M_thread = 2
[debug]  }
[debug]}
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]No arguments.
[debug]>>>>>>cb_gdb:
[debug]> if 1
disassemble 0x4016dd
info frame
end
[debug]#0  0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]#1  0x000007fefd9810ac in WaitForSingleObjectEx () from C:\Windows\system32\KernelBase.dll
[debug]#2  0x000000000041f73d in pthread_join ()
[debug]#3  0x00000000004929fa in std::thread::join() ()
[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]>>>>>>cb_gdb: > > >Dump of assembler code for function main():

Failure finding "Stack level "
Failure matching reg_output

[debug]> info threads
[debug]   0x0000000000401698 <+0>: push   %rbp
[debug]   0x0000000000401699 <+1>: push   %rbx
[debug]   0x000000000040169a <+2>: sub    $0x38,%rsp
[debug]   0x000000000040169e <+6>: lea    0x80(%rsp),%rbp
[debug]   0x00000000004016a6 <+14>: callq  0x40d920 <__main>
[debug]   0x00000000004016ab <+19>: lea    0xaa995(%rip),%rdx        # 0x4ac047 <__gnu_cxx::__default_lock_policy+19>
[debug]   0x00000000004016b2 <+26>: mov    0xafc17(%rip),%rcx        # 0x4b12d0 <.refptr._ZSt4cout>
[debug]   0x00000000004016b9 <+33>: callq  0x4a4e60 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x00000000004016be <+38>: lea    -0x60(%rbp),%rax
[debug]   0x00000000004016c2 <+42>: lea    -0x5b(%rip),%rdx        # 0x40166e <ThreadProc()>
[debug]   0x00000000004016c9 <+49>: mov    %rax,%rcx
[debug]   0x00000000004016cc <+52>: callq  0x492b40 <std::thread::thread<void (&)()>(void (&)())>
[debug]   0x00000000004016d1 <+57>: lea    -0x60(%rbp),%rax
[debug]   0x00000000004016d5 <+61>: mov    %rax,%rcx
[debug]   0x00000000004016d8 <+64>: callq  0x4929d0 <std::thread::join()>
[debug]=> 0x00000000004016dd <+69>: lea    0xaa96b(%rip),%rdx        # 0x4ac04f <__gnu_cxx::__default_lock_policy+27>
[debug]   0x00000000004016e4 <+76>: mov    0xafbe5(%rip),%rcx        # 0x4b12d0 <.refptr._ZSt4cout>
[debug]   0x00000000004016eb <+83>: callq  0x4a4e60 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x00000000004016f0 <+88>: lea    -0x60(%rbp),%rax
[debug]   0x00000000004016f4 <+92>: mov    %rax,%rcx
[debug]   0x00000000004016f7 <+95>: callq  0x492c00 <std::thread::~thread()>
[debug]   0x00000000004016fc <+100>: mov    $0x0,%eax
[debug]   0x0000000000401701 <+105>: jmp    0x40171d <main()+133>
[debug]   0x0000000000401703 <+107>: mov    %rax,%rbx
[debug]   0x0000000000401706 <+110>: lea    -0x60(%rbp),%rax
[debug]   0x000000000040170a <+114>: mov    %rax,%rcx
[debug]   0x000000000040170d <+117>: callq  0x492c00 <std::thread::~thread()>
[debug]   0x0000000000401712 <+122>: mov    %rbx,%rax
[debug]   0x0000000000401715 <+125>: mov    %rax,%rcx
[debug]   0x0000000000401718 <+128>: callq  0x40f0d0 <_Unwind_Resume>
[debug]   0x000000000040171d <+133>: add    $0x38,%rsp
[debug]   0x0000000000401721 <+137>: pop    %rbx
[debug]   0x0000000000401722 <+138>: pop    %rbp
[debug]   0x0000000000401723 <+139>: retq   
[debug]End of assembler dump.
[debug]Stack level 4, frame at 0x22fe60:
[debug] rip = 0x4016dd in main (D:\Denis\Projects\TEST\GdbTest\main.cpp:15); saved rip = 0x4013e8
[debug] caller of frame at 0x22fe10
[debug] source language c++.
[debug] Arglist at 0x22fe10, args:
[debug] Locals at 0x22fe10, Previous frame's sp is 0x22fe60
[debug] Saved registers:
[debug]  rbx at 0x22fe48, rbp at 0x22fe50, rip at 0x22fe58, xmm15 at 0x22fe58
[debug]>>>>>>cb_gdb:  Id   Target Id         Frame
[debug]> frame 4
[debug]  2    Thread 3952.0xb98 0x000000000040168e in ThreadProc () at D:\Denis\Projects\TEST\GdbTest\main.cpp:8
[debug]* 1    Thread 3952.0x758 0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll
[debug]>>>>>>cb_gdb:

  2    Thread 3952.0xb98 0x000000000040168e in ThreadProc () at D:\Denis\Projects\TEST\GdbTest\main.cpp:8
* 1    Thread 3952.0x758 0x00000000777afefa in ntdll!ZwWaitForSingleObject () from C:\Windows\SYSTEM32\ntdll.dll

[debug]#4  0x00000000004016dd in main () at D:\Denis\Projects\TEST\GdbTest\main.cpp:15
[debug]D:\Denis\Projects\TEST\GdbTest\main.cpp:15:248:beg:0x4016dd
[debug]>>>>>>cb_gdb:

Offline G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problems with debugger in 16.01
« Reply #3 on: April 27, 2016, 02:55:56 pm »
Just tried to build 32-bit executable and use 32-bit gcc. Threads window is not corrupted, but threads ciuld not be switched properly. After switching from thread 2 to 1, call stack updates, but active thread stays 2-nd and I could not switch back to it anymore, except with manual "thread 2" command.in gdb console.