This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] Fix for D demangling in GDB


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]