* 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. * tm-txvu.h: include tm-mips64.h instead of starting from scratch.
This commit is contained in:
parent
4c4a5de543
commit
36297ff31d
|
@ -1,3 +1,19 @@
|
||||||
|
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>
|
Wed Jul 15 11:51:33 1998 Keith Seitz <keiths@cygnus.com>
|
||||||
|
|
||||||
* main.c (main): Fix violations of GNU coding standard.
|
* main.c (main): Fix violations of GNU coding standard.
|
||||||
|
|
10
gdb/parse.c
10
gdb/parse.c
|
@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "parser-defs.h"
|
#include "parser-defs.h"
|
||||||
|
#include "symfile.h" /* for overlay functions */
|
||||||
|
|
||||||
/* Global variables declared in parser-defs.h (and commented there). */
|
/* Global variables declared in parser-defs.h (and commented there). */
|
||||||
struct expression *expout;
|
struct expression *expout;
|
||||||
|
@ -406,9 +407,16 @@ write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
|
||||||
struct type *text_symbol_type;
|
struct type *text_symbol_type;
|
||||||
struct type *data_symbol_type;
|
struct type *data_symbol_type;
|
||||||
{
|
{
|
||||||
|
CORE_ADDR addr;
|
||||||
|
|
||||||
write_exp_elt_opcode (OP_LONG);
|
write_exp_elt_opcode (OP_LONG);
|
||||||
write_exp_elt_type (lookup_pointer_type (builtin_type_void));
|
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 (OP_LONG);
|
||||||
|
|
||||||
write_exp_elt_opcode (UNOP_MEMVAL);
|
write_exp_elt_opcode (UNOP_MEMVAL);
|
||||||
|
|
48
gdb/symtab.c
48
gdb/symtab.c
|
@ -439,7 +439,8 @@ find_pc_sect_psymbol (psymtab, pc, section)
|
||||||
if (!psymtab)
|
if (!psymtab)
|
||||||
return 0;
|
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
|
/* Search the global symbols as well as the static symbols, so that
|
||||||
find_pc_partial_function doesn't use a minimal symbol and thus
|
find_pc_partial_function doesn't use a minimal symbol and thus
|
||||||
|
@ -453,7 +454,9 @@ find_pc_sect_psymbol (psymtab, pc, section)
|
||||||
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
|
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
|
||||||
&& SYMBOL_CLASS (p) == LOC_BLOCK
|
&& SYMBOL_CLASS (p) == LOC_BLOCK
|
||||||
&& pc >= SYMBOL_VALUE_ADDRESS (p)
|
&& 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 */
|
if (section) /* match on a specific section */
|
||||||
{
|
{
|
||||||
|
@ -465,6 +468,7 @@ find_pc_sect_psymbol (psymtab, pc, section)
|
||||||
best = p;
|
best = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pp = psymtab->objfile->static_psymbols.list + psymtab->statics_offset;
|
for (pp = psymtab->objfile->static_psymbols.list + psymtab->statics_offset;
|
||||||
(pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset)
|
(pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset)
|
||||||
< psymtab->n_static_syms);
|
< psymtab->n_static_syms);
|
||||||
|
@ -474,7 +478,9 @@ find_pc_sect_psymbol (psymtab, pc, section)
|
||||||
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
|
if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
|
||||||
&& SYMBOL_CLASS (p) == LOC_BLOCK
|
&& SYMBOL_CLASS (p) == LOC_BLOCK
|
||||||
&& pc >= SYMBOL_VALUE_ADDRESS (p)
|
&& 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 */
|
if (section) /* match on a specific section */
|
||||||
{
|
{
|
||||||
|
@ -486,8 +492,7 @@ find_pc_sect_psymbol (psymtab, pc, section)
|
||||||
best = p;
|
best = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best_pc == psymtab->textlow - 1)
|
|
||||||
return 0;
|
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1466,24 +1471,23 @@ find_pc_line (pc, notcurrent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int find_line_symtab PARAMS ((struct symtab *, int, struct linetable **,
|
static struct symtab* find_line_symtab PARAMS ((struct symtab *, int,
|
||||||
int *, int *));
|
int *, int *));
|
||||||
|
|
||||||
/* Find line number LINE in any symtab whose name is the same as
|
/* Find line number LINE in any symtab whose name is the same as
|
||||||
SYMTAB.
|
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, set *INDEX to the index in the linetable of the best entry
|
||||||
found, and set *EXACT_MATCH nonzero if the value returned is an
|
found, and set *EXACT_MATCH nonzero if the value returned is an
|
||||||
exact match.
|
exact match.
|
||||||
|
|
||||||
If not found, return 0. */
|
If not found, return NULL. */
|
||||||
|
|
||||||
static int
|
static struct symtab*
|
||||||
find_line_symtab (symtab, line, linetable, index, exact_match)
|
find_line_symtab (symtab, line, index, exact_match)
|
||||||
struct symtab *symtab;
|
struct symtab *symtab;
|
||||||
int line;
|
int line;
|
||||||
struct linetable **linetable;
|
|
||||||
int *index;
|
int *index;
|
||||||
int *exact_match;
|
int *exact_match;
|
||||||
{
|
{
|
||||||
|
@ -1494,9 +1498,11 @@ find_line_symtab (symtab, line, linetable, index, exact_match)
|
||||||
|
|
||||||
int best_index;
|
int best_index;
|
||||||
struct linetable *best_linetable;
|
struct linetable *best_linetable;
|
||||||
|
struct symtab *best_symtab;
|
||||||
|
|
||||||
/* First try looking it up in the given symtab. */
|
/* First try looking it up in the given symtab. */
|
||||||
best_linetable = LINETABLE (symtab);
|
best_linetable = LINETABLE (symtab);
|
||||||
|
best_symtab = symtab;
|
||||||
best_index = find_line_common (best_linetable, line, &exact);
|
best_index = find_line_common (best_linetable, line, &exact);
|
||||||
if (best_index < 0 || !exact)
|
if (best_index < 0 || !exact)
|
||||||
{
|
{
|
||||||
|
@ -1535,6 +1541,7 @@ find_line_symtab (symtab, line, linetable, index, exact_match)
|
||||||
{
|
{
|
||||||
best_index = ind;
|
best_index = ind;
|
||||||
best_linetable = l;
|
best_linetable = l;
|
||||||
|
best_symtab = s;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (best == 0 || l->item[ind].line < best)
|
if (best == 0 || l->item[ind].line < best)
|
||||||
|
@ -1542,21 +1549,21 @@ find_line_symtab (symtab, line, linetable, index, exact_match)
|
||||||
best = l->item[ind].line;
|
best = l->item[ind].line;
|
||||||
best_index = ind;
|
best_index = ind;
|
||||||
best_linetable = l;
|
best_linetable = l;
|
||||||
|
best_symtab = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
if (best_index < 0)
|
if (best_index < 0)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
if (index)
|
if (index)
|
||||||
*index = best_index;
|
*index = best_index;
|
||||||
if (linetable)
|
|
||||||
*linetable = best_linetable;
|
|
||||||
if (exact_match)
|
if (exact_match)
|
||||||
*exact_match = exact;
|
*exact_match = exact;
|
||||||
return 1;
|
|
||||||
|
return best_symtab;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the PC value for a given source file and line number and return true.
|
/* Set the PC value for a given source file and line number and return true.
|
||||||
|
@ -1576,8 +1583,10 @@ find_line_pc (symtab, line, pc)
|
||||||
if (symtab == 0)
|
if (symtab == 0)
|
||||||
return 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;
|
*pc = l->item[ind].pc;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -2427,7 +2436,14 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
|
||||||
*argptr = q;
|
*argptr = q;
|
||||||
if (s == 0)
|
if (s == 0)
|
||||||
s = default_symtab;
|
s = default_symtab;
|
||||||
|
|
||||||
|
/* 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.symtab = s;
|
||||||
|
|
||||||
val.pc = 0;
|
val.pc = 0;
|
||||||
values.sals = (struct symtab_and_line *)
|
values.sals = (struct symtab_and_line *)
|
||||||
xmalloc (sizeof (struct symtab_and_line));
|
xmalloc (sizeof (struct symtab_and_line));
|
||||||
|
|
Loading…
Reference in New Issue