This is the mail archive of the gdb@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]

arm reversible execution query



Hi all,

I have been wroking on arm-reversible implementation and doing arm insn part. 
I am done with framework, and supporting 30-40% on insns till now.
when I simply test on arm board, 
I find that,

all the memory and registers are replayed correctly and recording is happening.
but,
do I need to save Program counter explicitly ?
doesnt gdb reversible framework take care of changing pc when I apply 
reverse-stepi/nexti command ?

as i386-tdep.c, does not seem to be saving PC explicitly.

please clarify.
following is arm board output :
and youmay observe that PC is not being moved automatically by internal record.c 
/ framework

[root@EmbedSky gdb]# ./gdb ./test_mov 
GNU gdb (GDB) 7.2.50.20110106
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /sddisk/gdb-7.2.50.20110106/gdb/test_mov...done.
(gdb) start
Temporary breakpoint 1 at 0x8468: file test.c, line 10.
Starting program: /sddisk/gdb-7.2.50.20110106/gdb/test_mov 
re
Temporary breakpoint 1, main () at test.c:10
10           s = 10;
(gdb) record
(gdb) disp s
1: s = 1073892864
(gdb) n
11           s = 15;
1: s = 10
(gdb) 
12           s = 20;
1: s = 15
(gdb) 
13           s = -30;
1: s = 20
(gdb) reverse-next
13           s = -30;
1: s = 15
(gdb) reverse-next
13           s = -30;
1: s = 15
(gdb) reverse-next
13           s = -30;
1: s = 10
(gdb) reverse-next
13           s = -30;
1: s = 10
(gdb) reverse-next
13           s = -30;
1: s = 1073892864
(gdb) list
8       {
9            int s;
10           s = 10;
11           s = 15;
12           s = 20;
13           s = -30;
14           s = 88;
15           printf("address of s is 0x%X\n",&s);
16           a(s);
17           printf("hello world");
(gdb) disass main
Dump of assembler code for function main:
   0x0000845c <+0>:     push    {r11, lr}
   0x00008460 <+4>:     add     r11, sp, #4
   0x00008464 <+8>:     sub     sp, sp, #16
   0x00008468 <+12>:    mov     r3, #10
   0x0000846c <+16>:    str     r3, [r11, #-8]
   0x00008470 <+20>:    mov     r3, #15
   0x00008474 <+24>:    str     r3, [r11, #-8]
   0x00008478 <+28>:    mov     r3, #20
   0x0000847c <+32>:    str     r3, [r11, #-8]
=> 0x00008480 <+36>:    mvn     r3, #29
   0x00008484 <+40>:    str     r3, [r11, #-8]
   0x00008488 <+44>:    mov     r3, #88 ; 0x58
   0x0000848c <+48>:    str     r3, [r11, #-8]
   0x00008490 <+52>:    sub     r3, r11, #8
   0x00008494 <+56>:    ldr     r0, [pc, #32]   ; 0x84bc <main+96>
   0x00008498 <+60>:    mov     r1, r3
   0x0000849c <+64>:    bl      0x8378 <printf>
   0x000084a0 <+68>:    ldr     r3, [r11, #-8]
   0x000084a4 <+72>:    mov     r0, r3
   0x000084a8 <+76>:    bl      0x8434 <a>
   0x000084ac <+80>:    ldr     r0, [pc, #12]   ; 0x84c0 <main+100>
   0x000084b0 <+84>:    bl      0x8378 <printf>
   0x000084b4 <+88>:    sub     sp, r11, #4
   0x000084b8 <+92>:    pop     {r11, pc}
   0x000084bc <+96>:    andeq   r8, r0, r8, asr r5
   0x000084c0 <+100>:   andeq   r8, r0, r0, ror r5
End of assembler dump.
(gdb) 

Regards,
Oza.


----- Original Message ----
From: Michael Snyder <msnyder@vmware.com>
To: paawan oza <paawan1982@yahoo.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Sent: Sat, January 15, 2011 12:21:03 AM
Subject: Re: regcache_raw_supply query

paawan oza wrote:
> Hi,
> 
> I am using regcache_raw_supply (armr.regcache, ARM_PS_REGNUM, &reg);
> API to fetch arm register value
> 
> Is there any macro or API available to fetch arm register's value ?
> or it is ok to use regcache_raw_supply ?


It is fine to use that function, as well as
regcache_raw_read* and regcache_raw_write*.


      


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