Patchwork [07/15] s390x: Adjust GDB stub

login
register
mail settings
Submitter Alexander Graf
Date April 4, 2011, 2:32 p.m.
Message ID <1301927544-32767-8-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/89629/
State New
Headers show

Comments

Alexander Graf - April 4, 2011, 2:32 p.m.
We have successfully lazilized cc computation, so we need to manually
trigger its calculation when gdb wants to fetch it. We also changed the
variable name, so writing it writes into a different field now.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 gdbstub.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Aurelien Jarno - April 10, 2011, 8:39 p.m.
On Mon, Apr 04, 2011 at 04:32:16PM +0200, Alexander Graf wrote:
> We have successfully lazilized cc computation, so we need to manually
> trigger its calculation when gdb wants to fetch it. We also changed the
> variable name, so writing it writes into a different field now.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  gdbstub.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/gdbstub.c b/gdbstub.c
> index 0838948..ae856f9 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1436,7 +1436,11 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
>              /* XXX */
>              break;
>          case S390_PC_REGNUM: GET_REGL(env->psw.addr); break;
> -        case S390_CC_REGNUM: GET_REG32(env->cc); break;
> +        case S390_CC_REGNUM:
> +            env->cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst,
> +                                 env->cc_vr);
> +            GET_REG32(env->cc_op);
> +            break;
>      }
>  
>      return 0;
> @@ -1462,7 +1466,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
>              /* XXX */
>              break;
>          case S390_PC_REGNUM: env->psw.addr = tmpl; break;
> -        case S390_CC_REGNUM: env->cc = tmp32; r=4; break;
> +        case S390_CC_REGNUM: env->cc_op = tmp32; r=4; break;
>      }
>  
>      return r;

The patch looks fine, but it should appear later in the patch series.

Patch

diff --git a/gdbstub.c b/gdbstub.c
index 0838948..ae856f9 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1436,7 +1436,11 @@  static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
             /* XXX */
             break;
         case S390_PC_REGNUM: GET_REGL(env->psw.addr); break;
-        case S390_CC_REGNUM: GET_REG32(env->cc); break;
+        case S390_CC_REGNUM:
+            env->cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst,
+                                 env->cc_vr);
+            GET_REG32(env->cc_op);
+            break;
     }
 
     return 0;
@@ -1462,7 +1466,7 @@  static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
             /* XXX */
             break;
         case S390_PC_REGNUM: env->psw.addr = tmpl; break;
-        case S390_CC_REGNUM: env->cc = tmp32; r=4; break;
+        case S390_CC_REGNUM: env->cc_op = tmp32; r=4; break;
     }
 
     return r;