+Fri Jul 17 9:26:50 1998 Ron Unrau <runrau@cygnus.com>
+
+ * blockframe.c (find_pc_sect_partial_function): allow for the possi-
+ bility of multiple symbols at the same address when finding high.
+ * breakpoint.c (resolve_sal_pc): if the function based section lookup
+ fails, try getting the section from the minimal symbol table.
+ * parse.c (write_exp_msymbol): use symbol_overlayed_address to get
+ the LMA of a minimal symbol if unmapped.
+ * symtab.c (find_line_symtab): change interface to return symtab
+ containing the best linetable found.
+ (decode_line_1): use find_line_symtab to set val.symtab. This should
+ improve support for source files with multiple symtabs.
+start-sanitize-sky
+ * tm-txvu.h: include tm-mips64.h instead of starting from scratch.
+end-sanitize-sky
+
Wed Jul 15 11:51:33 1998 Keith Seitz <keiths@cygnus.com>
* main.c (main): Fix violations of GNU coding standard.
#include "command.h"
#include "language.h"
#include "parser-defs.h"
+#include "symfile.h" /* for overlay functions */
\f
/* Global variables declared in parser-defs.h (and commented there). */
struct expression *expout;
struct type *text_symbol_type;
struct type *data_symbol_type;
{
+ CORE_ADDR addr;
+
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (lookup_pointer_type (builtin_type_void));
- write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
+
+ addr = SYMBOL_VALUE_ADDRESS (msymbol);
+ if (overlay_debugging)
+ addr = symbol_overlayed_address (addr, SYMBOL_BFD_SECTION (msymbol));
+ write_exp_elt_longcst ((LONGEST) addr);
+
write_exp_elt_opcode (OP_LONG);
write_exp_elt_opcode (UNOP_MEMVAL);
if (!psymtab)
return 0;
- best_pc = psymtab->textlow - 1;
+ /* Cope with programs that start at address 0 */
+ best_pc = (psymtab->textlow != 0) ? psymtab->textlow - 1 : 0;
/* Search the global symbols as well as the static symbols, so that
find_pc_partial_function doesn't use a minimal symbol and thus
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
&& SYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
- && SYMBOL_VALUE_ADDRESS (p) > best_pc)
+ && (SYMBOL_VALUE_ADDRESS (p) > best_pc
+ || (psymtab->textlow == 0
+ && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
if (section) /* match on a specific section */
{
best = p;
}
}
+
for (pp = psymtab->objfile->static_psymbols.list + psymtab->statics_offset;
(pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset)
< psymtab->n_static_syms);
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
&& SYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
- && SYMBOL_VALUE_ADDRESS (p) > best_pc)
+ && (SYMBOL_VALUE_ADDRESS (p) > best_pc
+ || (psymtab->textlow == 0
+ && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
if (section) /* match on a specific section */
{
best = p;
}
}
- if (best_pc == psymtab->textlow - 1)
- return 0;
+
return best;
}
}
\f
-static int find_line_symtab PARAMS ((struct symtab *, int, struct linetable **,
- int *, int *));
+static struct symtab* find_line_symtab PARAMS ((struct symtab *, int,
+ int *, int *));
/* Find line number LINE in any symtab whose name is the same as
SYMTAB.
- If found, return 1, set *LINETABLE to the linetable in which it was
+ If found, return the symtab that contains the linetable in which it was
found, set *INDEX to the index in the linetable of the best entry
found, and set *EXACT_MATCH nonzero if the value returned is an
exact match.
- If not found, return 0. */
+ If not found, return NULL. */
-static int
-find_line_symtab (symtab, line, linetable, index, exact_match)
+static struct symtab*
+find_line_symtab (symtab, line, index, exact_match)
struct symtab *symtab;
int line;
- struct linetable **linetable;
int *index;
int *exact_match;
{
int best_index;
struct linetable *best_linetable;
+ struct symtab *best_symtab;
/* First try looking it up in the given symtab. */
best_linetable = LINETABLE (symtab);
+ best_symtab = symtab;
best_index = find_line_common (best_linetable, line, &exact);
if (best_index < 0 || !exact)
{
{
best_index = ind;
best_linetable = l;
+ best_symtab = s;
goto done;
}
if (best == 0 || l->item[ind].line < best)
best = l->item[ind].line;
best_index = ind;
best_linetable = l;
+ best_symtab = s;
}
}
}
}
done:
if (best_index < 0)
- return 0;
+ return NULL;
if (index)
*index = best_index;
- if (linetable)
- *linetable = best_linetable;
if (exact_match)
*exact_match = exact;
- return 1;
+
+ return best_symtab;
}
\f
/* Set the PC value for a given source file and line number and return true.
if (symtab == 0)
return 0;
- if (find_line_symtab (symtab, line, &l, &ind, NULL))
+ symtab = find_line_symtab (symtab, line, &ind, NULL);
+ if (symtab != NULL)
{
+ l = LINETABLE (symtab);
*pc = l->item[ind].pc;
return 1;
}
*argptr = q;
if (s == 0)
s = default_symtab;
- val.symtab = s;
+
+ /* It is possible that this source file has more than one symtab,
+ and that the new line number specification has moved us from the
+ default (in s) to a new one. */
+ val.symtab = find_line_symtab (s, val.line, NULL, NULL);
+ if (val.symtab == 0)
+ val.symtab = s;
+
val.pc = 0;
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));