From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26406 invoked by alias); 4 Nov 2008 22:22:04 -0000 Received: (qmail 26343 invoked by uid 22791); 4 Nov 2008 22:22:03 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout4.012.net.il (HELO mtaout4.012.net.il) (84.95.2.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 04 Nov 2008 22:21:22 +0000 Received: from HOME-C4E4A596F7 ([77.126.241.172]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K9T00DOZY5UWTS0@i_mtaout4.012.net.il> for gdb-patches@sourceware.org; Wed, 05 Nov 2008 00:22:52 +0200 (IST) Date: Tue, 04 Nov 2008 22:22:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 1/4] 'catch syscall' feature -- Architecture-independent part In-reply-to: <1225836687.20764.21.camel@localhost.localdomain> X-012-Sender: halo1@inter.net.il To: Thiago Jung Bauermann Cc: sergiodj@linux.vnet.ibm.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <1225773079.24532.52.camel@miki> <1225836687.20764.21.camel@localhost.localdomain> 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: 2008-11/txt/msg00058.txt.bz2 > From: Thiago Jung Bauermann > Cc: =?ISO-8859-1?Q?S=E9rgio?= Durigan =?ISO-8859-1?Q?J=FAnior?= , > gdb-patches@sourceware.org > Date: Tue, 04 Nov 2008 20:11:27 -0200 > > > More generally, let's say I'd like to implement support for this on > > Windows -- how would I need to go about it? > > ... but from what you are saying it seems that in Windows it's > different. What's the proper datatype to represent a syscall there? A symbol, I think. > > > + /* Checking if the user provided a syscall name or a number. */ > > > + if (isdigit (cur_name[0])) > > > > Is the assumption that no name will ever begin with a digit > > universally valid? > > Syscall names need to be valid function names in at least the most > common programming languages. I'm far from being a specialist, but isn't > it a very common (or universal?) restriction that function names have to > start with a non-digit character? But why assume that, instead of just checking that the argument is all-digits? It's so easy (e.g., use `strtoul') that shortcuts like this one are not needed.