From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29002 invoked by alias); 10 Jan 2011 22:29:14 -0000 Received: (qmail 28992 invoked by uid 22791); 10 Jan 2011 22:29:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_RG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Jan 2011 22:29:07 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0F4D21B4158; Mon, 10 Jan 2011 22:29:05 +0000 (UTC) From: Mike Frysinger To: Doug Evans Subject: Re: [PATCH] gdb: add callback defines for new ARGV handling Date: Mon, 10 Jan 2011 22:29:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc5; KDE/4.5.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org References: <1294308908-23356-1-git-send-email-vapier@gentoo.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4364319.veAEMAvtJ5"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201101101729.10772.vapier@gentoo.org> 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/msg00208.txt.bz2 --nextPart4364319.veAEMAvtJ5 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 2910 On Monday, January 10, 2011 17:11:53 Doug Evans wrote: > 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. This is because the generated callback header > >>> includes simple common gdb/sim headers only which causes it to skip > >>> the new ARGV syscalls. Plus, it isn't like providing these in the > >>> common header will break any sim targets which don't want them. > >>>=20 > >>> Signed-off-by: Mike Frysinger > >>>=20 > >>> 2010-01-06 Mike Frysinger > >>>=20 > >>> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Defin= e. > >>> --- > >>> include/gdb/callback.h | 5 +++++ > >>> 1 files changed, 5 insertions(+), 0 deletions(-) > >>>=20 > >>> 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; > >>> #define CB_SYS_truncate 21 > >>> #define CB_SYS_ftruncate 22 > >>> #define CB_SYS_pipe 23 > >>> + > >>> +/* New ARGV support. */ > >>> +#define CB_SYS_argc 24 > >>> +#define CB_SYS_argnlen 25 > >>> +#define CB_SYS_argn 26 > >>>=20 > >>> /* Struct use to pass and return information necessary to perform a > >>> system call. */ > >>=20 > >> The common sim code has CB_SYS_{argv,argvlen}, but I don't see the > >> above. Where do they come from? > >=20 > > pretty much all the callback "syscalls" that the sim handles are > > because of newlib/libgloss > > -mike >=20 > Ah. src/libgloss/syscall.h has SYS_{argc,argnlen,argn}, added in 2006. >=20 > So now we have CB_SYS_{argv,argvlen,argc,argnlen,argn}. > Blech. > It would be nice to know the reasoning behind argn,argnlen. >=20 > 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? these things were created long before i had even heard of either project, s= o i=20 can only speculate on their history. i would guess that argv/argvlen made = it=20 more difficult to do what most people actually want -- pass argc/argv to th= e=20 main function. and so argc/argn were born. all i really know is that argc/argn/argnlen are labeled as "the new approac= h"=20 in a few places, and as such, it is what the Blackfin port supports. it also seems like the syscall handling intended to handle argv at some poi= nt,=20 but someone didnt get around to implementing it. so i could flesh that out= =20 too so that i could take the Blackfin argn/argc code and move it to=20 common/syscall.c in the sim. -mike --nextPart4364319.veAEMAvtJ5 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iQIcBAABAgAGBQJNK4g2AAoJEEFjO5/oN/WB7vQP/RWQA8rauBJiczBxpsL0rSwn lLwQG/5mFM0/8Qv1eEcMBexKyxf+BxAwz6qHlUmY4Xwyk7A+d6Kit0IgIHFuKVzS naoBmAMzvv5/rNrXv5zpny9Ij2QGzHaU83XTb4aWg6A7Sslcdyb8bBmAOYXwMK6v SXXYW3nluMvV11daLb36lNq75eHEpjFF7pkprS+W60TymAkCDj44lP3CyZbZVQp/ RL1/5MfYeG+jrdNseO0obKqUogApq9wD7iXj7sZDa76j8+1U7X1c9GqiGQVljTyy CYep2Z9Iv177pZG7A+8cuWcqIqt8XFbbnOsWMrqG/WgDK0g1eJ7IFW9m/OiAq6Ub I6ESPkcrtoG1nx+O4GhAK7D5+TtqQ90oIxJ9AWbqUoM94EQ1Hx4R4Fo7hfLFZk58 At5yi38DunWEYafOGbeYJWBd9IZ5tgGKO6oLXu/a5gPNauW1dNKpYLxy+px3x1Kq NawrLU796sql7ipbfYhWuNKmXDVO8h25Su3MkI4TVj73LuAx3tZEL6qcGDVjLlL6 Qr4a30jdty8m987FyEo/ASgRD8C9OEesy+kE7laMuAGgtGX9V3MbmHAdNcAzpJbp pL3GXJs0GTC79lvvYtQiqZdqpYPdVihI0uYNvyAxE0dqN7g9081HNyL4yndJg9N3 yZZZtoBp/pWJYYArZ95F =rQ1B -----END PGP SIGNATURE----- --nextPart4364319.veAEMAvtJ5--