Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>, kevinb@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] TARGET_ADJUST_BREAKPOINT_ADDRESS - patch 1 of 4
Date: Wed, 08 Oct 2003 18:26:00 -0000	[thread overview]
Message-ID: <3F8456E8.6090005@redhat.com> (raw)
In-Reply-To: <200310062109.h96L9Waq000481@elgar.kettenis.dyndns.org>

>    Date: Mon, 6 Oct 2003 08:36:58 -0700
>    From: Kevin Buettner <kevinb@redhat.com>
> 
>    On Oct 6,  2:49pm, Mark Kettenis wrote:
> 
>    >    The patch below should be non-controversial.  It merely adds the
>    >    TARGET_ADJUST_BREAKPOINT_ADDRESS method.  Code which uses it (the
>    >    possibly controversial bit) will come in patch #3.  Documentation will
>    >    be in the next patch, #2.  Finally, target specific code which
>    >    requires TARGET_ADJUST_BREAKPOINT_ADDRESS will be posted in patch #4.
>    > 
>    > Do we really need the "TARGET" in the name of the new method?  It made
>    > me think that this was something that was going to be added to the
>    > target-vector instead of the architecture vector.
> 
>    How about just "ADJUST_BREAKPOINT_ADDRESS" ?
> 
> Sounds fine to me :-).  Thanks,

Then ADJUST_BREAKPOINT_ADDRESS is the name.

[snip]
> To review the criticism of the previous TARGET_ADJUST_BREAKPOINT
> patch (from three years ago!), see:

Since then, the architecture vector has gained "m" and "M" - i.e., 
strictly multi-arch - and the new method will need to be one of those. 
Looking at:

+/* Call TARGET_ADJUST_BREAKPOINT_ADDRESS and print warning if an address
+   adjustment was made.  Returns the adjusted address. */
+
+static CORE_ADDR
+adjust_breakpoint_address (CORE_ADDR bpaddr)
+{
+  CORE_ADDR adjusted_bpaddr;
+
+  adjusted_bpaddr = TARGET_ADJUST_BREAKPOINT_ADDRESS (bpaddr);
+
+  if (adjusted_bpaddr != bpaddr)
+    breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, 0);
+
+  return adjusted_bpaddr;
+}
+

I've a strong preference for "M" - method with predicate - since, for 
everyone but an frv developer, this code is irrelevant.

Having a predicate would let adjust_breakpoint_address be written in a 
style that reflects this atypical code path:

	if (gdbarch_adjust_..._p())
	  adjusted = ...
	  if (changed)
	    warning ...

and the average (non-frv) developer wouldn't be distracted by the change.

Other than that, the architect method is ok.

Andrew

PS:

I wonder if the other parts of your change slam straight into DanielJ's 
two teer breakpoint effect (assuming I remember his long ago intent) vis:
- the high-level user specified breakpoint (requested_address?)
- the low-level corresponding list of real breakpoints (address?)

I also wonder if PPC64 GDB could use this to do the descriptor -> 
function address transformation that I described in:
http://sources.redhat.com/ml/gdb-patches/2003-09/msg00415.html

Andrew



  reply	other threads:[~2003-10-08 18:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-04  0:28 Kevin Buettner
2003-10-06 12:49 ` Mark Kettenis
2003-10-06 14:37   ` Andrew Cagney
2003-10-06 15:37   ` Kevin Buettner
2003-10-06 21:09     ` Mark Kettenis
2003-10-08 18:26       ` Andrew Cagney [this message]
2003-10-11  2:17         ` Kevin Buettner
2003-10-11 16:17           ` Andrew Cagney
2003-10-13 23:43 ` Kevin Buettner

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=3F8456E8.6090005@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    --cc=kevinb@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