From b203fc1803219d5eb29b0a3dcc0b07143ce4a836 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Sun, 21 Apr 1991 05:17:05 +0000 Subject: [PATCH] * coffread.c (find_linenos): Use LINESZ not sizeof (struct lineno). * coffread.c (end_symtab): Initialize language, dirname, and fullname fields. --- gdb/ChangeLog | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/coffread.c | 11 +++++++++- gdb/symtab.c | 10 +++++----- 3 files changed, 69 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a045365967..a0656714124 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,57 @@ +Sat Apr 20 21:42:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * symtab.c (various): Change error return of find_line_common to -1. + + * coffread.c (find_linenos): Use LINESZ not sizeof (struct lineno). + + * coffread.c (end_symtab): Initialize language, dirname, and + fullname fields. + +Fri Apr 19 18:18:31 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * mips-tdep.c (mips_frame_chain): Don't chain if saved_pc == 0. + + * stddef.h (size_t): Let either _SIZE_T or _SIZE_T_ guard it. + + * mipsread.c (parse_symbol): Set startup_file_{start,end} if + entry_point is in current file. + + * findvar.c (read_register_gen): Add "target byte-order" comment. + +Wed Apr 17 17:09:48 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * i386-tdep.c (i386_get_frame_setup): Use SWAP_TARGET_AND_HOST + before returning locals or slocals. + + * i386-tdep.c (i386_follow_jump): Do not add data16 to pos in + call to codestream_seek; add one to pos if (and only if) + we are dealing with a jump with data16 == 1 (i.e. 0x66, 0xe9). + +Mon Apr 15 12:04:32 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * valops.c (call_function_by_hand): Put dummy1 in target order + before FIX_CALL_DUMMY. + + * tm-i386v.h (FIX_CALL_DUMMY): Don't depend on host byte order. + +Sun Apr 14 11:55:19 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * valops.c (push_word): Add SWAP_TARGET_AND_HOST. + + * remote.c (remote_open): Send '+' before calling putpkt(). + + * tm-i386v.h (REGISTER_VIRTUAL_TYPE): Return pointer to void, + not int, for pc, fp, and sp. + + * remote.c (remote_open): Call start_remote after putpkt("?"); + infrun.c (start_remote): Also call wait_for_inferior & normal_stop. + +Sat Apr 13 22:11:42 1991 Jim Kingdon (kingdon at spiff.cygnus.com) + + * exec.c: Include . + + * sun3-xdep.c (fetch_core_registers): Add #ifdef FP0_REGNUM. + Fri Apr 19 09:36:50 1991 Jim Kingdon (kingdon at cygint.cygnus.com) * tm-68k.h (NUM_REGS): Conditionalize on TARGET_SUN3 not sun. diff --git a/gdb/coffread.c b/gdb/coffread.c index 68eed3761cd..3dcb2d1026b 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -512,6 +512,7 @@ end_symtab () symtab->blockvector = blockvector; symtab->free_code = free_linetable; symtab->filename = last_source_file; + symtab->dirname = NULL; lv = line_vector; lv->nitems = line_vector_index; symtab->linetable = (struct linetable *) @@ -520,6 +521,9 @@ end_symtab () symtab->nlines = 0; symtab->line_charpos = 0; + symtab->language = language_unknown; + symtab->fullname = NULL; + #ifdef TDESC symtab->coffsem = last_coffsem; symtab->coffsyn = last_coffsyn; @@ -624,7 +628,12 @@ find_linenos (abfd, asect, vpinfo) if (count == 0) return; - size = count * sizeof (struct lineno); +#if !defined (LINESZ) +/* Just in case, you never know what to expect from those + COFF header files. */ +#define LINESZ (sizeof (struct lineno)) +#endif /* No LINESZ. */ + size = count * LINESZ; info = (struct coff_symfile_info *)vpinfo; /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ diff --git a/gdb/symtab.c b/gdb/symtab.c index 96c751f3589..0e77e7fb310 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1371,7 +1371,7 @@ find_line_pc (symtab, line) return 0; l = LINETABLE (symtab); ind = find_line_common(l, line, &dummy); - return ind ? l->item[ind].pc : 0; + return (ind >= 0) ? l->item[ind].pc : 0; } /* Find the range of pc values in a line. @@ -1395,7 +1395,7 @@ find_line_pc_range (symtab, thisline, startptr, endptr) l = LINETABLE (symtab); ind = find_line_common (l, thisline, &exact_match); - if (ind) + if (ind >= 0) { *startptr = l->item[ind].pc; /* If we have not seen an entry for the specified line, @@ -1418,7 +1418,7 @@ find_line_pc_range (symtab, thisline, startptr, endptr) /* Given a line table and a line number, return the index into the line table for the pc of the nearest line whose number is >= the specified one. - Return 0 if none is found. The value is never zero is it is an index. + Return -1 if none is found. The value is >= 0 if it is an index. Set *EXACT_MATCH nonzero if the value returned is an exact match. */ @@ -1435,11 +1435,11 @@ find_line_common (l, lineno, exact_match) or 0 if none has been seen so far. BEST_INDEX identifies the item for it. */ - int best_index = 0; + int best_index = -1; int best = 0; if (lineno <= 0) - return 0; + return -1; len = l->nitems; for (i = 0; i < len; i++) -- 2.30.2