From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17093 invoked by alias); 23 Dec 2003 15:03:09 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 17085 invoked from network); 23 Dec 2003 15:03:07 -0000 Received: from unknown (HELO e2.ny.us.ibm.com) (32.97.182.102) by sources.redhat.com with SMTP; 23 Dec 2003 15:03:07 -0000 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e2.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id hBNF36d6428208 for ; Tue, 23 Dec 2003 10:03:06 -0500 Received: from srikrishnan (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with SMTP id hBNF33ss119692; Tue, 23 Dec 2003 10:03:05 -0500 Message-ID: <00e501c3c966$3fc1ab90$fd0eb609@srikrishnan> From: "srikrish" To: References: <00c701c3c965$424c6a90$fd0eb609@srikrishnan> Subject: Re: gdb stack trace shows only those frames after the signal Date: Tue, 23 Dec 2003 15:03:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00258.txt.bz2 Hi - I'm sorry for the formatting problems in my previous post. After handling a signal the previous stack trace is lost. Is this a known problem? Any fixes? Hardware Environment: Intel x86 Software Environment: RHEL 3; gdb-5.3.90-0.20030710.40rh; glibc 2.3.2-95.6; gcc 3.2.3 20030502 Steps to Reproduce: 1. compile the testcase (under Additinal Info below) with "gcc -o t mytrap.c" 2. run "t" 3. attach gdb to the "t"'s PID and type "where" Actual Results: [root@localhost root]# gdb GNU gdb Red Hat Linux (5.3.90-0.20030710.40rh) This GDB was configured as "i386-redhat-linux-gnu". (gdb) attach 2032 Attaching to process 2032 Reading symbols from /home/krishna/t...done. Using host libthread_db library "/lib/libthread_db.so.1". Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 0xb755d8cb in pause () from /lib/libc.so.6 (gdb) where #0 0xb755d8cb in pause () from /lib/libc.so.6 #1 0x0804840f in function2 () at mytrap.c:8 #2 0x0804842c in function1 () at mytrap.c:15 #3 0x08048449 in SIGSEGVhandler (sig=11, info=0xbfffa5a0, ucontext=0xbfffa620) at mytrap.c:22 #4 (gdb) frame 5 #0 0x00000000 in ?? () (gdb) Expected Results: the stack traceback should display functionb, functiona, and main for this testcase mytrap.c: #include #include #include void function2( void ) { printf( "Now in function2.. pausing.. pid = %d\n", getpid() ); pause(); } void function1( void ) { printf( "Now in function1\n" ); function2(); } void SIGSEGVhandler( int sig, siginfo_t *info, void *ucontext ) { printf( "Now in SIGSEGVhandler\n" ); function1(); } void functionb( void ) { char *p = NULL; printf( "Now in functionb... causing sig11...\n" ); *p = 'x'; /* forcing SEGFAULT */ } void functiona( void ) { printf( "Now in functiona\n" ); functionb(); } int main( void ) { struct sigaction newact; struct sigaction oldact; newact.sa_sigaction = SIGSEGVhandler; newact.sa_flags = SA_SIGINFO; sigaction( SIGSEGV, &newact, &oldact ); printf( "About to call functiona\n" ); functiona(); return 0; } Srikrishnan