From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24603 invoked by alias); 17 Apr 2012 04:06:09 -0000 Received: (qmail 24582 invoked by uid 22791); 17 Apr 2012 04:06:07 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_GV,TW_RG X-Spam-Check-By: sourceware.org Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Apr 2012 04:05:34 +0000 Received: by wgbdr12 with SMTP id dr12so4809633wgb.12 for ; Mon, 16 Apr 2012 21:05:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.107.234 with SMTP id hf10mr10802166wib.0.1334635532747; Mon, 16 Apr 2012 21:05:32 -0700 (PDT) Received: by 10.223.103.79 with HTTP; Mon, 16 Apr 2012 21:05:32 -0700 (PDT) In-Reply-To: <201204091508.11480.vapier@gentoo.org> References: <1294308908-23356-1-git-send-email-vapier@gentoo.org> <201101101729.10772.vapier@gentoo.org> <201204091508.11480.vapier@gentoo.org> Date: Tue, 17 Apr 2012 07:00:00 -0000 Message-ID: Subject: Re: [PATCH] gdb: add callback defines for new ARGV handling From: Jie Zhang To: Mike Frysinger Cc: Doug Evans , gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org, newlib@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2012-04/txt/msg00449.txt.bz2 On Mon, Apr 9, 2012 at 3:08 PM, Mike Frysinger wrote: > Jie: could you comment on the below thread ? Yes. > -mike > > On Monday 10 January 2011 22:38:11 Doug Evans wrote: >> [+ newlib] >> >> On Mon, Jan 10, 2011 at 2:29 PM, Mike Frysinger wrote: >> >> For callback.h, IWBN to add some documentation regarding why things >> >> are the way they are. =A0E.g. if argn is preferred over argv, why? >> > >> > these things were created long before i had even heard of either proje= ct, >> > so i can only speculate on their history. >> >> Understood. >> >> > i would guess that argv/argvlen made it >> > more difficult to do what most people actually want -- pass argc/argv = to >> > the main function. =A0and so argc/argn were born. >> >> I wouldn't mind hearing more, sounds pretty fishy. >> Though I understand it was before your time. >> It was also much before my time. See my next comment. >> I found these in the newlib archives: >> An inquiry into argv,argvlen: >> http://sourceware.org/ml/newlib/2006/msg00859.html >> Submission of argc,argn,argnlen: >> http://sourceware.org/ml/newlib/2006/msg00883.html >> >> I couldn't find any pushback when argn,argnlen were submitted. >> When I was working on adding argc/argv support for Blackfin newlib/libgloss/simulator, I just copied the existing implementation from other ports. I checked out the sim and newlib code around 27 Oct 2006. It seems at that time sh used argc/argn/argnlen while d30v used argv/argvlen. But the code for CB_SYS_argvlen and CB_SYS_argv was commented out by "#if 0 /* FIXME: wip */... #endif" in sim. So I just used the same one as sh port for Blackfin. The initial sh newlib patch: http://sourceware.org/ml/newlib/2001/msg00043.html The initial sh sim patch: http://sourceware.org/ml/gdb-patches/2001-01/msg00288.html >> > all i really know is that argc/argn/argnlen are labeled as "the new >> > approach" in a few places, and as such, it is what the Blackfin port >> > supports. I think this is true. CB_SYS_argv/CB_SYS_argvlen came in with the initial import of gdb repository in 1999. It was still commented out as WIP when argc/argn/argnlen was added in 2001. It's still commented out today! I really think we should remove these commented out code, which has been WIP for 13 years. I don't think it will get done in near future. >> >> Blech. >> I'm hesitant to approve the patch, but since this is sim,newlib I >> don't want to hold things up much just because of this. >> >> > it also seems like the syscall handling intended to handle argv at some >> > point, but someone didnt get around to implementing it. =A0so i could >> > flesh that out too so that i could take the Blackfin argn/argc code and >> > move it to common/syscall.c in the sim. >> >> newlib: does anyone know the history of SYS_argc,argn,argnlen vs >> SYS_argv,argvlen beyond the above mentioned emails? The earliest information I know is the two patches I mentioned above. Regards, Jie