This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: GDB Search capabilities.. :)
- To: fygrave at tigerteam dot net
- Subject: Re: GDB Search capabilities.. :)
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Sat, 10 Mar 2001 13:04:30 -0500 (EST)
- CC: gdb at sources dot redhat dot com
- References: <20010309000127.F42341@tigerteam.net>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> Date: Fri, 9 Mar 2001 00:01:27 +0700
> From: Fyodor <fygrave@tigerteam.net>
>
> ..
> 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, \
FWIW, I was missing such a feature in GDB from day one. Even DOS
DEBUG has something primitive to search memory for a given byte
sequence.