+2009-04-93 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * spu-linux-nat.c (spu_bfd_open): Set filename of in-memory
+ BFD to contents of SPU name note.
+ (spu_symbol_file_add_from_memory): Call symbol_file_add_from_bfd
+ with "from_tty" argument 1 instead of 0.
+
2009-04-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c
spu_bfd_open (ULONGEST addr)
{
struct bfd *nbfd;
+ asection *spu_name;
ULONGEST *open_closure = xmalloc (sizeof (ULONGEST));
*open_closure = addr;
return NULL;
}
+ /* Retrieve SPU name note and update BFD name. */
+ spu_name = bfd_get_section_by_name (nbfd, ".note.spu_name");
+ if (spu_name)
+ {
+ int sect_size = bfd_section_size (nbfd, spu_name);
+ if (sect_size > 20)
+ {
+ char *buf = alloca (sect_size - 20 + 1);
+ bfd_get_section_contents (nbfd, spu_name, buf, 20, sect_size - 20);
+ buf[sect_size - 20] = '\0';
+
+ xfree ((char *)nbfd->filename);
+ nbfd->filename = xstrdup (buf);
+ }
+ }
+
return nbfd;
}
/* Open BFD representing SPE executable and read its symbols. */
nbfd = spu_bfd_open (addr);
if (nbfd)
- symbol_file_add_from_bfd (nbfd, 0, NULL, 1, 0);
+ symbol_file_add_from_bfd (nbfd, 1, NULL, 1, 0);
}