diff options
-rw-r--r-- | gdb/ChangeLog | 28 | ||||
-rw-r--r-- | gdb/c-exp.y | 8 | ||||
-rw-r--r-- | gdb/dwarfread.c | 2 | ||||
-rw-r--r-- | gdb/objfiles.c | 51 | ||||
-rw-r--r-- | gdb/objfiles.h | 3 | ||||
-rw-r--r-- | gdb/procfs.c | 2 | ||||
-rw-r--r-- | gdb/tm-68k.h | 2 |
7 files changed, 73 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 27d030a..bf7b4891 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 b3bf309..1ef8764 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); + $<ivec>$[0] = 1; /* Number of types in vector */ $$[1] = $1; } | nonempty_typelist ',' type - { int len = sizeof (struct type *) * ++($<ivec>1[0]); - $$ = (struct type **)xrealloc ((char *) $1, len); + { int len = sizeof (struct type *) * (++($<ivec>1[0]) + 1); + $$ = (struct type **) xrealloc ((char *) $1, len); $$[$<ivec>$[0]] = $3; } ; diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 1cd34cd..8a9cebd 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 642026c..1ad5d94 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 d158fbb..51a2a82 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -293,6 +293,9 @@ extern struct objfile * allocate_objfile PARAMS ((bfd *, int)); extern void +unlink_objfile PARAMS ((struct objfile *)); + +extern void free_objfile PARAMS ((struct objfile *)); extern void diff --git a/gdb/procfs.c b/gdb/procfs.c index 6da85a7..aa4561a 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 b769ebe..6a926e0 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. */ \ |