From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2513 invoked by alias); 22 Jan 2011 15:06:19 -0000 Received: (qmail 2502 invoked by uid 22791); 22 Jan 2011 15:06:18 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 22 Jan 2011 15:06:03 +0000 Received: (qmail 16589 invoked from network); 22 Jan 2011 15:06:01 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Jan 2011 15:06:01 -0000 Date: Sat, 22 Jan 2011 15:08:00 -0000 From: Nathan Froyd To: David Daney Cc: gdb-patches@sourceware.org Subject: Re: [Patch] Add mips*-linux* catch syscall support. Message-ID: <20110122150559.GY6247@codesourcery.com> References: <4D39E2DC.6060907@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D39E2DC.6060907@caviumnetworks.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00451.txt.bz2 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? -Nathan