* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 18:34 ` Ulrich Weigand
@ 2007-10-09 18:45 ` Daniel Jacobowitz
2007-10-09 18:54 ` Ulrich Weigand
2007-10-09 19:50 ` Maxim Grigoriev
2007-10-10 8:09 ` Markus Deuling
2 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2007-10-09 18:45 UTC (permalink / raw)
To: Ulrich Weigand
Cc: Markus Deuling, GDB Patches, Joel Brobecker, Maxim Grigoriev
On Tue, Oct 09, 2007 at 08:22:45PM +0200, Ulrich Weigand wrote:
> At this point, there's no need to involve get_current_frame. The
> routine operates on the current regcache, and should simply consult
> its architecture.
As a more general note, replacing one global state with another is of
limited value. It's not completely useless, but let's avoid it when
we can :-)
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 18:45 ` Daniel Jacobowitz
@ 2007-10-09 18:54 ` Ulrich Weigand
0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Weigand @ 2007-10-09 18:54 UTC (permalink / raw)
To: Daniel Jacobowitz
Cc: Markus Deuling, GDB Patches, Joel Brobecker, Maxim Grigoriev
Daniel Jacobowitz wrote:
> On Tue, Oct 09, 2007 at 08:22:45PM +0200, Ulrich Weigand wrote:
> > At this point, there's no need to involve get_current_frame. The
> > routine operates on the current regcache, and should simply consult
> > its architecture.
>
> As a more general note, replacing one global state with another is of
> limited value. It's not completely useless, but let's avoid it when
> we can :-)
Well, in some cases you have to have some global state ... At this
point, which is the implementation of the "return" command, you have
no other context -- the command by design operates on the "current"
register set ... (That still doesn't mean it should refer to
current_gdbarch at this point, that makes a lot more assumptions.)
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 18:34 ` Ulrich Weigand
2007-10-09 18:45 ` Daniel Jacobowitz
@ 2007-10-09 19:50 ` Maxim Grigoriev
2007-10-09 19:59 ` Ulrich Weigand
2007-10-10 8:09 ` Markus Deuling
2 siblings, 1 reply; 8+ messages in thread
From: Maxim Grigoriev @ 2007-10-09 19:50 UTC (permalink / raw)
To: Ulrich Weigand
Cc: Markus Deuling, GDB Patches, Joel Brobecker, Daniel Jacobowitz,
Maxim Grigoriev
>> I've checked in all of those except:
>>
>> - the xtensa-tdep.c patch (to give Maxim a chance to comment), and
I've tested xtensa-tdep.* patch. It works fine.
Getting rid of defines looks somewhat less elegant. But, I think it's
been done for a reason.
Please, go ahead and check it in.
Thanks much for doing this.
-- Maxim
Ulrich Weigand wrote:
> Markus Deuling wrote:
>
>
>> this is the next series of 8 mostly mechnical patches to get rid of of some trivial to replace occurences of current_gdbarch.
>>
>
> I've checked in all of those except:
>
> - the xtensa-tdep.c patch (to give Maxim a chance to comment), and
> - the stack.c patch, because of this:
>
> @@ -1854,10 +1856,11 @@ If you continue, the return value that y
> if (return_value != NULL)
> {
> struct type *return_type = value_type (return_value);
> - gdb_assert (gdbarch_return_value (current_gdbarch, return_type,
> + gdb_assert (gdbarch_return_value (get_frame_arch (get_current_frame ()),
> + return_type,
> NULL, NULL, NULL)
> == RETURN_VALUE_REGISTER_CONVENTION);
> - gdbarch_return_value (current_gdbarch, return_type,
> + gdbarch_return_value (get_frame_arch (get_current_frame ()), return_type,
> get_current_regcache (), NULL /*read*/,
> value_contents (return_value) /*write*/);
> }
>
> At this point, there's no need to involve get_current_frame. The
> routine operates on the current regcache, and should simply consult
> its architecture.
>
> Thanks,
> Ulrich
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 19:50 ` Maxim Grigoriev
@ 2007-10-09 19:59 ` Ulrich Weigand
2007-10-10 5:14 ` Markus Deuling
0 siblings, 1 reply; 8+ messages in thread
From: Ulrich Weigand @ 2007-10-09 19:59 UTC (permalink / raw)
To: Maxim Grigoriev
Cc: Markus Deuling, GDB Patches, Joel Brobecker, Daniel Jacobowitz,
Maxim Grigoriev
Maxim Grigoriev wrote:
> >> I've checked in all of those except:
> >>
> >> - the xtensa-tdep.c patch (to give Maxim a chance to comment), and
>
> I've tested xtensa-tdep.* patch. It works fine.
>
> Getting rid of defines looks somewhat less elegant. But, I think it's
> been done for a reason.
>
> Please, go ahead and check it in.
Done.
> Thanks much for doing this.
Thanks for testing!
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 19:59 ` Ulrich Weigand
@ 2007-10-10 5:14 ` Markus Deuling
0 siblings, 0 replies; 8+ messages in thread
From: Markus Deuling @ 2007-10-10 5:14 UTC (permalink / raw)
To: Ulrich Weigand
Cc: Maxim Grigoriev, Markus Deuling, GDB Patches, Joel Brobecker,
Daniel Jacobowitz
Ulrich Weigand schrieb:
> Maxim Grigoriev wrote:
>
>>>> I've checked in all of those except:
>>>>
>>>> - the xtensa-tdep.c patch (to give Maxim a chance to comment), and
>> I've tested xtensa-tdep.* patch. It works fine.
>>
>> Getting rid of defines looks somewhat less elegant. But, I think it's
>> been done for a reason.
>>
>> Please, go ahead and check it in.
> Done.
>
>> Thanks much for doing this.
>
> Thanks for testing!
>
Thanks Maxim for testing and Uli for checking in !
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfc] [0/8] Get rid of current_gdbarch
2007-10-09 18:34 ` Ulrich Weigand
2007-10-09 18:45 ` Daniel Jacobowitz
2007-10-09 19:50 ` Maxim Grigoriev
@ 2007-10-10 8:09 ` Markus Deuling
2 siblings, 0 replies; 8+ messages in thread
From: Markus Deuling @ 2007-10-10 8:09 UTC (permalink / raw)
To: Ulrich Weigand
Cc: Markus Deuling, GDB Patches, Joel Brobecker, Daniel Jacobowitz,
Maxim Grigoriev
Ulrich Weigand schrieb:
>
> @@ -1854,10 +1856,11 @@ If you continue, the return value that y
> if (return_value != NULL)
> {
> struct type *return_type = value_type (return_value);
> - gdb_assert (gdbarch_return_value (current_gdbarch, return_type,
> + gdb_assert (gdbarch_return_value (get_frame_arch (get_current_frame ()),
> + return_type,
> NULL, NULL, NULL)
> == RETURN_VALUE_REGISTER_CONVENTION);
> - gdbarch_return_value (current_gdbarch, return_type,
> + gdbarch_return_value (get_frame_arch (get_current_frame ()), return_type,
> get_current_regcache (), NULL /*read*/,
> value_contents (return_value) /*write*/);
> }
>
> At this point, there's no need to involve get_current_frame. The
> routine operates on the current regcache, and should simply consult
> its architecture.
Hm, ok, thank you very much. I'll come up with another patch.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
^ permalink raw reply [flat|nested] 8+ messages in thread