mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 19:46:09 +08:00
New "find" command.
* NEWS: Document find command and qSearch:memory packet. * Makefile.in (SFILES): Add findcmd.c. (COMMON_OBJS): Add findcmd.o. (findcmd.o): New rule. * findcmd.c: New file. * target.h (target_ops): New member to_search_memory. (simple_search_memory): Declare. (target_search_memory): Declare. * target.c (simple_search_memory): New fn. (target_search_memory): New fn. * remote.c (PACKET_qSearch_memory): New packet kind. (remote_search_memory): New fn. (init_remote_ops): Init to_search_memory. (init_extended_remote_ops): Ditto. (_initialize_remote): Add qSearch:memory packet config command. * gdbserver/server.h (decode_search_memory_packet): Declare. * gdbserver/remote-utils.c (decode_search_memory_packet): New fn. * gdbserver/server.c (handle_search_memory_1): New fn. (handle_search_memory): New fn. (handle_query): Process qSearch:memory packets. * doc/gdb.texinfo: Document "find" command, qSearch:memory packet. * testsuite/gdb.base/find.exp: New file. * testsuite/gdb.base/find.c: New file.
This commit is contained in:
@ -1080,6 +1080,24 @@ decode_xfer_write (char *buf, int packet_len, char **annex, CORE_ADDR *offset,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Decode the parameters of a qSearch:memory packet. */
|
||||
|
||||
int
|
||||
decode_search_memory_packet (const char *buf, int packet_len,
|
||||
CORE_ADDR *start_addrp,
|
||||
CORE_ADDR *search_space_lenp,
|
||||
gdb_byte *pattern, unsigned int *pattern_lenp)
|
||||
{
|
||||
const char *p = buf;
|
||||
|
||||
p = decode_address_to_semicolon (start_addrp, p);
|
||||
p = decode_address_to_semicolon (search_space_lenp, p);
|
||||
packet_len -= p - buf;
|
||||
*pattern_lenp = remote_unescape_input ((const gdb_byte *) p, packet_len,
|
||||
pattern, packet_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Ask GDB for the address of NAME, and return it in ADDRP if found.
|
||||
Returns 1 if the symbol is found, 0 if it is not, -1 on error. */
|
||||
|
||||
|
Reference in New Issue
Block a user