/* addr2line.c -- convert addresses to line number and function name
- Copyright 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
Contributed by Ulrich Lauther <Ulrich.Lauther@zfe.siemens.de>
This file is part of GNU Binutils.
PTR data;
{
bfd_vma vma;
+ bfd_size_type size;
if (found)
return;
if (pc < vma)
return;
+ size = bfd_get_section_size_before_reloc (section);
+ if (pc >= vma + size)
+ return;
+
found = bfd_find_nearest_line (abfd, section, syms, pc - vma,
&filename, &functionname, &line);
}
{
if (with_functions)
{
- if (*functionname == '\0')
+ if (functionname == NULL || *functionname == '\0')
printf ("??\n");
else if (! do_demangle)
printf ("%s\n", functionname);
}
}
- if (base_names)
+ if (base_names && filename != NULL)
{
char *h;
filename = h + 1;
}
- printf ("%s:%u\n", filename, line);
+ printf ("%s:%u\n", filename ? filename : "??", line);
}
/* fflush() is essential for using this command as a server
char *target;
int c;
+#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
+#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);