This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch rfc] Eliminate extract_address


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]