From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 444 invoked by alias); 13 Sep 2011 13:28:52 -0000 Received: (qmail 430 invoked by uid 22791); 13 Sep 2011 13:28:51 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD,TW_GJ,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Sep 2011 13:28:10 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1R3T22-0005QY-5r for gdb@sourceware.org; Tue, 13 Sep 2011 06:28:10 -0700 Message-ID: <32455704.post@talk.nabble.com> Date: Tue, 13 Sep 2011 13:28:00 -0000 From: adeeshah To: gdb@sourceware.org Subject: Re: How to check that GDB is going to make a longjmp? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <32414505.post@talk.nabble.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00038.txt.bz2 Hi again, sorry for the later reply. Well with some more digging I find out that its not the long jumps that are culprit here. I actually don't know whats the error but I will try to explain my scenerio. - I have a C file called main.c and I create a new C file called main2.c from it. - The main2.c is actually same as main.c but it contains lines like this, #line 112:main.c - Such lines appear after every line in main2.c so that GDB reads these lines and create stack frames from there. - Now when I debug my executable created from main2.c. - Everything works perfect while stepping but right after my program does longjump (even the longjmp executes correctly), and then i try to do step again my stack frames are corrupted. and return me some file with line number which is not correct. I am compiling with Mingw on windows 7 using these flags -ggdb -O0 -falign-functions. Adeel. Kevin Pouget-2 wrote: >=20 > I guess you want to catch longjump of the inferior, not GDB itself, right? >=20 > One way is to set a breakpoint on the `longjmp' function itself, and > then jump over the function, or enter `return' to return directly from > the function without executing its body. > The content of the jmp_bug depends of your system, so you need to > check your local setjmp.h. For instance, you can see in this =C2=B5libC [= 1] > implementation that they use a buffer to store the relevant CPU > registers, with pre-processor macro. >=20 > setjump populates the buffer with the registers, longjmp pushes the > buffer values back to the CPU registers. >=20 >=20 > Cordially, >=20 > Kevin >=20 > [1]: > http://cristi.indefero.net/p/uClibc-cristi/source/tree/0_9_29_rc1/libc/sy= sdeps/linux/cris/bits/setjmp.h >=20 > On Wed, Sep 7, 2011 at 11:10 AM, adeeshah wrote: >> >> Hi, >> >> I want to avoid the GDB's longjmp. Is there a way to check that GDB is >> going >> to make a longjmp? >> >> How can i check the contents of jmp_buf? >> >> Adeel. >> -- >> View this message in context: >> http://old.nabble.com/How-to-check-that-GDB-is-going-to-make-a-longjmp--= tp32414505p32414505.html >> Sent from the Sourceware - gdb list mailing list archive at Nabble.com. >> >=20 >=20 --=20 View this message in context: http://old.nabble.com/How-to-check-that-GDB-i= s-going-to-make-a-longjmp--tp32414505p32455704.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.