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).
This commit is contained in:
Michael Snyder 1998-07-27 23:13:22 +00:00
parent 5ef103c0b9
commit 0745a748dd
2 changed files with 52 additions and 1 deletions

View File

@ -1,3 +1,10 @@
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).
Mon Jul 27 15:38:07 1998 Mark Alexander <marka@cygnus.com>
* mn10300-tdep.c (mn10300_analyze_prologue): Undo previous fix

View File

@ -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"))