This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] register_to_value/value_to_register arguments?
- From: Tom Tromey <tromey at redhat dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 12 Jun 2012 09:32:16 -0600
- Subject: Re: [RFC] register_to_value/value_to_register arguments?
- References: <alpine.DEB.1.10.1206110958250.23962@tp.orcam.me.uk>
>>>>> "Maciej" == Maciej W Rozycki <macro@codesourcery.com> writes:
Maciej> However this rises a question: it is relatively expensive to
Maciej> retrieve gdbarch from frame, most target implementations of
Maciej> these methods need it and it is already readily available to the
Maciej> caller (retrieved from the very frame) -- wouldn't it therefore
Maciej> make sense to pass it along frame?
It seems to me that the frame's arch is cached, so retrieving it is only
expensive the first time. Given that, the current approach is clearer
and safer, since there's no possibility of arguments being out of sync.
Tom