[gtk/wip/hadess/inspector-search-by-pointer] inspector: Search by pointer address
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/hadess/inspector-search-by-pointer] inspector: Search by pointer address
- Date: Fri, 4 Feb 2022 17:17:52 +0000 (UTC)
commit 95e9d85716b6d192c305a813ca6c95899c09b978
Author: Bastien Nocera <hadess hadess net>
Date: Fri Feb 4 18:16:50 2022 +0100
inspector: Search by pointer address
Useful to find a widget that corresponds to a pointer address in gdb.
gtk/inspector/object-tree.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index 18c08a4b80..6590957ff9 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -850,21 +850,26 @@ match_row (GtkTreeModel *model,
gpointer data)
{
GtkInspectorObjectTree *wt = data;
- gchar *type, *name, *label;
+ gpointer object;
+ gchar *type, *name, *label, *address;
const gchar *text;
gboolean match;
text = gtk_entry_get_text (GTK_ENTRY (wt->priv->search_entry));
gtk_tree_model_get (model, iter,
+ OBJECT, &object,
OBJECT_TYPE, &type,
OBJECT_NAME, &name,
OBJECT_LABEL, &label,
-1);
+ address = g_strdup_printf ("%p", object);
- match = (match_string (type, text) ||
+ match = (match_string (address, text) ||
+ match_string (type, text) ||
match_string (name, text) ||
match_string (label, text));
+ g_free (address);
g_free (type);
g_free (name);
g_free (label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]