This commit is contained in:
K. Richard Pixley 1993-09-08 21:30:33 +00:00
parent 72cd0384f2
commit fee933f19c
3 changed files with 48 additions and 27 deletions

View file

@ -1,6 +1,15 @@
Wed Sep 8 13:01:10 1993 K. Richard Pixley (rich@cygnus.com) Wed Sep 8 13:01:10 1993 K. Richard Pixley (rich@cygnus.com)
Gcc lint. Gcc lint.
* blockframe.c (get_prev_frame_info): initialize address.
* breakpoint.c (bpstat_copy): initialize retval.
(bpstat_stop_status): initialize value_is_zero.
(bpstat_what): initialize bs_class.
(breakpoint_1, mention): add do-nothing case for bp_step_resume.
(break_command_1): initialize cond_end, addr_end, &
canonical_strings_chain.
(enable_breakpoint): initialize save_selected_frame.
* buildsym.c (end_symtab): initialize symtab & linetablesize.
* c-exp.y (parse_number): initialize i. * c-exp.y (parse_number): initialize i.
* c-typeprint.c (c_type_print_varspec_prefix): include * c-typeprint.c (c_type_print_varspec_prefix): include
TYPE_CODE_BITSTRING in switch statements and do nothing. TYPE_CODE_BITSTRING in switch statements and do nothing.

View file

@ -570,7 +570,7 @@ bpstat_copy (bs)
{ {
bpstat p = NULL; bpstat p = NULL;
bpstat tmp; bpstat tmp;
bpstat retval; bpstat retval = NULL;
if (bs == NULL) if (bs == NULL)
return bs; return bs;
@ -1100,7 +1100,7 @@ bpstat_stop_status (pc, frame_address)
bs->stop = 0; bs->stop = 0;
else else
{ {
int value_is_zero; int value_is_zero = 0;
if (b->cond) if (b->cond)
{ {
@ -1249,7 +1249,7 @@ bpstat_what (bs)
for (; bs != NULL; bs = bs->next) for (; bs != NULL; bs = bs->next)
{ {
enum class bs_class; enum class bs_class = no_effect;
if (bs->breakpoint_at == NULL) if (bs->breakpoint_at == NULL)
/* I suspect this can happen if it was a momentary breakpoint /* I suspect this can happen if it was a momentary breakpoint
which has since been deleted. */ which has since been deleted. */
@ -1352,12 +1352,6 @@ breakpoint_1 (bnum, allflag)
static char bpenables[] = "ny"; static char bpenables[] = "ny";
char wrap_indent[80]; char wrap_indent[80];
if (!breakpoint_chain)
{
printf_filtered ("No breakpoints or watchpoints.\n");
return;
}
ALL_BREAKPOINTS (b) ALL_BREAKPOINTS (b)
if (bnum == -1 if (bnum == -1
|| bnum == b->number) || bnum == b->number)
@ -1409,6 +1403,9 @@ breakpoint_1 (bnum, allflag)
} }
else else
print_address_symbolic (b->address, stdout, demangle, " "); print_address_symbolic (b->address, stdout, demangle, " ");
/* intentional fall-through */
case bp_step_resume: /* do nothing. */
break;
} }
printf_filtered ("\n"); printf_filtered ("\n");
@ -1434,9 +1431,13 @@ breakpoint_1 (bnum, allflag)
} }
} }
if (!found_a_breakpoint if (!found_a_breakpoint)
&& bnum != -1) {
printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum); if (bnum == -1)
printf_filtered ("No breakpoints or watchpoints.\n");
else
printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
}
else else
/* Compare against (CORE_ADDR)-1 in case some compiler decides /* Compare against (CORE_ADDR)-1 in case some compiler decides
that a comparison of an unsigned with -1 is always false. */ that a comparison of an unsigned with -1 is always false. */
@ -1743,6 +1744,7 @@ mention (b)
case bp_finish: case bp_finish:
case bp_longjmp: case bp_longjmp:
case bp_longjmp_resume: case bp_longjmp_resume:
case bp_step_resume:
break; break;
} }
printf_filtered ("\n"); printf_filtered ("\n");
@ -1801,13 +1803,13 @@ break_command_1 (arg, tempflag, from_tty)
/* Pointers in arg to the start, and one past the end, of the condition. */ /* Pointers in arg to the start, and one past the end, of the condition. */
char *cond_start = NULL; char *cond_start = NULL;
char *cond_end; char *cond_end = NULL;
/* Pointers in arg to the start, and one past the end, /* Pointers in arg to the start, and one past the end,
of the address part. */ of the address part. */
char *addr_start = NULL; char *addr_start = NULL;
char *addr_end; char *addr_end = NULL;
struct cleanup *old_chain; struct cleanup *old_chain;
struct cleanup *canonical_strings_chain; struct cleanup *canonical_strings_chain = NULL;
char **canonical = (char **)NULL; char **canonical = (char **)NULL;
int i; int i;
@ -2615,12 +2617,30 @@ breakpoint_re_set_one (bint)
for (i = 0; i < sals.nelts; i++) for (i = 0; i < sals.nelts; i++)
{ {
resolve_sal_pc (&sals.sals[i]); resolve_sal_pc (&sals.sals[i]);
/* Reparse conditions, they might contain references to the
old symtab. */
if (b->cond_string != NULL)
{
s = b->cond_string;
if (b->cond)
free ((PTR)b->cond);
b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
}
/* We need to re-set the breakpoint if the address changes...*/
if (b->address != sals.sals[i].pc if (b->address != sals.sals[i].pc
/* ...or new and old breakpoints both have source files, and
the source file name or the line number changes... */
|| (b->source_file != NULL || (b->source_file != NULL
&& sals.sals[i].symtab != NULL && sals.sals[i].symtab != NULL
&& (!STREQ (b->source_file, sals.sals[i].symtab->filename) && (!STREQ (b->source_file, sals.sals[i].symtab->filename)
|| b->line_number != sals.sals[i].line) || b->line_number != sals.sals[i].line)
)) )
/* ...or we switch between having a source file and not having
one. */
|| ((b->source_file == NULL) != (sals.sals[i].symtab == NULL))
)
{ {
if (b->source_file != NULL) if (b->source_file != NULL)
free (b->source_file); free (b->source_file);
@ -2633,14 +2653,6 @@ breakpoint_re_set_one (bint)
b->line_number = sals.sals[i].line; b->line_number = sals.sals[i].line;
b->address = sals.sals[i].pc; b->address = sals.sals[i].pc;
if (b->cond_string != NULL)
{
s = b->cond_string;
if (b->cond)
free ((PTR)b->cond);
b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
}
check_duplicates (b->address); check_duplicates (b->address);
mention (b); mention (b);
@ -2824,7 +2836,7 @@ static void
enable_breakpoint (bpt) enable_breakpoint (bpt)
struct breakpoint *bpt; struct breakpoint *bpt;
{ {
FRAME save_selected_frame; FRAME save_selected_frame = NULL;
int save_selected_frame_level = -1; int save_selected_frame_level = -1;
bpt->enable = enabled; bpt->enable = enabled;

View file

@ -653,7 +653,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section)
struct objfile *objfile; struct objfile *objfile;
int section; int section;
{ {
register struct symtab *symtab; register struct symtab *symtab = NULL;
register struct blockvector *blockvector; register struct blockvector *blockvector;
register struct subfile *subfile; register struct subfile *subfile;
register struct context_stack *cstk; register struct context_stack *cstk;
@ -751,7 +751,7 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section)
for (subfile = subfiles; subfile; subfile = nextsub) for (subfile = subfiles; subfile; subfile = nextsub)
{ {
int linetablesize; int linetablesize = 0;
/* If we have blocks of symbols, make a symtab. /* If we have blocks of symbols, make a symtab.
Otherwise, just ignore this file and any line number info in it. */ Otherwise, just ignore this file and any line number info in it. */
symtab = NULL; symtab = NULL;