summaryrefslogtreecommitdiffstats
path: root/linkers/rtems-exeinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linkers/rtems-exeinfo.cpp')
-rw-r--r--linkers/rtems-exeinfo.cpp48
1 files changed, 27 insertions, 21 deletions
diff --git a/linkers/rtems-exeinfo.cpp b/linkers/rtems-exeinfo.cpp
index e54f9b2..0b43403 100644
--- a/linkers/rtems-exeinfo.cpp
+++ b/linkers/rtems-exeinfo.cpp
@@ -144,7 +144,7 @@ namespace rld
/**
* Load the executable file.
*/
- image (const std::string exe_name);
+ image (const std::string exe_name, bool load_functions);
/**
* Clean up.
@@ -223,8 +223,7 @@ namespace rld
* Helper for for_each to filter and load the sections we wish to
* dump.
*/
- class section_loader:
- public std::unary_function < const files::section, void >
+ class section_loader
{
public:
@@ -283,7 +282,7 @@ namespace rld
}
}
- image::image (const std::string exe_name)
+ image::image (const std::string exe_name, bool load_functions)
: exe (exe_name),
init (0),
fini (0)
@@ -321,7 +320,11 @@ namespace rld
debug.load_debug ();
debug.load_types ();
debug.load_variables ();
- debug.load_functions ();
+ if (load_functions)
+ {
+ std::cout << "May take a while ..." << std::endl;
+ debug.load_functions ();
+ }
symbols.globals (addresses);
symbols.weaks (addresses);
symbols.locals (addresses);
@@ -610,23 +613,26 @@ namespace rld
uint32_t address;
symbols::symbol* sym;
sec.data >> address;
- sym = addresses[address];
- std::cout << " "
- << std::hex << std::setfill ('0')
- << "0x" << std::setw (8) << address
- << std::dec << std::setfill ('0');
- if (sym)
- {
- std::string label = sym->name ();
- if (rld::symbols::is_cplusplus (label))
- rld::symbols::demangle_name (label, label);
- std::cout << " " << label;
- }
- else
+ if (address != 0)
{
- std::cout << " no symbol";
+ sym = addresses[address];
+ std::cout << " "
+ << std::hex << std::setfill ('0')
+ << "0x" << std::setw (8) << address
+ << std::dec << std::setfill ('0');
+ if (sym)
+ {
+ std::string label = sym->name ();
+ if (rld::symbols::is_cplusplus (label))
+ rld::symbols::demangle_name (label, label);
+ std::cout << " " << label;
+ }
+ else
+ {
+ std::cout << " no symbol (maybe static to a module)";
+ }
+ std::cout << std::endl;
}
- std::cout << std::endl;
}
}
@@ -1114,7 +1120,7 @@ main (int argc, char* argv[])
/*
* Open the executable and read the symbols.
*/
- rld::exeinfo::image exe (exe_name);
+ rld::exeinfo::image exe (exe_name, inlined | dwarf_data);
std::cout << "exe: " << exe.exe.name ().full () << std::endl
<< std::endl;