mirror of
https://github.com/rizinorg/rizin.git
synced 2026-10-12 02:21:57 +00:00
Load split DWARF (#3833)
- Add `read_debuglink` and `read_build_id` - Fix `*.dwo` loading - Try process DW_UT_skeleton - Fix dwo_id - Check buffer size - Add `bin.dbginfo.debug_file_directory` - Add test "Debugging Information in Separate Files"
This commit is contained in:
@@ -174,9 +174,10 @@ RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_new(RZ_OWN RZ_NONNULL RzBinE
|
||||
* \param bf Binfile to parse
|
||||
* \return RzBinDwarfAbbrevs object
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_abbrev");
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_abbrev", is_dwo);
|
||||
RET_NULL_IF_FAIL(r);
|
||||
return rz_bin_dwarf_abbrev_new(r);
|
||||
}
|
||||
@@ -201,6 +202,9 @@ RZ_API size_t rz_bin_dwarf_abbrev_count(RZ_BORROW RZ_NONNULL const RzBinDwarfAbb
|
||||
*/
|
||||
RZ_API RZ_BORROW RzBinDwarfAbbrevDecl *rz_bin_dwarf_abbrev_get(RZ_BORROW RZ_NONNULL const RzBinDwarfAbbrevTable *tbl, size_t idx) {
|
||||
rz_return_val_if_fail(tbl, NULL);
|
||||
if (idx > rz_vector_len(&tbl->abbrevs)) {
|
||||
return NULL;
|
||||
}
|
||||
return rz_vector_index_ptr(&tbl->abbrevs, idx - 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ RZ_IPI RzBinDwarfAddr *DebugAddr_new(RzBinEndianReader *reader) {
|
||||
|
||||
RZ_IPI RzBinDwarfAddr *DebugAddr_from_file(RzBinFile *bf) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_addr");
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_addr", false);
|
||||
RET_NULL_IF_FAIL(r);
|
||||
return DebugAddr_new(r);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ err:
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfARanges *rz_bin_dwarf_aranges_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(bf, ".debug_aranges");
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(bf, ".debug_aranges", false);
|
||||
RET_NULL_IF_FAIL(reader);
|
||||
return rz_bin_dwarf_aranges_new(reader);
|
||||
}
|
||||
|
||||
+197
-12
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <rz_bin_dwarf.h>
|
||||
#include "dwarf_private.h"
|
||||
#include "../format/elf/elf.h"
|
||||
|
||||
RZ_IPI bool RzBinDwarfEncoding_from_file(RzBinDwarfEncoding *encoding, RzBinFile *bf) {
|
||||
if (!(encoding && bf)) {
|
||||
@@ -15,39 +16,223 @@ RZ_IPI bool RzBinDwarfEncoding_from_file(RzBinDwarfEncoding *encoding, RzBinFile
|
||||
return true;
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
static inline RZ_OWN RzBinDWARF *dwarf_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinDWARF *dw = RZ_NEW0(RzBinDWARF);
|
||||
RET_NULL_IF_FAIL(dw);
|
||||
|
||||
dw->addr = DebugAddr_from_file(bf);
|
||||
dw->str = RzBinDwarfStr_from_file(bf);
|
||||
dw->str_offsets = RzBinDwarfStrOffsets_from_file(bf);
|
||||
dw->line_str = rz_bin_dwarf_line_str_from_file(bf);
|
||||
dw->abbrev = rz_bin_dwarf_abbrev_from_file(bf);
|
||||
dw->aranges = rz_bin_dwarf_aranges_from_file(bf);
|
||||
|
||||
dw->str = rz_bin_dwarf_str_from_file(bf, is_dwo);
|
||||
dw->str_offsets = rz_bin_dwarf_str_offsets_from_file(bf, is_dwo);
|
||||
dw->loclists = rz_bin_dwarf_loclists_new_from_file(bf, is_dwo);
|
||||
dw->rnglists = rz_bin_dwarf_rnglists_new_from_file(bf, is_dwo);
|
||||
dw->abbrev = rz_bin_dwarf_abbrev_from_file(bf, is_dwo);
|
||||
|
||||
if (dw->abbrev) {
|
||||
dw->info = rz_bin_dwarf_info_from_file(bf, dw);
|
||||
dw->info = rz_bin_dwarf_info_from_file(bf, dw, is_dwo);
|
||||
}
|
||||
dw->loclists = rz_bin_dwarf_loclists_new_from_file(bf);
|
||||
dw->rnglists = rz_bin_dwarf_rnglists_new_from_file(bf);
|
||||
if (dw->info) {
|
||||
dw->line = rz_bin_dwarf_line_from_file(bf, dw);
|
||||
dw->line = rz_bin_dwarf_line_from_file(bf, dw, is_dwo);
|
||||
}
|
||||
return dw;
|
||||
}
|
||||
|
||||
static inline char *read_debuglink(RzBinFile *binfile) {
|
||||
RzBinSection *sect = rz_bin_dwarf_section_by_name(binfile, ".gnu_debuglink", false);
|
||||
RET_NULL_IF_FAIL(sect);
|
||||
RzBuffer *buffer = rz_bin_dwarf_section_buf(binfile, sect);
|
||||
RET_NULL_IF_FAIL(buffer);
|
||||
char *name = rz_buf_get_string(buffer, 0);
|
||||
// TODO: Verification the CRC
|
||||
rz_buf_free(buffer);
|
||||
return name;
|
||||
}
|
||||
|
||||
static inline char *read_build_id(RzBinFile *binfile) {
|
||||
RzBinSection *sect = rz_bin_dwarf_section_by_name(binfile, ".note.gnu.build-id", false);
|
||||
RET_NULL_IF_FAIL(sect);
|
||||
RzBuffer *buffer = rz_bin_dwarf_section_buf(binfile, sect);
|
||||
RET_NULL_IF_FAIL(buffer);
|
||||
|
||||
char *build_id = NULL;
|
||||
/**
|
||||
* struct build_id_note {
|
||||
* Elf_Nhdr nhdr;
|
||||
* char name[4];
|
||||
* uint8_t buf[0];
|
||||
* };
|
||||
*/
|
||||
size_t nhdr_sz = binfile->o->info->bits == 64 ? sizeof(Elf64_Nhdr) : sizeof(Elf32_Nhdr);
|
||||
size_t begin = nhdr_sz + 4;
|
||||
size_t sz = rz_buf_size(buffer) - begin;
|
||||
ut8 *buf = RZ_NEWS0(ut8, sz);
|
||||
if (!buf) {
|
||||
goto beach;
|
||||
}
|
||||
if (rz_buf_read_at(buffer, begin, buf, sz) != sz) {
|
||||
goto beach;
|
||||
}
|
||||
build_id = rz_hex_bin2strdup(buf, (int)sz);
|
||||
|
||||
beach:
|
||||
rz_buf_free(buffer);
|
||||
free(buf);
|
||||
return build_id;
|
||||
}
|
||||
|
||||
static inline RzBinDWARF *dwarf_from_debuglink(
|
||||
const char *file_directory,
|
||||
RzList /*<const char *>*/ *debug_file_directorys,
|
||||
const char *debuglink_path) {
|
||||
RzBinDWARF *dw = NULL;
|
||||
char *dir = NULL;
|
||||
char *path = NULL;
|
||||
char *file_dir = NULL;
|
||||
|
||||
path = rz_file_path_join(file_directory, debuglink_path);
|
||||
if (rz_file_exists(path)) {
|
||||
goto ok;
|
||||
}
|
||||
free(path);
|
||||
|
||||
dir = rz_file_path_join(file_directory, ".debug");
|
||||
path = rz_file_path_join(dir, debuglink_path);
|
||||
if (rz_file_exists(path)) {
|
||||
goto ok;
|
||||
}
|
||||
free(dir);
|
||||
free(path);
|
||||
|
||||
if (RZ_STR_ISNOTEMPTY(file_directory) && strlen(file_directory) >= 2 && file_directory[1] == ':') {
|
||||
file_dir = rz_str_newf("/%c%s", file_directory[0], file_directory + 2);
|
||||
} else {
|
||||
file_dir = rz_str_new(file_directory);
|
||||
}
|
||||
RzListIter *it = NULL;
|
||||
const char *debug_file_directory = NULL;
|
||||
rz_list_foreach (debug_file_directorys, it, debug_file_directory) {
|
||||
dir = rz_file_path_join(debug_file_directory, file_dir);
|
||||
path = rz_file_path_join(dir, debuglink_path);
|
||||
if (rz_file_exists(path)) {
|
||||
goto ok;
|
||||
}
|
||||
free(dir);
|
||||
free(path);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
ok:
|
||||
dw = rz_bin_dwarf_from_path(path, false);
|
||||
free(dir);
|
||||
free(path);
|
||||
free(file_dir);
|
||||
return dw;
|
||||
}
|
||||
|
||||
static inline RzBinDWARF *dwarf_from_build_id(
|
||||
RzList /*<const char *>*/ *debug_file_directorys,
|
||||
const char *build_id_path) {
|
||||
RzListIter *it = NULL;
|
||||
const char *debug_file_directory = NULL;
|
||||
rz_list_foreach (debug_file_directorys, it, debug_file_directory) {
|
||||
char *dir = rz_file_path_join(debug_file_directory, ".build-id");
|
||||
char *path = rz_file_path_join(dir, build_id_path);
|
||||
if (rz_file_exists(path)) {
|
||||
RzBinDWARF *dw = rz_bin_dwarf_from_path(path, false);
|
||||
free(dir);
|
||||
free(path);
|
||||
return dw;
|
||||
}
|
||||
free(dir);
|
||||
free(path);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_search_debug_file_directory(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NONNULL RzList /*<const char *>*/ *debug_file_directorys) {
|
||||
rz_return_val_if_fail(bf && debug_file_directorys, NULL);
|
||||
|
||||
RzBinDWARF *dw = NULL;
|
||||
char *build_id = read_build_id(bf);
|
||||
if (build_id) {
|
||||
char *build_id_path = rz_str_newf("%c%c/%s", build_id[0], build_id[1], build_id + 2);
|
||||
dw = dwarf_from_build_id(debug_file_directorys, build_id_path);
|
||||
free(build_id);
|
||||
free(build_id_path);
|
||||
if (dw) {
|
||||
return dw;
|
||||
}
|
||||
}
|
||||
char *debuglink = read_debuglink(bf);
|
||||
if (debuglink) {
|
||||
char *file_abspath = rz_file_abspath(bf->file);
|
||||
char *file_dir = file_abspath ? rz_file_dirname(file_abspath) : NULL;
|
||||
if (file_dir) {
|
||||
dw = dwarf_from_debuglink(file_dir, debug_file_directorys, debuglink);
|
||||
}
|
||||
free(debuglink);
|
||||
free(file_dir);
|
||||
if (dw) {
|
||||
return dw;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Load DWARF from split DWARF file
|
||||
* \param filepath The file path
|
||||
* \return RzBinDWARF pointer or NULL if failed
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_from_path(
|
||||
RZ_BORROW RZ_NONNULL const char *filepath, bool is_dwo) {
|
||||
rz_return_val_if_fail(filepath, NULL);
|
||||
|
||||
RzBinDWARF *dwo = NULL;
|
||||
RzIO *io_tmp = rz_io_new();
|
||||
RzBin *bin_tmp = rz_bin_new();
|
||||
rz_io_bind(io_tmp, &bin_tmp->iob);
|
||||
|
||||
RzBinOptions bopt = { 0 };
|
||||
rz_bin_options_init(&bopt, 0, 0, 0, false);
|
||||
RzBinFile *bf = rz_bin_open(bin_tmp, filepath, &bopt);
|
||||
if (!bf) {
|
||||
goto beach;
|
||||
}
|
||||
dwo = dwarf_from_file(bf, is_dwo);
|
||||
|
||||
beach:
|
||||
rz_bin_free(bin_tmp);
|
||||
rz_io_free(io_tmp);
|
||||
return dwo;
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
return dwarf_from_file(bf, false);
|
||||
}
|
||||
|
||||
RZ_API void rz_bin_dwarf_free(RZ_OWN RZ_NULLABLE RzBinDWARF *dw) {
|
||||
if (!dw) {
|
||||
return;
|
||||
}
|
||||
rz_bin_dwarf_free(dw->parent);
|
||||
|
||||
DebugRngLists_free(dw->rnglists);
|
||||
DebugAddr_free(dw->addr);
|
||||
rz_bin_dwarf_str_free(dw->str);
|
||||
rz_bin_dwarf_str_offsets_free(dw->str_offsets);
|
||||
|
||||
rz_bin_dwarf_abbrev_free(dw->abbrev);
|
||||
rz_bin_dwarf_info_free(dw->info);
|
||||
rz_bin_dwarf_line_free(dw->line);
|
||||
rz_bin_dwarf_loclists_free(dw->loclists);
|
||||
DebugRngLists_free(dw->rnglists);
|
||||
rz_bin_dwarf_aranges_free(dw->aranges);
|
||||
DebugAddr_free(dw->addr);
|
||||
RzBinDwarfStr_free(dw->str);
|
||||
free(dw);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ RZ_IPI RzBinEndianReader *RzBinDwarfBlock_as_reader(const RzBinDwarfBlock *self)
|
||||
RZ_IPI void RzBinDwarfBlock_fini(RzBinDwarfBlock *self);
|
||||
RZ_IPI void RzBinDwarfBlock_free(RzBinDwarfBlock *self);
|
||||
|
||||
RZ_IPI RzBinSection *rz_bin_dwarf_section_by_name(RzBinFile *binfile, const char *sn, bool is_dwo);
|
||||
RZ_IPI RzBuffer *rz_bin_dwarf_section_buf(RzBinFile *binfile, RzBinSection *section);
|
||||
|
||||
RZ_IPI bool read_initial_length(RzBinEndianReader *reader, RZ_OUT bool *is_64bit, ut64 *out);
|
||||
RZ_IPI bool read_offset(RzBinEndianReader *reader, ut64 *out, bool is_64bit);
|
||||
RZ_IPI bool read_address(RzBinEndianReader *reader, ut64 *out, ut8 address_size);
|
||||
@@ -40,9 +43,9 @@ RZ_IPI RzBinEndianReader *RzBinEndianReader_clone(RzBinEndianReader *x);
|
||||
|
||||
RZ_IPI bool RzBinDwarfAttr_parse(RzBinEndianReader *reader, RzBinDwarfAttr *attr, AttrOption *opt);
|
||||
RZ_IPI void RzBinDwarfAttr_fini(RzBinDwarfAttr *attr);
|
||||
RZ_IPI char *RzBinDwarfAttr_to_string(RzBinDwarfAttr *attr);
|
||||
|
||||
RZ_IPI RzBinEndianReader *RzBinEndianReader_from_file(RzBinFile *binfile, const char *sect_name);
|
||||
RZ_IPI RzBinEndianReader *RzBinEndianReader_from_file(
|
||||
RzBinFile *binfile, const char *sect_name, bool is_dwo);
|
||||
|
||||
static inline bool bf_bigendian(RzBinFile *bf) {
|
||||
return bf->o && bf->o->info && bf->o->info->big_endian;
|
||||
@@ -124,19 +127,4 @@ RZ_IPI void Value_dump(
|
||||
|
||||
#include "op.h"
|
||||
|
||||
///
|
||||
|
||||
/// debug_str
|
||||
RZ_IPI void RzBinDwarfStr_free(RzBinDwarfStr *str);
|
||||
RZ_IPI char *RzBinDwarfStr_get(RzBinDwarfStr *str, ut64 offset);
|
||||
RZ_IPI void RzBinDwarfStr_read_all(RzBinDwarfStr *str);
|
||||
RZ_IPI RzBinDwarfStr *RzBinDwarfStr_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader);
|
||||
RZ_IPI RzBinDwarfStr *RzBinDwarfStr_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf);
|
||||
|
||||
/// debug_str_offsets
|
||||
RZ_IPI void RzBinDwarfStrOffsets_free(RzBinDwarfStrOffsets *str_offsets);
|
||||
RZ_IPI char *RzBinDwarfStrOffsets_get(RzBinDwarfStr *str, RzBinDwarfStrOffsets *str_offsets, ut64 base, ut64 index);
|
||||
RZ_IPI RzBinDwarfStrOffsets *RzBinDwarfStrOffsets_new(RzBinEndianReader *reader);
|
||||
RZ_IPI RzBinDwarfStrOffsets *RzBinDwarfStrOffsets_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,29 +1,36 @@
|
||||
// SPDX-FileCopyrightText: 2023 billow <[email protected]>
|
||||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
#include <zstd.h>
|
||||
#include <rz_bin_dwarf.h>
|
||||
#include "dwarf_private.h"
|
||||
#include <zstd.h>
|
||||
#include "../format/elf/elf.h"
|
||||
|
||||
RZ_IPI RzBinSection *get_section(RzBinFile *binfile, const char *sn) {
|
||||
RZ_IPI RzBinSection *rz_bin_dwarf_section_by_name(RzBinFile *binfile, const char *sn, bool is_dwo) {
|
||||
rz_return_val_if_fail(binfile && sn, NULL);
|
||||
RzListIter *iter;
|
||||
RzListIter *iter = NULL;
|
||||
RzBinSection *section = NULL;
|
||||
RzBinSection *result_section = NULL;
|
||||
RzBinObject *o = binfile->o;
|
||||
if (!o || !o->sections || RZ_STR_ISEMPTY(sn)) {
|
||||
return NULL;
|
||||
}
|
||||
char *name = is_dwo ? rz_str_newf("%s.dwo", sn) : rz_str_new(sn);
|
||||
if (!name) {
|
||||
return NULL;
|
||||
}
|
||||
rz_list_foreach (o->sections, iter, section) {
|
||||
if (!section->name) {
|
||||
continue;
|
||||
}
|
||||
if (RZ_STR_EQ(section->name, sn) ||
|
||||
rz_str_endswith(section->name, sn + 1)) {
|
||||
return section;
|
||||
if (RZ_STR_EQ(section->name, name) ||
|
||||
rz_str_endswith(section->name, name + 1)) {
|
||||
result_section = section;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
free(name);
|
||||
return result_section;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -31,7 +38,7 @@ typedef struct {
|
||||
ut8 gch_size[8]; /* unaligned 64-bit ELFDATAMSB integer */
|
||||
} Chdr_GNU;
|
||||
|
||||
RZ_IPI RzBuffer *get_section_buf(RzBinFile *binfile, RzBinSection *section) {
|
||||
RZ_IPI RzBuffer *rz_bin_dwarf_section_buf(RzBinFile *binfile, RzBinSection *section) {
|
||||
rz_return_val_if_fail(binfile && section, NULL);
|
||||
if (section->paddr >= binfile->size) {
|
||||
return NULL;
|
||||
@@ -106,7 +113,7 @@ err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void add_relocations(
|
||||
static inline void add_relocations(
|
||||
RzBinFile *bf,
|
||||
HtUP *relocations,
|
||||
RzBinSection *section) {
|
||||
@@ -121,11 +128,11 @@ void add_relocations(
|
||||
}
|
||||
}
|
||||
|
||||
RZ_IPI RzBinEndianReader *RzBinEndianReader_from_file(RzBinFile *binfile, const char *sect_name) {
|
||||
RZ_IPI RzBinEndianReader *RzBinEndianReader_from_file(RzBinFile *binfile, const char *sect_name, bool is_dwo) {
|
||||
rz_return_val_if_fail(binfile && sect_name, NULL);
|
||||
RzBinSection *section = get_section(binfile, sect_name);
|
||||
RzBinSection *section = rz_bin_dwarf_section_by_name(binfile, sect_name, is_dwo);
|
||||
OK_OR(section, return NULL);
|
||||
RzBuffer *buf = get_section_buf(binfile, section);
|
||||
RzBuffer *buf = rz_bin_dwarf_section_buf(binfile, section);
|
||||
OK_OR(buf, return NULL);
|
||||
|
||||
HtUP *relocations = ht_up_new0();
|
||||
@@ -137,7 +144,7 @@ RZ_IPI RzBinEndianReader *RzBinEndianReader_from_file(RzBinFile *binfile, const
|
||||
|
||||
reader->buffer = buf;
|
||||
reader->big_endian = bf_bigendian(binfile);
|
||||
reader->section = section;
|
||||
reader->section_name = rz_str_new(section->name);
|
||||
reader->relocations = relocations;
|
||||
return reader;
|
||||
}
|
||||
@@ -251,6 +258,7 @@ RZ_IPI void RzBinEndianReader_free(RzBinEndianReader *r) {
|
||||
}
|
||||
rz_buf_free(r->buffer);
|
||||
ht_up_free(r->relocations);
|
||||
free(r->section_name);
|
||||
free(r);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,8 +142,9 @@ static RzBinDwarfFileEntry *FileEntry_parse_v5(
|
||||
entry->size = rz_bin_dwarf_attr_udata(&attr);
|
||||
break;
|
||||
case DW_LNCT_MD5: {
|
||||
const RzBinDwarfBlock *b = rz_bin_dwarf_attr_block(&attr);
|
||||
memcpy(entry->md5, rz_bin_dwarf_block_data(b), 16);
|
||||
rz_warn_if_fail(attr.form == DW_FORM_data16);
|
||||
const ut128 data = attr.value.u128;
|
||||
memcpy(entry->md5, &data, 16);
|
||||
break;
|
||||
}
|
||||
default: rz_warn_if_reached(); break;
|
||||
@@ -737,14 +738,15 @@ RZ_API RZ_OWN RzBinDwarfLine *rz_bin_dwarf_line_new(
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfLine *rz_bin_dwarf_line_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NULLABLE RzBinDWARF *dw) {
|
||||
RZ_BORROW RZ_NULLABLE RzBinDWARF *dw,
|
||||
bool is_dwo) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinDwarfEncoding encoding_bf = { 0 };
|
||||
if (!RzBinDwarfEncoding_from_file(&encoding_bf, bf)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(bf, ".debug_line");
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(bf, ".debug_line", is_dwo);
|
||||
RET_NULL_IF_FAIL(reader);
|
||||
return Line_parse(reader, &encoding_bf, dw);
|
||||
}
|
||||
|
||||
@@ -5,16 +5,19 @@
|
||||
#include "dwarf_private.h"
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfLineStr *rz_bin_dwarf_line_str_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
return RzBinDwarfStr_new(reader);
|
||||
return rz_bin_dwarf_str_new(reader);
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfLineStr *rz_bin_dwarf_line_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf) {
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_line_str");
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_line_str", false);
|
||||
RET_NULL_IF_FAIL(r);
|
||||
return RzBinDwarfStr_new(r);
|
||||
return rz_bin_dwarf_str_new(r);
|
||||
}
|
||||
RZ_API void rz_bin_dwarf_line_str_free(RzBinDwarfLineStr *str) {
|
||||
RzBinDwarfStr_free(str);
|
||||
|
||||
RZ_API void rz_bin_dwarf_line_str_free(RZ_NULLABLE RzBinDwarfLineStr *str) {
|
||||
rz_bin_dwarf_str_free(str);
|
||||
}
|
||||
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_line_str_get(RZ_NONNULL RZ_BORROW RzBinDwarfLineStr *str, ut64 offset) {
|
||||
return RzBinDwarfStr_get(str, offset);
|
||||
return rz_bin_dwarf_str_get(str, offset);
|
||||
}
|
||||
|
||||
@@ -359,10 +359,11 @@ RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new(RzBinEndianReader *l
|
||||
* \param dw RzBinDwarf instance
|
||||
* \return RzBinDwarfLocListTable instance on success, NULL otherwise
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo) {
|
||||
RET_NULL_IF_FAIL(bf);
|
||||
RzBinEndianReader *loclists = RzBinEndianReader_from_file(bf, ".debug_loclists");
|
||||
RzBinEndianReader *loc = RzBinEndianReader_from_file(bf, ".debug_loc");
|
||||
RzBinEndianReader *loclists = RzBinEndianReader_from_file(bf, ".debug_loclists", is_dwo);
|
||||
RzBinEndianReader *loc = RzBinEndianReader_from_file(bf, ".debug_loc", is_dwo);
|
||||
if (!(loclists || loc)) {
|
||||
RzBinEndianReader_free(loclists);
|
||||
RzBinEndianReader_free(loc);
|
||||
|
||||
@@ -287,10 +287,10 @@ RZ_API RZ_OWN RzBinDwarfRngLists *rz_bin_dwarf_rnglists_new(
|
||||
* \return the RzBinDwarfRngListTable instance on success, NULL otherwise
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfRngLists *rz_bin_dwarf_rnglists_new_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf) {
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo) {
|
||||
RET_NULL_IF_FAIL(bf);
|
||||
RzBinEndianReader *rnglists = RzBinEndianReader_from_file(bf, ".debug_rnglists");
|
||||
RzBinEndianReader *ranges = RzBinEndianReader_from_file(bf, ".debug_ranges");
|
||||
RzBinEndianReader *rnglists = RzBinEndianReader_from_file(bf, ".debug_rnglists", is_dwo);
|
||||
RzBinEndianReader *ranges = RzBinEndianReader_from_file(bf, ".debug_ranges", is_dwo);
|
||||
if (!(rnglists || ranges)) {
|
||||
RzBinEndianReader_free(rnglists);
|
||||
RzBinEndianReader_free(ranges);
|
||||
|
||||
+15
-34
@@ -6,16 +6,7 @@
|
||||
|
||||
Ht_FREE_IMPL(UP, string, free);
|
||||
|
||||
RZ_IPI void RzBinDwarfStr_free(RzBinDwarfStr *str) {
|
||||
if (!str) {
|
||||
return;
|
||||
}
|
||||
ht_up_free(str->str_by_offset);
|
||||
RzBinEndianReader_free(str->reader);
|
||||
free(str);
|
||||
}
|
||||
|
||||
RZ_IPI RzBinDwarfStr *RzBinDwarfStr_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
rz_return_val_if_fail(reader, NULL);
|
||||
RzBinDwarfStr *str = RZ_NEW0(RzBinDwarfStr);
|
||||
RET_NULL_IF_FAIL(str);
|
||||
@@ -28,14 +19,24 @@ RZ_IPI RzBinDwarfStr *RzBinDwarfStr_new(RZ_NONNULL RZ_OWN RzBinEndianReader *rea
|
||||
return str;
|
||||
}
|
||||
|
||||
RZ_IPI RzBinDwarfStr *RzBinDwarfStr_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf) {
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf, bool is_dwo) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_str");
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(
|
||||
bf, ".debug_str", is_dwo);
|
||||
RET_NULL_IF_FAIL(r);
|
||||
return RzBinDwarfStr_new(r);
|
||||
return rz_bin_dwarf_str_new(r);
|
||||
}
|
||||
|
||||
RZ_IPI char *RzBinDwarfStr_get(RzBinDwarfStr *str, ut64 offset) {
|
||||
RZ_API void rz_bin_dwarf_str_free(RZ_NULLABLE RzBinDwarfStr *str) {
|
||||
if (!str) {
|
||||
return;
|
||||
}
|
||||
ht_up_free(str->str_by_offset);
|
||||
RzBinEndianReader_free(str->reader);
|
||||
free(str);
|
||||
}
|
||||
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_get(RZ_NONNULL RZ_BORROW RzBinDwarfStr *str, ut64 offset) {
|
||||
rz_return_val_if_fail(str, NULL);
|
||||
char *string = ht_up_find(str->str_by_offset, offset, NULL);
|
||||
if (!string) {
|
||||
@@ -47,23 +48,3 @@ RZ_IPI char *RzBinDwarfStr_get(RzBinDwarfStr *str, ut64 offset) {
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
RZ_IPI void RzBinDwarfStr_read_all(RzBinDwarfStr *str) {
|
||||
rz_return_if_fail(str);
|
||||
while (rz_buf_tell(str->reader->buffer) < rz_buf_size(str->reader->buffer)) {
|
||||
RzBinDwarfStr_get(str, rz_buf_tell(str->reader->buffer));
|
||||
}
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
return RzBinDwarfStr_new(reader);
|
||||
}
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf) {
|
||||
return RzBinDwarfStr_from_file(bf);
|
||||
}
|
||||
RZ_API void rz_bin_dwarf_str_free(RzBinDwarfStr *str) {
|
||||
RzBinDwarfStr_free(str);
|
||||
}
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_get(RZ_NONNULL RZ_BORROW RzBinDwarfStr *str, ut64 offset) {
|
||||
return RzBinDwarfStr_get(str, offset);
|
||||
}
|
||||
|
||||
@@ -4,16 +4,8 @@
|
||||
#include <rz_bin_dwarf.h>
|
||||
#include "dwarf_private.h"
|
||||
|
||||
RZ_IPI void RzBinDwarfStrOffsets_free(RzBinDwarfStrOffsets *str_offsets) {
|
||||
if (!str_offsets) {
|
||||
return;
|
||||
}
|
||||
rz_vector_free(str_offsets->offsets);
|
||||
RzBinEndianReader_free(str_offsets->reader);
|
||||
free(str_offsets);
|
||||
}
|
||||
|
||||
RZ_IPI RzBinDwarfStrOffsets *RzBinDwarfStrOffsets_new(RzBinEndianReader *reader) {
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_from_buf(
|
||||
RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
rz_return_val_if_fail(reader, NULL);
|
||||
RzBinDwarfStrOffsets *str_offsets = RZ_NEW0(RzBinDwarfStrOffsets);
|
||||
RET_NULL_IF_FAIL(str_offsets);
|
||||
@@ -27,39 +19,39 @@ RZ_IPI RzBinDwarfStrOffsets *RzBinDwarfStrOffsets_new(RzBinEndianReader *reader)
|
||||
U_OR_GOTO(16, str_offsets->padding, err);
|
||||
return str_offsets;
|
||||
err:
|
||||
RzBinDwarfStrOffsets_free(str_offsets);
|
||||
rz_bin_dwarf_str_offsets_free(str_offsets);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RZ_IPI RzBinDwarfStrOffsets *RzBinDwarfStrOffsets_from_file(
|
||||
RZ_NONNULL RZ_BORROW RzBinFile *bf) {
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_from_file(
|
||||
RZ_NONNULL RZ_BORROW RzBinFile *bf, bool is_dwo) {
|
||||
rz_return_val_if_fail(bf, NULL);
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(bf, ".debug_str_offsets");
|
||||
RzBinEndianReader *r = RzBinEndianReader_from_file(
|
||||
bf, ".debug_str_offsets", is_dwo);
|
||||
RET_NULL_IF_FAIL(r);
|
||||
return RzBinDwarfStrOffsets_new(r);
|
||||
return rz_bin_dwarf_str_offsets_from_buf(r);
|
||||
}
|
||||
|
||||
RZ_IPI char *RzBinDwarfStrOffsets_get(RzBinDwarfStr *str, RzBinDwarfStrOffsets *str_offsets, ut64 base, ut64 index) {
|
||||
RZ_API void rz_bin_dwarf_str_offsets_free(RZ_NULLABLE RzBinDwarfStrOffsets *str_offsets) {
|
||||
if (!str_offsets) {
|
||||
return;
|
||||
}
|
||||
rz_vector_free(str_offsets->offsets);
|
||||
RzBinEndianReader_free(str_offsets->reader);
|
||||
free(str_offsets);
|
||||
}
|
||||
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_offsets_get(
|
||||
RZ_NONNULL RZ_BORROW RzBinDwarfStr *str,
|
||||
RZ_NONNULL RZ_BORROW RzBinDwarfStrOffsets *str_offsets,
|
||||
ut64 base, ut64 index) {
|
||||
rz_return_val_if_fail(str && str_offsets && index >= 0, NULL);
|
||||
RzBinEndianReader *reader = str_offsets->reader;
|
||||
ut64 offset = 0;
|
||||
OK_OR(rz_buf_seek(reader->buffer, (st64)base, RZ_BUF_SET) >= 0, return NULL);
|
||||
OK_OR(rz_buf_seek(reader->buffer, (st64)index * (str_offsets->encoding.is_64bit ? 8 : 4), RZ_BUF_CUR) >= 0, return NULL);
|
||||
OK_OR(rz_buf_seek(reader->buffer,
|
||||
(st64)index * (str_offsets->encoding.is_64bit ? 8 : 4), RZ_BUF_CUR) >= 0,
|
||||
return NULL);
|
||||
OK_OR(read_offset(reader, &offset, str_offsets->encoding.is_64bit), return NULL);
|
||||
return RzBinDwarfStr_get(str, offset);
|
||||
}
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_from_buf(
|
||||
RZ_NONNULL RZ_OWN RzBinEndianReader *reader) {
|
||||
return RzBinDwarfStrOffsets_new(reader);
|
||||
}
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_from_file(
|
||||
RZ_NONNULL RZ_BORROW RzBinFile *bf) {
|
||||
return RzBinDwarfStrOffsets_from_file(bf);
|
||||
}
|
||||
RZ_API void rz_bin_dwarf_str_offsets_free(RzBinDwarfStrOffsets *str_offsets) {
|
||||
RzBinDwarfStrOffsets_free(str_offsets);
|
||||
}
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_offsets_get(RzBinDwarfStr *debug_str, RzBinDwarfStrOffsets *debug_str_offsets, ut64 base, ut64 index) {
|
||||
return RzBinDwarfStrOffsets_get(debug_str, debug_str_offsets, base, index);
|
||||
return rz_bin_dwarf_str_get(str, offset);
|
||||
}
|
||||
|
||||
+23
-2
@@ -353,6 +353,25 @@ RZ_API RZ_OWN RzBinDwarfInfo *rz_bin_dwarf_info_from_buf(
|
||||
RzBinDwarfCompUnit *unit = NULL;
|
||||
rz_vector_foreach(&info->units, unit) {
|
||||
ht_up_insert(info->unit_by_offset, unit->offset, unit);
|
||||
switch (unit->hdr.ut) {
|
||||
case DW_UT_skeleton: {
|
||||
RzBinDwarfDie *die = rz_vector_head(&unit->dies);
|
||||
if (!die) {
|
||||
RZ_LOG_ERROR("Invalid DW_UT_skeleton [0x%" PFMT64x "]\n", unit->offset);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DW_UT_compile:
|
||||
case DW_UT_type:
|
||||
case DW_UT_partial:
|
||||
case DW_UT_split_compile:
|
||||
case DW_UT_split_type:
|
||||
case DW_UT_lo_user:
|
||||
case DW_UT_hi_user:
|
||||
default: break;
|
||||
}
|
||||
|
||||
RzBinDwarfDie *die = NULL;
|
||||
rz_vector_foreach(&unit->dies, die) {
|
||||
ht_up_insert(info->die_by_offset, die->offset, die); // optimization for further processing
|
||||
@@ -372,9 +391,11 @@ err:
|
||||
*/
|
||||
RZ_API RZ_OWN RzBinDwarfInfo *rz_bin_dwarf_info_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NONNULL RzBinDWARF *dw) {
|
||||
RZ_BORROW RZ_NONNULL RzBinDWARF *dw,
|
||||
bool is_dwo) {
|
||||
rz_return_val_if_fail(bf && dw && dw->abbrev, NULL);
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(bf, ".debug_info");
|
||||
RzBinEndianReader *reader = RzBinEndianReader_from_file(
|
||||
bf, ".debug_info", is_dwo);
|
||||
RET_NULL_IF_FAIL(reader);
|
||||
return rz_bin_dwarf_info_from_buf(reader, dw);
|
||||
}
|
||||
|
||||
+31
-2
@@ -626,13 +626,42 @@ RZ_API bool rz_core_bin_apply_main(RzCore *r, RzBinFile *binfile, bool va) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline RzBinDWARF *load_dwarf(RzCore *core, RzBinFile *binfile) {
|
||||
RzBinDWARF *dw = rz_bin_dwarf_from_file(binfile);
|
||||
|
||||
const char *dwo_path = rz_config_get(core->config, "bin.dbginfo.dwo_path");
|
||||
if (RZ_STR_ISNOTEMPTY(dwo_path)) {
|
||||
RzBinDWARF *dwo = rz_bin_dwarf_from_path(dwo_path, true);
|
||||
if (dwo) {
|
||||
dwo->parent = dw;
|
||||
return dwo;
|
||||
}
|
||||
}
|
||||
const char *debug_file_directory = rz_config_get(
|
||||
core->config, "bin.dbginfo.debug_file_directory");
|
||||
if (RZ_STR_ISNOTEMPTY(debug_file_directory)) {
|
||||
RzList *debug_file_directorys =
|
||||
rz_str_split_duplist(debug_file_directory, ";", true);
|
||||
if (debug_file_directorys) {
|
||||
RzBinDWARF *sep_dw =
|
||||
rz_bin_dwarf_search_debug_file_directory(binfile, debug_file_directorys);
|
||||
rz_list_free(debug_file_directorys);
|
||||
if (sep_dw) {
|
||||
sep_dw->parent = dw;
|
||||
return sep_dw;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dw;
|
||||
}
|
||||
|
||||
RZ_API bool rz_core_bin_apply_dwarf(RzCore *core, RzBinFile *binfile) {
|
||||
rz_return_val_if_fail(core && binfile, false);
|
||||
if (!rz_config_get_i(core->config, "bin.dbginfo") || !binfile->o) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RzBinDWARF *dw = rz_bin_dwarf_from_file(binfile);
|
||||
RzBinDWARF *dw = load_dwarf(core, binfile);
|
||||
if (!dw) {
|
||||
return false;
|
||||
}
|
||||
@@ -1704,7 +1733,7 @@ static bool bin_dwarf(RzCore *core, RzBinFile *binfile, RzCmdStateOutput *state)
|
||||
|
||||
RzBinDWARF *dw = (core->analysis && core->analysis->debug_info && core->analysis->debug_info->dw)
|
||||
? core->analysis->debug_info->dw
|
||||
: rz_bin_dwarf_from_file(binfile);
|
||||
: load_dwarf(core, binfile);
|
||||
if (!dw) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3230,6 +3230,9 @@ RZ_API int rz_core_config_init(RzCore *core) {
|
||||
SETI("bin.baddr", -1, "Base address of the binary");
|
||||
SETI("bin.laddr", 0, "Base address for loading library ('*.so')");
|
||||
SETCB("bin.dbginfo", "true", &cb_bindbginfo, "Load debug information at startup if available");
|
||||
SETCB("bin.dbginfo.dwo_path", "", NULL, "Load separate debug information (DWARF) file if available");
|
||||
SETCB("bin.dbginfo.debug_file_directory", "/usr/lib/debug", NULL,
|
||||
"Set the directories which searches for separate debugging information files to directory");
|
||||
SETBPREF("bin.relocs", "true", "Load relocs information at startup if available");
|
||||
SETICB("bin.minstr", 0, &cb_binminstr, "Minimum string length for strings in bin plugins");
|
||||
SETICB("bin.maxstr", 0, &cb_binmaxstr, "Maximum string length for strings in bin plugins");
|
||||
|
||||
+3
-2
@@ -192,7 +192,8 @@ RZ_API RZ_OWN char *rz_core_bin_dwarf_debug_info_to_string(
|
||||
|
||||
RzBinDwarfDie *die = NULL;
|
||||
rz_vector_foreach(&unit->dies, die) {
|
||||
rz_strbuf_appendf(sb, "<0x%" PFMT64x ">: Abbrev Number: %-4" PFMT64u " ", die->offset, die->abbrev_code);
|
||||
rz_strbuf_appendf(sb, "<0x%" PFMT64x ">: Abbrev Number: %-4" PFMT64u " ",
|
||||
die->offset, die->abbrev_code);
|
||||
|
||||
const char *tag_name = rz_bin_dwarf_tag(die->tag);
|
||||
if (tag_name) {
|
||||
@@ -425,7 +426,7 @@ RZ_API RZ_OWN char *rz_core_bin_dwarf_line_units_to_string(RZ_NONNULL RZ_BORROW
|
||||
if (!sb) {
|
||||
return NULL;
|
||||
}
|
||||
rz_strbuf_appendf(sb, "Raw dump of debug contents of section %s:\n\n", line->reader->section->name);
|
||||
rz_strbuf_appendf(sb, "Raw dump of debug contents of section %s:\n\n", line->reader->section_name);
|
||||
RzListIter *it;
|
||||
RzBinDwarfLineUnit *unit;
|
||||
bool first = true;
|
||||
|
||||
@@ -972,7 +972,7 @@ struct rz_bin_section_t;
|
||||
typedef struct {
|
||||
RzBuffer *buffer;
|
||||
bool big_endian;
|
||||
const struct rz_bin_section_t *section;
|
||||
char *section_name;
|
||||
HtUP *relocations;
|
||||
} RzBinEndianReader;
|
||||
|
||||
@@ -1042,9 +1042,13 @@ typedef struct {
|
||||
// A 4-byte unsigned offset into the .debug_abbrev section.
|
||||
ut64 abbrev_offset;
|
||||
DW_UT ut; // DWARF 5 addition
|
||||
ut8 dwo_id; // DWARF 5 addition
|
||||
ut64 type_sig; // DWARF 5 addition
|
||||
ut64 type_offset; // DWARF 5 addition
|
||||
union {
|
||||
ut64 dwo_id; // DWARF 5 addition
|
||||
struct {
|
||||
ut64 type_sig; // DWARF 5 addition
|
||||
ut64 type_offset; // DWARF 5 addition
|
||||
};
|
||||
};
|
||||
ut64 header_size; // excluding length field
|
||||
RzBinDwarfEncoding encoding;
|
||||
} RzBinDwarfCompUnitHdr;
|
||||
@@ -1413,7 +1417,11 @@ typedef struct {
|
||||
HtUP /*<ut64, RzBinDwarfLocList>*/ *loclist_by_offset;
|
||||
} RzBinDwarfLocLists;
|
||||
|
||||
struct rz_core_bin_dwarf_t;
|
||||
|
||||
typedef struct rz_core_bin_dwarf_t {
|
||||
struct rz_core_bin_dwarf_t *parent;
|
||||
|
||||
RzBinDwarfARanges *aranges;
|
||||
RzBinDwarfLine *line;
|
||||
RzBinDwarfLocLists *loclists;
|
||||
@@ -1440,21 +1448,24 @@ RZ_API const char *rz_bin_dwarf_op(DW_OP op);
|
||||
|
||||
/// .debug_str
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader);
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf);
|
||||
RZ_API void rz_bin_dwarf_str_free(RzBinDwarfStr *str);
|
||||
RZ_API RZ_OWN RzBinDwarfStr *rz_bin_dwarf_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf, bool is_dwo);
|
||||
RZ_API void rz_bin_dwarf_str_free(RZ_NULLABLE RzBinDwarfStr *str);
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_get(RZ_NONNULL RZ_BORROW RzBinDwarfStr *str, ut64 offset);
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfLineStr *rz_bin_dwarf_line_str_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader);
|
||||
RZ_API RZ_OWN RzBinDwarfLineStr *rz_bin_dwarf_line_str_from_file(RZ_NONNULL RZ_BORROW RzBinFile *bf);
|
||||
RZ_API void rz_bin_dwarf_line_str_free(RzBinDwarfLineStr *str);
|
||||
RZ_API void rz_bin_dwarf_line_str_free(RZ_NULLABLE RzBinDwarfLineStr *str);
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_line_str_get(RZ_NONNULL RZ_BORROW RzBinDwarfLineStr *str, ut64 offset);
|
||||
|
||||
/// .debug_str_offsets
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader);
|
||||
RZ_API RZ_OWN RzBinDwarfStrOffsets *rz_bin_dwarf_str_offsets_from_file(
|
||||
RZ_NONNULL RZ_BORROW RzBinFile *bf);
|
||||
RZ_API void rz_bin_dwarf_str_offsets_free(RzBinDwarfStrOffsets *str_offsets);
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_offsets_get(RzBinDwarfStr *debug_str, RzBinDwarfStrOffsets *debug_str_offsets, ut64 base, ut64 index);
|
||||
RZ_NONNULL RZ_BORROW RzBinFile *bf, bool is_dwo);
|
||||
RZ_API void rz_bin_dwarf_str_offsets_free(RZ_NULLABLE RzBinDwarfStrOffsets *str_offsets);
|
||||
RZ_API RZ_BORROW const char *rz_bin_dwarf_str_offsets_get(
|
||||
RZ_NONNULL RZ_BORROW RzBinDwarfStr *str,
|
||||
RZ_NONNULL RZ_BORROW RzBinDwarfStrOffsets *str_offsets,
|
||||
ut64 base, ut64 index);
|
||||
|
||||
/// .debug_aranges
|
||||
RZ_API RZ_OWN RzBinDwarfARanges *rz_bin_dwarf_aranges_new(RZ_NONNULL RZ_OWN RzBinEndianReader *reader);
|
||||
@@ -1464,7 +1475,8 @@ RZ_API void rz_bin_dwarf_aranges_free(RZ_OWN RZ_NULLABLE RzBinDwarfARanges *aran
|
||||
|
||||
/// .debug_abbrev
|
||||
RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_new(RZ_OWN RZ_NONNULL RzBinEndianReader *reader);
|
||||
RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf);
|
||||
RZ_API RZ_OWN RzBinDwarfAbbrev *rz_bin_dwarf_abbrev_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo);
|
||||
|
||||
RZ_API void rz_bin_dwarf_abbrev_free(RZ_OWN RZ_NULLABLE RzBinDwarfAbbrev *abbrevs);
|
||||
RZ_API size_t rz_bin_dwarf_abbrev_count(RZ_BORROW RZ_NONNULL const RzBinDwarfAbbrev *da);
|
||||
@@ -1480,7 +1492,8 @@ RZ_API RZ_OWN RzBinDwarfInfo *rz_bin_dwarf_info_from_buf(
|
||||
RZ_BORROW RZ_NONNULL RzBinDWARF *dw);
|
||||
RZ_API RZ_OWN RzBinDwarfInfo *rz_bin_dwarf_info_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NONNULL RzBinDWARF *dw);
|
||||
RZ_BORROW RZ_NONNULL RzBinDWARF *dw,
|
||||
bool is_dwo);
|
||||
|
||||
RZ_API void rz_bin_dwarf_info_free(RZ_OWN RZ_NULLABLE RzBinDwarfInfo *info);
|
||||
RZ_API RZ_BORROW RzBinDwarfAttr *rz_bin_dwarf_die_get_attr(
|
||||
@@ -1493,11 +1506,18 @@ RZ_API RZ_OWN RzBinDwarfLine *rz_bin_dwarf_line_new(
|
||||
RZ_BORROW RZ_NULLABLE RzBinDWARF *dw);
|
||||
RZ_API RZ_OWN RzBinDwarfLine *rz_bin_dwarf_line_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NULLABLE RzBinDWARF *dw);
|
||||
RZ_BORROW RZ_NULLABLE RzBinDWARF *dw,
|
||||
bool is_dwo);
|
||||
RZ_API void rz_bin_dwarf_line_op_fini(RZ_OWN RZ_NULLABLE RzBinDwarfLineOp *op);
|
||||
RZ_API void rz_bin_dwarf_line_free(RZ_OWN RZ_NULLABLE RzBinDwarfLine *li);
|
||||
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf);
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_from_path(
|
||||
RZ_BORROW RZ_NONNULL const char *filepath, bool is_dwo);
|
||||
RZ_API RZ_OWN RzBinDWARF *rz_bin_dwarf_search_debug_file_directory(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf,
|
||||
RZ_BORROW RZ_NONNULL RzList /*<const char *>*/ *debug_file_directorys);
|
||||
|
||||
RZ_API void rz_bin_dwarf_free(RZ_OWN RZ_NULLABLE RzBinDWARF *dw);
|
||||
|
||||
// Assuming ValueType is an enum defined elsewhere
|
||||
@@ -1748,8 +1768,10 @@ RZ_API RzBinDwarfLocList *rz_bin_dwarf_loclists_get(
|
||||
RZ_BORROW RZ_NONNULL RzBinDwarfCompUnit *cu,
|
||||
ut64 offset);
|
||||
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new(RzBinEndianReader *loclists, RzBinEndianReader *loc);
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf);
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new(
|
||||
RzBinEndianReader *loclists, RzBinEndianReader *loc);
|
||||
RZ_API RZ_OWN RzBinDwarfLocLists *rz_bin_dwarf_loclists_new_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo);
|
||||
|
||||
RZ_API bool rz_bin_dwarf_rnglists_parse_at(
|
||||
RZ_BORROW RZ_NONNULL RzBinDwarfRngLists *self,
|
||||
@@ -1759,7 +1781,8 @@ RZ_API bool rz_bin_dwarf_rnglists_parse_at(
|
||||
/// rnglists
|
||||
RZ_API RZ_OWN RzBinDwarfRngLists *rz_bin_dwarf_rnglists_new(
|
||||
RZ_OWN RZ_NULLABLE RzBinEndianReader *rnglists, RZ_OWN RZ_NULLABLE RzBinEndianReader *ranges);
|
||||
RZ_API RZ_OWN RzBinDwarfRngLists *rz_bin_dwarf_rnglists_new_from_file(RZ_BORROW RZ_NONNULL RzBinFile *bf);
|
||||
RZ_API RZ_OWN RzBinDwarfRngLists *rz_bin_dwarf_rnglists_new_from_file(
|
||||
RZ_BORROW RZ_NONNULL RzBinFile *bf, bool is_dwo);
|
||||
|
||||
/// Block
|
||||
RZ_API bool rz_bin_dwarf_block_valid(const RzBinDwarfBlock *self);
|
||||
|
||||
@@ -6572,3 +6572,641 @@ var double c @ ...
|
||||
\ 0x00008150 pop {r4, pc}
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME="Debugging Information in Separate Files"
|
||||
FILE=bins/elf/float_ex1/float_ex1_split-dwarf
|
||||
CMDS=<<EOF
|
||||
aaa
|
||||
iS
|
||||
id
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
paddr size vaddr vsize align perm name type flags
|
||||
-----------------------------------------------------------------------------------------
|
||||
0x00000000 0x0 ---------- 0x0 0x0 ---- NULL
|
||||
0x00000318 0x1c 0x00000318 0x1c 0x0 -r-- .interp PROGBITS alloc
|
||||
0x00000338 0x20 0x00000338 0x20 0x0 -r-- .note.gnu.property NOTE alloc
|
||||
0x00000358 0x24 0x00000358 0x24 0x0 -r-- .note.gnu.build-id NOTE alloc
|
||||
0x0000037c 0x20 0x0000037c 0x20 0x0 -r-- .note.ABI-tag NOTE alloc
|
||||
0x000003a0 0x40 0x000003a0 0x40 0x0 -r-- .hash HASH alloc
|
||||
0x000003e0 0x24 0x000003e0 0x24 0x0 -r-- .gnu.hash GNU_HASH alloc
|
||||
0x00000408 0x108 0x00000408 0x108 0x0 -r-- .dynsym DYNSYM alloc
|
||||
0x00000510 0xac 0x00000510 0xac 0x0 -r-- .dynstr STRTAB alloc
|
||||
0x000005bc 0x16 0x000005bc 0x16 0x0 -r-- .gnu.version VERSYM alloc
|
||||
0x000005d8 0x30 0x000005d8 0x30 0x0 -r-- .gnu.version_r VERNEED alloc
|
||||
0x00000608 0xc0 0x00000608 0xc0 0x0 -r-- .rela.dyn RELA alloc
|
||||
0x000006c8 0x78 0x000006c8 0x78 0x0 -r-- .rela.plt RELA alloc,info
|
||||
0x00001000 0x17 0x00001000 0x17 0x0 -r-x .init PROGBITS alloc,execute
|
||||
0x00001020 0x60 0x00001020 0x60 0x0 -r-x .plt PROGBITS alloc,execute
|
||||
0x00001080 0x8 0x00001080 0x8 0x0 -r-x .plt.got PROGBITS alloc,execute
|
||||
0x00001090 0x31f 0x00001090 0x31f 0x0 -r-x .text PROGBITS alloc,execute
|
||||
0x000013b0 0x9 0x000013b0 0x9 0x0 -r-x .fini PROGBITS alloc,execute
|
||||
0x00002000 0x58 0x00002000 0x58 0x0 -r-- .rodata PROGBITS alloc
|
||||
0x00002058 0x3c 0x00002058 0x3c 0x0 -r-- .eh_frame_hdr PROGBITS alloc
|
||||
0x00002098 0xec 0x00002098 0xec 0x0 -r-- .eh_frame PROGBITS alloc
|
||||
0x00002dc0 0x8 0x00003dc0 0x8 0x0 -rw- .init_array INIT_ARRAY write,alloc
|
||||
0x00002dc8 0x8 0x00003dc8 0x8 0x0 -rw- .fini_array FINI_ARRAY write,alloc
|
||||
0x00002dd0 0x1f0 0x00003dd0 0x1f0 0x0 -rw- .dynamic DYNAMIC write,alloc
|
||||
0x00002fc0 0x28 0x00003fc0 0x28 0x0 -rw- .got PROGBITS write,alloc
|
||||
0x00002fe8 0x40 0x00003fe8 0x40 0x0 -rw- .got.plt PROGBITS write,alloc
|
||||
0x00003028 0x10 0x00004028 0x10 0x0 -rw- .data PROGBITS write,alloc
|
||||
0x00003038 0x0 0x00004038 0x8 0x0 -rw- .bss NOBITS write,alloc
|
||||
0x00003038 0x3b ---------- 0x3b 0x0 ---- .comment PROGBITS merge,strings
|
||||
0x00003074 0x20 ---------- 0x20 0x0 ---- .gnu_debuglink PROGBITS
|
||||
0x00003098 0x378 ---------- 0x378 0x0 ---- .symtab SYMTAB
|
||||
0x00003410 0x21c ---------- 0x21c 0x0 ---- .strtab STRTAB
|
||||
0x0000362c 0x129 ---------- 0x129 0x0 ---- .shstrtab STRTAB
|
||||
1 DW_TAG_compile_unit [has children] (0x0)
|
||||
DW_AT_producer DW_FORM_strx1
|
||||
DW_AT_language DW_FORM_data2
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_str_offsets_base DW_FORM_sec_offset
|
||||
DW_AT_stmt_list DW_FORM_sec_offset
|
||||
DW_AT_comp_dir DW_FORM_strx1
|
||||
DW_AT_low_pc DW_FORM_addrx
|
||||
DW_AT_high_pc DW_FORM_data4
|
||||
DW_AT_addr_base DW_FORM_sec_offset
|
||||
2 DW_TAG_pointer_type [no children] (0x17)
|
||||
DW_AT_type DW_FORM_ref4
|
||||
3 DW_TAG_typedef [no children] (0x1e)
|
||||
DW_AT_type DW_FORM_ref4
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
4 DW_TAG_structure_type [has children] (0x2b)
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_byte_size DW_FORM_data1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
5 DW_TAG_member [no children] (0x38)
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_type DW_FORM_ref4
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
DW_AT_data_member_location DW_FORM_data1
|
||||
6 DW_TAG_base_type [no children] (0x47)
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_encoding DW_FORM_data1
|
||||
DW_AT_byte_size DW_FORM_data1
|
||||
7 DW_TAG_array_type [has children] (0x52)
|
||||
DW_AT_type DW_FORM_ref4
|
||||
8 DW_TAG_subrange_type [no children] (0x59)
|
||||
DW_AT_type DW_FORM_ref4
|
||||
DW_AT_count DW_FORM_data1
|
||||
9 DW_TAG_base_type [no children] (0x62)
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_byte_size DW_FORM_data1
|
||||
DW_AT_encoding DW_FORM_data1
|
||||
10 DW_TAG_pointer_type [no children] (0x6d)
|
||||
11 DW_TAG_subprogram [has children] (0x72)
|
||||
DW_AT_low_pc DW_FORM_addrx
|
||||
DW_AT_high_pc DW_FORM_data4
|
||||
DW_AT_frame_base DW_FORM_exprloc
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
DW_AT_prototyped DW_FORM_flag_present
|
||||
DW_AT_type DW_FORM_ref4
|
||||
DW_AT_external DW_FORM_flag_present
|
||||
12 DW_TAG_formal_parameter [no children] (0x89)
|
||||
DW_AT_location DW_FORM_exprloc
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
DW_AT_type DW_FORM_ref4
|
||||
13 DW_TAG_subprogram [has children] (0x98)
|
||||
DW_AT_low_pc DW_FORM_addrx
|
||||
DW_AT_high_pc DW_FORM_data4
|
||||
DW_AT_frame_base DW_FORM_exprloc
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
DW_AT_type DW_FORM_ref4
|
||||
DW_AT_external DW_FORM_flag_present
|
||||
14 DW_TAG_variable [no children] (0xad)
|
||||
DW_AT_location DW_FORM_exprloc
|
||||
DW_AT_name DW_FORM_strx1
|
||||
DW_AT_decl_file DW_FORM_data1
|
||||
DW_AT_decl_line DW_FORM_data1
|
||||
DW_AT_type DW_FORM_ref4
|
||||
|
||||
Compilation Unit @ offset 0x0:
|
||||
Length: 0x14f
|
||||
Version: 5
|
||||
Abbrev Offset: 0x0
|
||||
Pointer Size: 8
|
||||
Unit Type: DW_UT_compile
|
||||
|
||||
<0xc>: Abbrev Number: 1 (DW_TAG_compile_unit)
|
||||
DW_AT_producer [DW_FORM_strx1] : (indirect string, index 0x0): Debian clang version 14.0.6
|
||||
DW_AT_language [DW_FORM_data2] : 12 (C99)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x1): float_ex1.c
|
||||
DW_AT_str_offsets_base [DW_FORM_sec_offset] : <0x8>
|
||||
DW_AT_stmt_list [DW_FORM_sec_offset] : <0x0>
|
||||
DW_AT_comp_dir [DW_FORM_strx1] : (indirect string, index 0x2): /app
|
||||
DW_AT_low_pc [DW_FORM_addrx] : 0x0
|
||||
DW_AT_high_pc [DW_FORM_data4] : 559
|
||||
DW_AT_addr_base [DW_FORM_sec_offset] : <0x8>
|
||||
<0x23>: Abbrev Number: 2 (DW_TAG_pointer_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x28>
|
||||
<0x28>: Abbrev Number: 3 (DW_TAG_typedef)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x30>
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xc): some_t
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 13
|
||||
<0x30>: Abbrev Number: 4 (DW_TAG_structure_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xb): Some
|
||||
DW_AT_byte_size [DW_FORM_data1] : 24
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 6
|
||||
<0x35>: Abbrev Number: 5 (DW_TAG_member)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x3): a
|
||||
DW_AT_type [DW_FORM_ref4] : <0x5a>
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 7
|
||||
DW_AT_data_member_location [DW_FORM_data1] : 0
|
||||
<0x3e>: Abbrev Number: 5 (DW_TAG_member)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x5): b
|
||||
DW_AT_type [DW_FORM_ref4] : <0x5e>
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 8
|
||||
DW_AT_data_member_location [DW_FORM_data1] : 4
|
||||
<0x47>: Abbrev Number: 5 (DW_TAG_member)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x8): c
|
||||
DW_AT_type [DW_FORM_ref4] : <0x72>
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 9
|
||||
DW_AT_data_member_location [DW_FORM_data1] : 12
|
||||
<0x50>: Abbrev Number: 5 (DW_TAG_member)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xa): qwe
|
||||
DW_AT_type [DW_FORM_ref4] : <0x76>
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 10
|
||||
DW_AT_data_member_location [DW_FORM_data1] : 16
|
||||
<0x59>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
<0x5a>: Abbrev Number: 6 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x4): int
|
||||
DW_AT_encoding [DW_FORM_data1] : 5
|
||||
DW_AT_byte_size [DW_FORM_data1] : 4
|
||||
<0x5e>: Abbrev Number: 7 (DW_TAG_array_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x6a>
|
||||
<0x63>: Abbrev Number: 8 (DW_TAG_subrange_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x6e>
|
||||
DW_AT_count [DW_FORM_data1] : 6
|
||||
<0x69>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
<0x6a>: Abbrev Number: 6 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x6): char
|
||||
DW_AT_encoding [DW_FORM_data1] : 6
|
||||
DW_AT_byte_size [DW_FORM_data1] : 1
|
||||
<0x6e>: Abbrev Number: 9 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x7): __ARRAY_SIZE_TYPE__
|
||||
DW_AT_byte_size [DW_FORM_data1] : 8
|
||||
DW_AT_encoding [DW_FORM_data1] : 7
|
||||
<0x72>: Abbrev Number: 6 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x9): float
|
||||
DW_AT_encoding [DW_FORM_data1] : 4
|
||||
DW_AT_byte_size [DW_FORM_data1] : 4
|
||||
<0x76>: Abbrev Number: 10 (DW_TAG_pointer_type)
|
||||
<0x77>: Abbrev Number: 11 (DW_TAG_subprogram)
|
||||
DW_AT_low_pc [DW_FORM_addrx] : 0x0
|
||||
DW_AT_high_pc [DW_FORM_data4] : 170
|
||||
DW_AT_frame_base [DW_FORM_exprloc] : 1 byte block: 0x56
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xd): fn1
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_prototyped [DW_FORM_flag_present] : 1
|
||||
DW_AT_type [DW_FORM_ref4] : <0x136>
|
||||
DW_AT_external [DW_FORM_flag_present] : 1
|
||||
<0x86>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9178
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x3): a
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_type [DW_FORM_ref4] : <0x5a>
|
||||
<0x91>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9170
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x11): g
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_type [DW_FORM_ref4] : <0x13a>
|
||||
<0x9c>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9168
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x12): q
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_type [DW_FORM_ref4] : <0x13f>
|
||||
<0xa7>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9160
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x14): gg
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_type [DW_FORM_ref4] : <0x143>
|
||||
<0xb2>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9158
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x15): out
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 15
|
||||
DW_AT_type [DW_FORM_ref4] : <0x148>
|
||||
<0xbd>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
<0xbe>: Abbrev Number: 13 (DW_TAG_subprogram)
|
||||
DW_AT_low_pc [DW_FORM_addrx] : 0x1
|
||||
DW_AT_high_pc [DW_FORM_data4] : 48
|
||||
DW_AT_frame_base [DW_FORM_exprloc] : 1 byte block: 0x56
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xf): new_some
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 27
|
||||
DW_AT_type [DW_FORM_ref4] : <0x23>
|
||||
DW_AT_external [DW_FORM_flag_present] : 1
|
||||
<0xcd>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9178
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x16): n
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 28
|
||||
DW_AT_type [DW_FORM_ref4] : <0x143>
|
||||
<0xd8>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
<0xd9>: Abbrev Number: 11 (DW_TAG_subprogram)
|
||||
DW_AT_low_pc [DW_FORM_addrx] : 0x2
|
||||
DW_AT_high_pc [DW_FORM_data4] : 335
|
||||
DW_AT_frame_base [DW_FORM_exprloc] : 1 byte block: 0x56
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x10): main
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 33
|
||||
DW_AT_prototyped [DW_FORM_flag_present] : 1
|
||||
DW_AT_type [DW_FORM_ref4] : <0x5a>
|
||||
DW_AT_external [DW_FORM_flag_present] : 1
|
||||
<0xe8>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9178
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x17): argc
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 33
|
||||
DW_AT_type [DW_FORM_ref4] : <0x5a>
|
||||
<0xf3>: Abbrev Number: 12 (DW_TAG_formal_parameter)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9170
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x18): argv
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 33
|
||||
DW_AT_type [DW_FORM_ref4] : <0x14d>
|
||||
<0xfe>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x916c
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x3): a
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 34
|
||||
DW_AT_type [DW_FORM_ref4] : <0x72>
|
||||
<0x109>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9168
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x5): b
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 34
|
||||
DW_AT_type [DW_FORM_ref4] : <0x72>
|
||||
<0x114>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9160
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x8): c
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 37
|
||||
DW_AT_type [DW_FORM_ref4] : <0x13f>
|
||||
<0x11f>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9158
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x19): s
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 39
|
||||
DW_AT_type [DW_FORM_ref4] : <0x23>
|
||||
<0x12a>: Abbrev Number: 14 (DW_TAG_variable)
|
||||
DW_AT_location [DW_FORM_exprloc] : 2 byte block: 0x9150
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x14): gg
|
||||
DW_AT_decl_file [DW_FORM_data1] : 0
|
||||
DW_AT_decl_line [DW_FORM_data1] : 43
|
||||
DW_AT_type [DW_FORM_ref4] : <0x143>
|
||||
<0x135>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
<0x136>: Abbrev Number: 6 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0xe): _Bool
|
||||
DW_AT_encoding [DW_FORM_data1] : 2
|
||||
DW_AT_byte_size [DW_FORM_data1] : 1
|
||||
<0x13a>: Abbrev Number: 2 (DW_TAG_pointer_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x6a>
|
||||
<0x13f>: Abbrev Number: 6 (DW_TAG_base_type)
|
||||
DW_AT_name [DW_FORM_strx1] : (indirect string, index 0x13): double
|
||||
DW_AT_encoding [DW_FORM_data1] : 4
|
||||
DW_AT_byte_size [DW_FORM_data1] : 8
|
||||
<0x143>: Abbrev Number: 2 (DW_TAG_pointer_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x30>
|
||||
<0x148>: Abbrev Number: 2 (DW_TAG_pointer_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x23>
|
||||
<0x14d>: Abbrev Number: 2 (DW_TAG_pointer_type)
|
||||
DW_AT_type [DW_FORM_ref4] : <0x13a>
|
||||
<0x152>: Abbrev Number: 0 (DW_TAG_null_entry)
|
||||
Raw dump of debug contents of section .debug_line:
|
||||
|
||||
Header information[0x0]
|
||||
Length: 351
|
||||
DWARF Version: 5
|
||||
Header Length: 55
|
||||
Minimum Instruction Length: 1
|
||||
Maximum Operations per Instruction: 1
|
||||
Initial value of 'is_stmt': 1
|
||||
Line Base: -5
|
||||
Line Range: 14
|
||||
Opcode Base: 13
|
||||
|
||||
Opcodes:
|
||||
standard_opcode_lengths[DW_LNS_copy] = 0
|
||||
standard_opcode_lengths[DW_LNS_advance_pc] = 1
|
||||
standard_opcode_lengths[DW_LNS_advance_line] = 1
|
||||
standard_opcode_lengths[DW_LNS_set_file] = 1
|
||||
standard_opcode_lengths[DW_LNS_set_column] = 1
|
||||
standard_opcode_lengths[DW_LNS_negate_stmt] = 0
|
||||
standard_opcode_lengths[DW_LNS_set_basic_block] = 0
|
||||
standard_opcode_lengths[DW_LNS_const_add_pc] = 0
|
||||
standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
|
||||
standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
|
||||
standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
|
||||
standard_opcode_lengths[DW_LNS_set_isa] = 1
|
||||
|
||||
The Directory Table:
|
||||
1 /app
|
||||
|
||||
The File Name Table:
|
||||
Entry Dir Time Size Name
|
||||
1 0 0 0 float_ex1.c
|
||||
|
||||
Line Number Statements:
|
||||
DW_LNS_set_file 0
|
||||
DW_LNE_set_address 0x1180
|
||||
DW_LNS_advance_line 14
|
||||
DW_LNS_copy
|
||||
DW_LNS_set_column 7
|
||||
DW_LNS_set_prologue_end
|
||||
DW_LNS_const_add_pc
|
||||
Special opcode 173
|
||||
DW_LNS_set_column 10
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 14
|
||||
Special opcode 102
|
||||
DW_LNS_set_column 6
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 3
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 103
|
||||
DW_LNS_set_column 19
|
||||
Special opcode 146
|
||||
DW_LNS_set_column 3
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 200
|
||||
DW_LNS_set_column 7
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 14
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 61
|
||||
DW_LNS_set_column 4
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 60
|
||||
DW_LNS_set_column 3
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 12
|
||||
Special opcode 60
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 47
|
||||
DW_LNS_set_column 11
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 18
|
||||
Special opcode 60
|
||||
DW_LNS_set_column 21
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 2
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 21
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 159
|
||||
DW_LNS_set_column 14
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 4
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 3
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 12
|
||||
Special opcode 60
|
||||
DW_LNS_set_column 16
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 89
|
||||
DW_LNS_set_column 4
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 3
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 14
|
||||
Special opcode 60
|
||||
DW_LNS_set_column 2
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 75
|
||||
DW_LNS_set_column 1
|
||||
Special opcode 75
|
||||
DW_LNS_set_column 0
|
||||
DW_LNS_const_add_pc
|
||||
Special opcode 62
|
||||
DW_LNS_set_column 29
|
||||
DW_LNS_set_prologue_end
|
||||
Special opcode 131
|
||||
DW_LNS_set_column 15
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 158
|
||||
DW_LNS_set_column 9
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 75
|
||||
DW_LNS_set_column 2
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 9
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 187
|
||||
DW_LNS_set_column 2
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 0
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 105
|
||||
DW_LNS_set_column 4
|
||||
DW_LNS_set_prologue_end
|
||||
DW_LNS_const_add_pc
|
||||
Special opcode 90
|
||||
Special opcode 201
|
||||
DW_LNS_set_column 13
|
||||
Special opcode 201
|
||||
DW_LNS_set_column 15
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 21
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 25
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 19
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 13
|
||||
Special opcode 130
|
||||
DW_LNS_set_column 9
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 35
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 89
|
||||
DW_LNS_set_column 38
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 41
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 2
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 14
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 215
|
||||
DW_LNS_set_column 10
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 7
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 75
|
||||
DW_LNS_set_column 6
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 3
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 103
|
||||
DW_LNS_set_column 20
|
||||
Special opcode 188
|
||||
DW_LNS_set_column 15
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 11
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 75
|
||||
DW_LNS_set_column 19
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 130
|
||||
DW_LNS_set_column 37
|
||||
DW_LNS_const_add_pc
|
||||
Special opcode 32
|
||||
DW_LNS_set_column 40
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 7
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 6
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 3
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 131
|
||||
DW_LNS_set_column 60
|
||||
Special opcode 189
|
||||
DW_LNS_set_column 63
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 4
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 47
|
||||
DW_LNS_set_column 13
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 130
|
||||
DW_LNS_set_column 22
|
||||
Special opcode 130
|
||||
DW_LNS_set_column 31
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 40
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 49
|
||||
Special opcode 144
|
||||
DW_LNS_set_column 58
|
||||
Special opcode 130
|
||||
DW_LNS_set_column 61
|
||||
Special opcode 74
|
||||
DW_LNS_set_column 58
|
||||
Special opcode 88
|
||||
DW_LNS_set_column 2
|
||||
DW_LNS_negate_stmt
|
||||
Special opcode 73
|
||||
DW_LNS_const_add_pc
|
||||
Special opcode 90
|
||||
DW_LNS_set_column 1
|
||||
Special opcode 117
|
||||
DW_LNS_advance_pc 9
|
||||
DW_LNE_end_sequence
|
||||
|
||||
0x00001180 /app/float_ex1.c 15 0
|
||||
0x0000119c /app/float_ex1.c 16 7
|
||||
0x000011a1 /app/float_ex1.c 16 10
|
||||
0x000011a7 /app/float_ex1.c 16 14
|
||||
0x000011ac /app/float_ex1.c 16 6
|
||||
0x000011b2 /app/float_ex1.c 17 3
|
||||
0x000011bb /app/float_ex1.c 19 19
|
||||
0x000011c8 /app/float_ex1.c 19 3
|
||||
0x000011cc /app/float_ex1.c 19 7
|
||||
0x000011cf /app/float_ex1.c 20 14
|
||||
0x000011d2 /app/float_ex1.c 20 4
|
||||
0x000011d6 /app/float_ex1.c 20 3
|
||||
0x000011d9 /app/float_ex1.c 20 12
|
||||
0x000011db /app/float_ex1.c 21 12
|
||||
0x000011df /app/float_ex1.c 21 11
|
||||
0x000011e2 /app/float_ex1.c 21 18
|
||||
0x000011e6 /app/float_ex1.c 21 21
|
||||
0x000011ea /app/float_ex1.c 21 2
|
||||
0x000011f4 /app/float_ex1.c 22 21
|
||||
0x000011f9 /app/float_ex1.c 22 14
|
||||
0x000011fd /app/float_ex1.c 22 4
|
||||
0x00001201 /app/float_ex1.c 22 3
|
||||
0x00001204 /app/float_ex1.c 22 12
|
||||
0x00001209 /app/float_ex1.c 23 16
|
||||
0x0000120d /app/float_ex1.c 23 4
|
||||
0x00001211 /app/float_ex1.c 23 3
|
||||
0x00001214 /app/float_ex1.c 23 14
|
||||
0x00001218 /app/float_ex1.c 24 2
|
||||
0x0000121c /app/float_ex1.c 25 1
|
||||
0x00001230 /app/float_ex1.c 27 0
|
||||
0x00001238 /app/float_ex1.c 28 29
|
||||
0x00001242 /app/float_ex1.c 28 15
|
||||
0x00001246 /app/float_ex1.c 29 9
|
||||
0x0000124a /app/float_ex1.c 29 2
|
||||
0x00001256 /app/float_ex1.c 30 9
|
||||
0x0000125a /app/float_ex1.c 30 2
|
||||
0x00001260 /app/float_ex1.c 33 0
|
||||
0x00001276 /app/float_ex1.c 35 4
|
||||
0x00001283 /app/float_ex1.c 36 4
|
||||
0x00001290 /app/float_ex1.c 37 13
|
||||
0x00001295 /app/float_ex1.c 37 15
|
||||
0x0000129a /app/float_ex1.c 37 21
|
||||
0x0000129f /app/float_ex1.c 37 25
|
||||
0x000012a4 /app/float_ex1.c 37 19
|
||||
0x000012ac /app/float_ex1.c 37 13
|
||||
0x000012b0 /app/float_ex1.c 37 9
|
||||
0x000012b5 /app/float_ex1.c 38 35
|
||||
0x000012be /app/float_ex1.c 38 38
|
||||
0x000012c7 /app/float_ex1.c 38 41
|
||||
0x000012cc /app/float_ex1.c 38 2
|
||||
0x000012da /app/float_ex1.c 39 14
|
||||
0x000012df /app/float_ex1.c 39 10
|
||||
0x000012e3 /app/float_ex1.c 40 7
|
||||
0x000012e8 /app/float_ex1.c 40 6
|
||||
0x000012ee /app/float_ex1.c 41 3
|
||||
0x000012fa /app/float_ex1.c 43 20
|
||||
0x000012ff /app/float_ex1.c 43 15
|
||||
0x00001303 /app/float_ex1.c 44 11
|
||||
0x0000130b /app/float_ex1.c 44 19
|
||||
0x0000131d /app/float_ex1.c 44 37
|
||||
0x00001322 /app/float_ex1.c 44 40
|
||||
0x00001326 /app/float_ex1.c 44 7
|
||||
0x0000132f /app/float_ex1.c 44 6
|
||||
0x00001337 /app/float_ex1.c 45 3
|
||||
0x00001343 /app/float_ex1.c 48 60
|
||||
0x00001347 /app/float_ex1.c 48 63
|
||||
0x00001349 /app/float_ex1.c 49 4
|
||||
0x00001351 /app/float_ex1.c 49 13
|
||||
0x00001359 /app/float_ex1.c 49 22
|
||||
0x00001362 /app/float_ex1.c 49 31
|
||||
0x0000136b /app/float_ex1.c 49 40
|
||||
0x00001374 /app/float_ex1.c 49 49
|
||||
0x0000137c /app/float_ex1.c 49 58
|
||||
0x00001380 /app/float_ex1.c 49 61
|
||||
0x00001385 /app/float_ex1.c 49 58
|
||||
0x00001389 /app/float_ex1.c 48 2
|
||||
0x0000139f /app/float_ex1.c 50 2
|
||||
0x000013a6 /app/float_ex1.c 51 1
|
||||
0x000013af - 0 0
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@@ -94,7 +94,7 @@ bool test_dwarf3_c_basic(void) { // this should work for dwarf2 aswell
|
||||
// mode = 0, calls
|
||||
// static void dump_r_bin_dwarf_debug_abbrev(FILE *f, RzBinDwarfDebugAbbrev *da)
|
||||
// which prints out all the abbreviation
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
mu_assert_eq(rz_bin_dwarf_abbrev_count(da), 7, "Incorrect number of abbreviation");
|
||||
|
||||
RzBinDwarfAbbrevTable *tbl = ht_up_find(da->tbl_by_offset, 0x0, NULL);
|
||||
@@ -123,7 +123,7 @@ bool test_dwarf3_c_basic(void) { // this should work for dwarf2 aswell
|
||||
TEST_ABBREV_ATTR(4, DW_AT_type, DW_FORM_ref4);
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 1, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
@@ -170,7 +170,7 @@ bool test_dwarf3_cpp_basic(void) { // this should work for dwarf2 aswell
|
||||
// mode = 0, calls
|
||||
// static void dump_r_bin_dwarf_debug_abbrev(FILE *f, RzBinDwarfDebugAbbrev *da)
|
||||
// which prints out all the abbreviation
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
mu_assert("Incorrect number of abbreviation", rz_bin_dwarf_abbrev_count(da) == 32);
|
||||
|
||||
RzBinDwarfAbbrevTable *tbl = ht_up_find(da->tbl_by_offset, 0x0, NULL);
|
||||
@@ -209,7 +209,7 @@ bool test_dwarf3_cpp_basic(void) { // this should work for dwarf2 aswell
|
||||
// rz_bin_dwarf_parse_aranges (core->bin, MODE); Information not stored anywhere, not testable now?
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 1, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
@@ -298,7 +298,7 @@ bool test_dwarf3_cpp_many_comp_units(void) {
|
||||
// mode = 0, calls
|
||||
// static void dump_r_bin_dwarf_debug_abbrev(FILE *f, RzBinDwarfDebugAbbrev *da)
|
||||
// which prints out all the abbreviation
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
mu_assert_eq(rz_bin_dwarf_abbrev_count(da), 58, "Incorrect number of abbreviation");
|
||||
|
||||
RzBinDwarfAbbrevTable *tbl = ht_up_find(da->tbl_by_offset, 0x0, NULL);
|
||||
@@ -325,7 +325,7 @@ bool test_dwarf3_cpp_many_comp_units(void) {
|
||||
TEST_ABBREV_ATTR(6, DW_AT_sibling, DW_FORM_ref4);
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 2, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
@@ -438,12 +438,12 @@ bool test_dwarf_cpp_empty_line_info(void) { // this should work for dwarf2 aswel
|
||||
// mode = 0, calls
|
||||
// static void dump_r_bin_dwarf_debug_abbrev(FILE *f, RzBinDwarfDebugAbbrev *da)
|
||||
// which prints out all the abbreviation
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
// not ignoring null entries -> 755 abbrevs
|
||||
mu_assert_eq(rz_bin_dwarf_abbrev_count(da), 731, "Incorrect number of abbreviation");
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 25, "line units count");
|
||||
RzBinDwarfLineUnit *lunit = rz_list_tail(li->units)->data;
|
||||
@@ -547,7 +547,7 @@ bool test_dwarf2_cpp_many_comp_units(void) {
|
||||
// mode = 0, calls
|
||||
// static void dump_r_bin_dwarf_debug_abbrev(FILE *f, RzBinDwarfDebugAbbrev *da)
|
||||
// which prints out all the abbreviation
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
mu_assert_eq(rz_bin_dwarf_abbrev_count(da), 58, "Incorrect number of abbreviation");
|
||||
|
||||
RzBinDwarfAbbrevTable *tbl = ht_up_find(da->tbl_by_offset, 0x0, NULL);
|
||||
@@ -571,7 +571,7 @@ bool test_dwarf2_cpp_many_comp_units(void) {
|
||||
TEST_ABBREV_ATTR(3, DW_AT_location, DW_FORM_block1);
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 2, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
@@ -663,7 +663,7 @@ bool test_dwarf4_cpp_many_comp_units(void) {
|
||||
// TODO add abbrev checks
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(
|
||||
bin->cur, NULL);
|
||||
bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 2, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
@@ -765,7 +765,7 @@ bool test_dwarf4_multidir_comp_units(void) {
|
||||
RzBinDWARF *dw = rz_bin_dwarf_from_file(bf);
|
||||
mu_assert_notnull(dw, "DWARF");
|
||||
|
||||
RzBinDwarfAbbrev *da = rz_bin_dwarf_abbrev_from_file(bin->cur);
|
||||
RzBinDwarfAbbrev *da = rz_bin_dwarf_abbrev_from_file(bin->cur, false);
|
||||
mu_assert_notnull(da, "abbrevs");
|
||||
mu_assert_eq(rz_bin_dwarf_abbrev_count(da), 8, "abbrevs count");
|
||||
|
||||
@@ -807,7 +807,7 @@ bool test_big_endian_dwarf2(void) {
|
||||
RzBinFile *bf = rz_bin_open(bin, "bins/elf/ppc64_sudoku_dwarf", &opt);
|
||||
mu_assert_notnull(bf, "couldn't open file");
|
||||
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(bin->cur, NULL);
|
||||
RzBinDwarfLine *li = rz_bin_dwarf_line_from_file(bin->cur, NULL, false);
|
||||
mu_assert_notnull(li, "line info");
|
||||
mu_assert_eq(rz_list_length(li->units), 1, "line units count");
|
||||
mu_assert_notnull(li->lines, "line info");
|
||||
|
||||
Reference in New Issue
Block a user