This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH multi-arch GET_LONGJMP_TARGET


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  <rearnsha@arm.com>
>
>         * 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  <muller@ics.u-strasbg.fr>

        * 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]