From 7f7e9482db3f4c15bcc4f2b341b6fc7244a418aa Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 27 Nov 2000 02:18:44 +0000 Subject: [PATCH] * remote.c (remote_write_bytes): Add default case to switch initializing ``todo''. Ditto for ``nr_bytes''. * top.c (catch_errors): Always initialize ``val''. * solib.c (info_sharedlibrary_command): Handle bfd_get_arch_size returning an unknown size. * gdbtypes.c (count_virtual_fns): Always initialize ``vfuncs''. * breakpoint.c (break_at_finish_at_depth_command_1): Initialise extra_args to NULL. (break_at_finish_command_1): Ditto. --- gdb/ChangeLog | 12 ++++++++++++ gdb/breakpoint.c | 6 ++++-- gdb/gdbtypes.c | 2 ++ gdb/remote.c | 10 ++++++++-- gdb/solib.c | 5 +++++ gdb/top.c | 2 ++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5902026a05d..9b527bbafc9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +Mon Nov 27 11:45:52 2000 Andrew Cagney + + * remote.c (remote_write_bytes): Add default case to switch + initializing ``todo''. Ditto for ``nr_bytes''. + * top.c (catch_errors): Always initialize ``val''. + * solib.c (info_sharedlibrary_command): Handle bfd_get_arch_size + returning an unknown size. + * gdbtypes.c (count_virtual_fns): Always initialize ``vfuncs''. + * breakpoint.c (break_at_finish_at_depth_command_1): Initialise + extra_args to NULL. + (break_at_finish_command_1): Ditto. + Mon Nov 27 11:27:06 2000 Andrew Cagney * TODO: Add GFDL updates to 5.1 release criteria. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 6f648f67dfe..d7b128ce506 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4905,7 +4905,9 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty) { struct frame_info *frame; CORE_ADDR low, high, selected_pc = 0; - char *extra_args, *level_arg, *addr_string; + char *extra_args = NULL; + char *level_arg; + char *addr_string; int extra_args_len = 0, if_arg = 0; if (!arg || @@ -4983,7 +4985,7 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty) struct symtabs_and_lines sals; struct symtab_and_line sal; struct cleanup *old_chain; - char *extra_args; + char *extra_args = NULL; int extra_args_len = 0; int i, if_arg = 0; diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index d9f6e0e1ed4..c54d4726c35 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1986,6 +1986,8 @@ count_virtual_fns (struct type *dclass) struct type *pbc = primary_base_class (dclass); if (pbc) vfuncs = count_virtual_fns (pbc); + else + vfuncs = 0; for (fn = 0; fn < TYPE_NFN_FIELDS (dclass); fn++) for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (dclass, fn); oi++) diff --git a/gdb/remote.c b/gdb/remote.c index 2b8279cb031..9b49b970ba7 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3363,7 +3363,10 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) todo = min (len, max_buf_size / 2); break; case PACKET_SUPPORT_UNKNOWN: - internal_error ("remote_write_bytes: bad switch"); + internal_error ("%s:%d: remote_write_bytes: bad internal state", + __FILE__, __LINE__); + default: + internal_error ("%s:%d: bad switch", __FILE__, __LINE__); } /* Append */ @@ -3427,7 +3430,10 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) *p = '\0'; break; case PACKET_SUPPORT_UNKNOWN: - internal_error ("remote_write_bytes: bad switch"); + internal_error ("%s:%d: remote_write_bytes: bad internal state", + __FILE__, __LINE__); + default: + internal_error ("%s:%d: bad switch", __FILE__, __LINE__); } putpkt_binary (buf, (int) (p - buf)); diff --git a/gdb/solib.c b/gdb/solib.c index 288a54a4a91..b8ffaa3d11b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -613,6 +613,11 @@ info_sharedlibrary_command (char *ignore, int from_tty) addr_width = 16 + 4; addr_fmt = "016l"; } + else + { + internal_error ("%s:%d: bfd_get_arch_size() returned unknown size %d", + __FILE__, __LINE__, arch_size); + } update_solib_list (from_tty, 0); diff --git a/gdb/top.c b/gdb/top.c index 0b04c3c1dc8..1022f840d6b 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -605,6 +605,8 @@ catch_errors (catch_errors_ftype *func, PTR args, char *errstring, caught = SIGSETJMP (catch); if (!caught) val = (*func) (args); + else + val = 0; catch_return = saved_catch; /* FIXME: cagney/1999-11-05: A correct FUNC implementation will -- 2.30.2