<listitem><para>Show when an incoming D-Bus method call is received</para></listitem>
</varlistentry>
<varlistentry>
+ <term>return</term>
+ <listitem><para>Show when a reply is returned via the #GDBusMethodInvocation API</para></listitem>
+ </varlistentry>
+ <varlistentry>
<term>emission</term>
<listitem><para>Trace g_dbus_connection_emit_signal() API usage</para></listitem>
</varlistentry>
<listitem><para>Show information about D-Bus address lookups and autolaunching</para></listitem>
</varlistentry>
</variablelist>
- The special value <literal>all</literal> can be used to turn on
- all debug options.
+ The special value <literal>all</literal> can be used to turn
+ on all debug options. The special value
+ <literal>help</literal> can be used to print a list of
+ supported options to standard output.
</para>
</formalpara>
"GDBus-debug:Incoming:\n"
" <<<< METHOD INVOCATION %s.%s()\n"
" on object %s\n"
- " invoked by name %s\n",
+ " invoked by name %s\n"
+ " serial %d\n",
interface_name, member,
path,
- g_dbus_message_get_sender (message) != NULL ? g_dbus_message_get_sender (message) : "(none)");
+ g_dbus_message_get_sender (message) != NULL ? g_dbus_message_get_sender (message) : "(none)",
+ g_dbus_message_get_serial (message));
_g_dbus_debug_print_unlock ();
}
g_variant_type_free (type);
}
+ if (G_UNLIKELY (_g_dbus_debug_return ()))
+ {
+ _g_dbus_debug_print_lock ();
+ g_print ("========================================================================\n"
+ "GDBus-debug:Return:\n"
+ " >>>> METHOD RETURN\n"
+ " in response to %s.%s()\n"
+ " on object %s\n"
+ " to name %s\n"
+ " reply-serial %d\n",
+ invocation->interface_name, invocation->method_name,
+ invocation->object_path,
+ invocation->sender,
+ g_dbus_message_get_serial (invocation->message));
+ _g_dbus_debug_print_unlock ();
+ }
+
reply = g_dbus_message_new_method_reply (invocation->message);
g_dbus_message_set_body (reply, parameters);
error = NULL;
g_return_if_fail (error_name != NULL && g_dbus_is_name (error_name));
g_return_if_fail (error_message != NULL);
+ if (G_UNLIKELY (_g_dbus_debug_return ()))
+ {
+ _g_dbus_debug_print_lock ();
+ g_print ("========================================================================\n"
+ "GDBus-debug:Return:\n"
+ " >>>> METHOD ERROR %s\n"
+ " message `%s'\n"
+ " in response to %s.%s()\n"
+ " on object %s\n"
+ " to name %s\n"
+ " reply-serial %d\n",
+ error_name,
+ error_message,
+ invocation->interface_name, invocation->method_name,
+ invocation->object_path,
+ invocation->sender,
+ g_dbus_message_get_serial (invocation->message));
+ _g_dbus_debug_print_unlock ();
+ }
+
reply = g_dbus_message_new_method_error_literal (invocation->message,
error_name,
error_message);
#define G_DBUS_DEBUG_CALL (1<<3)
#define G_DBUS_DEBUG_SIGNAL (1<<4)
#define G_DBUS_DEBUG_INCOMING (1<<5)
-#define G_DBUS_DEBUG_EMISSION (1<<6)
-#define G_DBUS_DEBUG_ADDRESS (1<<7)
+#define G_DBUS_DEBUG_RETURN (1<<6)
+#define G_DBUS_DEBUG_EMISSION (1<<7)
+#define G_DBUS_DEBUG_ADDRESS (1<<8)
static gint _gdbus_debug_flags = 0;
}
gboolean
+_g_dbus_debug_return (void)
+{
+ _g_dbus_initialize ();
+ return (_gdbus_debug_flags & G_DBUS_DEBUG_RETURN) != 0;
+}
+
+gboolean
_g_dbus_debug_emission (void)
{
_g_dbus_initialize ();
{ "call", G_DBUS_DEBUG_CALL },
{ "signal", G_DBUS_DEBUG_SIGNAL },
{ "incoming", G_DBUS_DEBUG_INCOMING },
+ { "return", G_DBUS_DEBUG_RETURN },
{ "emission", G_DBUS_DEBUG_EMISSION },
{ "address", G_DBUS_DEBUG_ADDRESS }
};
gboolean _g_dbus_debug_call (void);
gboolean _g_dbus_debug_signal (void);
gboolean _g_dbus_debug_incoming (void);
+gboolean _g_dbus_debug_return (void);
gboolean _g_dbus_debug_emission (void);
gboolean _g_dbus_debug_address (void);