From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com, amit bhor <amit.bhor@codito.com>
Subject: Re: RFC : Handling breakpoints on archs. with imprecise exceptions.
Date: Thu, 24 Mar 2005 22:46:00 -0000 [thread overview]
Message-ID: <42434333.4000908@codito.com> (raw)
In-Reply-To: <20050324203814.GA7529@nevyn.them.org>
Hi,
>>While looking at a GDB port to a processor that has
>>imprecise exceptions/ interrupts i.e. the equivalent of a
>>software breakpoint would require 4 instructions to stop.
>>With my research I was unable to find any GDB port that
>>needed to handle such a case.
>>
>>The mechanism that is in mind is the following for setting
>>breakpoints.
>
>
> It sounds plausible, although messy. Does a single-instruction
> branch always give you enough range to reach a breakpoint table?
At the moment yes, since the branch would give a 16MB range
per app. The case is for uClinux apps on the ARC600
platform. ( though one could possibly dream up a solution
that cascaded branches maybe if the footprint so demanded
this sic :-) or KevinB's suggestion later on in the thread . )
>
> I suspect you could handle this by wrapping gdbarch_read_pc, so that
> a "breakpoint" at a particular "pc" would appear to stop there rather
> than in the table. Be sure to restore the correct pc at that point.
This is where one does the reverse mapping.
> That and breakpoint_from_pc may be all the hooks you need. And maybe
> hooks in target_insert_breakpoint/target_remove_breakpoint to reference
> count.
>
>
>>a. Define gdbarch_adjust_breakpoint_address in the backend
>>to store the mapping in the backend for the PC at which
>>breakpoint has been set to the actual value for the PC where
>>the breakpoint would be reported to have been hit.
>>
>>b. Define deprecated_target_wait_hook in the backend to
>>restore the actual value of the PC for GDB to continue with
>>its work.However as this is a deprecated hook I would not
>>like to use this in a new port.
>>
>>c. Add a new notify_backend_breakpoint_deleted_hook since
>>the backend needs notification for the breakpoint being
>>deleted and hence free an entry in the breakpoint table.
>
>
> You should be hooking insert/remove breakpoint, not add/delete user
> breakpoint.
Aha! that would be because for one, breakpoints for single
stepping need not necessarily be in the breakpoint table .
>
> Does gdbarch_read_pc do everything you need for the wait_hook? You can
> update the PC from there if necessary.
>
Sounds equivalent, though not yet sure. Will give it a shot
in the next couple of days and post the results.
cheers
Ramana
--
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)
next prev parent reply other threads:[~2005-03-24 22:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-24 19:46 Ramana Radhakrishnan
2005-03-24 19:57 ` Paul Gilliam
2005-03-24 20:23 ` Ramana Radhakrishnan
2005-03-24 21:46 ` Paul Gilliam
2005-03-24 20:37 ` Daniel Jacobowitz
2005-03-24 22:46 ` Ramana Radhakrishnan [this message]
2005-03-24 21:30 ` Kevin Buettner
2005-03-24 23:31 Decker, Paul
2005-03-24 23:32 ` Daniel Jacobowitz
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=42434333.4000908@codito.com \
--to=ramana.radhakrishnan@codito.com \
--cc=amit.bhor@codito.com \
--cc=drow@false.org \
--cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).