Package: gdb Version: 6.7.1-2 Severity: normal
I'm having trouble with gdb stopping on SIGTRAP a lot. I can run up to the first breakpoint, then sometimes I try to print or step and gdb will claim that the program is responding to SIGTRAP. I'm debugging C++ code and I'm doing nothing with signals in this code. As an example, I've hit a break point and printing values in a vector. The first value prints fine, then gdb starts doing the following below. The "set unwindonsignal on" doesn't help. I still get SIGTRAPS after this, almost as if gdb thinks there's a breakpoint on every statement from then on. (gdb) p context->h[iwi] $30 = (const int &) @0x8058194: 3 (gdb) p context->h[2] Program received signal SIGTRAP, Trace/breakpoint trap. 0xb7ce6913 in std::vector<int, std::allocator<int> >::operator[] ( this=0x8057d84, __n=2) at /usr/include/c++/4.2/bits/stl_vector.h:489 489 operator[](size_type __n) const The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on" Evaluation of the expression containing the function (std::vector<int, std::allocator<int> >::operator[](unsigned int) const) will be abandoned. (gdb) fin Run till exit from #0 0xb7ce6913 in std::vector<int, std::allocator<int> >::operator[] (this=0x8057d84, __n=2) at /usr/include/c++/4.2/bits/stl_vector.h:489 Program received signal SIGTRAP, Trace/breakpoint trap. std::vector<int, std::allocator<int> >::operator[] (this=0x8057d84, __n=2) at /usr/include/c++/4.2/bits/stl_vector.h:490 490 { return *(this->_M_impl._M_start + __n); } The only way I've been able to work around this and shut gdb up is: handle SIGTRAP noprint nostop However, once I've hit a break point, I find the code tends to execute really slowly. I suspect this is related to the handler change above. But I can't confirm because gdb misbehaves without changing the handler. -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages gdb depends on: ii libc6 2.7-10 GNU C Library: Shared libraries ii libexpat1 1.95.8-4 XML parsing C library - runtime li ii libncurses5 5.6+20080308-1 Shared libraries for terminal hand ii libreadline5 5.2-3 GNU readline and history libraries gdb recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]