From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9735 invoked by alias); 11 Jan 2002 20:26:06 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9694 invoked from network); 11 Jan 2002 20:26:03 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 11 Jan 2002 20:26:03 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id MAA00303; Fri, 11 Jan 2002 12:26:00 -0800 (PST) Message-ID: <3C3F491F.F58F79F7@redhat.com> Date: Fri, 11 Jan 2002 12:26:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: "Frank Ch. Eigler" CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] Add new cmd line parameter "--pid" for attach. References: <200201050321.g053L6l16505@reddwarf.cygnus.com> <15418.21637.258565.54021@localhost.cygnus.com> <3C3B70ED.D8256B4A@redhat.com> <3C3B95FD.50803@cygnus.com> <15421.63455.895750.313310@localhost.cygnus.com> <3C3E2FBD.3080108@cygnus.com> <3C3E394C.7A1E6BA8@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00305.txt.bz2 "Frank Ch. Eigler" wrote: > > msnyder wrote: > > > [...] > > + [...] Now, if the second argument begins with a non-digit, > > + it will be treated as a corefile. If it begins with a digit, > > + GDB will attempt to attach it as a process, and if no such process > > + is found, will then attempt to open it as a corefile. > > [...] > > How hard would it be to stop guessing based on isdigit(arg[0]) and > parse the whole string? Wouldn't make any difference if the whole string consists of digits, eg. the cannonical case of a corefile called "12345". > Anyway, there is only a problem here if there > are *both* an entirely-numeric core file, and an existing process with > the same id. If not both of these hold, there is no ambiguity about > what the user means, right? Right.