aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-13 18:44:06 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-13 18:44:06 +0000
commit63dcc380266e80411e37bdb72fd6e0fad8c94072 (patch)
tree053991dec7ff801d443cdfddc8ef7ba2dbb23503 /gdb
parentd6596eee9fbabb9c37160cf6291f1dc343b5e652 (diff)
downloadgdb-63dcc380266e80411e37bdb72fd6e0fad8c94072.zip
gdb-63dcc380266e80411e37bdb72fd6e0fad8c94072.tar.gz
gdb-63dcc380266e80411e37bdb72fd6e0fad8c94072.tar.bz2
Add search to target vector (#if 0'd until after 4.12):
* target.h (to_search, target_search): Add. * gdbcore.h, core.c (generic_search): Add. * remote.c (remote_search): Add. * a29k-tdep.c (init_frame_info): Use target_search to find traceback tag.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/a29k-tdep.c12
-rw-r--r--gdb/core.c40
3 files changed, 58 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5922aa9..1c6866f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
Thu Jan 13 10:32:38 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+ Add search to target vector (#if 0'd until after 4.12):
+ * target.h (to_search, target_search): Add.
+ * gdbcore.h, core.c (generic_search): Add.
+ * remote.c (remote_search): Add.
+ * a29k-tdep.c (init_frame_info): Use target_search to find traceback
+ tag.
+
* printcmd.c (print_address_symbolic): If set print fast-symbolic-addr
is on, call find_pc_function rather than relying just on the minimal
symbols (probably only matters for symbol readers which don't put
diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c
index a34b189..7d02b8b 100644
--- a/gdb/a29k-tdep.c
+++ b/gdb/a29k-tdep.c
@@ -418,10 +418,20 @@ init_frame_info (innermost_frame, fci)
/* Search backward to find the trace-back tag. However,
do not trace back beyond the start of the text segment
(just as a sanity check to avoid going into never-never land). */
+#if 1
while (p >= text_start
&& ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
p -= 4;
-
+#else /* 0 */
+ char pat[4] = {0, 0, 0, 0};
+ char mask[4];
+ char insn_raw[4];
+ store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK);
+ /* Enable this once target_search is enabled and tested. */
+ target_search (4, pat, mask, p, -4, text_start, p+1, &p, &insn_raw);
+ insn = extract_unsigned_integer (insn_raw, 4);
+#endif /* 0 */
+
if (p < text_start)
{
/* Couldn't find the trace-back tag.
diff --git a/gdb/core.c b/gdb/core.c
index 9126d94..3d399f8 100644
--- a/gdb/core.c
+++ b/gdb/core.c
@@ -234,6 +234,46 @@ read_memory_unsigned_integer (memaddr, len)
return extract_unsigned_integer (buf, len);
}
+#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 */
+
/* The current default bfd target. Points to storage allocated for
gnutarget_string. */
char *gnutarget;