Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Data Structure for Source Lines to replace SDB #880

Merged
merged 5 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions librz/bin/bfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@ RZ_IPI RzBinFile *rz_bin_file_new(RzBin *bin, const char *file, ut64 file_sz, in
bf->xtr_data = rz_list_newf((RzListFree)rz_bin_xtrdata_free);
bf->xtr_obj = NULL;
bf->sdb = sdb_new0();
bf->sdb_addrinfo = sdb_new0(); //ns (bf->sdb, "addrinfo", 1);
// bf->sdb_addrinfo->refs++;
}
return bf;
}
Expand Down Expand Up @@ -699,11 +697,6 @@ RZ_API void rz_bin_file_free(void /*RzBinFile*/ *_bf) {
if (bf->curxtr && bf->curxtr->destroy && bf->xtr_obj) {
bf->curxtr->free_xtr((void *)(bf->xtr_obj));
}
// TODO: unset related sdb namespaces
if (bf->sdb_addrinfo) {
sdb_free(bf->sdb_addrinfo);
bf->sdb_addrinfo = NULL;
}
free(bf->file);
rz_bin_object_free(bf->o);
rz_list_free(bf->xtr_data);
Expand Down
5 changes: 1 addition & 4 deletions librz/bin/bobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static void object_delete_items(RzBinObject *o) {
rz_list_free(o->classes);
ht_pp_free(o->classes_ht);
ht_pp_free(o->methods_ht);
rz_list_free(o->lines);
rz_bin_source_line_info_free(o->lines);
sdb_free(o->kv);
rz_list_free(o->mem);
for (i = 0; i < RZ_BIN_SYM_LAST; i++) {
Expand Down Expand Up @@ -179,7 +179,6 @@ RZ_IPI RzBinObject *rz_bin_object_new(RzBinFile *bf, RzBinPlugin *plugin, ut64 b
if (sdb) {
Sdb *bdb = bf->sdb; // sdb_new0 ();
sdb_ns_set(bdb, "info", o->kv);
sdb_ns_set(bdb, "addrinfo", bf->sdb_addrinfo);
o->kv = bdb;
// bf->sdb = o->kv;
// bf->sdb_info = o->kv;
Expand All @@ -192,8 +191,6 @@ RZ_IPI RzBinObject *rz_bin_object_new(RzBinFile *bf, RzBinPlugin *plugin, ut64 b
/* And if any namespace is referenced backwards it gets
* double-freed */
// bf->sdb_info = sdb_ns (bf->sdb, "info", 1);
// bf->sdb_addrinfo = sdb_ns (bf->sdb, "addrinfo", 1);
// bf->sdb_addrinfo->refs++;
sdb_ns_set(sdb, "cur", bdb); // bf->sdb);
const char *fdns = sdb_fmt("fd.%d", bf->fd);
sdb_ns_set(sdb, fdns, bdb); // bf->sdb);
Expand Down
Loading