From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: ddaney@caviumnetworks.com
Cc: froydnj@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: [Patch] Add mips*-linux* catch syscall support.
Date: Sat, 12 Feb 2011 22:32:00 -0000 [thread overview]
Message-ID: <201102122229.p1CMTqvN031897@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <4D3DC1CC.6020906@caviumnetworks.com> (message from David Daney on Mon, 24 Jan 2011 10:15:40 -0800)
> Date: Mon, 24 Jan 2011 10:15:40 -0800
> From: David Daney <ddaney@caviumnetworks.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.
That's typically what I do for code that supports both 32-bit and
64-bit registers in the GDB targets I (sort of) maintain (i386/amd64,
sparc/sparc64).
prev parent reply other threads:[~2011-02-12 22:32 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
2011-02-12 22:32 ` Mark Kettenis [this message]
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=201102122229.p1CMTqvN031897@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).