Changeset 1c85380 in rtems-tools


Ignore:
Timestamp:
May 11, 2018, 5:21:05 AM (12 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
d6ae3ae
Parents:
881824f
git-author:
Chris Johns <chrisj@…> (05/11/18 05:21:05)
git-committer:
Chris Johns <chrisj@…> (06/18/18 02:26:16)
Message:

rtemstoolkit/dwarf: Change the address source line to signed so valid() works.

Also add a check to valid where there must be source to be valid.

Location:
rtemstoolkit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtemstoolkit/rld-dwarf.cpp

    r881824f r1c85380  
    6464        end_sequence (false)
    6565    {
    66         dwarf_error de;
    67         int         dr;
    68         dr = ::dwarf_lineaddr(line, &addr, &de);
    69         libdwarf_error_check ("address::address", dr, de);
    70         dr = ::dwarf_line_srcfileno(line, &source_index, &de);
    71         libdwarf_error_check ("address::address", dr, de);
    72         dr = ::dwarf_lineno(line, &source_line, &de);
    73         libdwarf_error_check ("address::address", dr, de);
    74         dwarf_bool b;
    75         dr = ::dwarf_linebeginstatement(line, &b, &de);
    76         libdwarf_error_check ("address::address", dr, de);
    77         begin_statement = b ? true : false;
    78         dr = ::dwarf_lineblock(line, &b, &de);
    79         libdwarf_error_check ("address::address", dr, de);
    80         block = b ? true : false;
    81         dr = ::dwarf_lineendsequence(line, &b, &de);
    82         libdwarf_error_check ("address::address", dr, de);
    83         end_sequence = b ? true : false;
     66      dwarf_error de;
     67      int         dr;
     68      dr = ::dwarf_lineaddr(line, &addr, &de);
     69      libdwarf_error_check ("address::address", dr, de);
     70      dr = ::dwarf_line_srcfileno(line, &source_index, &de);
     71      libdwarf_error_check ("address::address", dr, de);
     72      dwarf_unsigned src_line;
     73      dr = ::dwarf_lineno(line, &src_line, &de);
     74      libdwarf_error_check ("address::address", dr, de);
     75      source_line = src_line;
     76      dwarf_bool b;
     77      dr = ::dwarf_linebeginstatement(line, &b, &de);
     78      libdwarf_error_check ("address::address", dr, de);
     79      begin_statement = b ? true : false;
     80      dr = ::dwarf_lineblock(line, &b, &de);
     81      libdwarf_error_check ("address::address", dr, de);
     82      block = b ? true : false;
     83      dr = ::dwarf_lineendsequence(line, &b, &de);
     84      libdwarf_error_check ("address::address", dr, de);
     85      end_sequence = b ? true : false;
    8486    }
    8587
     
    109111    {
    110112      source = nullptr;
     113      source_line = -1;
    111114    }
    112115
     
    114117    address::valid () const
    115118    {
    116       return source_line > 0;
     119      return source != nullptr && source_line > 0;
    117120    }
    118121
     
    156159
    157160    address&
    158     address::operator = (address& rhs)
     161    address::operator = (const address& rhs)
    159162    {
    160163      if (this != &rhs)
     
    613616    {
    614617      if (addr_lines_.find (addr) == addr_lines_.end ())
    615         return false;
     618          return false;
    616619      addr_line = addr_lines_[addr];
    617620      return true;
  • rtemstoolkit/rld-dwarf.h

    r881824f r1c85380  
    8989       * Assigment operator.
    9090       */
    91       address& operator = (address& rhs);
     91      address& operator = (const address& rhs);
    9292
    9393    private:
     
    9696      sources const* source;
    9797      dwarf_unsigned source_index;
    98       dwarf_unsigned source_line;
     98      dwarf_signed  source_line;
    9999      bool           begin_statement;
    100100      bool           block;
Note: See TracChangeset for help on using the changeset viewer.