gprofng: fix build with -mx32
[binutils-gdb/blckswan.git] / gdbsupport / search.h
blob766687b8dbe8aa1ace31d5d359953148a6aadf69
1 /* Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef COMMON_SEARCH_H
19 #define COMMON_SEARCH_H
21 #include "gdbsupport/function-view.h"
23 /* This is needed by the unit test, so appears here. */
24 #define SEARCH_CHUNK_SIZE 16000
26 /* The type of a callback function that can be used to read memory.
27 Note that target_read_memory is not used here, because gdbserver
28 wants to be able to examine trace data when searching, and
29 target_read_memory does not do this. */
31 typedef bool target_read_memory_ftype (CORE_ADDR, gdb_byte *, size_t);
33 /* Utility implementation of searching memory. */
34 extern int simple_search_memory
35 (gdb::function_view<target_read_memory_ftype> read_memory,
36 CORE_ADDR start_addr,
37 ULONGEST search_space_len,
38 const gdb_byte *pattern,
39 ULONGEST pattern_len,
40 CORE_ADDR *found_addrp);
42 #endif /* COMMON_SEARCH_H */