From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9876 invoked by alias); 19 Feb 2002 10:42:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9672 invoked from network); 19 Feb 2002 10:42:16 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 19 Feb 2002 10:42:17 -0000 Received: by fw-cam.cambridge.arm.com; id KAA13731; Tue, 19 Feb 2002 10:42:14 GMT Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma013233; Tue, 19 Feb 02 10:41:39 GMT Received: from cam-mail2.cambridge.arm.com (localhost [127.0.0.1]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id KAA10648; Tue, 19 Feb 2002 10:41:39 GMT Received: from sun18.cambridge.arm.com (sun18.cambridge.arm.com [172.16.2.18]) by cam-mail2.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id KAA18603; Tue, 19 Feb 2002 10:41:38 GMT Message-Id: <200202191041.KAA18603@cam-mail2.cambridge.arm.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Pierre Muller cc: gdb-patches@sources.redhat.com, Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: PATCH multi-arch GET_LONGJMP_TARGET In-reply-to: Your message of "Tue, 19 Feb 2002 10:13:54 GMT." <200202191013.KAA15886@cam-mail2.cambridge.arm.com> Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_-6259232160" Date: Tue, 19 Feb 2002 02:42:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-02/txt/msg00493.txt.bz2 This is a multipart MIME message. --==_Exmh_-6259232160 Content-Type: text/plain; charset=us-ascii Content-length: 1467 > > > > This patch makes that > > GET_LONGJMP_TARGET is always defined for all mutiarched target > > (even partial !). > > > > Thus it breaks compilation of Cygwin native GDB, > > because JB_PC and JB_ELEMENT_SIZE are not defined for these targets. > > (and several other i386 targets) > > > > The correct fix would be to add these values to gdbarch ... > > > > The following was committed as an obvious fix. > > Ah, sorry about that. > > Perhaps it would also be sensible to check GET_LONGJMP_TARGET_P() in that > code and always return 0 if it is false. > > I'll go around the other tdep files and clean those up as well. > > R. > Thinking about it, the cleanest way to handle this for now is to change the test for a definition of JB_PC, since unless that is defined the code won't compile, and even if it did it would give the wrong answer. As far as I can tell, apart from i386, only two further ports define GET_LONGJMP_TARGET: arc and sparc. Arc seems never to use the code (there's only one .h file for that port and it doesn't define GET_LONGJMP_TARGET or JB_PC); Sparc seems to define it for pretty much all configurations I can think of. Anyone object to the following patch? I'll leave the x86 code as is for now, since you've already fixed that. R. Richard Earnshaw * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC is defined. * sparc-tdep.c (get_longjmp_target): Likewise. --==_Exmh_-6259232160 Content-Type: text/x-patch ; name="gdb-jbpc.patch"; charset=us-ascii Content-Description: gdb-jbpc.patch Content-Disposition: attachment; filename="gdb-jbpc.patch" Content-length: 1918 Index: arc-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arc-tdep.c,v retrieving revision 1.8 diff -p -r1.8 arc-tdep.c *** arc-tdep.c 2002/02/05 04:37:21 1.8 --- arc-tdep.c 2002/02/19 10:35:26 *************** arc_software_single_step (enum target_si *** 571,577 **** } } ! #ifdef GET_LONGJMP_TARGET /* Figure out where the longjmp will land. Slurp the args out of the stack. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the pc (JB_PC) that we will land at. The pc is copied into PC. --- 571,579 ---- } } ! /* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test ! for a definition of JB_PC. */ ! #ifdef JB_PC /* Figure out where the longjmp will land. Slurp the args out of the stack. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the pc (JB_PC) that we will land at. The pc is copied into PC. Index: sparc-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc-tdep.c,v retrieving revision 1.22 diff -p -r1.22 sparc-tdep.c *** sparc-tdep.c 2002/01/20 19:26:48 1.22 --- sparc-tdep.c 2002/02/19 10:35:26 *************** fill_fpregset (gdb_fpregset_t *fpregsetp *** 1686,1693 **** #endif /* USE_PROC_FS */ ! ! #ifdef GET_LONGJMP_TARGET /* Figure out where the longjmp will land. We expect that we have just entered longjmp and haven't yet setup the stack frame, so the args are still in the --- 1686,1694 ---- #endif /* USE_PROC_FS */ ! /* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test ! for a definition of JB_PC. */ ! #ifdef JB_PC /* Figure out where the longjmp will land. We expect that we have just entered longjmp and haven't yet setup the stack frame, so the args are still in the --==_Exmh_-6259232160--