From bec7fe8b2840838fe3a2620b8af29264d8b54e60 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Thu, 30 Apr 2015 23:10:48 +0000 Subject: Fixed implicit declarations of functions causing crashes. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@523 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 21 ++++++++++ plugins/mobicore/mclf.c | 1 + src/analysis/db/cdb.c | 1 + src/format/dex/dex.c | 2 +- src/format/elf/helper_arm.c | 13 +++++- src/format/elf/symbols.h | 6 +++ src/gtkext/gtkblockview.c | 2 +- src/gtkext/gtkbufferview-int.h | 7 ---- src/gtkext/gtkbufferview.c | 89 ++---------------------------------------- src/gtkext/gtkbufferview.h | 8 ---- src/gtkext/gtkgraphview.c | 2 +- src/gtkext/gtkviewpanel-int.h | 14 +++++++ src/gtkext/gtkviewpanel.c | 79 +++++++++++++++++++++++++++++++++++++ 13 files changed, 141 insertions(+), 104 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89e6c08..b10dc29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +15-05-01 Cyrille Bagard + + * plugins/mobicore/mclf.c: + * src/analysis/db/cdb.c: + * src/format/dex/dex.c: + * src/format/elf/helper_arm.c: + Fix implicit declarations of functions causing crashes. + + * src/format/elf/symbols.h: + Declare some Elf symbols related functions as public. + + * src/gtkext/gtkblockview.c: + * src/gtkext/gtkbufferview.c: + * src/gtkext/gtkbufferview.h: + * src/gtkext/gtkbufferview-int.h: + * src/gtkext/gtkgraphview.c: + * src/gtkext/gtkviewpanel.c: + * src/gtkext/gtkviewpanel-int.h: + Fix implicit declarations of functions causing crashes. Move some code + dealing with scrolling adjustments. + 15-04-30 Cyrille Bagard * src/arch/arm/v7/opcodes/opcodes_tmp_thumb_16.h: diff --git a/plugins/mobicore/mclf.c b/plugins/mobicore/mclf.c index 3fc9e21..c456c04 100644 --- a/plugins/mobicore/mclf.c +++ b/plugins/mobicore/mclf.c @@ -29,6 +29,7 @@ #include "annotations.h" #include "mclf-int.h" +#include "symbols.h" diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c index d56c1fa..b96e0fe 100644 --- a/src/analysis/db/cdb.c +++ b/src/analysis/db/cdb.c @@ -50,6 +50,7 @@ #include "../../common/io.h" #include "../../common/xdg.h" #include "../../common/xml.h" +#include "../../core/collections.h" diff --git a/src/format/dex/dex.c b/src/format/dex/dex.c index 476e6f5..eb78f79 100755 --- a/src/format/dex/dex.c +++ b/src/format/dex/dex.c @@ -28,7 +28,7 @@ #include "dex-int.h" -#include "../format-int.h" +#include "pool.h" diff --git a/src/format/elf/helper_arm.c b/src/format/elf/helper_arm.c index 7282d23..e44222f 100644 --- a/src/format/elf/helper_arm.c +++ b/src/format/elf/helper_arm.c @@ -21,15 +21,26 @@ */ -#include "helper_x86.h" +#include "helper_arm.h" #include "elf-int.h" +#include "symbols.h" +#include "../mangling/demangler.h" + + + +/* symbols.c : Récupère la désignation d'un symbole donné. */ +//extern const char *get_elf_symbol_name(GElfFormat *, const elf_shdr *, const elf_shdr *, off_t); + + + + diff --git a/src/format/elf/symbols.h b/src/format/elf/symbols.h index a413395..634158d 100644 --- a/src/format/elf/symbols.h +++ b/src/format/elf/symbols.h @@ -31,6 +31,12 @@ /* Charge en mémoire la liste humaine des symboles. */ bool load_elf_symbols(GElfFormat *); +/* Récupère la définition complète d'un symbole donné. */ +bool get_elf_symbol_by_index(GElfFormat *, const elf_shdr *, off_t, elf_sym *); + +/* Récupère la désignation d'un symbole donné. */ +const char *get_elf_symbol_name(GElfFormat *, const elf_shdr *, const elf_shdr *, off_t); + #endif /* _FORMAT_ELF_SYMBOLS_H */ diff --git a/src/gtkext/gtkblockview.c b/src/gtkext/gtkblockview.c index 2b72ff4..5d14db2 100644 --- a/src/gtkext/gtkblockview.c +++ b/src/gtkext/gtkblockview.c @@ -225,7 +225,7 @@ static gboolean gtk_block_view_button_press_event(GtkBlockView *view, GdkEventBu real_x = event->x; real_y = event->y; - gtk_buffer_view_compute_real_coord(bview, &real_x, &real_y); + gtk_view_panel_compute_real_coord(GTK_VIEW_PANEL(bview), &real_x, &real_y); g_buffer_view_highlight_segments(gtk_buffer_view_get_buffer(bview), real_x, real_y, NULL); diff --git a/src/gtkext/gtkbufferview-int.h b/src/gtkext/gtkbufferview-int.h index 105d32b..944ddc7 100644 --- a/src/gtkext/gtkbufferview-int.h +++ b/src/gtkext/gtkbufferview-int.h @@ -70,12 +70,5 @@ struct _GtkBufferViewClass }; -/* Transcrit les coordonnées à l'écran en coordonnées absolues. */ -void gtk_buffer_view_compute_fake_coord(GtkBufferView *, gint *, gint *); - -/* Transcrit les coordonnées absolues en coordonnées à l'écran. */ -void gtk_buffer_view_compute_real_coord(GtkBufferView *, gint *, gint *); - - #endif /* _GTK_BUFFERVIEW_INT_H */ diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c index f54ecff..86a738a 100644 --- a/src/gtkext/gtkbufferview.c +++ b/src/gtkext/gtkbufferview.c @@ -287,7 +287,7 @@ static gboolean gtk_buffer_view_button_press(GtkWidget *widget, GdkEventButton * real_x = event->x; real_y = event->y; - gtk_buffer_view_compute_real_coord(view, &real_x, &real_y); + gtk_view_panel_compute_real_coord(GTK_VIEW_PANEL(view), &real_x, &real_y); printf(" !mouse! :: (%g ; %g) -> (%d ; %d)\n", event->x, event->y, @@ -313,54 +313,6 @@ static gboolean gtk_buffer_view_button_press(GtkWidget *widget, GdkEventButton * /****************************************************************************** * * -* Paramètres : view = composant GTK à consulter. * -* event = informations liées à l'événement. * -* * -* Description : Transcrit les coordonnées à l'écran en coordonnées absolues. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void gtk_buffer_view_compute_fake_coord(GtkBufferView *view, gint *x, gint *y) -{ - if (GTK_VIEW_PANEL(view)->hadjustment != NULL) - *x -= gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->hadjustment); - - if (GTK_VIEW_PANEL(view)->vadjustment != NULL) - *y += gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->vadjustment); - -} - - -/****************************************************************************** -* * -* Paramètres : view = composant GTK à consulter. * -* event = informations liées à l'événement. * -* * -* Description : Transcrit les coordonnées absolues en coordonnées à l'écran. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void gtk_buffer_view_compute_real_coord(GtkBufferView *view, gint *x, gint *y) -{ - if (x != NULL && GTK_VIEW_PANEL(view)->hadjustment != NULL) - *x += gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->hadjustment); - - if (y != NULL && GTK_VIEW_PANEL(view)->vadjustment != NULL) - *y += gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->vadjustment); - -} - - -/****************************************************************************** -* * * Paramètres : widget = composant GTK à redessiner. * * cr = contexte graphique associé à l'événement. * * * @@ -420,7 +372,7 @@ static gboolean gtk_buffer_view_draw(GtkWidget *widget, cairo_t *cr) { fake_x = 0; fake_y = 0; - gtk_buffer_view_compute_fake_coord(view, &fake_x, &fake_y); + gtk_view_panel_compute_fake_coord(GTK_VIEW_PANEL(view), &fake_x, &fake_y); g_generic_config_get_value(get_main_configuration(), MPK_SELECTION_LINE, &sel_line); sel_line &= gtk_widget_has_focus(widget); @@ -806,39 +758,6 @@ GBufferView *gtk_buffer_view_get_buffer(const GtkBufferView *view) - - -/* ---------------------------------------------------------------------------------- */ -/* CONVERSIONS DE COORDONNEES */ -/* ---------------------------------------------------------------------------------- */ - - -/****************************************************************************** -* * -* Paramètres : view = composant GTK à consulter. * -* x = abscisse à ajuster. [OUT] * -* x = ordonnée à ajuster. [OUT] * -* * -* Description : Transcrit les coordonnées absolues en coordonnées à l'écran. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void gtk_buffer_view_compute_relative_coords(GtkBufferView *view, gint *x, gint *y) -{ - if (x != NULL && GTK_VIEW_PANEL(view)->hadjustment != NULL) - *x -= gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->hadjustment); - - if (y != NULL && GTK_VIEW_PANEL(view)->vadjustment != NULL) - *y -= gtk_adjustment_get_value(GTK_VIEW_PANEL(view)->vadjustment); - -} - - - /* ---------------------------------------------------------------------------------- */ /* ANIMATION DU CURSEUR */ /* ---------------------------------------------------------------------------------- */ @@ -963,7 +882,7 @@ static void gtk_buffer_view_relocate_caret(GtkBufferView *view, const GdkRectang else if (clear_old) { - gtk_buffer_view_compute_relative_coords(view, &old_area.x, &old_area.y); + gtk_view_panel_compute_relative_coords(GTK_VIEW_PANEL(view), &old_area.x, &old_area.y); gtk_widget_queue_draw_area(GTK_WIDGET(view), old_area.x, old_area.y, old_area.width, old_area.height); @@ -1063,7 +982,7 @@ static gboolean gtk_buffer_view_refresh_caret(GtkBufferView *view) } area = view->caret; - gtk_buffer_view_compute_relative_coords(view, &area.x, &area.y); + gtk_view_panel_compute_relative_coords(GTK_VIEW_PANEL(view), &area.x, &area.y); /* Réinitialisation de la surface */ if (view->show_caret) diff --git a/src/gtkext/gtkbufferview.h b/src/gtkext/gtkbufferview.h index ed26fd5..6b5cf30 100644 --- a/src/gtkext/gtkbufferview.h +++ b/src/gtkext/gtkbufferview.h @@ -59,14 +59,6 @@ GBufferView *gtk_buffer_view_get_buffer(const GtkBufferView *); -/* --------------------------- CONVERSIONS DE COORDONNEES --------------------------- */ - - -/* Transcrit les coordonnées absolues en coordonnées à l'écran. */ -void gtk_buffer_view_compute_relative_coords(GtkBufferView *, gint *, gint *); - - - /* ------------------------------ ANIMATION DU CURSEUR ------------------------------ */ diff --git a/src/gtkext/gtkgraphview.c b/src/gtkext/gtkgraphview.c index 46a82eb..3c117d9 100644 --- a/src/gtkext/gtkgraphview.c +++ b/src/gtkext/gtkgraphview.c @@ -240,7 +240,7 @@ static void gtk_graph_view_adjust_scroll_value(GtkGraphView *view, GtkAdjustment fake_x = 0; fake_y = 0; - gtk_buffer_view_compute_fake_coord(view, &fake_x, &fake_y); + gtk_view_panel_compute_fake_coord(GTK_VIEW_PANEL(view), &fake_x, &fake_y); gtk_fixed_move(GTK_FIXED(view), GTK_WIDGET(view->support), fake_x, -fake_y); diff --git a/src/gtkext/gtkviewpanel-int.h b/src/gtkext/gtkviewpanel-int.h index 10ae933..e51dbac 100644 --- a/src/gtkext/gtkviewpanel-int.h +++ b/src/gtkext/gtkviewpanel-int.h @@ -112,4 +112,18 @@ typedef enum _ViewPanelProps +/* --------------------------- CONVERSIONS DE COORDONNEES --------------------------- */ + + +/* Transcrit les coordonnées à l'écran en coordonnées absolues. */ +void gtk_view_panel_compute_fake_coord(GtkViewPanel *, gint *, gint *); + +/* Transcrit les coordonnées absolues en coordonnées à l'écran. */ +void gtk_view_panel_compute_real_coord(GtkViewPanel *, gint *, gint *); + +/* Transcrit les coordonnées absolues en coordonnées à l'écran. */ +void gtk_view_panel_compute_relative_coords(GtkViewPanel *, gint *, gint *); + + + #endif /* _GTK_VIEWPANEL_INT_H */ diff --git a/src/gtkext/gtkviewpanel.c b/src/gtkext/gtkviewpanel.c index 574bf22..03f6daa 100644 --- a/src/gtkext/gtkviewpanel.c +++ b/src/gtkext/gtkviewpanel.c @@ -961,3 +961,82 @@ void gtk_view_panel_cache_glance(GtkViewPanel *panel, cairo_t *cairo, const GtkA GTK_VIEW_PANEL_GET_CLASS(panel)->cache_glance(panel, cairo, area, scale); } + + + +/* ---------------------------------------------------------------------------------- */ +/* CONVERSIONS DE COORDONNEES */ +/* ---------------------------------------------------------------------------------- */ + + +/****************************************************************************** +* * +* Paramètres : panel = composant GTK à consulter. * +* event = informations liées à l'événement. * +* * +* Description : Transcrit les coordonnées à l'écran en coordonnées absolues. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_view_panel_compute_fake_coord(GtkViewPanel *panel, gint *x, gint *y) +{ + if (panel->hadjustment != NULL) + *x -= gtk_adjustment_get_value(panel->hadjustment); + + if (panel->vadjustment != NULL) + *y += gtk_adjustment_get_value(panel->vadjustment); + +} + + +/****************************************************************************** +* * +* Paramètres : panel = composant GTK à consulter. * +* event = informations liées à l'événement. * +* * +* Description : Transcrit les coordonnées absolues en coordonnées à l'écran. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_view_panel_compute_real_coord(GtkViewPanel *panel, gint *x, gint *y) +{ + if (x != NULL && panel->hadjustment != NULL) + *x += gtk_adjustment_get_value(panel->hadjustment); + + if (y != NULL && panel->vadjustment != NULL) + *y += gtk_adjustment_get_value(panel->vadjustment); + +} + + +/****************************************************************************** +* * +* Paramètres : panel = composant GTK à consulter. * +* x = abscisse à ajuster. [OUT] * +* x = ordonnée à ajuster. [OUT] * +* * +* Description : Transcrit les coordonnées absolues en coordonnées à l'écran. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void gtk_view_panel_compute_relative_coords(GtkViewPanel *panel, gint *x, gint *y) +{ + if (x != NULL && panel->hadjustment != NULL) + *x -= gtk_adjustment_get_value(panel->hadjustment); + + if (y != NULL && panel->vadjustment != NULL) + *y -= gtk_adjustment_get_value(panel->vadjustment); + +} -- cgit v0.11.2-87-g4458