From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1494 invoked by alias); 12 Sep 2009 08:20:43 -0000 Received: (qmail 1481 invoked by uid 22791); 12 Sep 2009 08:20:42 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout3.012.net.il (HELO mtaout3.012.net.il) (84.95.2.7) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 08:20:38 +0000 Received: from conversion-daemon.i_mtaout3.012.net.il by i_mtaout3.012.net.il (HyperSendmail v2004.12) id <0KPU00D00N5K0Z00@i_mtaout3.012.net.il> for gdb-patches@sourceware.org; Sat, 12 Sep 2009 11:20:35 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.50.163]) by i_mtaout3.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KPU008SKN64OJ00@i_mtaout3.012.net.il>; Sat, 12 Sep 2009 11:20:28 +0300 (IDT) Date: Sat, 12 Sep 2009 08:20:00 -0000 From: Eli Zaretskii Subject: Re: [RFC 1/3] catch syscall -- try 6 -- Source-code modifications In-reply-to: <200909112127.41832.sergiodj@linux.vnet.ibm.com> To: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <838wgk1smq.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <200909041600.47670.sergiodj@linux.vnet.ibm.com> <200909101942.26646.sergiodj@linux.vnet.ibm.com> <83tyz929bz.fsf@gnu.org> <200909112127.41832.sergiodj@linux.vnet.ibm.com> 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: 2009-09/txt/msg00362.txt.bz2 > From: Sérgio_Durigan_Júnior > Date: Fri, 11 Sep 2009 21:27:41 -0300 > Cc: gdb-patches@sourceware.org > > On Friday 11 September 2009, Eli Zaretskii wrote: > > I have one more small request: > > > + /* Check if the user provided a syscall name or a number. */ > > > + syscall_number = (int) strtol (cur_name, &endptr, 10); > > > > This forces the user to specify the system call numbers in decimal. > > However, sometimes it might be more convenient to use hex. For > > example, I'm planning to add support for this to the DJGPP port, where > > the various software interrupts and their functions are known to > > people by their hex numbers, e.g. Interrupt 0x21 function 0x2a is the > > DOS system call to get the system clock date. Asking the users to > > translate those into decimal would be a nuisance. > > > > So can we use zero instead of 10 for the last argument of this call to > > strtol? > > Sure, I should have used zero since the start. Sorry about that, it's fixed > (and tested) now. > > > Finally, a minor nit: > > > + while (*arg != '\0') > > > + { > > > + int i, syscall_number; > > > + char *endptr; > > > + char cur_name[128]; > > > + struct syscall s; > > > + > > > + /* Skip whitespace. */ > > > + while (isspace (*arg)) > > > + arg++; > > > + > > > + for (i = 0; arg[i] && !isspace (arg[i]); ++i) > > > + cur_name[i] = arg[i]; > > > + cur_name[i] = '\0'; > > > + arg += i; > > > > The last loop does not take care not to overrun the 128-character > > limit that cur_name[] imposes on the length of syscall names, and will > > happily smash the stack if GDB is fed a very long string. > > Ops, sorry about that too :-)... Thank you for pointing this nit, I've fixed > it too (and tested, of course). Thanks, I am happy now. > What about the patch now? Ok to check in? I think everybody approved it, right? How about waiting one more day and then checking it in?