diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-11-18 18:46:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-11-18 18:46:08 (GMT) |
commit | 0f914ad3fdcc1ebac5789b55b9677e7868016e21 (patch) | |
tree | bafc46ac54d02ff35310c3433615e6b74010a920 /src/format | |
parent | 23bc425f9c35c31a80d65d824452c8728614a206 (diff) |
Allowed to attach debug information to formats.
Diffstat (limited to 'src/format')
-rw-r--r-- | src/format/executable-int.h | 2 | ||||
-rw-r--r-- | src/format/executable.c | 31 | ||||
-rw-r--r-- | src/format/format.c | 2 |
3 files changed, 29 insertions, 6 deletions
diff --git a/src/format/executable-int.h b/src/format/executable-int.h index 58eba25..2f3ea73 100644 --- a/src/format/executable-int.h +++ b/src/format/executable-int.h @@ -86,7 +86,7 @@ struct _GExeFormatClass void g_executable_format_setup_portions(GExeFormat *, GtkStatusStack *); /* Effectue les ultimes opérations de chargement d'un binaire. */ -bool g_executable_format_complete_loading(GExeFormat *, GtkStatusStack *); +bool g_executable_format_complete_loading(GExeFormat *, wgroup_id_t, GtkStatusStack *); /* Fournit l'emplacement correspondant à une position physique. */ bool g_exe_format_without_virt_translate_offset_into_vmpa(const GExeFormat *, phys_t, vmpa2t *); diff --git a/src/format/executable.c b/src/format/executable.c index e70840b..fcc0acd 100644 --- a/src/format/executable.c +++ b/src/format/executable.c @@ -33,6 +33,7 @@ #include "executable-int.h" #include "format.h" #include "../core/logs.h" +#include "../plugins/pglist.h" @@ -326,6 +327,7 @@ void g_executable_format_setup_portions(GExeFormat *format, GtkStatusStack *stat /****************************************************************************** * * * Paramètres : format = instance à traiter. * +* gid = groupe de travail dédié. * * status = barre de statut à tenir informée. * * * * Description : Effectue les ultimes opérations de chargement d'un binaire. * @@ -336,14 +338,37 @@ void g_executable_format_setup_portions(GExeFormat *format, GtkStatusStack *stat * * ******************************************************************************/ -bool g_executable_format_complete_loading(GExeFormat *format, GtkStatusStack *status) +bool g_executable_format_complete_loading(GExeFormat *format, wgroup_id_t gid, GtkStatusStack *status) { bool result; /* Bilan à faire remonter */ + size_t count; /* Qté d'infos supplémentaires */ + size_t i; /* Boucle de parcours */ + GDbgFormat *dbg; /* Informations de débogage */ GBinFormat *base; /* Version basique du format */ - base = G_BIN_FORMAT(format); + result = true; + + attach_debug_format(format); + + count = g_exe_format_count_debug_info(format); + + for (i = 0; i < count && result; i++) + { + dbg = g_exe_format_get_debug_info(format, i); + + result = g_binary_format_analyze(G_BIN_FORMAT(dbg), gid, status); + + g_object_unref(G_OBJECT(dbg)); - result = g_binary_format_complete_loading(base, status); + } + + if (result) + { + base = G_BIN_FORMAT(format); + + result = g_binary_format_complete_loading(base, status); + + } return result; diff --git a/src/format/format.c b/src/format/format.c index de57e4c..05e4597 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -203,8 +203,6 @@ static void g_binary_format_finalize(GBinFormat *format) bool g_binary_format_complete_loading(GBinFormat *format, GtkStatusStack *status) { - handle_binary_format(PGA_FORMAT_LOADER_LAST, format, status); - g_binary_format_delete_duplicated_symbols(format); return true; |