From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: gdb-patches@sources.redhat.com, cagney@cygnus.com Subject: [PATCH]: Set nr_bytes in remote_write_bytes Date: Mon, 14 May 2001 11:38:00 -0000 Message-id: <3B002606.5B737A04@cygnus.com> X-SW-Source: 2001-05/msg00301.html Use the return value of bin2hex to set the number of converted bytes. 2001-05-14 Michael Snyder * remote.c (remote_write_bytes): Set nr_bytes to return value of bin2hex. Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.50 retrieving revision 1.51 diff -c -3 -p -r1.50 -r1.51 *** remote.c 2001/05/14 16:48:01 1.50 --- remote.c 2001/05/14 18:31:35 1.51 *************** remote_write_bytes (CORE_ADDR memaddr, c *** 3629,3636 **** /* Normal mode: Send target system values byte by byte, in increasing byte addresses. Each byte is encoded as a two hex value. */ ! bin2hex (myaddr, p, todo); ! nr_bytes = todo; break; case PACKET_SUPPORT_UNKNOWN: internal_error (__FILE__, __LINE__, --- 3629,3635 ---- /* Normal mode: Send target system values byte by byte, in increasing byte addresses. Each byte is encoded as a two hex value. */ ! nr_bytes = bin2hex (myaddr, p, todo); break; case PACKET_SUPPORT_UNKNOWN: internal_error (__FILE__, __LINE__, >From msnyder@cygnus.com Mon May 14 11:46:00 2001 From: Michael Snyder To: Kevin Buettner Cc: Andrew Cagney , GDB Patches Subject: Re: [patch/but] Fix -Werror probs remote.c, fixes bug Date: Mon, 14 May 2001 11:46:00 -0000 Message-id: <3B0027F2.C2417CF4@cygnus.com> References: <3B000D0F.1080702@cygnus.com> <1010514181430.ZM6964@ocotillo.lan> X-SW-Source: 2001-05/msg00302.html Content-length: 1972 Kevin Buettner wrote: > > On May 14, 12:51pm, Andrew Cagney wrote: > > > 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. > > I've fixed the prototype to match the definition in solib.c. > > Michael S: Could I ask you to provide some comments regarding the > purpose of no_shared_libraries()? Done. See attached. 2001-05-14 Michael Snyder * solib.c, solib.h: Add comment for function no_shared_libraries. Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.39 diff -c -3 -p -r1.39 solib.c *** solib.c 2001/04/17 23:22:52 1.39 --- solib.c 2001/05/14 18:45:01 *************** sharedlibrary_command (char *args, int f *** 809,814 **** --- 809,826 ---- solib_add (args, from_tty, (struct target_ops *) 0); } + /* LOCAL FUNCTION + + no_shared_libraries -- handle command to explicitly discard symbols + from shared libraries. + + DESCRIPTION + + Implements the command "nosharedlibrary", which discards symbols + that have been auto-loaded from shared libraries. Symbols from + shared libraries that were added by explicit request of the user + are not discarded. Also called from remote.c. */ + void no_shared_libraries (char *ignored, int from_tty) { Index: solib.h =================================================================== RCS file: /cvs/src/src/gdb/solib.h,v retrieving revision 1.6 diff -c -3 -p -r1.6 solib.h *** solib.h 2001/05/14 18:09:05 1.6 --- solib.h 2001/05/14 18:45:01 *************** extern char *solib_address (CORE_ADDR); *** 194,197 **** --- 194,199 ---- extern int in_solib_dynsym_resolve_code (CORE_ADDR); /* solib.c */ + /* Discard symbols that were auto-loaded from shared libraries. */ + extern void no_shared_libraries (char *ignored, int from_tty); >From ac131313@cygnus.com Mon May 14 13:02:00 2001 From: Andrew Cagney To: Mark Kettenis Cc: gdb-patches@sources.redhat.com, jimb@cygnus.com, ezannoni@cygnus.com Subject: Re: [PATCH, RFA] Fix basename bug in symtab.c Date: Mon, 14 May 2001 13:02:00 -0000 Message-id: <3B0039B5.7060704@cygnus.com> References: <200105132045.f4DKjpm03579@delius.kettenis.local> X-SW-Source: 2001-05/msg00303.html Content-length: 953 > [Jim, Elena, sorry I keep saying cygnus instead of redhat :-(] > > Here is a patch that fixes the problems discussed on the discussion > list. Eli pretty much convinced me that this is the right approach. > We can still discuss the other uses of basename() in GDB, but since > this fixes a rather serious bug on FreeBSD (and I suppose other > systems as well), I'd like to get this in ASAP. Just to be clear on one thing, the bug occures on FreeBSD. It isn't a FreeBSD bug :-). To quote the opengroup standard: > #include > char *basename(char *path); ... > The basename() function may modify the string pointed to by path, and may return a pointer to static storage that may then be overwritten by a subsequent call to basename(). > > This interface need not be reentrant. Any way, looking at libiberty/lbasename.c, it casts: (const char*) -> (char *) so I'd not call that function safe either (actually grrrr). Andrew