Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Hui Zhu <teawater@gmail.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	  gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA/RFC Prec] Add Linux AMD64 process record support second  	version, (64 bits system call support) 2/3
Date: Sun, 26 Jul 2009 07:46:00 -0000	[thread overview]
Message-ID: <4A6B83A8.8030505@vmware.com> (raw)
In-Reply-To: <daef60380907191018v31cd43e6v9ab4e842d7073396@mail.gmail.com>

Hui, I have just a few more small issues with this patch:


>  linux-record.c    | 2570 ++++++++++++++++++++++++++++++------------------------
[...]
> +        case RECORD_SYS_ACCEPT:
> +        case RECORD_SYS_GETSOCKNAME:
> +        case RECORD_SYS_GETPEERNAME:
> +          {
> +            regcache_raw_read_unsigned (regcache, tdep->arg2,
> +                                        &tmpulongest);
> +            if (tmpulongest)
> +              {
> +                gdb_byte *a = alloca (tdep->size_ulong * 2);
> +                int addrlen;
> +                gdb_byte *addrlenp;

> +                tmpulongest += tdep->size_ulong;
> +                if (target_read_memory ((CORE_ADDR) tmpulongest, a,
> +                                        tdep->size_ulong * 2))
> +                  {
> +                    if (record_debug)
> +                      fprintf_unfiltered (gdb_stdlog,
> +                                          "Process record: error reading "
> +                                          "memory at addr = 0x%s len = %d.\n",
> +                                          OUTPUT_REG (tmpulongest, tdep->arg2),
> +                                          tdep->size_ulong * 2);
> +                    return -1;
> +                  }
> +                if (record_linux_sockaddr (regcache, tdep,
> +                                           extract_unsigned_integer
> +                                             (a, tdep->size_ulong, byte_order),
> +                                           extract_unsigned_integer
> +                                             (a + tdep->size_ulong,
> +                                              tdep->size_ulong, byte_order)))

Could you use a couple of temporary variables for
extract_unsigned_integer here?


> +        case RECORD_SYS_RECVFROM:
> +          regcache_raw_read_unsigned (regcache, tdep->arg2,
> +                                      &tmpulongest);
> +          if (tmpulongest)
> +            {
> +              gdb_byte *a = alloca (tdep->size_ulong * 2);
> +              int addrlen;
> +              gdb_byte *addrlenp;
>  

> +              tmpulongest += tdep->size_ulong * 4;
> +              if (target_read_memory ((CORE_ADDR) tmpulongest, a,
> +                                      tdep->size_ulong * 2))
> +                {
> +                  if (record_debug)
> +                    fprintf_unfiltered (gdb_stdlog,
> +                                        "Process record: error reading "
> +                                        "memory at addr = 0x%s len = %d.\n",
> +                                        OUTPUT_REG (tmpulongest, tdep->arg2),
> +                                        tdep->size_ulong * 2);
> +                  return -1;
> +                }
> +              if (record_linux_sockaddr (regcache, tdep,
> +                                         extract_unsigned_integer
> +                                           (a, tdep->size_ulong, byte_order),
> +                                         extract_unsigned_integer
> +                                           (a + tdep->size_ulong,
> +                                            tdep->size_ulong, byte_order)))

And here?


> +        case RECORD_SYS_RECVMSG:
> +          {
> +            gdb_byte *a = alloca (tdep->size_ulong);
> +
> +            regcache_raw_read_unsigned (regcache, tdep->arg2,
> +                                        &tmpulongest);
> +            if (tmpulongest)
> +              {
> +                tmpulongest += tdep->size_ulong;
> +                if (target_read_memory ((CORE_ADDR) tmpulongest, a,
> +                                        tdep->size_ulong))
> +                  {
> +                    if (record_debug)
> +                      fprintf_unfiltered (gdb_stdlog,
> +                                          "Process record: error reading "
> +                                          "memory at addr = 0x%s len = %d.\n",
> +                                          OUTPUT_REG (tmpulongest, tdep->arg2),
> +                                          tdep->size_ulong);
> +                    return -1;
> +                  }
> +                tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
> +                                                        byte_order);
> +                if (record_linux_msghdr (regcache, tdep,
> +                                         extract_unsigned_integer
> +                                           (a, tdep->size_ulong, byte_order)))

And here?


> +    case 528:
> +      /* sys_shmdt */
> +      /* XXX maybe need do some record works wiht sys_shmdt.  */

"with".

> +        case RECORD_SEMOP:
> +        case RECORD_SEMGET:
> +        case RECORD_SEMTIMEDOP:
> +        case RECORD_MSGSND:
> +        case RECORD_MSGGET:
> +          /* XXX maybe need do some record works wiht RECORD_SHMDT.  */

"with".


That's all I've got!  After those, I'm good.

Mark?  How about you?

Michael


  reply	other threads:[~2009-07-25 22:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  2:40 Hui Zhu
2009-07-13  2:26 ` Michael Snyder
2009-07-17 12:03   ` Hui Zhu
2009-07-18  3:04     ` Michael Snyder
2009-07-19 17:39       ` Hui Zhu
2009-07-26  7:46         ` Michael Snyder [this message]
2009-07-28  1:44           ` Hui Zhu
2009-08-03  5:40             ` Hui Zhu

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=4A6B83A8.8030505@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --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