diff mbox

[10/17] s390x: Adjust GDB stub

Message ID 1300982333-12802-11-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf March 24, 2011, 3:58 p.m. UTC
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(-)

Comments

Nathan Froyd March 25, 2011, 12:07 p.m. UTC | #1
On Thu, Mar 24, 2011 at 04:58:46PM +0100, 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.

Wouldn't you want to:

a) change the variable name in the earlier commit and just do the
   manual triggering in this commit, so as not to break bisect; or
b) combine this change with the previous lazification?

-Nathan
Alexander Graf March 25, 2011, 12:16 p.m. UTC | #2
On 25.03.2011, at 13:07, Nathan Froyd wrote:

> On Thu, Mar 24, 2011 at 04:58:46PM +0100, 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.
> 
> Wouldn't you want to:
> 
> a) change the variable name in the earlier commit and just do the
>   manual triggering in this commit, so as not to break bisect; or
> b) combine this change with the previous lazification?

I mostly did the variable name change so I can easily track all users of cc and adjust them accordingly.

The nice position we're in with S/390 is that nobody is building it currently. And even if they were, it would just break as compilation has been broken for quite a while now (ivshmem). So I basically assume that the target is only enabled for real bisecting as of the last patch which enables its configuration in the default target list.


Alex
diff mbox

Patch

diff --git a/gdbstub.c b/gdbstub.c
index 1e9f931..f8b5d7e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1431,7 +1431,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;
@@ -1457,7 +1461,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;