From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: Andrew Cagney Cc: GDB Patches Subject: Re: [patch/but] Fix -Werror probs remote.c, fixes bug Date: Mon, 14 May 2001 11:05:00 -0000 Message-id: <3B001E57.B3EBF534@cygnus.com> References: <3B000D0F.1080702@cygnus.com> X-SW-Source: 2001-05/msg00296.html 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 > > * 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