From: Orjan Friberg <orjan.friberg@axis.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: STEP_SKIPS_DELAY question, sort of
Date: Wed, 16 Jun 2004 14:53:00 -0000 [thread overview]
Message-ID: <40D05EE4.40601@axis.com> (raw)
In-Reply-To: <40CD94F2.8050901@axis.com>
Orjan Friberg wrote:
> Andrew Cagney wrote:
>>
>> I also think this needs a new macro name that better reflects what the
>> test is doing. But I've no good ideas :-/ (SINGLE_STEP_THROUGH_DELAY
>> (pc)?)
I'm facing a slightly different situation than the MIPS case when implementing
SINGLE_STEP_THROUGH_DELAY, because the size of the instruction that the delay
slot belongs to may be 2, 4, or 6 bytes. (For MIPS, it seems the size of that
instruction is always 4 bytes.)
So, I have to find out the size of the preceding instruction (since I want to do
the single-step thingy when we're stopped in the delay slot), but I can't find
anything in the opcodes directory that would let me do that.
The thing is, this information (whether I'm in a delay slot, and the address of
the instruction the delay slot belongs to) is available in a register. Besides
the fact that this triggers sending a 'g' packet to the remote target, is it
wrong to deduce this information from the registers content rather than reading
from the program's text segment?
Basically, my implementation would look like this:
int
cris_single_step_through_delay (CORE_ADDR pc)
{
ULONGEST erp;
int ret = 0;
regcache_cooked_read_unsigned (current_regcache, ERP_REGNUM, &erp);
if (erp & 0x1)
/* In delay slot - check if there's a breakpoint at the preceding
instruction. */
if (breakpoint_here_p (erp & ~0x1))
ret = 1;
return ret;
}
--
Orjan Friberg
Axis Communications
next prev parent reply other threads:[~2004-06-16 14:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 17:14 Orjan Friberg
2004-05-21 20:25 ` Andrew Cagney
2004-05-24 9:15 ` Orjan Friberg
2004-05-24 18:15 ` Andrew Cagney
2004-05-25 11:53 ` Orjan Friberg
2004-05-25 21:14 ` Andrew Cagney
2004-05-26 9:39 ` Orjan Friberg
2004-05-26 17:39 ` Andrew Cagney
2004-06-07 12:12 ` Orjan Friberg
2004-06-07 12:42 ` Orjan Friberg
2004-06-07 13:09 ` Orjan Friberg
2004-06-07 15:08 ` Andrew Cagney
2004-06-09 9:48 ` Orjan Friberg
2004-06-09 16:00 ` Andrew Cagney
2004-06-14 12:09 ` Orjan Friberg
2004-06-16 14:53 ` Orjan Friberg [this message]
2004-06-24 18:25 ` Andrew Cagney
2004-10-01 11:26 ` Orjan Friberg
2004-10-25 20:18 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40D05EE4.40601@axis.com \
--to=orjan.friberg@axis.com \
--cc=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox