From: Tom Tromey <tromey@redhat.com>
To: "Sérgio Durigan Júnior" <sergiodj@linux.vnet.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/4] 'catch syscall' feature -- Architecture-dependent part
Date: Tue, 04 Nov 2008 16:18:00 -0000 [thread overview]
Message-ID: <m3ljvzpiv5.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1225773084.24532.54.camel@miki> (=?utf-8?Q?=22S=C3=A9rgio?= Durigan =?utf-8?Q?J=C3=BAnior=22's?= message of "Tue\, 04 Nov 2008 02\:31\:24 -0200")
>>>>> "Sérgio" == Sérgio Durigan Júnior <sergiodj@linux.vnet.ibm.com> writes:
Sérgio> * i386-linux-tdep.c: Define the syscall's XML struct to hold
Sérgio> information about syscalls.
Sérgio> (init_sysinfo): New.
There is some code duplication between this and ppc-linux-tdep.c.
It seems to me that much of the Linux code will be shared by all
ports. So, I think the duplicated stuff should go in linux-nat.c.
Sérgio> (i386_linux_get_syscall_number): New.
Sérgio> (i386_linux_syscall_name_from_number): New.
Sérgio> (i386_linux_syscall_number_from_name): New.
Sérgio> (i386_linux_get_syscalls_names): New.
In the current patch, these could all be static. Aside from
i386_linux_get_syscall_number, perhaps they ought to be shared in
linux-nat.c though. The same applies for the equivalent PPC functions.
Sérgio> +/* Return the current system call's number present in the
Sérgio> + r0 register. When the function fails, it returns -1. */
Sérgio> +LONGEST
Sérgio> +ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
Sérgio> + ptid_t ptid)
Sérgio> +{
[...]
Sérgio> + buf = (gdb_byte *) xmalloc (tdep->wordsize * sizeof (gdb_byte));
I suspect you need a cleanup here, rather than an explicit xfree. I
am not sure. If regcache_cooked_read can call error, then you need
one.
Tom
next prev parent reply other threads:[~2008-11-04 16:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 4:32 Sérgio Durigan Júnior
2008-11-04 16:18 ` Tom Tromey [this message]
2008-11-04 16:50 ` Sérgio Durigan Júnior
2008-11-04 21:18 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2008-09-30 18:13 [PATCH 2/4] catch " Sérgio Durigan Júnior
2008-10-06 19:14 ` Sérgio Durigan Júnior
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=m3ljvzpiv5.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@linux.vnet.ibm.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