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: RFC: ARM simulator coredump


Hi Fred,

> The ARM simulator is dumping core during gdb testing for arm-elf:

Which gdb test(s) in particular ?

> This patch seems to work, but I've not really checked it too
> carefully for correctness.  Can whomever is responsible for the ARM
> simulator look it over please?  Thanks.

Sure - that would be me.  The patch has the right idea, but also a few
mistakes.  Mind you seeing it prompted me to dig up an old patch that
I had for this and apply it.  Please try updating your sources and let
me know if this had fixed things.


In case you are interested here are a few comments on the patch.

>  -	  if (cp14r0 && ARMul_CP14_R0_ENABLE)
> +	  if (ok && ARMul_CP14_R0_ENABLE)

This was a bug in the original code.  The intention was to test the
ARMul_CP14_R0_ENABLE bit in the r0 register of co-processor 14, so '&'
should have been used instead of '&&'.  Hence the correct version of
this line would be:

          if (ok && (cp14r0 & ARMul_CP14_R0_ENABLE))


> -	      if (cp14r0 && ARMul_CP14_R0_CCD)
> +	      if (ok && ARMul_CP14_R0_CCD)

A similar comment applied here, plus there is no need to retest 'ok'.

> -		      if (state->CPRead[13] (state, 8, 0)
> +		      ARMword temp;
> +		      if (state->CPRead[13] (state, 8, &temp)
>  			&& ARMul_CP13_R8_PMUS)

And here.

> +      {
> +	ARMword temp;

There is no need to declare a 'temp' variable here.  There is a
variable of the same type and name declared at the top of the
function, and it is no longer being used by this point.

Cheers
        Nick


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