#include "budemang.h"
static bfd_boolean unwind_inlines; /* -i, unwind inlined functions. */
+static bfd_boolean with_addresses; /* -a, show addresses. */
static bfd_boolean with_functions; /* -f, show function names. */
static bfd_boolean do_demangle; /* -C, demangle names. */
static bfd_boolean base_names; /* -s, strip directory names. */
static struct option long_options[] =
{
+ {"addresses", no_argument, NULL, 'a'},
{"basenames", no_argument, NULL, 's'},
{"demangle", optional_argument, NULL, 'C'},
{"exe", required_argument, NULL, 'e'},
fprintf (stream, _(" If no addresses are specified on the command line, they will be read from stdin\n"));
fprintf (stream, _(" The options are:\n\
@<file> Read options from <file>\n\
+ -a --addresses Show addresses\n\
-b --target=<bfdname> Set the binary file format\n\
-e --exe=<executable> Set the input file name (default is a.out)\n\
-i --inlines Unwind inlined functions\n\
pc = bfd_scan_vma (*addr++, NULL, 16);
}
+ if (with_addresses)
+ {
+ printf ("0x");
+ bfd_printf_vma (abfd, pc);
+ printf ("\n");
+ }
+
found = FALSE;
if (section)
find_offset_in_section (abfd, section);
file_name = NULL;
section_name = NULL;
target = NULL;
- while ((c = getopt_long (argc, argv, "b:Ce:sfHhij:Vv", long_options, (int *) 0))
+ while ((c = getopt_long (argc, argv, "ab:Ce:sfHhij:Vv", long_options, (int *) 0))
!= EOF)
{
switch (c)
{
case 0:
break; /* We've been given a long option. */
+ case 'a':
+ with_addresses = TRUE;
+ break;
case 'b':
target = optarg;
break;
@smallexample
@c man begin SYNOPSIS addr2line
-addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}]
+addr2line [@option{-a}|@option{--addresses}]
+ [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}]
[@option{-C}|@option{--demangle}[=@var{style}]]
[@option{-e} @var{filename}|@option{--exe=}@var{filename}]
[@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}]
equivalent.
@table @env
+@item -a
+@itemx --addresses
+Display the address before the function name, file and line number information.
+The address is printed with a @samp{0x} prefix to easily identify it.
+
@item -b @var{bfdname}
@itemx --target=@var{bfdname}
@cindex object code format