Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [patch rfc] Eliminate extract_address
Date: Wed, 14 May 2003 16:42:00 -0000	[thread overview]
Message-ID: <1030514164201.ZM9355@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@redhat.com> "[patch rfc] Eliminate extract_address" (May 14,  8:10am)

Can you explain why you doing

    s/extract_address/extract_unsigned_integer/

is a good thing?

Perhaps this has been discussed already, but I see two drawbacks...

First, the return types are different.  extract_address() returns
CORE_ADDR while extract_unsigned_integer returns ULONGEST.  If
we were to encounter a scenario where this is a problem, it's easier
to fix a wrapper (extract_address()) instead of the myriad places in
the code which presently call extract_address().  (This point is
probably moot because I suspect we already have a lot of code which
assumes that CORE_ADDR may be interchanged with LONGEST or ULONGEST
anyway.)

Second, having function calls to extract_address() provides
information to the reader that you don't get by having calls to
extract_unsigned_integer().  It tells the reader that we're expecting
to get an address and not an integer.  This really helps when someone
reading gdb's code is wondering about what the thing is that's being
extracted.

Kevin


  reply	other threads:[~2003-05-14 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-14 12:10 Andrew Cagney
2003-05-14 16:42 ` Kevin Buettner [this message]
2003-05-15 16:49   ` Andrew Cagney
2003-05-15 18:20     ` Kevin Buettner
2003-05-15 19:03       ` Andrew Cagney
2003-05-21 16:20         ` Andrew Cagney
2003-05-21 16:41           ` Kevin Buettner
2003-05-22 17:50             ` 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=1030514164201.ZM9355@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=ac131313@redhat.com \
    --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