|
|
|
@ -314,7 +314,9 @@ parse_debug_info(u8 *file, struct mi_debuginfo *dest)
@@ -314,7 +314,9 @@ parse_debug_info(u8 *file, struct mi_debuginfo *dest)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
parse_debug_line(u8 *file, struct mi_sourcepoint *dest, char **dest_files, int *dest_size, int *dest_files_size) |
|
|
|
|
parse_debug_line(u8 *file, |
|
|
|
|
struct mi_sourcepoint *dest, struct mi_sourcefile *dest_files, char **dest_directories, |
|
|
|
|
int *dest_size, int *dest_files_size, int *dest_directories_size) |
|
|
|
|
{ |
|
|
|
|
u64 dl_offset = get_section_offset(file, ".debug_line"); |
|
|
|
|
|
|
|
|
@ -336,7 +338,12 @@ is followed by a single null byte." */
@@ -336,7 +338,12 @@ is followed by a single null byte." */
|
|
|
|
|
u8 *p = file + dl_offset; |
|
|
|
|
|
|
|
|
|
while (*p != 0) { |
|
|
|
|
if (dest_directories) { |
|
|
|
|
dest_directories[ndirs] = (char *) p; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
++ndirs; |
|
|
|
|
|
|
|
|
|
while (*p != 0) { |
|
|
|
|
++p; |
|
|
|
|
} |
|
|
|
@ -352,11 +359,9 @@ is followed by a single null byte." */
@@ -352,11 +359,9 @@ is followed by a single null byte." */
|
|
|
|
|
while (*p != 0) { |
|
|
|
|
/* null-terminated string */ |
|
|
|
|
if (dest_files) { |
|
|
|
|
dest_files[nfiles] = (char *) p; |
|
|
|
|
dest_files[nfiles].filename = (char *) p; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
++nfiles; |
|
|
|
|
|
|
|
|
|
while (*p != 0) { |
|
|
|
|
++p; |
|
|
|
|
} |
|
|
|
@ -364,12 +369,19 @@ is followed by a single null byte." */
@@ -364,12 +369,19 @@ is followed by a single null byte." */
|
|
|
|
|
++p; |
|
|
|
|
|
|
|
|
|
u64 offset = 0; |
|
|
|
|
u32 dir_index = 0; |
|
|
|
|
u32 dummy = 0; |
|
|
|
|
|
|
|
|
|
offset += decode_leb128(p, &dummy); |
|
|
|
|
offset += decode_leb128(p, &dir_index); |
|
|
|
|
offset += decode_leb128(p, &dummy); |
|
|
|
|
offset += decode_leb128(p, &dummy); |
|
|
|
|
|
|
|
|
|
if (dest_files) { |
|
|
|
|
dest_files[nfiles].dir = dest_directories[dir_index - 1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
++nfiles; |
|
|
|
|
|
|
|
|
|
p += offset; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -619,6 +631,10 @@ is followed by a single null byte." */
@@ -619,6 +631,10 @@ is followed by a single null byte." */
|
|
|
|
|
if (dest_size) { |
|
|
|
|
*dest_size = pc_count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (dest_directories_size) { |
|
|
|
|
*dest_directories_size = ndirs; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static u64 |
|
|
|
|