+
+ return 0;
+}
+
+static int object_dump_properties(GTypeModule *pkg, unsigned long idx)
+{
+ GParamSpec **props;
+ GObject *obj;
+ unsigned n;
+
+ obj = u_object_new_from_package(pkg, idx);
+ if (!obj) {
+ fprintf(stderr, "%s: failed to load object.\n", progname);
+ return -1;
+ }
+
+ props = g_object_class_list_properties(G_OBJECT_GET_CLASS(obj), &n);
+ for (unsigned i = 0; i < n; i++) {
+ GValue val = {0};
+ char *valstr;
+
+ printf(" property %s:", props[i]->name);
+ fflush(stdout);
+
+ g_value_init(&val, props[i]->value_type);
+ g_object_get_property(obj, props[i]->name, &val);
+
+ if (G_VALUE_HOLDS(&val, U_TYPE_OBJECT)) {
+ UObject *obj = g_value_get_object(&val);
+
+ if (obj && obj->pkg_name) {
+ printf(" %s", obj->pkg_name);
+ }
+ }
+
+ valstr = g_strdup_value_contents(&val);
+ printf(" %s\n", valstr);
+ g_free(valstr);
+ }
+
+ g_free(props);
+ g_object_unref(obj);
+
+ return 0;
+}
+
+static int object_dump_offsets(GTypeModule *pkg, unsigned long idx)
+{
+ struct upkg_file *f;
+
+ f = upkg_export_open(U_PKG(pkg)->pkg, idx);
+ if (!f) {
+ fprintf(stderr, "%s: failed to open export.\n", progname);
+ return -1;
+ }
+
+ printf(" file size: %lu\n", f->len);
+ printf(" file start: %#lx\n", f->base);
+ printf(" file end: %#lx\n", f->base + f->len);
+
+ upkg_export_close(f);
+
+ return 0;