From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31223 invoked by alias); 20 Apr 2010 21:45:58 -0000 Received: (qmail 31214 invoked by uid 22791); 20 Apr 2010 21:45:57 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SARE_MSGID_LONG45,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Apr 2010 21:45:54 +0000 Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id o3KLjpEY012674 for ; Tue, 20 Apr 2010 23:45:51 +0200 Received: from pvb32 (pvb32.prod.google.com [10.241.209.96]) by wpaz24.hot.corp.google.com with ESMTP id o3KLjnjR002268 for ; Tue, 20 Apr 2010 14:45:49 -0700 Received: by pvb32 with SMTP id 32so3945641pvb.6 for ; Tue, 20 Apr 2010 14:45:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.247.17 with HTTP; Tue, 20 Apr 2010 14:45:49 -0700 (PDT) In-Reply-To: <83bpdjccpc.fsf@gnu.org> References: <20100416070540.4205E84396@ruffy.mtv.corp.google.com> <83tyrbwxex.fsf@gnu.org> <83bpdjccpc.fsf@gnu.org> Date: Tue, 20 Apr 2010 21:45:00 -0000 Received: by 10.140.248.13 with SMTP id v13mr2678358rvh.25.1271799949205; Tue, 20 Apr 2010 14:45:49 -0700 (PDT) Message-ID: Subject: Re: [RFA] [1/2] auto-loading scripts from .debug_gdb_scripts section From: Doug Evans To: Eli Zaretskii Cc: gdb-patches@sourceware.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: 2010-04/txt/msg00650.txt.bz2 On Fri, Apr 16, 2010 at 2:25 PM, Eli Zaretskii wrote: >> Date: Fri, 16 Apr 2010 11:06:44 -0700 >> From: Doug Evans >> Cc: gdb-patches@sourceware.org >> >> > The existing Python Auto-loading section is not too long, so how about >> > simply adding the description of this new feature to that section? =A0I >> > think ripping it out of "Python API" is not a good idea. >> >> To me the Auto-loading section is not really part of the API. > > Well, yes, but this feature is currently specific to Python, so why > move it out of the Python chapter? I moved it from the "Python API" node to the "Python" node. It's up one level but it's still in the Python chapter. >> >> + =A0if (!input && debug_file_directory) >> >> + =A0 =A0{ >> >> + =A0 =A0 =A0/* Also try the same file in the separate debug info dir= ectory. =A0*/ >> >> + =A0 =A0 =A0debugfile =3D xmalloc (strlen (filename) >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ strlen (debug_file= _directory) + 1); >> >> + =A0 =A0 =A0strcpy (debugfile, debug_file_directory); >> >> + =A0 =A0 =A0/* FILENAME is absolute, so we don't need a "/" here. = =A0*/ >> >> + =A0 =A0 =A0strcat (debugfile, filename); >> > >> > What will that last strcat do if FILENAME has a drive letter? >> > >> >> + =A0 =A0 =A0strcpy (debugfile, gdb_datadir); >> >> + =A0 =A0 =A0strcat (debugfile, "/auto-load"); >> >> + =A0 =A0 =A0/* FILENAME is absolute, so we don't need a "/" here. = =A0*/ >> >> + =A0 =A0 =A0strcat (debugfile, filename); >> > >> > Ditto. >> >> This is cut-n-pasted from the existing code to auto-load -gdb.py >> scripts. =A0I don't know if filename can have a drive letter here. > > Yes, it can. =A0It depends how the files were called out in the > compilation command line. > > I think we should strip the drive letter and the colon before > concatenating the rest with the leading directory. Sure. I'll do that.