[gobject-introspection] gi-dump-types: New uninstalled debugging program
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] gi-dump-types: New uninstalled debugging program
- Date: Sat, 3 Sep 2011 16:35:49 +0000 (UTC)
commit 246efe09f5787bcf5dfd82bd19727526196b4766
Author: Colin Walters <walters verbum org>
Date: Sat Sep 3 12:34:29 2011 -0400
gi-dump-types: New uninstalled debugging program
Usage: ./_build/gi-dump-types g_object_get_type
Makefile-girepository.am | 6 ++++++
girepository/gdump.c | 2 ++
girepository/gi-dump-types.c | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/Makefile-girepository.am b/Makefile-girepository.am
index 736efc5..3279cf7 100644
--- a/Makefile-girepository.am
+++ b/Makefile-girepository.am
@@ -77,6 +77,12 @@ libgirepository_1_0_la_LDFLAGS = -no-undefined -version-number 1:0:0 -export-sym
gdumpdir = $(datadir)/gobject-introspection-1.0/
gdump_DATA = girepository/gdump.c
+noinst_PROGRAMS += gi-dump-types
+
+gi_dump_types_SOURCES = girepository/gdump.c girepository/gi-dump-types.c
+gi_dump_types_CFLAGS = $(GIO_UNIX_CFLAGS)
+gi_dump_types_LDADD = $(GIO_UNIX_LIBS)
+
GTESTER_PROGS += gthash-test
gthash_test_SOURCES = girepository/gthash.c girepository/gthash-test.c
diff --git a/girepository/gdump.c b/girepository/gdump.c
index aab067b..c237a81 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -431,6 +431,8 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out)
*/
#ifndef G_IREPOSITORY_COMPILATION
static gboolean
+dump_irepository (const char *arg, GError **error) G_GNUC_UNUSED;
+static gboolean
dump_irepository (const char *arg, GError **error)
#else
gboolean
diff --git a/girepository/gi-dump-types.c b/girepository/gi-dump-types.c
new file mode 100644
index 0000000..eacf8a0
--- /dev/null
+++ b/girepository/gi-dump-types.c
@@ -0,0 +1,34 @@
+#include "gdump.c"
+#include <gio/gunixoutputstream.h>
+
+int
+main (int argc,
+ char **argv)
+{
+ int i;
+ GOutputStream *stdout;
+ GModule *self;
+
+ g_type_init ();
+
+ stdout = g_unix_output_stream_new (1, FALSE);
+
+ self = g_module_open (NULL, 0);
+
+ for (i = 1; i < argc; i++)
+ {
+ GError *error = NULL;
+ GType type;
+
+ type = invoke_get_type (self, argv[i], &error);
+ if (!type)
+ {
+ g_printerr ("%s\n", error->message);
+ g_clear_error (&error);
+ }
+ else
+ dump_type (type, argv[i], stdout);
+ }
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]