This is the mail archive of the gdb-prs@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]

[Bug rust/20367] add further Rust demangling


https://sourceware.org/bugzilla/show_bug.cgi?id=20367

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #7 from Mark Wielaard <mark at klomp dot org> ---
I think in rust_sniff_from_mangled_name () you need to use the new
rust_is_mangled () or rust_demangle () from libiberty. See the documentation in
demangle.h:

/* Returns non-zero iff MANGLED is a rust mangled symbol.  MANGLED must
   already have been demangled through cplus_demangle_v3.  If this function
   returns non-zero then MANGLED can be demangled (in-place) using
   RUST_DEMANGLE_SYM.  */
extern int
rust_is_mangled (const char *mangled);

/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
   If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
   replace characters that cannot be demangled with '?' and might truncate
   SYM.  After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
   larger.  */
extern void
rust_demangle_sym (char *sym);

/* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise
   returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and
   RUST_DEMANGLE_SYM.  Returns a new string that is owned by the caller.  */
extern char *
rust_demangle (const char *mangled, int options);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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