From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22827 invoked by alias); 10 Jan 2011 22:12:08 -0000 Received: (qmail 22817 invoked by uid 22791); 10 Jan 2011 22:12:06 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Jan 2011 22:11:58 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id p0AMBt5d000407 for ; Mon, 10 Jan 2011 14:11:55 -0800 Received: from qwj9 (qwj9.prod.google.com [10.241.195.73]) by kpbe15.cbf.corp.google.com with ESMTP id p0AMA3Xn003824 for ; Mon, 10 Jan 2011 14:11:53 -0800 Received: by qwj9 with SMTP id 9so21665391qwj.22 for ; Mon, 10 Jan 2011 14:11:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.179.76 with SMTP id bp12mr27233939qab.264.1294697513439; Mon, 10 Jan 2011 14:11:53 -0800 (PST) Received: by 10.220.118.80 with HTTP; Mon, 10 Jan 2011 14:11:53 -0800 (PST) In-Reply-To: References: <1294308908-23356-1-git-send-email-vapier@gentoo.org> Date: Mon, 10 Jan 2011 22:12:00 -0000 Message-ID: Subject: Re: [PATCH] gdb: add callback defines for new ARGV handling From: Doug Evans To: Mike Frysinger Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00207.txt.bz2 On Mon, Jan 10, 2011 at 1:25 PM, Mike Frysinger wrote: > On Mon, Jan 10, 2011 at 12:57 PM, Doug Evans wrote: >> On Thu, Jan 6, 2011 at 2:15 AM, Mike Frysinger wrote: >>> The common sim code has slightly unfinished support for these already, >>> but even arch ports are unable to handle these if the common header does >>> not define them. =A0This is because the generated callback header inclu= des >>> simple common gdb/sim headers only which causes it to skip the new ARGV >>> syscalls. =A0Plus, it isn't like providing these in the common header w= ill >>> break any sim targets which don't want them. >>> >>> Signed-off-by: Mike Frysinger >>> >>> 2010-01-06 =A0Mike Frysinger =A0 >>> >>> =A0 =A0 =A0 =A0* callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn):= Define. >>> --- >>> =A0include/gdb/callback.h | =A0 =A05 +++++ >>> =A01 files changed, 5 insertions(+), 0 deletions(-) >>> >>> diff --git a/include/gdb/callback.h b/include/gdb/callback.h >>> index a1f79f9..296dfc3 100644 >>> --- a/include/gdb/callback.h >>> +++ b/include/gdb/callback.h >>> @@ -231,6 +231,11 @@ extern host_callback default_callback; >>> =A0#define CB_SYS_truncate =A0 =A0 =A0 =A021 >>> =A0#define CB_SYS_ftruncate 22 >>> =A0#define CB_SYS_pipe =A0 =A023 >>> + >>> +/* New ARGV support. =A0*/ >>> +#define CB_SYS_argc =A0 =A024 >>> +#define CB_SYS_argnlen 25 >>> +#define CB_SYS_argn =A0 =A026 >>> >>> =A0/* Struct use to pass and return information necessary to perform a >>> =A0 =A0system call. =A0*/ >> >> The common sim code has CB_SYS_{argv,argvlen}, but I don't see the above. >> Where do they come from? > > pretty much all the callback "syscalls" that the sim handles are > because of newlib/libgloss > -mike Ah. src/libgloss/syscall.h has SYS_{argc,argnlen,argn}, added in 2006. So now we have CB_SYS_{argv,argvlen,argc,argnlen,argn}. Blech. It would be nice to know the reasoning behind argn,argnlen. For callback.h, IWBN to add some documentation regarding why things are the way they are. E.g. if argn is preferred over argv, why? Any ideas?