From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9175 invoked by alias); 9 Jan 2014 18:29:50 -0000 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 Received: (qmail 9163 invoked by uid 89); 9 Jan 2014 18:29:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qe0-f48.google.com Received: from mail-qe0-f48.google.com (HELO mail-qe0-f48.google.com) (209.85.128.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 09 Jan 2014 18:29:47 +0000 Received: by mail-qe0-f48.google.com with SMTP id k5so2267335qej.35 for ; Thu, 09 Jan 2014 10:29:45 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.229.24.4 with SMTP id t4mr10415761qcb.13.1389292185349; Thu, 09 Jan 2014 10:29:45 -0800 (PST) Received: by 10.229.195.196 with HTTP; Thu, 9 Jan 2014 10:29:45 -0800 (PST) In-Reply-To: <87wqi981ef.fsf@fleche.redhat.com> References: <87wqi981ef.fsf@fleche.redhat.com> Date: Thu, 09 Jan 2014 18:29:00 -0000 Message-ID: Subject: Re: [PATCH 3/5] Add d_main_name to dlang.c From: Iain Buclaw To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00248.txt.bz2 On 9 January 2014 18:18, Tom Tromey wrote: >>>>>> "Iain" == Iain Buclaw writes: > > Iain> The main program in D is _Dmain (demangled as 'D main') not C 'main'. > Iain> So the logical entry point of the program should be set accordingly. > > Iain> 2014-01-09 Iain Buclaw > > Iain> * d-lang.h (d_main_name): Add declaration. > Iain> * d-lang.c (d_main_name): New function. > Iain> * symtab.c (find_main_name): Add call to d_main_name. > > This is ok. > > Iain> +static const char D_MAIN[] = "D main"; > > If D symbols routinely demangle to have spaces in them, then I think > your users may be in for some difficulties using gdb. Right now I think > linespecs have some hacks to let this work for C++, but I'm not sure how > readily they could be extended to the above. > > If it is just the one symbol, then no big deal, there is quoting. > It's just the one symbol. 'D main' is the demangled name, _Dmain is the mangled. Either one works perfectly well with `start`, and when using cgdb, it sets the start line in the correct place.