#include "target.h"
#include "gdbcore.h"
#include "dis-asm.h"
+#include "language.h"
extern char registers[];
int status;
CORE_ADDR memaddr;
{
-
+ /* FIXME-32x64--casting CORE_ADDR to unsigned long */
if (status == EIO)
{
/* Actually, address between memaddr and memaddr + len
was out of bounds. */
- error ("Cannot access memory at address %s.", local_hex_string(memaddr));
+ error ("Cannot access memory at address %s.",
+ local_hex_string((unsigned long) memaddr));
}
else
{
error ("Error accessing memory address %s: %s.",
- local_hex_string (memaddr), safe_strerror (status));
+ local_hex_string ((unsigned long) memaddr),
+ safe_strerror (status));
}
}
return extract_unsigned_integer (buf, len);
}
\f
+#if 0
+/* Enable after 4.12. It is not tested. */
+
+/* Search code. Targets can just make this their search function, or
+ if the protocol has a less general search function, they can call this
+ in the cases it can't handle. */
+void
+generic_search (len, data, mask, startaddr, increment, lorange, hirange
+ addr_found, data_found)
+ int len;
+ char *data;
+ char *mask;
+ CORE_ADDR startaddr;
+ int increment;
+ CORE_ADDR lorange;
+ CORE_ADDR hirange;
+ CORE_ADDR *addr_found;
+ char *data_found;
+{
+ int i;
+ CORE_ADDR curaddr = startaddr;
+
+ while (curaddr >= lorange && curaddr < hirange)
+ {
+ read_memory (curaddr, data_found, len);
+ for (i = 0; i < len; ++i)
+ if ((data_found[i] & mask[i]) != data[i])
+ goto try_again;
+ /* It matches. */
+ *addr_found = curaddr;
+ return;
+
+ try_again:
+ curaddr += increment;
+ }
+ *addr_found = (CORE_ADDR)0;
+ return;
+}
+#endif /* 0 */
+\f
/* The current default bfd target. Points to storage allocated for
gnutarget_string. */
char *gnutarget;