Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: teawater <teawater@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Process record and replay, 5/10
Date: Thu, 13 Nov 2008 23:00:00 -0000	[thread overview]
Message-ID: <1226606210.4574.10.camel@localhost.localdomain> (raw)
In-Reply-To: <daef60380811052348u5bffc8e9p1ca809fb1c85e14d@mail.gmail.com>

El jue, 06-11-2008 a las 15:48 +0800, teawater escribió:
> +/* Record the values of the registers and memory that will be changed in
> +   current system call.
> +   Return -1 if something wrong.  */
> +
> +int
> +record_linux_system_call (int num, linux_record_tdep_t * tdep)
> +{
> +  uint32_t tmpu32;
> +
> +  switch (num)
> +    {
<snip>
> +      /* sys_read */
> +    case 3:
> +      {
> +	uint32_t addr, count;
> +	regcache_raw_read (record_regcache, tdep->arg2, (gdb_byte *) & addr);
> +	regcache_raw_read (record_regcache, tdep->arg3, (gdb_byte *) & count);
> +	if (record_arch_list_add_mem (addr, count))
> +	  {
> +	    return (-1);
> +	  }
> +      }
> +      break;
<snip>
> +    case 84:
> +      regcache_raw_read (record_regcache, tdep->arg2, (gdb_byte *) & tmpu32);
> +      if (record_arch_list_add_mem (tmpu32, tdep->size__old_kernel_stat))
> +	{
> +	  return (-1);
> +	}
> +      break;

Syscalls have different numbers across different architectures in Linux,
so this file should be named i386-linux-record.c.

Do you know if what you need to record for a syscall in one architecture
is the same as what you need to record in the others? If so, it wouldn't
be hard to make this file general for Linux in all architectures, and
just get the syscall number mapping from the XML in the catch syscall
feature (here are we talking about it again... :-) ). Otherwise, you'll
have to rename the file, and also you can't directly call
record_linux_system_call directly from i386-linux-tdep.c like you do
now. You'd have to add a gdbarch method and reach this code through
that.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


  parent reply	other threads:[~2008-11-13 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06  7:50 teawater
2008-11-07 15:10 ` Eli Zaretskii
2008-11-09  3:54   ` teawater
2008-11-09 19:58     ` Eli Zaretskii
2008-11-11 18:54       ` teawater
2008-11-13 23:00 ` Thiago Jung Bauermann [this message]
2008-11-14 13:53   ` teawater
2008-12-03  1:34     ` Thiago Jung Bauermann
2008-12-03  2:57       ` teawater
2008-12-04  3:22       ` teawater

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=1226606210.4574.10.camel@localhost.localdomain \
    --to=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=teawater@gmail.com \
    /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