From: David Daney <ddaney@caviumnetworks.com>
To: Nathan Froyd <froydnj@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [Patch] Add mips*-linux* catch syscall support.
Date: Mon, 24 Jan 2011 19:11:00 -0000 [thread overview]
Message-ID: <4D3DC1CC.6020906@caviumnetworks.com> (raw)
In-Reply-To: <20110122150559.GY6247@codesourcery.com>
On 01/22/2011 07:06 AM, Nathan Froyd wrote:
> On Fri, Jan 21, 2011 at 11:47:40AM -0800, David Daney wrote:
>> Index: gdb/mips-linux-tdep.c
>> ===================================================================
>> @@ -1206,6 +1207,40 @@ mips_linux_syscall_next_pc (struct frame
>>
>> return pc + 4;
>> }
>> +/* Return the current system call's number present in the
>> + v0 register. When the function fails, it returns -1. */
>> +static LONGEST
>> +mips_linux_get_syscall_number (struct gdbarch *gdbarch,
>> + ptid_t ptid)
>> +{
>> + buf = (gdb_byte *) xmalloc (regsize * sizeof (gdb_byte));
>
> Why not just use alloca or XALLOCAVEC here?
>
Because I copied the code from PPC, and that is what was done there.
Since we know that the maximum size is 8 bytes, I could just allocate a
fixed size array on the stack. That would simplify things quite a bit.
I will test that and generate a revised patch.
Thanks,
David Daney
next prev parent reply other threads:[~2011-01-24 18:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 20:19 David Daney
2011-01-22 15:08 ` Nathan Froyd
2011-01-24 19:11 ` David Daney [this message]
2011-02-12 22:32 ` Mark Kettenis
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=4D3DC1CC.6020906@caviumnetworks.com \
--to=ddaney@caviumnetworks.com \
--cc=froydnj@codesourcery.com \
--cc=gdb-patches@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