Module Std.Demangler

Demangler is a named string transformation.

type t = demangler
val create : ?package:string -> string -> (string -> string) -> t

create name demangler creates and registers a new named demangler.

A simple demangler is a total function that either demangles a symbol name or leaves it untouched if it can't or if the name is not mangled.

  • since 2.5.0 accepts the optional (but recommended) [package]

parameter.

  • since 2.5.0 fails demangler with the given [package:name]

already exists.

  • since 2.5.0 automatically registers the demangler in the

repository.

val declare : ?package:string -> string -> (string -> string) -> unit

define name run creates and registers a simple named demangler.

A simple demangler is a total function that either demangles a symbol name or leaves it untouched if it can't or if the name is not mangled.

Essentially, declare name run is ignore (create name run).

  • since 2.5.0
val id : demangler

id the identity demangler that returns names unchanged.

The name id is bap:id

  • since 2.5.0
val strip_leading_underscore : demangler

strip_leading_underscore the demangler that strips one leading underscore.

If a symbol is not underscored then it is returned unchanged.

The name strip_leading_underscore is bap:strip-leading-underscore

  • since 2.5.0
val run : t -> string -> string

run demangler name demangle given name.

val name : t -> string

name demangler returns demangler's unqualified name as a string.

val fullname : t -> Bap_core_theory.KB.Name.t

fullname d the fully-qualified name of the demangler d.

  • since 2.5.0