From 184249f07fb32fb2449723f5f94ce221015231b7 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 11 Aug 2009 23:12:20 +0000 Subject: Improved the loading of several binaries. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@106 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 16 +++++++++++++++- src/analysis/binary.c | 8 ++++++++ src/format/elf/helper_x86.c | 4 ++-- src/gtkext/gtkdockitem.c | 19 +++++++++++++------ src/gtkext/gtkdockitem.h | 4 +++- src/gtkext/gtkdockpanel.c | 1 - src/project.c | 6 +++++- 7 files changed, 46 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0d6f73..6d9709f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +09-08-12 Cyrille Bagard + + * src/analysis/binary.c: + Make sure analysis threads are ended one by one. + + * src/format/elf/helper_x86.c: + Fix a bug when accessing the symbols list. + + * src/gtkext/gtkdockitem.c: + * src/gtkext/gtkdockitem.h: + * src/gtkext/gtkdockpanel.c: + * src/project.c: + Change the title of each displayed binary. + 09-08-09 Cyrille Bagard * plugins/stackvars/operand.c: @@ -75,7 +89,7 @@ * src/format/elf/symbols.c: * src/format/elf/symbols.h: - Update the code handling the ELF format. + New entries: update the code handling the ELF format. * src/format/executable.c: * src/format/executable.h: diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 38d3d19..c21b554 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -640,6 +640,14 @@ void ack_completed_disassembly(GDelayedManager *manager, GOpenidaBinary *binary, } + /* On réintègre le flot premier */ + + gdk_threads_enter(); + g_signal_emit_by_name(binary, "disassembly-done"); + gdk_flush (); + + gdk_threads_leave(); + } diff --git a/src/format/elf/helper_x86.c b/src/format/elf/helper_x86.c index 82be74c..c31882c 100644 --- a/src/format/elf/helper_x86.c +++ b/src/format/elf/helper_x86.c @@ -257,8 +257,6 @@ void translate_elf_relocations(GElfFormat *format, GArchInstruction **instructio { operand = g_arch_instruction_get_operand(instructions[i], 0); - g_imm_operand_to_vmpa_t(G_IMM_OPERAND(operand), &address); - if (g_imm_operand_to_vmpa_t(G_IMM_OPERAND(operand), &address)) { symbols = g_binary_format_get_symbols(G_BIN_FORMAT(format), &symbols_count); @@ -286,6 +284,8 @@ void translate_elf_relocations(GElfFormat *format, GArchInstruction **instructio symbol = g_binary_symbol_new(STP_FUNCTION, new_name, address); g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol); + break; + } } diff --git a/src/gtkext/gtkdockitem.c b/src/gtkext/gtkdockitem.c index c031c7f..fcef31d 100644 --- a/src/gtkext/gtkdockitem.c +++ b/src/gtkext/gtkdockitem.c @@ -143,7 +143,7 @@ const gchar *gtk_dock_item_get_name(GtkDockItem *ditem) /****************************************************************************** * * * Paramètres : ditem = composant GTK à modifier. * -* name = nouveau nom à prendre en compte. * +* desc = nouvelle description à prendre en compte. * * * * Description : Change la description du panneau dockable pour son titre. * * * @@ -153,12 +153,12 @@ const gchar *gtk_dock_item_get_name(GtkDockItem *ditem) * * ******************************************************************************/ -void gtk_dock_item_set_desc(GtkDockItem *ditem, const gchar *name) +void gtk_dock_item_set_desc(GtkDockItem *ditem, const gchar *desc) { - if (ditem->name != NULL) - g_free(ditem->name); + if (ditem->desc != NULL) + g_free(ditem->desc); - ditem->name = g_strdup(name); + ditem->desc = g_strdup(desc); } @@ -177,7 +177,14 @@ void gtk_dock_item_set_desc(GtkDockItem *ditem, const gchar *name) const gchar *gtk_dock_item_get_desc(GtkDockItem *ditem) { - return ditem->name; + const char *result; /* CHaîne à renvoyer */ + + result = ditem->desc; + + if (result == NULL) + result = gtk_dock_item_get_name(ditem); + + return result; } diff --git a/src/gtkext/gtkdockitem.h b/src/gtkext/gtkdockitem.h index 21ca360..906973c 100644 --- a/src/gtkext/gtkdockitem.h +++ b/src/gtkext/gtkdockitem.h @@ -47,7 +47,9 @@ struct _GtkDockItem { GtkObject object; /* Présence obligatoire en 1er */ - gchar *name; /* Nom court pour onglet */ + gchar *name; /* Nom court pour titre */ + gchar *desc; /* Nom long pour onglet */ + GtkWidget *panel; /* Pnneau construit associé */ }; diff --git a/src/gtkext/gtkdockpanel.c b/src/gtkext/gtkdockpanel.c index 41b71aa..536d21b 100644 --- a/src/gtkext/gtkdockpanel.c +++ b/src/gtkext/gtkdockpanel.c @@ -674,7 +674,6 @@ static gboolean gtk_dock_panel_update_title(GtkNotebook *notebook, GtkNotebookPa ditem = GTK_DOCK_ITEM(g_list_nth_data(GTK_DOCK_PANEL(data)->ditems, index)); desc = gtk_dock_item_get_desc(ditem); - if (desc == NULL) desc = gtk_dock_item_get_name(ditem); str = calloc(strlen("") + strlen(desc) + strlen("") + 1, sizeof(char)); diff --git a/src/project.c b/src/project.c index 6824444..fd9d7ea 100644 --- a/src/project.c +++ b/src/project.c @@ -691,6 +691,7 @@ void display_new_binary_of_openida_project(GOpenidaBinary *binary, openida_proje size_t index; /* Indice du nouveau binaire */ GtkDockPanel *dpanel; /* Support de panneaux */ GtkWidget *view; /* Affichage du code binaire */ + char *title; /* Titre associé au binaire */ GtkDockItem *ditem; /* Panneau avec ses infos. */ GtkBinView *binview; /* Affichage à faire défiler */ @@ -704,7 +705,10 @@ void display_new_binary_of_openida_project(GOpenidaBinary *binary, openida_proje view = get_loaded_binary_view(project->binaries[index], BVW_BLOCK); - ditem = gtk_dock_item_new(g_openida_binary_to_string(binary), view); + title = g_openida_binary_to_string(binary); + + ditem = gtk_dock_item_new(strrchr(title, '/') + 1, view); + gtk_dock_item_set_desc(ditem, title); gtk_dock_panel_add_item(dpanel, ditem); -- cgit v0.11.2-87-g4458