Skip to content

Commit

Permalink
Drop support for running without GObject
Browse files Browse the repository at this point in the history
The footprint savings are so small it's not really worth the added
complexity and reduced code readability.
  • Loading branch information
oleavr committed Jan 8, 2025
1 parent f947acd commit 51f8f93
Show file tree
Hide file tree
Showing 84 changed files with 142 additions and 634 deletions.
4 changes: 0 additions & 4 deletions gum/arch-arm/gumarmbacktracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumarmbacktracer.h"

#include "guminterceptor.h"
Expand Down Expand Up @@ -211,5 +209,3 @@ gum_arm_backtracer_generate (GumBacktracer * backtracer,

return_addresses->len = i;
}

#endif
4 changes: 2 additions & 2 deletions gum/arch-arm/gumarmbacktracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_ARM_BACKTRACER (gum_arm_backtracer_get_type ())
GUM_DECLARE_FINAL_TYPE (GumArmBacktracer, gum_arm_backtracer, GUM,
ARM_BACKTRACER, GObject)
G_DECLARE_FINAL_TYPE (GumArmBacktracer, gum_arm_backtracer, GUM, ARM_BACKTRACER,
GObject)

GUM_API GumBacktracer * gum_arm_backtracer_new (void);

Expand Down
4 changes: 0 additions & 4 deletions gum/arch-arm64/gumarm64backtracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumarm64backtracer.h"

#include "guminterceptor.h"
Expand Down Expand Up @@ -221,5 +219,3 @@ gum_strip_item (gsize address)
return address;
#endif
}

#endif
4 changes: 2 additions & 2 deletions gum/arch-arm64/gumarm64backtracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_ARM64_BACKTRACER (gum_arm64_backtracer_get_type ())
GUM_DECLARE_FINAL_TYPE (GumArm64Backtracer, gum_arm64_backtracer, GUM,
ARM64_BACKTRACER, GObject)
G_DECLARE_FINAL_TYPE (GumArm64Backtracer, gum_arm64_backtracer, GUM,
ARM64_BACKTRACER, GObject)

GUM_API GumBacktracer * gum_arm64_backtracer_new (void);

Expand Down
4 changes: 2 additions & 2 deletions gum/arch-mips/gummipsbacktracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_MIPS_BACKTRACER (gum_mips_backtracer_get_type ())
GUM_DECLARE_FINAL_TYPE (GumMipsBacktracer, gum_mips_backtracer, GUM,
MIPS_BACKTRACER, GObject)
G_DECLARE_FINAL_TYPE (GumMipsBacktracer, gum_mips_backtracer, GUM,
MIPS_BACKTRACER, GObject)

GUM_API GumBacktracer * gum_mips_backtracer_new (void);

Expand Down
4 changes: 0 additions & 4 deletions gum/arch-x86/gumx86backtracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumx86backtracer.h"

#include "guminterceptor.h"
Expand Down Expand Up @@ -179,5 +177,3 @@ gum_x86_backtracer_generate (GumBacktracer * backtracer,

return_addresses->len = i;
}

#endif
4 changes: 2 additions & 2 deletions gum/arch-x86/gumx86backtracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_X86_BACKTRACER (gum_x86_backtracer_get_type ())
GUM_DECLARE_FINAL_TYPE (GumX86Backtracer, gum_x86_backtracer, GUM,
X86_BACKTRACER, GObject)
G_DECLARE_FINAL_TYPE (GumX86Backtracer, gum_x86_backtracer, GUM, X86_BACKTRACER,
GObject)

GUM_API GumBacktracer * gum_x86_backtracer_new (void);

Expand Down
4 changes: 0 additions & 4 deletions gum/backend-arm/gumstalker-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumstalker.h"

#include "gumarmreg.h"
Expand Down Expand Up @@ -6297,5 +6295,3 @@ gum_count_trailing_zeros (guint16 value)
return num_zeros;
#endif
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-arm64/gumstalker-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumstalker.h"

#include "gumarm64reader.h"
Expand Down Expand Up @@ -5995,5 +5993,3 @@ gum_is_bl_imm (guint32 insn)
{
return (insn & ~GUM_INT26_MASK) == 0x94000000;
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-darwin/gumdarwinbacktracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gum/gumdarwinbacktracer.h"

#include "guminterceptor.h"
Expand Down Expand Up @@ -205,5 +203,3 @@ gum_strip_item (gpointer address)
return address;
#endif
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-darwin/gumdarwinmapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gum/gumdarwinmapper.h"

#include "gum/gumdarwin.h"
Expand Down Expand Up @@ -2834,5 +2832,3 @@ gum_find_tlv_get_addr (const GumDarwinSectionDetails * details,

return FALSE;
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-darwin/gumdarwinmoduleresolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gum/gumdarwinmoduleresolver.h"

#include "gumdarwin-priv.h"
Expand Down Expand Up @@ -853,5 +851,3 @@ gum_darwin_module_compare_to_key (const GumAddress * key_ptr,

return 0;
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-darwin/gumdarwinsymbolicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gum/gumdarwinsymbolicator.h"

#include "gum-init.h"
Expand Down Expand Up @@ -816,5 +814,3 @@ gum_cs_unload_library (void)
dlclose (gum_cs);
gum_cs = NULL;
}

#endif
4 changes: 0 additions & 4 deletions gum/backend-darwin/gummodule-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ typedef struct _GumEnumerateSectionsContext GumEnumerateSectionsContext;

struct _GumNativeModule
{
#ifndef GUM_DIET
GObject parent;
#else
GumObject parent;
#endif

gchar * name;
gchar * path;
Expand Down
4 changes: 2 additions & 2 deletions gum/backend-darwin/gummodule-darwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_NATIVE_MODULE (gum_native_module_get_type ())
GUM_DECLARE_FINAL_TYPE (GumNativeModule, gum_native_module, GUM, NATIVE_MODULE,
GObject)
G_DECLARE_FINAL_TYPE (GumNativeModule, gum_native_module, GUM, NATIVE_MODULE,
GObject)

G_GNUC_INTERNAL GumNativeModule * _gum_native_module_make (const gchar * path,
const GumMemoryRange * range, GumDarwinModuleResolver * resolver);
Expand Down
4 changes: 0 additions & 4 deletions gum/backend-darwin/gumobjcapiresolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Licence: wxWindows Library Licence, Version 3.1
*/

#ifndef GUM_DIET

#include "gumobjcapiresolver.h"

#include "guminterceptor.h"
Expand Down Expand Up @@ -597,5 +595,3 @@ gum_objc_class_metadata_is_disposed (GumObjcClassMetadata * self)

return resolver->objc_lookUpClass (self->name) != self->handle;
}

#endif
4 changes: 2 additions & 2 deletions gum/backend-darwin/gumobjcapiresolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
G_BEGIN_DECLS

#define GUM_TYPE_OBJC_API_RESOLVER (gum_objc_api_resolver_get_type ())
GUM_DECLARE_FINAL_TYPE (GumObjcApiResolver, gum_objc_api_resolver, GUM,
OBJC_API_RESOLVER, GObject)
G_DECLARE_FINAL_TYPE (GumObjcApiResolver, gum_objc_api_resolver, GUM,
OBJC_API_RESOLVER, GObject)

GUM_API GumApiResolver * gum_objc_api_resolver_new (void);

Expand Down
12 changes: 4 additions & 8 deletions gum/backend-darwin/gumobjcdisposeclasspairmonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ G_BEGIN_DECLS

#define GUM_TYPE_OBJC_DISPOSE_CLASS_PAIR_MONITOR \
(gum_objc_dispose_class_pair_monitor_get_type ())
GUM_DECLARE_FINAL_TYPE (GumObjcDisposeClassPairMonitor,
gum_objc_dispose_class_pair_monitor,
GUM, OBJC_DISPOSE_CLASS_PAIR_MONITOR,
GObject)

#ifndef GUM_DIET
G_DECLARE_FINAL_TYPE (GumObjcDisposeClassPairMonitor,
gum_objc_dispose_class_pair_monitor,
GUM, OBJC_DISPOSE_CLASS_PAIR_MONITOR,
GObject)

struct _GumObjcDisposeClassPairMonitor
{
Expand All @@ -27,8 +25,6 @@ struct _GumObjcDisposeClassPairMonitor
GumInterceptor * interceptor;
};

#endif

G_GNUC_INTERNAL GumObjcDisposeClassPairMonitor *
gum_objc_dispose_class_pair_monitor_obtain (void);

Expand Down
2 changes: 1 addition & 1 deletion gum/backend-darwin/gumprocess-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ gum_process_get_libc_module (void)
static void
gum_deinit_libc_module (void)
{
gum_object_unref (gum_libc_module);
g_object_unref (gum_libc_module);
}

gboolean
Expand Down
Loading

0 comments on commit 51f8f93

Please sign in to comment.