Allow Java's ELF symtab reader to use separate debuginfo files
Andrew Haley
aph at redhat.com
Wed Dec 16 09:47:23 PST 2009
Testing revealed a couple of failures with separate debuginfo.
I made a silly off-by-one error and I missed a null pointer check.
Fixed, pushed.
Andrew.
2009-12-16 Andrew Haley <aph at redhat.com>
* openjdk/hotspot/agent/src/os/linux/symtab.c (open_file_from_debug_link):
Check for NULL.
Fix off by one error in aligning the CRC: the offset is 4 bytes,
not 3.
--- openjdk/hotspot/agent/src/os/linux/symtab.c~ 2009-12-11 16:33:49.926655750 +0000
+++ openjdk/hotspot/agent/src/os/linux/symtab.c 2009-12-16 16:08:22.525718029 +0000
@@ -198,11 +198,13 @@
ELF_SHDR *shbuf,
struct elf_section *scn_cache)
{
+ int debug_fd;
struct elf_section *debug_link = find_section_by_name(".gnu_debuglink", fd, ehdr,
shbuf, scn_cache);
- int debug_fd;
+ if (debug_link == NULL)
+ return -1;
char *debug_filename = debug_link->c_data;
- int offset = strlen(debug_filename) + 3 >> 2;
+ int offset = (strlen(debug_filename) + 4) >> 2;
static unsigned int crc;
crc = ((unsigned int*)debug_link->c_data)[offset];
char *debug_pathname = malloc(strlen(debug_filename)
More information about the distro-pkg-dev
mailing list