From 8eff3c7fe69220db3075e551f6cef34271f40d4c Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Wed, 17 Apr 1996 00:48:09 +0000 Subject: [PATCH] * corelow.c (add_to_thread_list): Make sure reg_sect is non-null before de-referencing it. Prevents deref of NULL pointer if core file lacks .reg section. * defs.h: Rename floatformat_{to from}_long_double to floatformat_{to from}_doublest. Get rid of FLOATFORMAT_{TO FROM}... macros. * findvar.c (extract_floating store_floating): Change all refs to FLOATFORMAT_{FROM TO}... to floatformat_{from to}_doublest. * utils.c: Change floatformat_{to from}_long_double to floatformat_{to from}_doublest cuz the new routines will use whatever size (double or long double) is appropriate. * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL REGISTER_CONVERT_TO_RAW): Change FLOATFORMAT... macros to floatformat... routine calls. --- gdb/ChangeLog | 17 +++++++++++++++++ gdb/config/i960/tm-i960.h | 4 ++-- gdb/corelow.c | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4dda931d40..32a97b2c44 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +Tue Apr 16 17:38:23 1996 Stu Grossman (grossman@critters.cygnus.com) + + * corelow.c (add_to_thread_list): Make sure reg_sect is non-null + before de-referencing it. Prevents deref of NULL pointer if core + file lacks .reg section. + * defs.h: Rename floatformat_{to from}_long_double to + floatformat_{to from}_doublest. Get rid of FLOATFORMAT_{TO + FROM}... macros. + * findvar.c (extract_floating store_floating): Change all refs to + FLOATFORMAT_{FROM TO}... to floatformat_{from to}_doublest. + * utils.c: Change floatformat_{to from}_long_double to + floatformat_{to from}_doublest cuz the new routines will use + whatever size (double or long double) is appropriate. + * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL + REGISTER_CONVERT_TO_RAW): Change FLOATFORMAT... macros to + floatformat... routine calls. + Mon Apr 15 16:34:11 1996 Per Bothner * stabsread.c (read_type): Move handling of '@' from type diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index 5c574243ae..c4d9fe8f9e 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -171,7 +171,7 @@ extern CORE_ADDR saved_pc_after_call (); #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ { \ DOUBLEST val; \ - FLOATFORMAT_TO_DOUBLEST (&floatformat_i960_ext, (FROM), &val); \ + floatformat_to_doublest (&floatformat_i960_ext, (FROM), &val); \ store_floating ((TO), TYPE_LENGTH (TYPE), val); \ } @@ -181,7 +181,7 @@ extern CORE_ADDR saved_pc_after_call (); #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ { \ DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - FLOATFORMAT_FROM_DOUBLEST (&floatformat_i960_ext, &val, (TO)); \ + floatformat_from_doublest (&floatformat_i960_ext, &val, (TO)); \ } /* Return the GDB type object for the "standard" data type diff --git a/gdb/corelow.c b/gdb/corelow.c index 48bc1843f7..f182e9c5f7 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -133,7 +133,8 @@ add_to_thread_list (abfd, asect, reg_sect_arg) /* Warning, Will Robinson, looking at BFD private data! */ - if (asect->filepos == reg_sect->filepos) /* Did we find .reg? */ + if (reg_sect != NULL + && asect->filepos == reg_sect->filepos) /* Did we find .reg? */ inferior_pid = thread_id; /* Yes, make it current */ }