Changeset 317d85d in rtems-tools


Ignore:
Timestamp:
Aug 6, 2018, 11:08:25 PM (10 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
2950fd4
Parents:
99c90b3
git-author:
Chris Johns <chrisj@…> (08/06/18 23:08:25)
git-committer:
Chris Johns <chrisj@…> (08/06/18 23:11:29)
Message:

rtemstoolkit/dwarf: Add types of inline. Report machine code size not span.

  • Add the types of inlined functions to the interface.
  • Return the machine code for each function and not the address span.
Location:
rtemstoolkit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtemstoolkit/rld-dwarf.cpp

    r99c90b3 r317d85d  
    814814    }
    815815
     816    function::inlined
     817    function::get_inlined () const
     818    {
     819      inlined i = inl_not_inlined;
     820      switch (inline_)
     821      {
     822        default:
     823        case DW_INL_not_inlined:
     824          break;
     825        case DW_INL_inlined:
     826          i = inl_inline;
     827          break;
     828        case DW_INL_declared_not_inlined:
     829          i = inl_declared_not_inlined;
     830          break;
     831        case DW_INL_declared_inlined:
     832          i = inl_declared_inlined;
     833          break;
     834      }
     835      return i;
     836    }
     837
    816838    std::string
    817839    function::call_file () const
     
    832854      size_t s = 0;
    833855      if (!name_.empty () && has_machine_code ())
    834         s = pc_high () - pc_low ();
     856      {
     857        if (ranges_.empty ())
     858          s = pc_high () - pc_low ();
     859        else
     860        {
     861          for (auto& r : ranges_.get ())
     862          {
     863            if (!r.end () && !r.empty ())
     864              s += r.addr2 () - r.addr1 ();
     865          }
     866        }
     867      }
    835868      return s;
    836869    }
  • rtemstoolkit/rld-dwarf.h

    r99c90b3 r317d85d  
    283283    {
    284284    public:
     285
     286      /**
     287       * The various inline states. See Table 3.4 DWARF 5 standard.
     288       */
     289      enum inlined {
     290        inl_not_inlined = 0,          /**< Not declared inline nore inlined. */
     291        inl_inline = 1,               /**< Not declared inline but inlined. */
     292        inl_declared_not_inlined = 2, /**< Declared inline but not inlined. */
     293        inl_declared_inlined = 3      /**< Declared inline and inlined */
     294      };
     295
    285296      function (file& debug, debug_info_entry& die);
    286297      function (const function& orig);
     
    332343       */
    333344      bool is_inlined () const;
     345
     346      /**
     347       * Get the inlined state.
     348       */
     349      inlined get_inlined () const;
    334350
    335351      /**
Note: See TracChangeset for help on using the changeset viewer.