diff options
Diffstat (limited to 'src/format/format-int.h')
-rw-r--r-- | src/format/format-int.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/format/format-int.h b/src/format/format-int.h index c8f2b1a..4ef9793 100644 --- a/src/format/format-int.h +++ b/src/format/format-int.h @@ -29,6 +29,7 @@ #include "preload.h" +#include "../glibext/objhole.h" #include "../gtkext/gtkstatusstack.h" #include "../mangling/demangler.h" @@ -56,6 +57,18 @@ typedef void (* format_complete_analysis_fc) (GBinFormat *, wgroup_id_t, GtkStat /* Rythme des allocations pour les entrées de code */ #define EXTRA_POINT_BLOCK 20 +/* Informations glissées dans la structure GObject de GBinFormat */ +typedef union _fmt_obj_extra +{ + struct + { + FormatFlag flags; /* Informations complémentaires*/ + + }; + + gint lock; /* Gestion d'accès aux fanions */ + +} fmt_obj_extra; /* Description d'une erreur */ typedef struct _fmt_error @@ -67,7 +80,6 @@ typedef struct _fmt_error } fmt_error; - /* Format binaire générique (instance) */ struct _GBinFormat { @@ -99,8 +111,39 @@ struct _GBinFormat gint error_locked; /* Statut d'accès à la liste */ #endif +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + + /** + * L'inclusion des informations suivantes dépend de l'architecture. + * + * Si la structure GObject possède un trou, on remplit de préférence + * ce dernier. + */ + + fmt_obj_extra extra; /* Externalisation embarquée */ + +#endif + }; +/** + * Accès aux informations éventuellement déportées. + */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + +# define INIT_BIN_FORMAT_EXTRA(fmt) fmt->extra.lock = 0 + +# define GET_BIN_FORMAT_EXTRA(fmt) &fmt->extra + +#else + +# define INIT_BIN_FORMAT_EXTRA(fmt) INIT_GOBJECT_EXTRA(G_OBJECT(fmt)) + +# define GET_BIN_FORMAT_EXTRA(fmt) GET_GOBJECT_EXTRA(G_OBJECT(fmt), fmt_obj_extra) + +#endif + /* Format binaire générique (classe) */ struct _GBinFormatClass { |