From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22618 invoked by alias); 24 Jun 2009 17:03:15 -0000 Received: (qmail 22483 invoked by uid 22791); 24 Jun 2009 17:03:14 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Jun 2009 17:03:06 +0000 Received: (qmail 4344 invoked from network); 24 Jun 2009 17:03:03 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Jun 2009 17:03:03 -0000 From: Pedro Alves To: Christopher Faylor Subject: Re: [RFA/Windows] Remove ADD_SHARED_SYMBOL_FILES macro Date: Wed, 24 Jun 2009 17:03:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org, Joel Brobecker , Pierre Muller References: <003d01c9d4e2$987399a0$c95acce0$@u-strasbg.fr> <20090622204950.GC7766@adacore.com> <20090623015441.GA19762@ednor.casa.cgf.cx> In-Reply-To: <20090623015441.GA19762@ednor.casa.cgf.cx> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906241804.00621.pedro@codesourcery.com> 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: 2009-06/txt/msg00650.txt.bz2 On Tuesday 23 June 2009 02:54:41, Christopher Faylor wrote: > On Mon, Jun 22, 2009 at 01:49:50PM -0700, Joel Brobecker wrote: > >[trying to catch up on email...] > > > >> On Monday 25 May 2009 23:57:25, Joel Brobecker wrote: > >> > > (_initialize _symfile): Move "add-shared-symbol-files" > >> > > command and "assf" alias. > >> > > * windows-nat.c (_initialize_windows_nat): to here. > >> > > Change "add-shared-symbol-files" to alias. > >> > > >> > I propose we deprecate these aliases as well; does it really make sense > >> > to have 2 identical commands? > >> > > >> > >>Well, let me go the other way around. Why is "dll-symbols" needed at > >>all? Why isn't "add-symbol-file" good enough? Other than the ugly > >>safe_symbol_file_add hack that would be nice to get rid of, and setting > >>OBJF_SHARED (itself dubious) it doesn't have anything Windows specific > >>at all (magically appending ".dll" doesn't count). > > > >I would love to get rid of these commands if they are indeed equivalent > >to add-symbol-file. I assumed that there was a reason for the > >different command name. Chris, do you remember? > > (gdb) add-symbol-file cygwin1.dll > The address where cygwin1.dll has been loaded is missing > (gdb) dll cygwin1.dll > (gdb) l dll_crt0 > 952 _main_tls = &_my_tls; > 953 _main_tls->call ((DWORD (*) (void *, void *)) dll_crt0_1, NULL); > 954 } > 955 > 956 void > 957 dll_crt0 (per_process *uptr) > 958 { > 959 /* Set the local copy of the pointer into the user space. */ > 960 if (!in_forkee && uptr && uptr != user_data) > 961 { > > As I have previously mentioned, the commands are not equivalent. Wouldn't "add-symbol-file cygwin1.dll 0" have pretty much the effect you want? (gdb) add-symbol-file dll.dll 0 add symbol table from file "dll.dll" at .text_addr = 0x0 (y or n) y Reading symbols from /home/pedro/dll.dll...done. (gdb) list foo 1 2 __declspec(dllexport) int foo () 3 { 4 return 0; 5 } (gdb) Or, even: (gdb) define dll-symbols2 Type commands for definition of "dll-symbols2". End with a line saying just "end". >add-symbol-file $arg0 0 >end (gdb) dll-symbols2 dll.dll add symbol table from file "dll.dll" at .text_addr = 0x0 (gdb) list foo 1 2 __declspec(dllexport) int foo () 3 { 4 return 0; 5 } (gdb) This is a legitimate question. I'm probably missing something important that is possible with dll-symbols and not with add-symbol-file. I'd be nice to understand it, since the command uses OBJF_SHARED for a user added object -- I can picture having these uses misunderstood making the job harder for people working on objfiles (re-)designs, for example. The other point I was getting across, and which Ulrich also pointed out in the other thread Pierre started that led to this patch, is that I it is a bit wrong to see this command/feature, being a symbols related command, included in a native Windows hosted gdb, while not, e.g., in a cross to Windows; or having it be a Windows specific at all, given that it doesn't seem to contain anything Windows related, other than the points I already mentioned. But this latter issue is not something worth iterating much over. -- Pedro Alves