Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: paawan oza <paawan1982@yahoo.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: arm reversible execution query
Date: Mon, 31 Jan 2011 13:50:00 -0000	[thread overview]
Message-ID: <610357.40561.qm@web112518.mail.gq1.yahoo.com> (raw)
In-Reply-To: <4D309B17.7020400@vmware.com>



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*.


      


  reply	other threads:[~2011-01-31 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 10:14 regcache_raw_supply query paawan oza
2011-01-14 18:51 ` Michael Snyder
2011-01-31 13:50   ` paawan oza [this message]
2011-01-31 18:53     ` arm reversible execution query Michael Snyder
2011-02-01  3:20       ` paawan oza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=610357.40561.qm@web112518.mail.gq1.yahoo.com \
    --to=paawan1982@yahoo.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox