summaryrefslogtreecommitdiffstats
path: root/linkers
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-05-11 06:12:27 +1200
committerChris Johns <chrisj@rtems.org>2018-06-18 12:26:16 +1000
commitd8eef0a463d4998d221ff318dd952dab18e5dfbf (patch)
treebf30a7ecbdf998a24e9393c1c83b603b04a3f057 /linkers
parentlinkers: Add an address to line tool. (diff)
downloadrtems-tools-d8eef0a463d4998d221ff318dd952dab18e5dfbf.tar.bz2
rtemstoolkit: Add DWARF function support.
Load the functions in each CU.
Diffstat (limited to 'linkers')
-rw-r--r--linkers/rtems-addr2line.cpp20
-rw-r--r--linkers/rtems-exeinfo.cpp2
2 files changed, 20 insertions, 2 deletions
diff --git a/linkers/rtems-addr2line.cpp b/linkers/rtems-addr2line.cpp
index 2e79c62..8aab7de 100644
--- a/linkers/rtems-addr2line.cpp
+++ b/linkers/rtems-addr2line.cpp
@@ -54,6 +54,7 @@ static struct option rld_opts[] = {
{ "version", no_argument, NULL, 'V' },
{ "verbose", no_argument, NULL, 'v' },
{ "executable", required_argument, NULL, 'e' },
+ { "functions" , no_argument, NULL, 'f' },
{ "addresses", no_argument, NULL, 'a' },
{ "pretty-print", no_argument, NULL, 'p' },
{ "basenames", no_argument, NULL, 's' },
@@ -69,7 +70,8 @@ usage (int exit_code)
<< " -V : print version number and exit (also --version)" << std::endl
<< " -v : verbose (trace import parts), can supply multiple times" << std::endl
<< " to increase verbosity (also --verbose)" << std::endl
- << " -e : executable (also --executablewarn)" << std::endl
+ << " -e : executable (also --executable)" << std::endl
+ << " -f : show function names (also --functions)" << std::endl
<< " -a : show addresses (also --addresses)" << std::endl
<< " -p : human readable format (also --pretty-print)" << std::endl
<< " -s : Strip directory paths (also --basenames)" << std::endl;
@@ -127,6 +129,7 @@ main (int argc, char* argv[])
try
{
std::string exe_name = "a.out";
+ bool show_functions = false;
bool show_addresses = false;
bool pretty_print = false;
bool show_basenames = false;
@@ -135,7 +138,7 @@ main (int argc, char* argv[])
while (true)
{
- int opt = ::getopt_long (argc, argv, "hvVe:aps", rld_opts, NULL);
+ int opt = ::getopt_long (argc, argv, "hvVe:faps", rld_opts, NULL);
if (opt < 0)
break;
@@ -156,6 +159,10 @@ main (int argc, char* argv[])
exe_name = optarg;
break;
+ case 'f':
+ show_functions = true;
+ break;
+
case 'a':
show_addresses = true;
break;
@@ -213,6 +220,8 @@ main (int argc, char* argv[])
exe.begin ();
debug.begin (exe.elf ());
debug.load_debug ();
+ debug.load_types ();
+ debug.load_functions ();
for (int arg = 0; arg < argc; ++arg)
{
@@ -244,6 +253,13 @@ main (int argc, char* argv[])
std::cout << std::endl;
}
+ if (show_functions)
+ {
+ std::string function;
+ debug.get_function (location, function);
+ std::cout << function << " at ";
+ }
+
if (show_basenames)
std::cout << rld::path::basename (path);
else
diff --git a/linkers/rtems-exeinfo.cpp b/linkers/rtems-exeinfo.cpp
index ef1b653..4fc5f00 100644
--- a/linkers/rtems-exeinfo.cpp
+++ b/linkers/rtems-exeinfo.cpp
@@ -293,6 +293,7 @@ namespace rld
*/
exe.load_symbols (symbols, true);
debug.load_debug ();
+ debug.load_types ();
symbols.globals (addresses);
symbols.weaks (addresses);
symbols.locals (addresses);
@@ -321,6 +322,7 @@ namespace rld
"-fno-stack-protector",
"-fbuilding-libgcc",
"-fno-implicit-templates",
+ "-fimplicit-templates",
"-ffunction-sections",
"-fdata-sections",
"-frandom-seed=",