2002-10-24 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (INIT_SAL): Delete macro. (init_sal): Export. * symtab.c (init_sal): New function. * ada-lang.c (ada_finish_decode_line_1): Change INIT_SAL macro to init_sal function call. (find_sal_from_funcs_and_line): Ditto. (all_sals_for_line): Ditto. * breakpoint.c (create_internal_breakpoint): Ditto. (create_fork_vfork_event_catchpoint): Ditto. (create_exec_event_catchpoint): Ditto. (parse_breakpoint_sals): Ditto. (watch_command_1): Ditto. (handle_gnu_4_16_catch_command): Ditto. (clear_command): Ditto. * hppa-tdep.c (child_enable_exception_callback): Ditto. * infcmd.c (run_stack_dummy): Ditto. * infrun.c (process_event_stop_test): Ditto. (check_sigtramp2): Ditto. (step_over_function): Ditto. * linespec.c (decode_line_2): Ditto. (decode_line_1): Ditto. * source.c (line_info): Ditto. * symtab.c (find_pc_sect_line): Ditto.
This commit is contained in:
parent
b64bbf8c48
commit
fe39c6533d
10 changed files with 63 additions and 31 deletions
|
@ -1,3 +1,30 @@
|
||||||
|
2002-10-24 Elena Zannoni <ezannoni@redhat.com>
|
||||||
|
|
||||||
|
* symtab.h (INIT_SAL): Delete macro.
|
||||||
|
(init_sal): Export.
|
||||||
|
* symtab.c (init_sal): New function.
|
||||||
|
|
||||||
|
* ada-lang.c (ada_finish_decode_line_1): Change INIT_SAL macro
|
||||||
|
to init_sal function call.
|
||||||
|
(find_sal_from_funcs_and_line): Ditto.
|
||||||
|
(all_sals_for_line): Ditto.
|
||||||
|
* breakpoint.c (create_internal_breakpoint): Ditto.
|
||||||
|
(create_fork_vfork_event_catchpoint): Ditto.
|
||||||
|
(create_exec_event_catchpoint): Ditto.
|
||||||
|
(parse_breakpoint_sals): Ditto.
|
||||||
|
(watch_command_1): Ditto.
|
||||||
|
(handle_gnu_4_16_catch_command): Ditto.
|
||||||
|
(clear_command): Ditto.
|
||||||
|
* hppa-tdep.c (child_enable_exception_callback): Ditto.
|
||||||
|
* infcmd.c (run_stack_dummy): Ditto.
|
||||||
|
* infrun.c (process_event_stop_test): Ditto.
|
||||||
|
(check_sigtramp2): Ditto.
|
||||||
|
(step_over_function): Ditto.
|
||||||
|
* linespec.c (decode_line_2): Ditto.
|
||||||
|
(decode_line_1): Ditto.
|
||||||
|
* source.c (line_info): Ditto.
|
||||||
|
* symtab.c (find_pc_sect_line): Ditto.
|
||||||
|
|
||||||
2002-10-24 Michal Ludvig <mludvig@suse.cz>
|
2002-10-24 Michal Ludvig <mludvig@suse.cz>
|
||||||
|
|
||||||
* dwarf2cfi.c (struct context)
|
* dwarf2cfi.c (struct context)
|
||||||
|
|
|
@ -4395,7 +4395,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
|
||||||
#endif
|
#endif
|
||||||
struct minimal_symbol *msymbol;
|
struct minimal_symbol *msymbol;
|
||||||
|
|
||||||
INIT_SAL (&val);
|
init_sal (&val);
|
||||||
|
|
||||||
msymbol = NULL;
|
msymbol = NULL;
|
||||||
if (lower_name != NULL)
|
if (lower_name != NULL)
|
||||||
|
@ -4537,7 +4537,7 @@ done:
|
||||||
sals.nelts = 1;
|
sals.nelts = 1;
|
||||||
sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0]));
|
sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0]));
|
||||||
|
|
||||||
INIT_SAL (&sals.sals[0]);
|
init_sal (&sals.sals[0]);
|
||||||
|
|
||||||
sals.sals[0].line = best_linetable->item[best_index].line;
|
sals.sals[0].line = best_linetable->item[best_index].line;
|
||||||
sals.sals[0].pc = best_linetable->item[best_index].pc;
|
sals.sals[0].pc = best_linetable->item[best_index].pc;
|
||||||
|
@ -4856,7 +4856,7 @@ all_sals_for_line (const char *filename, int line_num, char ***canonical)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
GROW_VECT (result.sals, len, result.nelts + 1);
|
GROW_VECT (result.sals, len, result.nelts + 1);
|
||||||
INIT_SAL (&result.sals[result.nelts]);
|
init_sal (&result.sals[result.nelts]);
|
||||||
result.sals[result.nelts].line = LINETABLE (s)->item[ind].line;
|
result.sals[result.nelts].line = LINETABLE (s)->item[ind].line;
|
||||||
result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
|
result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
|
||||||
result.sals[result.nelts].symtab = s;
|
result.sals[result.nelts].symtab = s;
|
||||||
|
|
|
@ -3884,7 +3884,7 @@ create_internal_breakpoint (CORE_ADDR address, enum bptype type)
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
|
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
|
|
||||||
sal.pc = address;
|
sal.pc = address;
|
||||||
sal.section = find_pc_overlay (sal.pc);
|
sal.section = find_pc_overlay (sal.pc);
|
||||||
|
@ -4204,7 +4204,7 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
int thread = -1; /* All threads. */
|
int thread = -1; /* All threads. */
|
||||||
|
|
||||||
INIT_SAL (&sal);
|
init_sal (&sal);
|
||||||
sal.pc = 0;
|
sal.pc = 0;
|
||||||
sal.symtab = NULL;
|
sal.symtab = NULL;
|
||||||
sal.line = 0;
|
sal.line = 0;
|
||||||
|
@ -4243,7 +4243,7 @@ create_exec_event_catchpoint (int tempflag, char *cond_string)
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
int thread = -1; /* All threads. */
|
int thread = -1; /* All threads. */
|
||||||
|
|
||||||
INIT_SAL (&sal);
|
init_sal (&sal);
|
||||||
sal.pc = 0;
|
sal.pc = 0;
|
||||||
sal.symtab = NULL;
|
sal.symtab = NULL;
|
||||||
sal.line = 0;
|
sal.line = 0;
|
||||||
|
@ -4600,7 +4600,7 @@ parse_breakpoint_sals (char **address,
|
||||||
if (default_breakpoint_valid)
|
if (default_breakpoint_valid)
|
||||||
{
|
{
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
sals->sals = (struct symtab_and_line *)
|
sals->sals = (struct symtab_and_line *)
|
||||||
xmalloc (sizeof (struct symtab_and_line));
|
xmalloc (sizeof (struct symtab_and_line));
|
||||||
sal.pc = default_breakpoint_address;
|
sal.pc = default_breakpoint_address;
|
||||||
|
@ -5296,7 +5296,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
|
||||||
enum bptype bp_type;
|
enum bptype bp_type;
|
||||||
int mem_cnt = 0;
|
int mem_cnt = 0;
|
||||||
|
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
|
|
||||||
/* Parse arguments. */
|
/* Parse arguments. */
|
||||||
innermost_block = NULL;
|
innermost_block = NULL;
|
||||||
|
@ -6262,7 +6262,7 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty)
|
||||||
char *save_arg;
|
char *save_arg;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
|
|
||||||
/* If no arg given, or if first arg is 'if ', all active catch clauses
|
/* If no arg given, or if first arg is 'if ', all active catch clauses
|
||||||
are breakpointed. */
|
are breakpointed. */
|
||||||
|
@ -6533,7 +6533,7 @@ clear_command (char *arg, int from_tty)
|
||||||
sals.sals = (struct symtab_and_line *)
|
sals.sals = (struct symtab_and_line *)
|
||||||
xmalloc (sizeof (struct symtab_and_line));
|
xmalloc (sizeof (struct symtab_and_line));
|
||||||
make_cleanup (xfree, sals.sals);
|
make_cleanup (xfree, sals.sals);
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
sal.line = default_breakpoint_line;
|
sal.line = default_breakpoint_line;
|
||||||
sal.symtab = default_breakpoint_symtab;
|
sal.symtab = default_breakpoint_symtab;
|
||||||
sal.pc = default_breakpoint_address;
|
sal.pc = default_breakpoint_address;
|
||||||
|
|
|
@ -4426,7 +4426,7 @@ child_enable_exception_callback (enum exception_event_kind kind, int enable)
|
||||||
{
|
{
|
||||||
break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
|
break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
|
||||||
}
|
}
|
||||||
INIT_SAL (break_callback_sal);
|
init_sal (break_callback_sal);
|
||||||
break_callback_sal->symtab = NULL;
|
break_callback_sal->symtab = NULL;
|
||||||
break_callback_sal->pc = eh_break_addr;
|
break_callback_sal->pc = eh_break_addr;
|
||||||
break_callback_sal->line = 0;
|
break_callback_sal->line = 0;
|
||||||
|
|
|
@ -983,7 +983,7 @@ run_stack_dummy (CORE_ADDR addr, struct regcache *buffer)
|
||||||
struct breakpoint *bpt;
|
struct breakpoint *bpt;
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
|
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
|
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
|
||||||
{
|
{
|
||||||
sal.pc = CALL_DUMMY_ADDRESS ();
|
sal.pc = CALL_DUMMY_ADDRESS ();
|
||||||
|
|
14
gdb/infrun.c
14
gdb/infrun.c
|
@ -2603,7 +2603,7 @@ process_event_stop_test:
|
||||||
/* Set up a step-resume breakpoint at the address
|
/* Set up a step-resume breakpoint at the address
|
||||||
indicated by SKIP_SOLIB_RESOLVER. */
|
indicated by SKIP_SOLIB_RESOLVER. */
|
||||||
struct symtab_and_line sr_sal;
|
struct symtab_and_line sr_sal;
|
||||||
INIT_SAL (&sr_sal);
|
init_sal (&sr_sal);
|
||||||
sr_sal.pc = pc_after_resolver;
|
sr_sal.pc = pc_after_resolver;
|
||||||
|
|
||||||
check_for_old_step_resume_breakpoint ();
|
check_for_old_step_resume_breakpoint ();
|
||||||
|
@ -2656,7 +2656,7 @@ process_event_stop_test:
|
||||||
breakpoint even though the signal happened. */
|
breakpoint even though the signal happened. */
|
||||||
struct symtab_and_line sr_sal;
|
struct symtab_and_line sr_sal;
|
||||||
|
|
||||||
INIT_SAL (&sr_sal);
|
init_sal (&sr_sal);
|
||||||
sr_sal.symtab = NULL;
|
sr_sal.symtab = NULL;
|
||||||
sr_sal.line = 0;
|
sr_sal.line = 0;
|
||||||
sr_sal.pc = prev_pc;
|
sr_sal.pc = prev_pc;
|
||||||
|
@ -2769,7 +2769,7 @@ process_event_stop_test:
|
||||||
struct symtab_and_line xxx;
|
struct symtab_and_line xxx;
|
||||||
/* Why isn't this s_a_l called "sr_sal", like all of the
|
/* Why isn't this s_a_l called "sr_sal", like all of the
|
||||||
other s_a_l's where this code is duplicated? */
|
other s_a_l's where this code is duplicated? */
|
||||||
INIT_SAL (&xxx); /* initialize to zeroes */
|
init_sal (&xxx); /* initialize to zeroes */
|
||||||
xxx.pc = tmp;
|
xxx.pc = tmp;
|
||||||
xxx.section = find_pc_overlay (xxx.pc);
|
xxx.section = find_pc_overlay (xxx.pc);
|
||||||
check_for_old_step_resume_breakpoint ();
|
check_for_old_step_resume_breakpoint ();
|
||||||
|
@ -2844,7 +2844,7 @@ process_event_stop_test:
|
||||||
/* And put the step-breakpoint there and go until there. */
|
/* And put the step-breakpoint there and go until there. */
|
||||||
struct symtab_and_line sr_sal;
|
struct symtab_and_line sr_sal;
|
||||||
|
|
||||||
INIT_SAL (&sr_sal); /* initialize to zeroes */
|
init_sal (&sr_sal); /* initialize to zeroes */
|
||||||
sr_sal.pc = tmp;
|
sr_sal.pc = tmp;
|
||||||
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
||||||
/* Do not specify what the fp should be when we stop
|
/* Do not specify what the fp should be when we stop
|
||||||
|
@ -2960,7 +2960,7 @@ check_sigtramp2 (struct execution_control_state *ecs)
|
||||||
|
|
||||||
struct symtab_and_line sr_sal;
|
struct symtab_and_line sr_sal;
|
||||||
|
|
||||||
INIT_SAL (&sr_sal); /* initialize to zeroes */
|
init_sal (&sr_sal); /* initialize to zeroes */
|
||||||
sr_sal.pc = prev_pc;
|
sr_sal.pc = prev_pc;
|
||||||
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
||||||
/* We perhaps could set the frame if we kept track of what the
|
/* We perhaps could set the frame if we kept track of what the
|
||||||
|
@ -3016,7 +3016,7 @@ step_into_function (struct execution_control_state *ecs)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Put the step-breakpoint there and go until there. */
|
/* Put the step-breakpoint there and go until there. */
|
||||||
INIT_SAL (&sr_sal); /* initialize to zeroes */
|
init_sal (&sr_sal); /* initialize to zeroes */
|
||||||
sr_sal.pc = ecs->stop_func_start;
|
sr_sal.pc = ecs->stop_func_start;
|
||||||
sr_sal.section = find_pc_overlay (ecs->stop_func_start);
|
sr_sal.section = find_pc_overlay (ecs->stop_func_start);
|
||||||
/* Do not specify what the fp should be when we stop since on
|
/* Do not specify what the fp should be when we stop since on
|
||||||
|
@ -3051,7 +3051,7 @@ step_over_function (struct execution_control_state *ecs)
|
||||||
{
|
{
|
||||||
struct symtab_and_line sr_sal;
|
struct symtab_and_line sr_sal;
|
||||||
|
|
||||||
INIT_SAL (&sr_sal); /* initialize to zeros */
|
init_sal (&sr_sal); /* initialize to zeros */
|
||||||
sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
|
sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
|
||||||
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
||||||
|
|
||||||
|
|
|
@ -367,8 +367,8 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
|
||||||
printf_unfiltered ("[0] cancel\n[1] all\n");
|
printf_unfiltered ("[0] cancel\n[1] all\n");
|
||||||
while (i < nelts)
|
while (i < nelts)
|
||||||
{
|
{
|
||||||
INIT_SAL (&return_values.sals[i]); /* initialize to zeroes */
|
init_sal (&return_values.sals[i]); /* initialize to zeroes */
|
||||||
INIT_SAL (&values.sals[i]);
|
init_sal (&values.sals[i]);
|
||||||
if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
|
if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
|
||||||
{
|
{
|
||||||
values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
|
values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
|
||||||
|
@ -536,7 +536,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
|
||||||
char *saved_arg = *argptr;
|
char *saved_arg = *argptr;
|
||||||
extern char *gdb_completer_quote_characters;
|
extern char *gdb_completer_quote_characters;
|
||||||
|
|
||||||
INIT_SAL (&val); /* initialize to zeroes */
|
init_sal (&val); /* initialize to zeroes */
|
||||||
|
|
||||||
/* Defaults have defaults. */
|
/* Defaults have defaults. */
|
||||||
|
|
||||||
|
|
|
@ -1221,7 +1221,7 @@ line_info (char *arg, int from_tty)
|
||||||
CORE_ADDR start_pc, end_pc;
|
CORE_ADDR start_pc, end_pc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
INIT_SAL (&sal); /* initialize to zeroes */
|
init_sal (&sal); /* initialize to zeroes */
|
||||||
|
|
||||||
if (arg == 0)
|
if (arg == 0)
|
||||||
{
|
{
|
||||||
|
|
13
gdb/symtab.c
13
gdb/symtab.c
|
@ -488,6 +488,17 @@ symbol_demangled_name (struct general_symbol_info *gsymbol)
|
||||||
/* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */
|
/* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */
|
||||||
/* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */
|
/* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialize the structure fields to zero values. */
|
||||||
|
void
|
||||||
|
init_sal (struct symtab_and_line *sal)
|
||||||
|
{
|
||||||
|
sal->symtab = 0;
|
||||||
|
sal->section = 0;
|
||||||
|
sal->line = 0;
|
||||||
|
sal->pc = 0;
|
||||||
|
sal->end = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1823,7 +1834,7 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent)
|
||||||
But what we want is the statement containing the instruction.
|
But what we want is the statement containing the instruction.
|
||||||
Fudge the pc to make sure we get that. */
|
Fudge the pc to make sure we get that. */
|
||||||
|
|
||||||
INIT_SAL (&val); /* initialize to zeroes */
|
init_sal (&val); /* initialize to zeroes */
|
||||||
|
|
||||||
/* It's tempting to assume that, if we can't find debugging info for
|
/* It's tempting to assume that, if we can't find debugging info for
|
||||||
any function enclosing PC, that we shouldn't search for line
|
any function enclosing PC, that we shouldn't search for line
|
||||||
|
|
|
@ -1207,13 +1207,7 @@ struct symtab_and_line
|
||||||
CORE_ADDR end;
|
CORE_ADDR end;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define INIT_SAL(sal) { \
|
extern void init_sal (struct symtab_and_line *sal);
|
||||||
(sal)->symtab = 0; \
|
|
||||||
(sal)->section = 0; \
|
|
||||||
(sal)->line = 0; \
|
|
||||||
(sal)->pc = 0; \
|
|
||||||
(sal)->end = 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
struct symtabs_and_lines
|
struct symtabs_and_lines
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue