From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Jim Blandy Cc: gdb-patches@sourceware.cygnus.com Subject: Re: RFA: distinguish between pointers and addresses Date: Mon, 10 Apr 2000 18:05:00 -0000 Message-id: <38F27A01.D3FC3F38@cygnus.com> References: <200004102022.PAA26368@zwingli.cygnus.com> X-SW-Source: 2000-04/msg00207.html Jim Blandy wrote: > Index: gdb/doc/gdbint.texinfo > + For example, the Mitsubishi D10V is a 16-bit processor that uses 32-bit > + instructions.@footnote{Some D10V instructions are actually pairs of > + 16-bit instructions, but you can't jump into the middle of a pair, so > + they're effectively 32-bit instructions, for the sake of this > + discussion.} If the D10V used ordinary byte addresses to refer to code > + locations, then the processor would only be able to address 64kb of > + instructions. However, since instructions must be aligned on a > + four-byte boundary, the low two bits of any valid instruction address > + are always zero --- byte addresses waste two bits in every address. So > + instead of byte addresses, the D10V uses word addresses --- byte > + addresses shifted right two bits --- to refer to code. Thus, the D10V > + can use 16-bit words to address 256kb of code space. Perhaphs ``the Mitsubishi D10V is a 16-bit VLIW processor that has a 32-bit instruction word''. (The 32 bit instruction can be issued as a single operation or two sub operations processed sequentially or in parallel but that sort of detail is distracting :-) > + However, this means that code pointers and data pointers have different > + forms on the D10V. The 16-bit word @code{0xC020} refers to byte address > + @code{0xC020} when used as a data address, but refers to byte address > + @code{0x30080} when used as a code address. > + > + (The D10V also uses separate code and data address spaces, which also > + affects the correspondence between pointers and addresses, but we're > + going to ignore that here; this example is already too long.) Thats the other half of the problem - segmented archtectures. The D10V cheats and maps segment:offset onto CORE_ADDR. That is another problem again. I think the changes look ok. Andrew >From ac131313@cygnus.com Mon Apr 10 18:13:00 2000 From: Andrew Cagney To: Philippe De Muyter Cc: "gdb-patches@sourceware.cygnus.com" Subject: Re: PATCH/RFA free(NULL) bomb in printcmd.c Date: Mon, 10 Apr 2000 18:13:00 -0000 Message-id: <38F27BB5.1241FAFD@cygnus.com> References: <200004101636.SAA28529@mail.macqel.be> X-SW-Source: 2000-04/msg00208.html Content-length: 616 Philippe De Muyter wrote: > > printcmd.c contains hidden calls to free(NULL), that can crash on many OS'es; > they are constructed by make_cleanup (free, name) calls, where `name' has > the value NULL. > - struct cleanup *cleanup_chain = make_cleanup (free, name); > + struct cleanup *cleanup_chain = make_cleanup (null_cleanup, name); > if (print_symbol_filename) > - make_cleanup (free, filename); > + make_cleanup (null_cleanup, filename); Um, I'm confused. wouldn't it be easier to just delete the two cleanup calls (the first, perhaphs, replaced with make_cleanup (null_cleanup, NULL))? Andrew >From ac131313@cygnus.com Mon Apr 10 18:22:00 2000 From: Andrew Cagney To: GDB Patches Subject: Re: [RFC] Cleanup USE_INCLUDED_REGEX Date: Mon, 10 Apr 2000 18:22:00 -0000 Message-id: <38F27DD6.D0EFA2FB@cygnus.com> References: <38F1C6C7.682528F2@cygnus.com> X-SW-Source: 2000-04/msg00209.html Content-length: 597 Andrew Cagney wrote: > > FYI, > > The attatched cleans up the -DUSE_INCLUDED_REGEX by moving it to > acconfig.h/config.h. > > Look ok? > > Andrew > > ------------------------------------------------------------------------ > Mon Apr 10 21:58:36 2000 Andrew Cagney > > * acconfig.h (USE_INCLUDED_REGEX): Add. > * Makefile.in (REGEX_CFLAGS): Delete > * configure.in (REGEX_CFLAGS): Delete. Use AC_DEFINE instead. > * configure, config.in: Re-generate. FYI, this has been comitted to the trunk but not to the branch. Andrew >From jimb@zwingli.cygnus.com Mon Apr 10 20:02:00 2000 From: Jim Blandy To: Andrew Cagney , David Taylor Cc: gdb-patches@sourceware.cygnus.com Subject: RFA: gdbarch IEEE_FLOAT Date: Mon, 10 Apr 2000 20:02:00 -0000 Message-id: <200004110302.WAA13962@zwingli.cygnus.com> X-SW-Source: 2000-04/msg00210.html Content-length: 23728 The changes to the tm.h files are trivial, so I don't think this really needs approval from the various platform maintainers. 2000-04-10 Jim Blandy Bring IEEE_FLOAT under gdbarch's control. * gdbarch.sh (IEEE_FLOAT): New entry. * gdbarch.c, gdbarch.h: Regenerated. * valprint.c (IEEE_FLOAT): Provide a default #definition for this. (print_floating): Use IEEE_FLOAT as if it were an expression; use the code specific to IEEE-format numbers whenever the value of IEEE_FLOAT is non-zero. * config/a29k/tm-a29k.h, config/alpha/tm-alpha.h, config/arc/tm-arc.h, config/arm/tm-arm.h, config/fr30/tm-fr30.h, config/h8300/tm-h8300.h, config/i386/tm-i386.h, config/i960/tm-i960.h, config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h, config/sparc/tm-sparc.h, config/delta/tm-delta.h, config/frv/tm-frv.h (IEEE_FLOAT): For all ports that #define IEEE_FLOAT, make sure they give it the value (1). Index: gdb/gdbarch.c =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.c,v retrieving revision 1.8 diff -c -r1.8 gdbarch.c *** gdb/gdbarch.c 2000/04/09 14:37:28 1.8 --- gdb/gdbarch.c 2000/04/11 02:36:40 *************** *** 135,140 **** --- 135,141 ---- int float_bit; int double_bit; int long_double_bit; + int ieee_float; gdbarch_read_pc_ftype *read_pc; gdbarch_write_pc_ftype *write_pc; gdbarch_read_fp_ftype *read_fp; *************** *** 271,276 **** --- 272,278 ---- 0, 0, 0, + 0, generic_get_saved_register, 0, 0, *************** *** 331,336 **** --- 333,339 ---- /* Force the explicit initialization of these. */ gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; + gdbarch->ieee_float = 1; gdbarch->num_regs = -1; gdbarch->sp_regnum = -1; gdbarch->fp_regnum = -1; *************** *** 417,422 **** --- 420,426 ---- if ((GDB_MULTI_ARCH >= 1) && (gdbarch->long_double_bit == 0)) internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid"); + /* Skip verify of ieee_float, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->read_pc == 0)) internal_error ("gdbarch: verify_gdbarch: read_pc invalid"); *************** *** 648,653 **** --- 652,660 ---- "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n", (long) TARGET_LONG_DOUBLE_BIT); fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: IEEE_FLOAT = %ld\n", + (long) IEEE_FLOAT); + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_READ_PC = 0x%08lx\n", (long) current_gdbarch->read_pc /*TARGET_READ_PC ()*/); *************** *** 1102,1107 **** --- 1109,1130 ---- int long_double_bit) { gdbarch->long_double_bit = long_double_bit; + } + + int + gdbarch_ieee_float (struct gdbarch *gdbarch) + { + /* Skip verify of ieee_float, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n"); + return gdbarch->ieee_float; + } + + void + set_gdbarch_ieee_float (struct gdbarch *gdbarch, + int ieee_float) + { + gdbarch->ieee_float = ieee_float; } CORE_ADDR Index: gdb/gdbarch.h =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.h,v retrieving revision 1.5 diff -c -r1.5 gdbarch.h *** gdb/gdbarch.h 2000/03/30 05:32:23 1.5 --- gdb/gdbarch.h 2000/04/11 02:36:40 *************** *** 171,176 **** --- 171,184 ---- #endif #endif + extern int gdbarch_ieee_float (struct gdbarch *gdbarch); + extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); + #if GDB_MULTI_ARCH + #if (GDB_MULTI_ARCH > 1) || !defined (IEEE_FLOAT) + #define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch)) + #endif + #endif + typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid); extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid); extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); Index: gdb/gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.7 diff -c -r1.7 gdbarch.sh *** gdb/gdbarch.sh 2000/04/03 00:00:32 1.7 --- gdb/gdbarch.sh 2000/04/11 02:36:41 *************** *** 193,198 **** --- 193,199 ---- v:1:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0 v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):0 v:1:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):0 + v:1:IEEE_FLOAT:int:ieee_float::::0:1:0 # f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0 f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0 *************** *** 812,818 **** cat <> 23) & 0xFF) == 0xFF) ! && 0 != (low & 0x7FFFFF)); ! low &= 0x7fffff; ! high = 0; ! } ! else if (len == 8) ! { ! /* It's double precision. Get the high and low words. */ ! ! /* Assume that floating point byte order is the same as ! integer byte order. */ ! if (TARGET_BYTE_ORDER == BIG_ENDIAN) ! { ! low = extract_unsigned_integer (valaddr + 4, 4); ! high = extract_unsigned_integer (valaddr, 4); ! } ! else ! { ! low = extract_unsigned_integer (valaddr, 4); ! high = extract_unsigned_integer (valaddr + 4, 4); ! } ! nonnegative = ((high & 0x80000000) == 0); ! is_nan = (((high >> 20) & 0x7ff) == 0x7ff ! && !((((high & 0xfffff) == 0)) && (low == 0))); ! high &= 0xfffff; ! } ! else ! { #ifdef TARGET_ANALYZE_FLOATING ! TARGET_ANALYZE_FLOATING; #else ! /* Extended. We can't detect extended NaNs for this target. ! Also note that currently extendeds get nuked to double in ! REGISTER_CONVERTIBLE. */ ! is_nan = 0; #endif ! } ! if (is_nan) ! { ! /* The meaning of the sign and fraction is not defined by IEEE. ! But the user might know what they mean. For example, they ! (in an implementation-defined manner) distinguish between ! signaling and quiet NaN's. */ ! if (high) ! fprintf_filtered (stream, "-NaN(0x%lx%.8lx)" + !!nonnegative, ! high, low); ! else ! fprintf_filtered (stream, "-NaN(0x%lx)" + nonnegative, low); ! return; ! } ! } ! #endif /* IEEE_FLOAT. */ doub = unpack_double (type, valaddr, &inv); if (inv) --- 581,662 ---- int inv; unsigned len = TYPE_LENGTH (type); /* Check for NaN's. Note that this code does not depend on us being on an IEEE conforming system. It only depends on the target machine using IEEE representation. This means (a) cross-debugging works right, and (2) IEEE_FLOAT can (and should) ! be non-zero for systems like the 68881, which uses IEEE representation, but is not IEEE conforming. */ ! if (IEEE_FLOAT) ! { ! unsigned long low, high; ! /* Is the sign bit 0? */ ! int nonnegative; ! /* Is it is a NaN (i.e. the exponent is all ones and ! the fraction is nonzero)? */ ! int is_nan; ! ! /* For lint, initialize these two variables to suppress warning: */ ! low = high = nonnegative = 0; ! if (len == 4) ! { ! /* It's single precision. */ ! /* Assume that floating point byte order is the same as ! integer byte order. */ ! low = extract_unsigned_integer (valaddr, 4); ! nonnegative = ((low & 0x80000000) == 0); ! is_nan = ((((low >> 23) & 0xFF) == 0xFF) ! && 0 != (low & 0x7FFFFF)); ! low &= 0x7fffff; ! high = 0; ! } ! else if (len == 8) ! { ! /* It's double precision. Get the high and low words. */ ! ! /* Assume that floating point byte order is the same as ! integer byte order. */ ! if (TARGET_BYTE_ORDER == BIG_ENDIAN) ! { ! low = extract_unsigned_integer (valaddr + 4, 4); ! high = extract_unsigned_integer (valaddr, 4); ! } ! else ! { ! low = extract_unsigned_integer (valaddr, 4); ! high = extract_unsigned_integer (valaddr + 4, 4); ! } ! nonnegative = ((high & 0x80000000) == 0); ! is_nan = (((high >> 20) & 0x7ff) == 0x7ff ! && !((((high & 0xfffff) == 0)) && (low == 0))); ! high &= 0xfffff; ! } ! else ! { #ifdef TARGET_ANALYZE_FLOATING ! TARGET_ANALYZE_FLOATING; #else ! /* Extended. We can't detect extended NaNs for this target. ! Also note that currently extendeds get nuked to double in ! REGISTER_CONVERTIBLE. */ ! is_nan = 0; #endif ! } ! if (is_nan) ! { ! /* The meaning of the sign and fraction is not defined by IEEE. ! But the user might know what they mean. For example, they ! (in an implementation-defined manner) distinguish between ! signaling and quiet NaN's. */ ! if (high) ! fprintf_filtered (stream, "-NaN(0x%lx%.8lx)" + !!nonnegative, ! high, low); ! else ! fprintf_filtered (stream, "-NaN(0x%lx)" + nonnegative, low); ! return; ! } ! } doub = unpack_double (type, valaddr, &inv); if (inv) Index: gdb/config/a29k/tm-a29k.h =================================================================== RCS file: /cvs/src/src/gdb/config/a29k/tm-a29k.h,v retrieving revision 1.1.1.7 diff -c -r1.1.1.7 tm-a29k.h *** gdb/config/a29k/tm-a29k.h 1999/08/31 01:06:42 1.1.1.7 --- gdb/config/a29k/tm-a29k.h 2000/04/11 02:36:42 *************** *** 31,37 **** #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point uses IEEE representations. */ ! #define IEEE_FLOAT /* Recognize our magic number. */ #define BADMAG(x) ((x).f_magic != 0572) --- 31,37 ---- #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point uses IEEE representations. */ ! #define IEEE_FLOAT (1) /* Recognize our magic number. */ #define BADMAG(x) ((x).f_magic != 0572) Index: gdb/config/alpha/tm-alpha.h =================================================================== RCS file: /cvs/src/src/gdb/config/alpha/tm-alpha.h,v retrieving revision 1.2 diff -c -r1.2 tm-alpha.h *** gdb/config/alpha/tm-alpha.h 2000/02/22 19:17:37 1.2 --- gdb/config/alpha/tm-alpha.h 2000/04/11 02:36:43 *************** *** 42,48 **** #define TARGET_PTR_BIT 64 /* Floating point is IEEE compliant */ ! #define IEEE_FLOAT /* Number of traps that happen between exec'ing the shell * to run an inferior, and when we finally get to --- 42,48 ---- #define TARGET_PTR_BIT 64 /* Floating point is IEEE compliant */ ! #define IEEE_FLOAT (1) /* Number of traps that happen between exec'ing the shell * to run an inferior, and when we finally get to Index: gdb/config/arc/tm-arc.h =================================================================== RCS file: /cvs/src/src/gdb/config/arc/tm-arc.h,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 tm-arc.h *** gdb/config/arc/tm-arc.h 1999/09/08 23:59:48 1.1.1.5 --- gdb/config/arc/tm-arc.h 2000/04/11 02:36:43 *************** *** 26,32 **** #define TARGET_BYTE_ORDER_SELECTABLE /* We have IEEE floating point, if we have any float at all. */ ! #define IEEE_FLOAT /* Offset from address of function to start of its code. Zero on most machines. */ --- 26,32 ---- #define TARGET_BYTE_ORDER_SELECTABLE /* We have IEEE floating point, if we have any float at all. */ ! #define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ Index: gdb/config/arm/tm-arm.h =================================================================== RCS file: /cvs/src/src/gdb/config/arm/tm-arm.h,v retrieving revision 1.2 diff -c -r1.2 tm-arm.h *** gdb/config/arm/tm-arm.h 2000/04/07 22:26:11 1.2 --- gdb/config/arm/tm-arm.h 2000/04/11 02:36:44 *************** *** 31,37 **** #define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN /* IEEE format floating point. */ ! #define IEEE_FLOAT #define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \ ? &floatformat_ieee_double_big \ : &floatformat_ieee_double_littlebyte_bigword) --- 31,37 ---- #define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN /* IEEE format floating point. */ ! #define IEEE_FLOAT (1) #define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \ ? &floatformat_ieee_double_big \ : &floatformat_ieee_double_littlebyte_bigword) Index: gdb/config/fr30/tm-fr30.h =================================================================== RCS file: /cvs/src/src/gdb/config/fr30/tm-fr30.h,v retrieving revision 1.2 diff -c -r1.2 tm-fr30.h *** gdb/config/fr30/tm-fr30.h 2000/02/22 19:17:47 1.2 --- gdb/config/fr30/tm-fr30.h 2000/04/11 02:36:44 *************** *** 186,192 **** #define TARGET_FR30 /* IEEE format floating point */ ! #define IEEE_FLOAT /* Define other aspects of the stack frame. */ --- 186,192 ---- #define TARGET_FR30 /* IEEE format floating point */ ! #define IEEE_FLOAT (1) /* Define other aspects of the stack frame. */ Index: gdb/config/h8300/tm-h8300.h =================================================================== RCS file: /cvs/src/src/gdb/config/h8300/tm-h8300.h,v retrieving revision 1.1.1.7 diff -c -r1.1.1.7 tm-h8300.h *** gdb/config/h8300/tm-h8300.h 1999/12/14 01:05:40 1.1.1.7 --- gdb/config/h8300/tm-h8300.h 2000/04/11 02:36:44 *************** *** 50,56 **** extern void h8300_init_extra_frame_info (); ! #define IEEE_FLOAT /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN #undef TARGET_INT_BIT --- 50,56 ---- extern void h8300_init_extra_frame_info (); ! #define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN #undef TARGET_INT_BIT Index: gdb/config/h8500/tm-h8500.h =================================================================== RCS file: /cvs/src/src/gdb/config/h8500/tm-h8500.h,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 tm-h8500.h *** gdb/config/h8500/tm-h8500.h 1999/07/07 20:12:26 1.1.1.5 --- gdb/config/h8500/tm-h8500.h 2000/04/11 02:36:44 *************** *** 22,28 **** #define GDB_TARGET_IS_H8500 ! #define IEEE_FLOAT 1 /* Define the bit, byte, and word ordering of the machine. */ --- 22,28 ---- #define GDB_TARGET_IS_H8500 ! #define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ Index: gdb/config/i386/tm-i386.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v retrieving revision 1.4 diff -c -r1.4 tm-i386.h *** gdb/config/i386/tm-i386.h 2000/03/26 22:10:59 1.4 --- gdb/config/i386/tm-i386.h 2000/04/11 02:36:44 *************** *** 44,50 **** /* Used for example in valprint.c:print_floating() to enable checking for NaN's */ ! #define IEEE_FLOAT /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 --- 44,50 ---- /* Used for example in valprint.c:print_floating() to enable checking for NaN's */ ! #define IEEE_FLOAT (1) /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 Index: gdb/config/i960/tm-i960.h =================================================================== RCS file: /cvs/src/src/gdb/config/i960/tm-i960.h,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 tm-i960.h *** gdb/config/i960/tm-i960.h 1999/09/08 23:59:54 1.1.1.5 --- gdb/config/i960/tm-i960.h 2000/04/11 02:36:44 *************** *** 40,46 **** /* We have IEEE floating point, if we have any float at all. */ ! #define IEEE_FLOAT /* Offset from address of function to start of its code. Zero on most machines. */ --- 40,46 ---- /* We have IEEE floating point, if we have any float at all. */ ! #define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ Index: gdb/config/m68k/tm-m68k.h =================================================================== RCS file: /cvs/src/src/gdb/config/m68k/tm-m68k.h,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 tm-m68k.h *** gdb/config/m68k/tm-m68k.h 1999/08/31 01:07:28 1.1.1.5 --- gdb/config/m68k/tm-m68k.h 2000/04/11 02:36:45 *************** *** 20,26 **** /* Generic 68000 stuff, to be included by other tm-*.h files. */ ! #define IEEE_FLOAT 1 /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN --- 20,26 ---- /* Generic 68000 stuff, to be included by other tm-*.h files. */ ! #define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN Index: gdb/config/m88k/tm-m88k.h =================================================================== RCS file: /cvs/src/src/gdb/config/m88k/tm-m88k.h,v retrieving revision 1.1.1.4 diff -c -r1.1.1.4 tm-m88k.h *** gdb/config/m88k/tm-m88k.h 1999/07/07 20:15:07 1.1.1.4 --- gdb/config/m88k/tm-m88k.h 2000/04/11 02:36:45 *************** *** 43,49 **** init_extra_frame_info (fromleaf, fi) extern void init_extra_frame_info (); ! #define IEEE_FLOAT /* Offset from address of function to start of its code. Zero on most machines. */ --- 43,49 ---- init_extra_frame_info (fromleaf, fi) extern void init_extra_frame_info (); ! #define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ Index: gdb/config/mips/tm-mips.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v retrieving revision 1.2 diff -c -r1.2 tm-mips.h *** gdb/config/mips/tm-mips.h 2000/02/22 19:18:09 1.2 --- gdb/config/mips/tm-mips.h 2000/04/11 02:36:45 *************** *** 58,64 **** #endif /* Floating point is IEEE compliant */ ! #define IEEE_FLOAT /* The name of the usual type of MIPS processor that is in the target system. */ --- 58,64 ---- #endif /* Floating point is IEEE compliant */ ! #define IEEE_FLOAT (1) /* The name of the usual type of MIPS processor that is in the target system. */ Index: gdb/config/pa/tm-hppa.h =================================================================== RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v retrieving revision 1.2 diff -c -r1.2 tm-hppa.h *** gdb/config/pa/tm-hppa.h 2000/02/22 19:18:19 1.2 --- gdb/config/pa/tm-hppa.h 2000/04/11 02:36:46 *************** *** 53,59 **** /* Watch out for NaNs */ ! #define IEEE_FLOAT /* On the PA, any pass-by-value structure > 8 bytes is actually passed via a pointer regardless of its type or the compiler --- 53,59 ---- /* Watch out for NaNs */ ! #define IEEE_FLOAT (1) /* On the PA, any pass-by-value structure > 8 bytes is actually passed via a pointer regardless of its type or the compiler Index: gdb/config/sh/tm-sh.h =================================================================== RCS file: /cvs/src/src/gdb/config/sh/tm-sh.h,v retrieving revision 1.2 diff -c -r1.2 tm-sh.h *** gdb/config/sh/tm-sh.h 2000/02/22 19:18:36 1.2 --- gdb/config/sh/tm-sh.h 2000/04/11 02:36:46 *************** *** 27,33 **** #define GDB_TARGET_IS_SH ! #define IEEE_FLOAT 1 /* Define the bit, byte, and word ordering of the machine. */ --- 27,33 ---- #define GDB_TARGET_IS_SH ! #define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ Index: gdb/config/sparc/tm-sparc.h =================================================================== RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v retrieving revision 1.2 diff -c -r1.2 tm-sparc.h *** gdb/config/sparc/tm-sparc.h 2000/02/22 19:18:53 1.2 --- gdb/config/sparc/tm-sparc.h 2000/04/11 02:36:47 *************** *** 28,34 **** #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point is IEEE compatible. */ ! #define IEEE_FLOAT /* If an argument is declared "register", Sun cc will keep it in a register, never saving it onto the stack. So we better not believe the "p" symbol --- 28,34 ---- #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point is IEEE compatible. */ ! #define IEEE_FLOAT (1) /* If an argument is declared "register", Sun cc will keep it in a register, never saving it onto the stack. So we better not believe the "p" symbol Index: gdb/config/w65/tm-w65.h =================================================================== RCS file: /cvs/src/src/gdb/config/w65/tm-w65.h,v retrieving revision 1.1.1.4 diff -c -r1.1.1.4 tm-w65.h *** gdb/config/w65/tm-w65.h 1999/07/07 20:17:36 1.1.1.4 --- gdb/config/w65/tm-w65.h 2000/04/11 02:36:47 *************** *** 22,28 **** #define GDB_TARGET_IS_W65 ! #define IEEE_FLOAT 1 /* Define the bit, byte, and word ordering of the machine. */ --- 22,28 ---- #define GDB_TARGET_IS_W65 ! #define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ Index: gdb/config/z8k/tm-z8k.h =================================================================== RCS file: /cvs/src/src/gdb/config/z8k/tm-z8k.h,v retrieving revision 1.1.1.6 diff -c -r1.1.1.6 tm-z8k.h *** gdb/config/z8k/tm-z8k.h 1999/09/09 00:00:07 1.1.1.6 --- gdb/config/z8k/tm-z8k.h 2000/04/11 02:36:47 *************** *** 18,24 **** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #define IEEE_FLOAT 1 #undef TARGET_INT_BIT #undef TARGET_LONG_BIT --- 18,24 ---- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #define IEEE_FLOAT (1) #undef TARGET_INT_BIT #undef TARGET_LONG_BIT >From dan@cgsoftware.com Mon Apr 10 20:17:00 2000 From: Daniel Berlin To: Andrew Cagney Cc: Philippe De Muyter , "gdb-patches@sourceware.cygnus.com" Subject: Re: PATCH/RFA free(NULL) bomb in printcmd.c Date: Mon, 10 Apr 2000 20:17:00 -0000 Message-id: References: <38F27BB5.1241FAFD@cygnus.com> X-SW-Source: 2000-04/msg00211.html Content-length: 990 Yeah. it would. Then again, i dmallocified GDB about a week and a half ago (which was quite a chore, involving dmallocifying libiberty, etc. I got literally every call), and i stopped fixing null pointer frees after about 35th one. So he's really going to be fighting an uphill battle. --Dan On Tue, 11 Apr 2000, Andrew Cagney wrote: > Philippe De Muyter wrote: > > > > printcmd.c contains hidden calls to free(NULL), that can crash on many OS'es; > > they are constructed by make_cleanup (free, name) calls, where `name' has > > the value NULL. > > > - struct cleanup *cleanup_chain = make_cleanup (free, name); > > + struct cleanup *cleanup_chain = make_cleanup (null_cleanup, name); > > if (print_symbol_filename) > > - make_cleanup (free, filename); > > + make_cleanup (null_cleanup, filename); > > Um, I'm confused. wouldn't it be easier to just delete the two cleanup > calls (the first, perhaphs, replaced with make_cleanup (null_cleanup, > NULL))? > > Andrew >