This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GDB Search capabilities.. :)

Hi folks,

Was playing with gdb source recently trying to 'implement' a feature which I needed and
came across following comments in


Add in commands like ADB's for searching for patterns, etc.  We should
be able to examine and patch raw unsymboled binaries as well in gdb as
we can in adb.  (E.g. increase the timeout in /bin/login without source).

and target.h:

#if 0
    /* Enable this after 4.12.  */
    /* Search target memory.  Start at STARTADDR and take LEN bytes of
       target memory, and them with MASK, and compare to DATA.  If they
       match, set *ADDR_FOUND to the address we found it at, store the data
       we found at LEN bytes starting at DATA_FOUND, and return.  If
       not, add INCREMENT to the search address and keep trying until
       the search address is outside of the range [LORANGE,HIRANGE).
       If we don't find anything, set *ADDR_FOUND to (CORE_ADDR)0 and
       return.  */
    void (*to_search) PARAMS ((int len, char *data, char *mask,
                               CORE_ADDR startaddr, int increment,
                               CORE_ADDR lorange, CORE_ADDR hirange,
                               CORE_ADDR * addr_found, char *data_found));
#define target_search(len, data, mask, startaddr, increment, lorange, hirange, addr_found, data_found)  \
    (*current_target.to_search) (len, data, mask, startaddr, increment, \


I wonder how strong is the interest of implementting/accepting this kind of
feature in gdb. I have managed to get done something similar for linux/x86
platform only (not really that 'full featured' as described above though), but
if there's enough interest, I guess I could expand and work it out. I'd also
would like to make sure though, that I am not going to reinvent the wheels
too ... :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]