Changeset f199d42 in rtems-tools for linkers/rtems-exeinfo.cpp


Ignore:
Timestamp:
05/18/22 08:13:30 (3 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
43843b8
Parents:
ff68bcc
git-author:
Chris Johns <chrisj@…> (05/18/22 08:13:30)
git-committer:
Chris Johns <chrisj@…> (05/18/22 08:17:33)
Message:

linkers: Speed up reading large executables for all cases except inlining

  • Only load the function DWARF data if checking inlines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • linkers/rtems-exeinfo.cpp

    rff68bcc rf199d42  
    145145       * Load the executable file.
    146146       */
    147       image (const std::string exe_name);
     147      image (const std::string exe_name, bool load_functions);
    148148
    149149      /**
     
    284284    }
    285285
    286     image::image (const std::string exe_name)
     286    image::image (const std::string exe_name, bool load_functions)
    287287      : exe (exe_name),
    288288        init (0),
     
    322322      debug.load_types ();
    323323      debug.load_variables ();
    324       debug.load_functions ();
     324      if (load_functions)
     325      {
     326        std::cout << "May take a while ..." << std::endl;
     327        debug.load_functions ();
     328      }
    325329      symbols.globals (addresses);
    326330      symbols.weaks (addresses);
     
    611615          symbols::symbol* sym;
    612616          sec.data >> address;
    613           sym = addresses[address];
    614           std::cout << "  "
    615                     << std::hex << std::setfill ('0')
    616                     << "0x" << std::setw (8) << address
    617                     << std::dec << std::setfill ('0');
    618           if (sym)
     617          if (address != 0)
    619618          {
    620             std::string label = sym->name ();
    621             if (rld::symbols::is_cplusplus (label))
    622               rld::symbols::demangle_name (label, label);
    623             std::cout << " " << label;
     619            sym = addresses[address];
     620            std::cout << "  "
     621                      << std::hex << std::setfill ('0')
     622                      << "0x" << std::setw (8) << address
     623                      << std::dec << std::setfill ('0');
     624            if (sym)
     625            {
     626              std::string label = sym->name ();
     627              if (rld::symbols::is_cplusplus (label))
     628                rld::symbols::demangle_name (label, label);
     629              std::cout << " " << label;
     630            }
     631            else
     632            {
     633              std::cout << " no symbol (maybe static to a module)";
     634            }
     635            std::cout << std::endl;
    624636          }
    625           else
    626           {
    627             std::cout << " no symbol";
    628           }
    629           std::cout << std::endl;
    630637        }
    631638      }
     
    11151122     * Open the executable and read the symbols.
    11161123     */
    1117     rld::exeinfo::image exe (exe_name);
     1124    rld::exeinfo::image exe (exe_name, inlined | dwarf_data);
    11181125
    11191126    std::cout << "exe: " << exe.exe.name ().full () << std::endl
Note: See TracChangeset for help on using the changeset viewer.