This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/but] Fix -Werror probs remote.c, fixes bug
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [patch/but] Fix -Werror probs remote.c, fixes bug
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 14 May 2001 11:05:11 -0700
- CC: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Organization: Red Hat
- References: <3B000D0F.1080702@cygnus.com>
Andrew Cagney wrote:
>
> Hello,
>
> The attatched fixes -Werror -Wuninitialized -Wimplict compile errors
> that were recently introduced to remote.c.
>
> In the case of nr_bytes, the -Werror -Wuninitialized flag was
> identifying a real bug. nr_bytes could be returned uninitialied and that
> bogus value could have easily hossed the caller.
>
> For the extern I'm adding to solib.h, I'm kind of wondering if that is
> the correct interface. Kevin? Feel free to clean up that exported
> function.
>
> Andrew
>
> ----------------------------------------------------------------------------------------------------
> 2001-05-14 Andrew Cagney <ac131313@redhat.com>
>
> * remote.c (remote_write_bytes): Set nr_bytes before returning it.
> * solib.h (no_shared_libraries): Declare.
>
> Index: remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote.c,v
> retrieving revision 1.49
> diff -p -r1.49 remote.c
> *** remote.c 2001/05/10 19:06:19 1.49
> --- remote.c 2001/05/14 16:45:01
> *************** remote_write_bytes (CORE_ADDR memaddr, c
> *** 3630,3635 ****
> --- 3630,3636 ----
> increasing byte addresses. Each byte is encoded as a two hex
> value. */
> bin2hex (myaddr, p, todo);
> + nr_bytes = todo;
This should be:
nr_bytes = bin2hex (myaddr, p, todo);
> break;
> case PACKET_SUPPORT_UNKNOWN:
> internal_error (__FILE__, __LINE__,
> Index: solib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib.h,v
> retrieving revision 1.4
> diff -p -r1.4 solib.h
> *** solib.h 2001/03/06 08:21:17 1.4
> --- solib.h 2001/05/14 16:45:01
> *************** extern char *solib_address (CORE_ADDR);
> *** 193,195 ****
> --- 193,197 ----
> #define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc)
>
> extern int in_solib_dynsym_resolve_code (CORE_ADDR); /* solib.c */
> +
> + extern int no_shared_libraries (char *ignored, int from_tty);
I'm going to add this prototype to solib.h.
Michael