This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/5] Fix for D demangling in GDB
- 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 14:54:16 -0700
- Subject: Re: [PATCH 5/5] Fix for D demangling in GDB
- Authentication-results: sourceware.org; auth=none
- References: <CABOHX+fr7hyD0WM-=1G4zcoJH61uPiE9ezYSYmKuUoqvZnLmvA at mail dot gmail dot com>
>>>>> "Iain" == Iain Buclaw <ibuclaw@gdcproject.org> writes:
Iain> * d-lang.h (d_parse_symbol): Add declaration.
Iain> * d-lang.c (extract_identifiers)
Iain> (extract_type_info): Remove functions.
Iain> (d_demangle): Use d_parse_symbol implemented in d-support.c to
Iain> demangle D symbols.
Iain> * d-support.c: New file.
The usual approach in cases like this is to do a "pure move" patch to
move the functions to another file, followed by a second patch to
implement the fixes.
It's also worth noting that with a bit more work you could push the D
demangler into libiberty (see ada_demangle there) and then get
demangling from "nm" and the other binutils.
Iain> +proc catch_demangling_errors {command} {
Iain> + if {[catch $command result]} {
Iain> + puts "ERROR: demangle.exp: while running $command: $result"
Iain> + }
Iain> +}
Iain> + # Using catch_demangling_errors this way ensures that, if one of
Iain> + # the functions raises a Tcl error, then it'll get reported, and
Iain> + # the rest of the functions will still run.
Iain> + catch_demangling_errors test_d_demangling
I don't think this stuff is needed. Usually we just let Tcl errors keep
going, since ordinarily they represent bugs in the test case. Is there
a particular failure you were seeing?
Iain> +
Iain> +} else {
Iain> + warning "D demangling tests suppressed."
I think "unsupported" instead of "warning" here.
Tom