* GDB broken on MIPS targets with unmarked binaries
@ 2002-06-05 13:08 Daniel Jacobowitz
2002-06-05 13:44 ` Andrew Cagney
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-06-05 13:08 UTC (permalink / raw)
To: gdb
There's an interesting crash on startup in a mips-elf GDB nowadays... the
code reads:
default:
tdep->mips_abi_string = "default";
tdep->mips_default_saved_regsize = MIPS_REGSIZE;
tdep->mips_default_stack_argsize = MIPS_REGSIZE;
tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) == 8);
tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1;
tdep->mips_regs_have_home_p = 1;
tdep->gdb_target_is_mips64 = 0;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
break;
Something brought in recently, probably by the OS ABI changes if I had to
guess, is causing the check of REGISTER_VIRTUAL_SIZE to fail. I've no idea
why. Compiling a mips-elf (not mips-linux, which sets MIPS_DEFAULT_ABI) and
running gdb on an unmarked ELF binary reproduces this.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-05 13:08 GDB broken on MIPS targets with unmarked binaries Daniel Jacobowitz @ 2002-06-05 13:44 ` Andrew Cagney 2002-06-05 14:03 ` Daniel Jacobowitz 0 siblings, 1 reply; 9+ messages in thread From: Andrew Cagney @ 2002-06-05 13:44 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb > There's an interesting crash on startup in a mips-elf GDB nowadays... the > code reads: > > default: > tdep->mips_abi_string = "default"; > tdep->mips_default_saved_regsize = MIPS_REGSIZE; > tdep->mips_default_stack_argsize = MIPS_REGSIZE; > tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) == 8); > tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; > tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; > tdep->mips_regs_have_home_p = 1; > tdep->gdb_target_is_mips64 = 0; > tdep->default_mask_address_p = 0; > set_gdbarch_long_bit (gdbarch, 32); > set_gdbarch_ptr_bit (gdbarch, 32); > set_gdbarch_long_long_bit (gdbarch, 64); > break; > > Something brought in recently, probably by the OS ABI changes if I had to > guess, is causing the check of REGISTER_VIRTUAL_SIZE to fail. I've no idea > why. Compiling a mips-elf (not mips-linux, which sets MIPS_DEFAULT_ABI) and > running gdb on an unmarked ELF binary reproduces this. I'd suspect this: 2002-05-08 Andrew Cagney <ac131313@redhat.com> * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. (clear_gdbarch_swap): New function. (initialize_non_multiarch): Call. (gdbarch_update_p): Before calling init(), swap out and clear the existing architecture. * gdbarch.c: Regenerate. The comment from arm-tdep.c should help explain why the above code is broken: /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still references the old architecture vector, not the one we are building here. */ prologue_cache.saved_regs = (CORE_ADDR *) xcalloc (1, (sizeof (CORE_ADDR) * (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch)))); As far as I can tell though, REGISTER_VIRTUAL_SIZE expands to REGISTER_VIRTUAL_TYPE which is still a macro? Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-05 13:44 ` Andrew Cagney @ 2002-06-05 14:03 ` Daniel Jacobowitz 2002-06-05 14:12 ` Daniel Jacobowitz 0 siblings, 1 reply; 9+ messages in thread From: Daniel Jacobowitz @ 2002-06-05 14:03 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb On Wed, Jun 05, 2002 at 04:44:21PM -0400, Andrew Cagney wrote: > >There's an interesting crash on startup in a mips-elf GDB nowadays... the > >code reads: > > > > default: > > tdep->mips_abi_string = "default"; > > tdep->mips_default_saved_regsize = MIPS_REGSIZE; > > tdep->mips_default_stack_argsize = MIPS_REGSIZE; > > tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) > > == 8); > > tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; > > tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; > > tdep->mips_regs_have_home_p = 1; > > tdep->gdb_target_is_mips64 = 0; > > tdep->default_mask_address_p = 0; > > set_gdbarch_long_bit (gdbarch, 32); > > set_gdbarch_ptr_bit (gdbarch, 32); > > set_gdbarch_long_long_bit (gdbarch, 64); > > break; > > > >Something brought in recently, probably by the OS ABI changes if I had to > >guess, is causing the check of REGISTER_VIRTUAL_SIZE to fail. I've no idea > >why. Compiling a mips-elf (not mips-linux, which sets MIPS_DEFAULT_ABI) > >and > >running gdb on an unmarked ELF binary reproduces this. > > I'd suspect this: > > 2002-05-08 Andrew Cagney <ac131313@redhat.com> > > * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. > (clear_gdbarch_swap): New function. > (initialize_non_multiarch): Call. > (gdbarch_update_p): Before calling init(), swap out and clear the > existing architecture. > * gdbarch.c: Regenerate. > > The comment from arm-tdep.c should help explain why the above code is > broken: > > /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still > references the old architecture vector, not the one we are > building here. */ > prologue_cache.saved_regs = (CORE_ADDR *) > xcalloc (1, (sizeof (CORE_ADDR) > * (gdbarch_num_regs (gdbarch) > + gdbarch_num_pseudo_regs (gdbarch)))); > > As far as I can tell though, REGISTER_VIRTUAL_SIZE expands to > REGISTER_VIRTUAL_TYPE which is still a macro? The expansion appears to be: tdep->mips_fp_register_double = (((((38) >= 38 && (38) < 38 +32) ? builtin_type_float : ((38) == 32 ) ? builtin_type_uint32 : ((38) >= 70 && (38) <= 89) ? builtin_type_uint32 : builtin_type_int))->main_type->length == 8); I can't see any reason for it to crash; I haven't reproduced this locally yet, although I'm working on it. The above expansion came from the second person to mention this to me. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-05 14:03 ` Daniel Jacobowitz @ 2002-06-05 14:12 ` Daniel Jacobowitz 2002-06-05 14:41 ` Andrew Cagney 0 siblings, 1 reply; 9+ messages in thread From: Daniel Jacobowitz @ 2002-06-05 14:12 UTC (permalink / raw) To: Andrew Cagney, gdb On Wed, Jun 05, 2002 at 04:58:34PM -0400, Daniel Jacobowitz wrote: > On Wed, Jun 05, 2002 at 04:44:21PM -0400, Andrew Cagney wrote: > > >There's an interesting crash on startup in a mips-elf GDB nowadays... the > > >code reads: > > > > > > default: > > > tdep->mips_abi_string = "default"; > > > tdep->mips_default_saved_regsize = MIPS_REGSIZE; > > > tdep->mips_default_stack_argsize = MIPS_REGSIZE; > > > tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) > > > == 8); > > > tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; > > > tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; > > > tdep->mips_regs_have_home_p = 1; > > > tdep->gdb_target_is_mips64 = 0; > > > tdep->default_mask_address_p = 0; > > > set_gdbarch_long_bit (gdbarch, 32); > > > set_gdbarch_ptr_bit (gdbarch, 32); > > > set_gdbarch_long_long_bit (gdbarch, 64); > > > break; > > > > > >Something brought in recently, probably by the OS ABI changes if I had to > > >guess, is causing the check of REGISTER_VIRTUAL_SIZE to fail. I've no idea > > >why. Compiling a mips-elf (not mips-linux, which sets MIPS_DEFAULT_ABI) > > >and > > >running gdb on an unmarked ELF binary reproduces this. > > > > I'd suspect this: > > > > 2002-05-08 Andrew Cagney <ac131313@redhat.com> > > > > * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. > > (clear_gdbarch_swap): New function. > > (initialize_non_multiarch): Call. > > (gdbarch_update_p): Before calling init(), swap out and clear the > > existing architecture. > > * gdbarch.c: Regenerate. > > > > The comment from arm-tdep.c should help explain why the above code is > > broken: > > > > /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still > > references the old architecture vector, not the one we are > > building here. */ > > prologue_cache.saved_regs = (CORE_ADDR *) > > xcalloc (1, (sizeof (CORE_ADDR) > > * (gdbarch_num_regs (gdbarch) > > + gdbarch_num_pseudo_regs (gdbarch)))); > > > > As far as I can tell though, REGISTER_VIRTUAL_SIZE expands to > > REGISTER_VIRTUAL_TYPE which is still a macro? > > The expansion appears to be: > tdep->mips_fp_register_double = (((((38) >= 38 && (38) < 38 +32) ? > builtin_type_float : ((38) == 32 ) ? > builtin_type_uint32 : ((38) >= 70 && (38) <= 89) ? > builtin_type_uint32 : > builtin_type_int))->main_type->length == 8); > > I can't see any reason for it to crash; I haven't reproduced this > locally yet, although I'm working on it. The above expansion came from > the second person to mention this to me. I believe you're right about the patch at fault, though I don't know what to do about it. This makes builtin_type_int == NULL during evaluation of that expression, along with all the others. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-05 14:12 ` Daniel Jacobowitz @ 2002-06-05 14:41 ` Andrew Cagney 2002-06-06 18:44 ` Daniel Jacobowitz 0 siblings, 1 reply; 9+ messages in thread From: Andrew Cagney @ 2002-06-05 14:41 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb > The expansion appears to be: >> tdep->mips_fp_register_double = (((((38) >= 38 && (38) < 38 +32) ? >> builtin_type_float : ((38) == 32 ) ? >> builtin_type_uint32 : ((38) >= 70 && (38) <= 89) ? >> builtin_type_uint32 : >> builtin_type_int))->main_type->length == 8); >> >> I can't see any reason for it to crash; I haven't reproduced this >> locally yet, although I'm working on it. The above expansion came from >> the second person to mention this to me. > > > I believe you're right about the patch at fault, though I don't know > what to do about it. This makes builtin_type_int == NULL during > evaluation of that expression, along with all the others. The patch isn't `at fault' - it is detecting a fault in mips_tdep.c :-) builtin_type_float would have contained a value from the previously selected ISA. That code is trying to reverse engineer the header files to figure out what the default should be for the given target. I think better would be to is set mips_fp_register_double=-1 and then change FP_REGISTER_DOUBLE to a real function (gdb multi-arch can now be assumed) that, when -1, apply the above logic (and even update the result). enjoy, Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-05 14:41 ` Andrew Cagney @ 2002-06-06 18:44 ` Daniel Jacobowitz 2002-06-07 12:55 ` Andrew Cagney 0 siblings, 1 reply; 9+ messages in thread From: Daniel Jacobowitz @ 2002-06-06 18:44 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb On Wed, Jun 05, 2002 at 05:41:42PM -0400, Andrew Cagney wrote: > >The expansion appears to be: > >>tdep->mips_fp_register_double = (((((38) >= 38 && (38) < 38 +32) ? > >> builtin_type_float : ((38) == 32 ) ? > >> builtin_type_uint32 : ((38) >= 70 && (38) <= 89) ? > >> builtin_type_uint32 : > >> builtin_type_int))->main_type->length == 8); > >> > >>I can't see any reason for it to crash; I haven't reproduced this > >>locally yet, although I'm working on it. The above expansion came from > >>the second person to mention this to me. > > > > > >I believe you're right about the patch at fault, though I don't know > >what to do about it. This makes builtin_type_int == NULL during > >evaluation of that expression, along with all the others. > > The patch isn't `at fault' - it is detecting a fault in mips_tdep.c :-) > builtin_type_float would have contained a value from the previously > selected ISA. > > That code is trying to reverse engineer the header files to figure out > what the default should be for the given target. > > I think better would be to is set mips_fp_register_double=-1 and then > change FP_REGISTER_DOUBLE to a real function (gdb multi-arch can now be > assumed) that, when -1, apply the above logic (and even update the result). How about setting something in each header that redefines REGISTER_VIRTUAL_TYPE, instead? I think that's much clearer, and when we multi-arch the targets which do this it will transition more naturally to setting it at gdbarch_init time. gdbarch_data() is a very nice tool, but this is the wrong kind of nail, IMO. I'm testing this patch. Yes, it's a little bit of a step backwards for multi-arching, but I still think it's correct; rather than "reverse engineer the header files to figure out the default", let's have the header files tell us what it is. It works fine in my testing; OK to commit, or would you prefer a different way? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2002-06-06 Daniel Jacobowitz <drow@mvista.com> * mips-tdep.c (FP_REGISTER_DOUBLE): Delete obsolete definition. Define unconditionally. (mips_gdbarch_init): Use MIPS_FP_DOUBLE. * config/mips/tm-mips.h (MIPS_FP_DOUBLE): New macro. * config/mips/tm-irix5.h (MIPS_FP_DOUBLE): New macro. * config/mips/tm-irix6.h (MIPS_FP_DOUBLE): New macro. * config/mips/tm-mips64.h (MIPS_FP_DOUBLE): New macro. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.74 diff -u -p -u -r1.74 mips-tdep.c --- mips-tdep.c 21 May 2002 15:36:03 -0000 1.74 +++ mips-tdep.c 6 Jun 2002 17:34:17 -0000 @@ -108,11 +108,6 @@ static int mips_fpu_type_auto = 1; static enum mips_fpu_type mips_fpu_type = MIPS_DEFAULT_FPU_TYPE; #define MIPS_FPU_TYPE mips_fpu_type -/* Do not use "TARGET_IS_MIPS64" to test the size of floating point registers */ -#ifndef FP_REGISTER_DOUBLE -#define FP_REGISTER_DOUBLE (REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8) -#endif - static int mips_debug = 0; /* MIPS specific per-architecture information */ @@ -212,10 +207,7 @@ mips2_fp_compat (void) form double-precision values). Do not use "TARGET_IS_MIPS64" to determine if the ABI is using double-precision registers. See also MIPS_FPU_TYPE. */ -#if GDB_MULTI_ARCH -#undef FP_REGISTER_DOUBLE #define FP_REGISTER_DOUBLE (gdbarch_tdep (current_gdbarch)->mips_fp_register_double) -#endif /* Does the caller allocate a ``home'' for each register used in the function call? The N32 ABI and MIPS_EABI do not, the others do. */ @@ -4332,7 +4324,7 @@ mips_gdbarch_init (struct gdbarch_info i tdep->mips_abi_string = "default"; tdep->mips_default_saved_regsize = MIPS_REGSIZE; tdep->mips_default_stack_argsize = MIPS_REGSIZE; - tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) == 8); + tdep->mips_fp_register_double = MIPS_FP_DOUBLE; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1; tdep->mips_regs_have_home_p = 1; Index: config/mips/tm-irix5.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-irix5.h,v retrieving revision 1.6 diff -u -p -u -r1.6 tm-irix5.h --- config/mips/tm-irix5.h 6 Mar 2001 08:21:32 -0000 1.6 +++ config/mips/tm-irix5.h 6 Jun 2002 17:34:17 -0000 @@ -41,6 +41,9 @@ ((N) - FP0_REGNUM) * sizeof(double) : \ 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE) +#undef MIPS_FP_DOUBLE +#define MIPS_FP_DOUBLE 1 + #undef REGISTER_VIRTUAL_TYPE #define REGISTER_VIRTUAL_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ Index: config/mips/tm-irix6.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-irix6.h,v retrieving revision 1.1 diff -u -p -u -r1.1 tm-irix6.h --- config/mips/tm-irix6.h 7 Jun 2001 15:57:57 -0000 1.1 +++ config/mips/tm-irix6.h 6 Jun 2002 17:34:17 -0000 @@ -88,6 +88,9 @@ ((N) - FP0_REGNUM) * sizeof(double) : \ 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE) +#undef MIPS_FP_DOUBLE +#define MIPS_FP_DOUBLE 1 + #undef REGISTER_VIRTUAL_TYPE #define REGISTER_VIRTUAL_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ Index: config/mips/tm-mips.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v retrieving revision 1.25 diff -u -p -u -r1.25 tm-mips.h --- config/mips/tm-mips.h 10 Feb 2002 07:17:17 -0000 1.25 +++ config/mips/tm-mips.h 6 Jun 2002 17:34:19 -0000 @@ -89,6 +89,12 @@ extern int in_sigtramp (CORE_ADDR, char #define MIPS_REGSIZE 4 #endif +/* Defined to 1 if this architecture uses double-precision floating point + registers. */ +#ifndef MIPS_FP_DOUBLE +#define MIPS_FP_DOUBLE 0 +#endif + /* Number of machine registers */ #ifndef NUM_REGS Index: config/mips/tm-mips64.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-mips64.h,v retrieving revision 1.5 diff -u -p -u -r1.5 tm-mips64.h --- config/mips/tm-mips64.h 5 Jun 2002 19:18:25 -0000 1.5 +++ config/mips/tm-mips64.h 6 Jun 2002 17:34:19 -0000 @@ -22,6 +22,9 @@ /* Use eight byte registers. */ #define MIPS_REGSIZE 8 +/* Use double-precision floating point registers. */ +#define MIPS_FP_DOUBLE 1 + /* define 8 byte register type */ #define REGISTER_VIRTUAL_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-06 18:44 ` Daniel Jacobowitz @ 2002-06-07 12:55 ` Andrew Cagney 2002-06-07 13:07 ` Daniel Jacobowitz 0 siblings, 1 reply; 9+ messages in thread From: Andrew Cagney @ 2002-06-07 12:55 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb > > How about setting something in each header that redefines > REGISTER_VIRTUAL_TYPE, instead? I think that's much clearer, and when > we multi-arch the targets which do this it will transition more > naturally to setting it at gdbarch_init time. gdbarch_data() is a very > nice tool, but this is the wrong kind of nail, IMO. > > I'm testing this patch. Yes, it's a little bit of a step backwards for > multi-arching, but I still think it's correct; rather than "reverse > engineer the header files to figure out the default", let's have the > header files tell us what it is. > > It works fine in my testing; OK to commit, or would you prefer a > different way? try something like: -/* Do not use "TARGET_IS_MIPS64" to test the size of floating point registers */ -#ifndef FP_REGISTER_DOUBLE -#define FP_REGISTER_DOUBLE (REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8) -#endif #define FP_REGISTER_DOUBLE mip_fp_register-double () mips_fp_register_double () { if (current_gdbarch->tdep->fp_register_double < 0) ...->fp_register_double = REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8; return gdbarch->tdep->fp_register_double; } And: - tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) == 8); tdep->mips_fp_register_double = -1; It delays the computation until it is needed. It also happens to keep the old code working without having to add more macros :-) enjoy, Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-07 12:55 ` Andrew Cagney @ 2002-06-07 13:07 ` Daniel Jacobowitz 2002-06-07 13:27 ` Andrew Cagney 0 siblings, 1 reply; 9+ messages in thread From: Daniel Jacobowitz @ 2002-06-07 13:07 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb On Fri, Jun 07, 2002 at 03:55:11PM -0400, Andrew Cagney wrote: > > > >How about setting something in each header that redefines > >REGISTER_VIRTUAL_TYPE, instead? I think that's much clearer, and when > >we multi-arch the targets which do this it will transition more > >naturally to setting it at gdbarch_init time. gdbarch_data() is a very > >nice tool, but this is the wrong kind of nail, IMO. > > > >I'm testing this patch. Yes, it's a little bit of a step backwards for > >multi-arching, but I still think it's correct; rather than "reverse > >engineer the header files to figure out the default", let's have the > >header files tell us what it is. > > > >It works fine in my testing; OK to commit, or would you prefer a > >different way? > > try something like: > > -/* Do not use "TARGET_IS_MIPS64" to test the size of floating point > registers */ > -#ifndef FP_REGISTER_DOUBLE > -#define FP_REGISTER_DOUBLE (REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8) > -#endif > > #define FP_REGISTER_DOUBLE mip_fp_register-double () > > mips_fp_register_double () > { > if (current_gdbarch->tdep->fp_register_double < 0) > ...->fp_register_double = REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8; > return gdbarch->tdep->fp_register_double; > } > > And: > > - tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE > (FP0_REGNUM) == 8); > > tdep->mips_fp_register_double = -1; > > It delays the computation until it is needed. It also happens to keep > the old code working without having to add more macros :-) Doesn't work. It's referenced in creating the register cache, which is still before we have an architecture. We need to know this information earlier. Any other ideas, or is my original patch OK? By the way, I think the existing default: case in that switch is pretty pointless anyway. Note that it selects an arbitrary number of argument registers. It doesn't work when all the tools are configured mips-elf (default to O32), which is why I suggested some time ago that we just default to O32 in that configuration at least... that would make the test numbers suck a bit less, and reduce the black magic factor a bit. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB broken on MIPS targets with unmarked binaries 2002-06-07 13:07 ` Daniel Jacobowitz @ 2002-06-07 13:27 ` Andrew Cagney 0 siblings, 0 replies; 9+ messages in thread From: Andrew Cagney @ 2002-06-07 13:27 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb > It delays the computation until it is needed. It also happens to keep >> the old code working without having to add more macros :-) > > > Doesn't work. It's referenced in creating the register cache, which is > still before we have an architecture. We need to know this information > earlier. Any other ideas, or is my original patch OK? I'll commit a work-around. > By the way, I think the existing default: case in that switch is pretty > pointless anyway. Note that it selects an arbitrary number of argument > registers. It doesn't work when all the tools are configured mips-elf > (default to O32), which is why I suggested some time ago that we just > default to O32 in that configuration at least... that would make the > test numbers suck a bit less, and reduce the black magic factor a bit. Default for plain mips-elf? Yes sounds like a good idea. As the other variants get deleted they can fall back to that. (I take it this is the default for mips-elf-{as,gcc}. Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-06-07 20:27 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-06-05 13:08 GDB broken on MIPS targets with unmarked binaries Daniel Jacobowitz 2002-06-05 13:44 ` Andrew Cagney 2002-06-05 14:03 ` Daniel Jacobowitz 2002-06-05 14:12 ` Daniel Jacobowitz 2002-06-05 14:41 ` Andrew Cagney 2002-06-06 18:44 ` Daniel Jacobowitz 2002-06-07 12:55 ` Andrew Cagney 2002-06-07 13:07 ` Daniel Jacobowitz 2002-06-07 13:27 ` Andrew Cagney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox