This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/5] Add d_main_name to dlang.c
- From: Tom Tromey <tromey at redhat dot com>
- To: Iain Buclaw <ibuclaw at gdcproject dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 09 Jan 2014 11:18:16 -0700
- Subject: Re: [PATCH 3/5] Add d_main_name to dlang.c
- Authentication-results: sourceware.org; auth=none
- References: <CABOHX+cKZ6+1H3DyHw6ZsOZHAu7_pvaE2KyGPqh9DKvC2n3tCg at mail dot gmail dot com>
>>>>> "Iain" == Iain Buclaw <ibuclaw@gdcproject.org> 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 <ibuclaw@gdcproject.org>
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.
Tom