Re: [RFA] new command to search memory

Doug Evans
2008-05-09T02:52:07Z

On Fri, May 2, 2008 at 8:17 AM, Daniel Jacobowitz <drow@false.org> wrote:
>> Index: gdbserver/Makefile.in
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
>> retrieving revision 1.57
>> diff -u -p -u -p -r1.57 Makefile.in
>> --- gdbserver/Makefile.in 14 Apr 2008 18:04:00 -0000 1.57
>> +++ gdbserver/Makefile.in 17 Apr 2008 02:35:24 -0000
>> @@ -81,11 +81,15 @@ BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
>> READLINE_DIR = ${srcdir}/../readline
>> READLINE_DEP = $$(READLINE_DIR)
>>
>> +# gnulib
>> +INCGNULIB = -I$(srcdir)/../gnulib -I../gnulib
>> +
>> # All the includes used for CFLAGS and for lint.
>> # -I. for config files.
>> # -I${srcdir} for our headers.
>> # -I$(srcdir)/../regformats for regdef.h.
>> -INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)
>> +INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR) \
>> + $(INCGNULIB)
>>
>> # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
>> # from the config/ directory.
>> @@ -143,7 +147,7 @@ TAGFILES = $(SOURCES) ${HFILES} ${ALLPAR
>>
>> OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
>> utils.o version.o \
>> - mem-break.o hostio.o \
>> + mem-break.o memmem.o hostio.o \
>> $(XML_BUILTIN) \
>> $(DEPFILES) $(LIBOBJS)
>> GDBSERVER_LIBS = @GDBSERVER_LIBS@
>
> The gdbserver configure script should already be taking care of all
> these. In particular we don't want to reference ../gnulib in the
> objdir since it won't exist if you're just building gdbserver. And I
> know it will add memmem.o, I tested that.

I thought gnulib/memmem.o was always going to be used. We started
down this path because, in part, libc's memmem is O(n^2).

configure ...
checking for memmem... yes

after making gdbserver ...
$ nm gdbserver | grep memmem
U memmem@@GLIBC_2.0

> Does that leave just the declaration? You can stick it somewhere in
> gdbserver instead of bringing in all the replacement gnulib headers.