Changeset 6c94148 in rtems-tools for rtemstoolkit


Ignore:
Timestamp:
Apr 3, 2016, 6:26:36 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, master
Children:
3e14594
Parents:
c81066f
Message:

linkers: Demangle the C++ labels in the .ctors/.dtors sections.

Show user friendly labels for the C++ constructors and destructors.

Location:
rtemstoolkit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtemstoolkit/rld-symbols.cpp

    rc81066f r6c94148  
    3838     * Get the demangled name.
    3939     */
    40     static void
    41     denamgle_name (std::string& name, std::string& demangled)
     40    bool
     41    is_cplusplus (const std::string& name)
     42    {
     43      char* demangled_name = ::cplus_demangle (name.c_str (),
     44                                               DMGL_ANSI | DMGL_PARAMS);
     45      bool yes = false;
     46      if (demangled_name)
     47      {
     48        yes = true;
     49        ::free (demangled_name);
     50      }
     51      return yes;
     52    }
     53
     54    void
     55    demangle_name (std::string& name, std::string& demangled)
    4256    {
    4357      char* demangled_name = ::cplus_demangle (name.c_str (),
     
    7185        throw rld_error_at ("object pointer is 0");
    7286      if (is_cplusplus ())
    73         denamgle_name (name_, demangled_);
     87        demangle_name (name_, demangled_);
    7488    }
    7589
     
    8498    {
    8599      if (is_cplusplus ())
    86         denamgle_name (name_, demangled_);
     100        demangle_name (name_, demangled_);
    87101    }
    88102
  • rtemstoolkit/rld-symbols.h

    rc81066f r6c94148  
    4646  {
    4747    /**
     48     * C++ demangler.
     49     */
     50    bool is_cplusplus (const std::string& name);
     51    void demangle_name (std::string& name, std::string& demangled);
     52
     53    /**
    4854     * Use a local type for the address.
    4955     */
Note: See TracChangeset for help on using the changeset viewer.