This is the mail archive of the gdb-patches@sourceware.org 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] fix typo in sim_state documentation


On Wed, Feb 3, 2010 at 11:05 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> the sim-base.h suggests you declare cpu storage in sim_state, but the proposed
> code causes build failures in some files such as sim-core and sim-cpu.c (since
> STATE_CPU() is supposed to return an lvalue).
>
> it also doesnt make sense with the common sim_cpu_alloc_all() which
> dynamically allocates the memory for each cpu.
>
> 2010-02-04 ?Mike Frysinger ?<vapier@gentoo.org>
>
> ? ? ? ?* sim-base.h: Declare sim_state.cpu as a pointer in the comment. ?Drop
> ? ? ? ?& from the STATE_CPU() examples.
>
> RCS file: /cvs/src/src/sim/common/sim-base.h,v
> retrieving revision 1.11
> diff -u -p -r1.11 sim-base.h
> --- sim/common/sim-base.h ? ? ? 1 Jan 2010 10:03:27 -0000 ? ? ? 1.11
> +++ sim/common/sim-base.h ? ? ? 4 Feb 2010 07:02:42 -0000
> @@ -44,11 +44,11 @@ along with this program. ?If not, see <h
> ? ? ?};
>
> ? ? ?struct sim_state {
> - ? ? ? sim_cpu cpu[MAX_NR_PROCESSORS];
> + ? ? ? sim_cpu *cpu[MAX_NR_PROCESSORS];
> ? ? ?#if (WITH_SMP)
> - ? ? #define STATE_CPU(sd,n) (&(sd)->cpu[n])
> + ? ? #define STATE_CPU(sd,n) ((sd)->cpu[n])
> ? ? ?#else
> - ? ? #define STATE_CPU(sd,n) (&(sd)->cpu[0])
> + ? ? #define STATE_CPU(sd,n) ((sd)->cpu[0])
> ? ? ?#endif
> ? ? ? ?... simulator specific members ...
> ? ? ? ?sim_state_base base;
>

This patch is ok.  Thanks.


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