From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11593 invoked by alias); 19 Feb 2002 08:48:59 -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 11398 invoked from network); 19 Feb 2002 08:48:37 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 19 Feb 2002 08:48:37 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id JAA31799; Tue, 19 Feb 2002 09:48:33 +0100 Message-Id: <4.2.0.58.20020219092651.00ad0668@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Tue, 19 Feb 2002 00:48:00 -0000 To: gdb-patches@sources.redhat.com From: Pierre Muller Subject: Re: PATCH multi-arch GET_LONGJMP_TARGET Cc: Richard.Earnshaw@arm.com In-Reply-To: <200202181337.NAA19035@cam-mail2.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-SW-Source: 2002-02/txt/msg00489.txt.bz2 At 14:37 18/02/2002 , Richard Earnshaw a écrit: >This patch multi-arches GET_LONGJMP_TARGET, using the predicate variant >with >GET_LONGJMP_TARGET_P() telling us whether the architecture supports this >or not. > >Committed as obvious for multi-arch. > >R. > >2002-02-18 Richard Earnshaw > > * gdbarch.sh (GET_LONGJMP_TARGET): Add rule. > * gdbarch.c gdbarch.h: Regenerate. > * breakpoint.c (create_longjmp_breakpoint): Always compile this > function. > (breakpoint_reset): Test GET_LONGJMP_TARGET_P(). > * infrun.c (GET_LONGJMP_TARGET): Delete default definition. > (handle_inferior_event): Test GET_LONGJMP_TARGET_P(). > > * arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields. > * arm-tdep.c (arm_get_longjmp_target): New function. > (arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes > this to a positive value register arm_get_longjmp_target as the > longjmp handler. > * arm-linux-tdep.c (arm_get_longjmp_target): Delete. > (arm_linux_init_abi): Set up longjmp description in tdep. > * armnbsd-nat.c (get_longjmp_target): Delete. > * armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp > description in tdep. > * config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete. > (get_longjmp_target): Delete declaration. > (GET_LONGJMP_TARGET): Delete. > * config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration. > (GET_LONGJMP_TARGET): Delete. 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. 2002-02-19 Pierre Muller * i386-tdep.c (get_longjmp_target): Fix compilation failure by setting dummy values to JB_PC and JB_ELEMENT_SIZE if not defined. Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.50 diff -u -p -r1.50 i386-tdep.c --- i386-tdep.c 2002/01/01 16:29:43 1.50 +++ i386-tdep.c 2002/02/19 08:42:36 @@ -839,6 +839,16 @@ i386_pop_frame (void) #ifdef GET_LONGJMP_TARGET +/* FIXME: Multi-arching does not set JB_PC and JB_ELEMENT_SIZE yet. + Fill in with dummy value to enable compilation. */ +#ifndef JB_PC +#define JB_PC 0 +#endif /* JB_PC */ + +#ifndef JB_ELEMENT_SIZE +#define JB_ELEMENT_SIZE 4 +#endif /* JB_ELEMENT_SIZE */ + /* 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 Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99