From: Andrew Cagney <ac131313@ges.redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>,
David Carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] dwarf2read.c: set TYPE_DOMAIN_TYPE correctly for methods
Date: Thu, 22 Aug 2002 14:19:00 -0000 [thread overview]
Message-ID: <3D655311.6030603@ges.redhat.com> (raw)
In-Reply-To: <20020822204211.GA31727@nevyn.them.org>
> On Thu, Aug 22, 2002 at 01:35:50PM -0700, David Carlton wrote:
>
>> I've figured out what caused the regression that I turned up in PR
>> gdb/653; here's a patch that fixes it.
>>
>> David Carlton
>> carlton@math.stanford.edu
>>
>> 2002-08-22 David Carlton <carlton@math.stanford.edu>
>>
>> * dwarf2read.c (dwarf2_add_member_fn): Add back in the type
>> argument that was deleted on 2002-06-14: it was needed after all,
>> as PR gdb/653 demonstrates. Update call to smash_to_method_type.
>> (read_structure_scope): Update call to dwarf2_add_member_fn.
>
>
> Can you explain why this is necessary? I could not find any path to
> that point where type != die->type.
Just a general reminder for people comming up with patches.
The place to put comments explaining changes is in the source code.
Something like:
/* NOTE: cagney/2002-08-12: Replaced a call to
regcache_raw_read_as_address() with a call to
regcache_cooked_read_unsigned(). The old, ...as_address
function was eventually calling extract_unsigned_integer (via
extract_address) to unpack the registers value. The below is
doing an unsigned extract so that it is functionally
equivalent. The read needs to be cooked as, otherwise, it
will never correctly return the value of a register in the
[NUM_REGS .. NUM_REGS+NUM_PSEUDO_REGS) range. */
(although, yes, the example is a bit overboard). This might feel
un-natural but it is correct and very very important. The ChangeLog
need only state what changed, not why.
Someone studying the code and trying to figure out why things currently
don't work should be able to do so by just examining the current code
and its commentary. Hopefully that commentry will explain what was
tried in the past and why it failed or why it needed to be changed.
Oh, and adding more comments to the code is always ``obvious'' :-) (Is
there a way to add ``comments'' to the doco?).
enjoy,
Andrew
next prev parent reply other threads:[~2002-08-22 21:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-22 13:36 David Carlton
2002-08-22 13:52 ` Daniel Jacobowitz
2002-08-22 13:56 ` David Carlton
2002-08-22 14:19 ` Andrew Cagney [this message]
2002-08-22 14:26 ` David Carlton
2002-08-22 14:39 ` 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=3D655311.6030603@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=carlton@math.stanford.edu \
--cc=drow@mvista.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