From: Fred Fish Date: Sun, 17 May 1992 23:54:32 +0000 (+0000) Subject: * inflow.c (new_tty): Temporarily ignore SIGTTOU when X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c316cfd666cefcdb824fbcb823358c308255b29;p=binutils-gdb.git * inflow.c (new_tty): Temporarily ignore SIGTTOU when disconnecting from controlling terminal, to avoid gdb hanging on SVR4. Fixes bug reported by Oliver Okrongli. * procfs.c (PROC_NAME_FMT): Change format to match default used by system, as suggested by Oliver Okrongli. * tm-68k.h (FRAME_FIND_SAVED_REGS): Apply missing parentheses bug fix from Brent Townshend (bst%tt@cam.ORG). * c-exp.y (nonempty_typelist): Fix memory overrun bug reported by turlais@rechser.total.fr. * dwarfread.c (decode_subscr_data): Fix bug in calculation of length of non-zero lowerbound arrays. Bug fix from Peggy Fieland. * objfiles.h (unlink_objfile): Add prototype. * objfiles.c (unlink_objfile): Add function. * objfiles.c (free_objfile): Call unlink_objfile. * objfiles.c (allocate_objfile): Call unlink_objfile on newly remapped objfiles. Bug reported by hahn@sunshine.labs.tek.com. Also, discard old possibly bogus sf struct. * symfile.c (symbol_file_add): Call init_entry_point_info() and find_sym_fns() for remapped symbol files, in case of any changes since the last mapping. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 27d030a84b1..bf7b4891493 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,31 @@ +Sun May 17 16:51:20 1992 Fred Fish (fnf@cygnus.com) + + * inflow.c (new_tty): Temporarily ignore SIGTTOU when + disconnecting from controlling terminal, to avoid gdb hanging + on SVR4. Fixes bug reported by Oliver Okrongli. + * procfs.c (PROC_NAME_FMT): Change format to match default used + by system, as suggested by Oliver Okrongli. + * tm-68k.h (FRAME_FIND_SAVED_REGS): Apply missing parentheses + bug fix from Brent Townshend (bst%tt@cam.ORG). + * c-exp.y (nonempty_typelist): Fix memory overrun bug reported + by turlais@rechser.total.fr. + * dwarfread.c (decode_subscr_data): Fix bug in calculation of + length of non-zero lowerbound arrays. Bug fix from Peggy Fieland. + * objfiles.h (unlink_objfile): Add prototype. + * objfiles.c (unlink_objfile): Add function. + * objfiles.c (free_objfile): Call unlink_objfile. + * objfiles.c (allocate_objfile): Call unlink_objfile on newly + remapped objfiles. Bug reported by hahn@sunshine.labs.tek.com. + Also, discard old possibly bogus sf struct. + * symfile.c (symbol_file_add): Call init_entry_point_info() and + find_sym_fns() for remapped symbol files, in case of any changes + since the last mapping. + +Wed May 13 18:28:20 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * findvar.c (read_relative_register_raw_bytes): use the raw size + of a register to bcopy, rather than the host's sizeof(CORE_ADDR). + Tue May 12 17:44:39 1992 Steve Chamberlain (sac@thepub.cygnus.com) Changes to support GDB running on DOS using GO32 and H8 support diff --git a/gdb/c-exp.y b/gdb/c-exp.y index b3bf309fbeb..1ef8764e38c 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -895,13 +895,13 @@ typename: TYPENAME nonempty_typelist : type - { $$ = (struct type **)xmalloc (sizeof (struct type *) * 2); - $$[0] = (struct type *)0; + { $$ = (struct type **) xmalloc (sizeof (struct type *) * 2); + $$[0] = 1; /* Number of types in vector */ $$[1] = $1; } | nonempty_typelist ',' type - { int len = sizeof (struct type *) * ++($1[0]); - $$ = (struct type **)xrealloc ((char *) $1, len); + { int len = sizeof (struct type *) * (++($1[0]) + 1); + $$ = (struct type **) xrealloc ((char *) $1, len); $$[$$[0]] = $3; } ; diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 1cd34cd3c3b..8a9cebd2949 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -1114,7 +1114,7 @@ decode_subscr_data (scan, end) TYPE_OBJFILE (typep) = current_objfile; TYPE_CODE (typep) = TYPE_CODE_ARRAY; TYPE_LENGTH (typep) = TYPE_LENGTH (nexttype); - TYPE_LENGTH (typep) *= lowbound + highbound + 1; + TYPE_LENGTH (typep) *= (highbound - lowbound) + 1; TYPE_TARGET_TYPE (typep) = nexttype; } } diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 642026c7cdc..1ad5d94c49e 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -110,6 +110,10 @@ allocate_objfile (abfd, mapped) obstack_freefun (&objfile -> symbol_obstack, mfree); obstack_chunkfun (&objfile -> type_obstack, xmmalloc); obstack_freefun (&objfile -> type_obstack, mfree); + /* If already in objfile list, unlink it. */ + unlink_objfile (objfile); + /* Forget things specific to a particular gdb, may have changed. */ + objfile -> sf = NULL; } else { @@ -193,6 +197,36 @@ allocate_objfile (abfd, mapped) return (objfile); } +/* Unlink OBJFILE from the list of known objfiles, if it is found in the + list. + + It is not a bug, or error, to call this function if OBJFILE is not known + to be in the current list. This is done in the case of mapped objfiles, + for example, just to ensure that the mapped objfile doesn't appear twice + in the list. Since the list is threaded, linking in a mapped objfile + twice would create a circular list. + + If OBJFILE turns out to be in the list, we zap it's NEXT pointer after + unlinking it, just to ensure that we have completely severed any linkages + between the OBJFILE and the list. */ + +void +unlink_objfile (objfile) + struct objfile *objfile; +{ + struct objfile** objpp; + + for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp) -> next)) + { + if (*objpp == objfile) + { + *objpp = (*objpp) -> next; + objfile -> next = NULL; + break; + } + } +} + /* Destroy an objfile and all the symtabs and psymtabs under it. Note that as much as possible is allocated on the symbol_obstack and @@ -238,22 +272,7 @@ free_objfile (objfile) /* Remove it from the chain of all objfiles. */ - if (object_files == objfile) - { - object_files = objfile -> next; - } - else - { - for (ofp = object_files; ofp; ofp = ofp -> next) - { - if (ofp -> next == objfile) - { - ofp -> next = objfile -> next; - break; - } - } - } - objfile -> next = NULL; + unlink_objfile (objfile); #if 0 /* FIXME!! */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index d158fbb4dd2..51a2a822de2 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -292,6 +292,9 @@ extern struct objfile *object_files; extern struct objfile * allocate_objfile PARAMS ((bfd *, int)); +extern void +unlink_objfile PARAMS ((struct objfile *)); + extern void free_objfile PARAMS ((struct objfile *)); diff --git a/gdb/procfs.c b/gdb/procfs.c index 6da85a7aa19..aa4561a3e86 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -47,7 +47,7 @@ regardless of whether or not the actual target has floating point hardware. #define MAX_SYSCALLS 256 /* Maximum number of syscalls for table */ #ifndef PROC_NAME_FMT -#define PROC_NAME_FMT "/proc/%d" +#define PROC_NAME_FMT "/proc/%05d" #endif #if 1 /* FIXME: Gross and ugly hack to resolve coredep.c global */ diff --git a/gdb/tm-68k.h b/gdb/tm-68k.h index b769ebe6794..6a926e0a826 100644 --- a/gdb/tm-68k.h +++ b/gdb/tm-68k.h @@ -437,7 +437,7 @@ extern const struct ext_format ext_format_68881; for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \ if (regmask & 1) \ (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ - else if (0x2f00 == 0xfff0 & read_memory_integer (pc, 2)) \ + else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2))) \ { regnum = 0xf & read_memory_integer (pc, 2); pc += 2; \ (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \ /* clrw -(sp); movw ccr,-(sp) may follow. */ \