/* rddbg.c -- Read debugging information into a generic form.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
if (! found)
{
- fprintf (stderr, "%s: no recognized debugging information\n",
+ fprintf (stderr, _("%s: no recognized debugging information\n"),
bfd_get_filename (abfd));
return NULL;
}
while (s[strlen (s) - 1] == '\\'
&& stab + 12 < stabs + stabsize)
{
+ char *p;
+
stab += 12;
- s[strlen (s) - 1] = '\0';
+ p = s + strlen (s) - 1;
+ *p = '\0';
s = concat (s,
((char *) strings
+ stroff
+ bfd_get_32 (abfd, stab)),
(const char *) NULL);
+
+ /* We have to restore the backslash, because, if
+ the linker is hashing stabs strings, we may
+ see the same string more than once. */
+ *p = '\\';
+
if (f != NULL)
free (f);
f = s;
*pfound = true;
s = i.name;
+ f = NULL;
while (s[strlen (s) - 1] == '\\'
&& ps + 1 < symend)
{
return false;
}
- free_saved_stabs ();
-
/* Don't free f, since I think the stabs code expects
strings to hang around. This should be straightened out.
FIXME. */
}
}
+ free_saved_stabs ();
+
if (shandle != NULL)
{
if (! finish_stab (dhandle, shandle))
{
int i;
- fprintf (stderr, "Last stabs entries before error:\n");
+ fprintf (stderr, _("Last stabs entries before error:\n"));
fprintf (stderr, "n_type n_desc n_value string\n");
i = saved_stabs_index;
int i;
for (i = 0; i < SAVE_STABS_COUNT; i++)
- if (saved_stabs[i].string != NULL)
- free (saved_stabs[i].string);
+ {
+ if (saved_stabs[i].string != NULL)
+ {
+ free (saved_stabs[i].string);
+ saved_stabs[i].string = NULL;
+ }
+ }
+
saved_stabs_index = 0;
}