aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>1998-07-27 23:13:22 +0000
committerMichael Snyder <msnyder@vmware.com>1998-07-27 23:13:22 +0000
commit0745a748dd31d92e9ffcf6fa3cddcddac88b6525 (patch)
treeff61002dee3883be87bdd759345e28f0f7796969 /gdb/tracepoint.c
parent5ef103c0b9b3bbce39cac24231142162ee90408f (diff)
downloadgdb-0745a748dd31d92e9ffcf6fa3cddcddac88b6525.zip
gdb-0745a748dd31d92e9ffcf6fa3cddcddac88b6525.tar.gz
gdb-0745a748dd31d92e9ffcf6fa3cddcddac88b6525.tar.bz2
Mon Jul 27 16:11:42 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
* tracepoint.c (remote_set_transparent_ranges): new function. Send the start and end addresses of all loadable read-only sections down to the trace target, so that it can treat them as "transparent" (ie. don't care if they were collected or not).
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 42898c4..f85ac54 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1616,9 +1616,50 @@ add_aexpr(collect, aexpr)
collect->next_aexpr_elt++;
}
-
static char target_buf[2048];
+/* Set "transparent" memory ranges
+
+ Allow trace mechanism to treat text-like sections
+ (and perhaps all read-only sections) transparently,
+ i.e. don't reject memory requests from these address ranges
+ just because they haven't been collected. */
+
+static void
+remote_set_transparent_ranges (void)
+{
+ extern bfd *exec_bfd;
+ asection *s;
+ bfd_size_type size;
+ bfd_vma lma;
+ int anysecs = 0;
+
+ if (!exec_bfd)
+ return; /* no information to give. */
+
+ strcpy (target_buf, "QTro");
+ for (s = exec_bfd->sections; s; s = s->next)
+ {
+ char tmp[40];
+
+ if ((s->flags & SEC_LOAD) == 0 ||
+ /* (s->flags & SEC_CODE) == 0 || */
+ (s->flags & SEC_READONLY) == 0)
+ continue;
+
+ anysecs = 1;
+ lma = s->lma;
+ size = bfd_get_section_size_before_reloc (s);
+ sprintf (tmp, ":%x,%x", lma, lma + size);
+ strcat (target_buf, tmp);
+ }
+ if (anysecs)
+ {
+ putpkt (target_buf);
+ getpkt (target_buf, 0);
+ }
+}
+
/* tstart command:
Tell target to clear any previous trace experiment.
@@ -1707,6 +1748,9 @@ trace_start_command (args, from_tty)
do_cleanups (old_chain);
}
}
+ /* Tell target to treat text-like sections as transparent */
+ remote_set_transparent_ranges ();
+ /* Now insert traps and begin collecting data */
putpkt ("QTStart");
remote_get_noisy_reply (target_buf);
if (strcmp (target_buf, "OK"))