Changeset View
Changeset View
Standalone View
Standalone View
lib/libproc/proc_sym.c
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | open_object(struct map_info *mapping) | ||||
} | } | ||||
/* | /* | ||||
* The data contains a null-terminated file name followed by a 4-byte | * The data contains a null-terminated file name followed by a 4-byte | ||||
* CRC. | * CRC. | ||||
*/ | */ | ||||
if (data->d_size < sizeof(crc) + 1) { | if (data->d_size < sizeof(crc) + 1) { | ||||
DPRINTFX("ERROR: debuglink section is too small (%zd bytes)", | DPRINTFX("ERROR: debuglink section is too small (%zd bytes)", | ||||
data->d_size); | (ssize_t)data->d_size); | ||||
goto internal; | goto internal; | ||||
} | } | ||||
if (strnlen(data->d_buf, data->d_size) >= data->d_size - sizeof(crc)) { | if (strnlen(data->d_buf, data->d_size) >= data->d_size - sizeof(crc)) { | ||||
DPRINTFX("ERROR: no null-terminator in gnu_debuglink section"); | DPRINTFX("ERROR: no null-terminator in gnu_debuglink section"); | ||||
goto internal; | goto internal; | ||||
} | } | ||||
debugfile = data->d_buf; | debugfile = data->d_buf; | ||||
▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct file_info *file; | struct file_info *file; | ||||
struct map_info *mapping; | struct map_info *mapping; | ||||
const char *s; | const char *s; | ||||
uintptr_t off; | uintptr_t off; | ||||
int error; | int error; | ||||
if ((mapping = _proc_addr2map(p, addr)) == NULL) { | if ((mapping = _proc_addr2map(p, addr)) == NULL) { | ||||
DPRINTFX("ERROR: proc_addr2map failed to resolve 0x%jx", addr); | DPRINTFX("ERROR: proc_addr2map failed to resolve 0x%jx", (uintmax_t)addr); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
if (open_object(mapping) != 0) { | if (open_object(mapping) != 0) { | ||||
DPRINTFX("ERROR: failed to open object %s", | DPRINTFX("ERROR: failed to open object %s", | ||||
mapping->map.pr_mapname); | mapping->map.pr_mapname); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines |