From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24367 invoked by alias); 24 Jan 2011 18:15:49 -0000 Received: (qmail 24318 invoked by uid 22791); 24 Jan 2011 18:15:48 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail3.caviumnetworks.com (HELO mail3.caviumnetworks.com) (12.108.191.235) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Jan 2011 18:15:42 +0000 Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by mail3.caviumnetworks.com with MailMarshal (v6,7,2,8378) id ; Mon, 24 Jan 2011 10:16:30 -0800 Received: from caexch01.caveonetworks.com ([192.168.16.9]) by caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 24 Jan 2011 10:15:40 -0800 Received: from dd1.caveonetworks.com ([12.108.191.236]) by caexch01.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 24 Jan 2011 10:15:40 -0800 Message-ID: <4D3DC1CC.6020906@caviumnetworks.com> Date: Mon, 24 Jan 2011 19:11:00 -0000 From: David Daney User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10 MIME-Version: 1.0 To: Nathan Froyd CC: gdb-patches@sourceware.org Subject: Re: [Patch] Add mips*-linux* catch syscall support. References: <4D39E2DC.6060907@caviumnetworks.com> <20110122150559.GY6247@codesourcery.com> In-Reply-To: <20110122150559.GY6247@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00462.txt.bz2 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