Commit Graph

11 Commits

Author SHA1 Message Date
Jens Georg
1944fc84ee gobject_gdb.py: Do not break bt on optimized build
Symptom:
20 0x00007ffff756337b in gtk_widget_size_allocate_with_baseline (widget=0xd7a0c0 [DirectWindow], allocation=, baseline=) at
gdb.error: value has been optimized out
2023-12-12 17:30:01 +00:00
Nelson Benítez León
c301542f81 gobject_gdb.py: adapt to recent gsignal changes
Add to script the new functions added in
commit 2368187e and commit e5ee6e14 which are:

signal_emitv_unlocked()
signal_emit_valist_unlocked()

so that the "<emit signal 'blabla'>" line keeps
showing after them.
2023-06-02 14:42:45 +01:00
Nelson Benítez León
f09805fd97 gobject_gdb.py: small style change to signal name
This is a minor style change to better differentiate
signal name by enclosing it in single quotes.

Before:
<emit signal event on instance 0xf14e60 [GdkWaylandToplevel]>

After:
<emit signal 'event' on instance 0xf14e60 [GdkWaylandToplevel]>
2023-05-20 02:30:07 +01:00
Nelson Benítez León
3e9db78656 gobject_gdb.py: support gsignal fastpath and detect more marshallers
- Commit f02ec2f2de added a gsignal fastpath where g_closure_invoke_va()
is directly called from g_signal_emit_valist() skipping signal_emit_unlocked_R()
altogether which it's the function used by gobject_gdb.py to detect
signal emission.

So we update gobject_gdb.py to also detect signals which use this
g_closure_invoke_va() fastpath.

- We also update the existent code to detect marshallers to also
include these:

surface_event_marshaller()
gdk_surface_event_marshallerv()
g_type_class_meta_marshal()
g_type_class_meta_marshalv()

This allow us that for signal emissions which use those marshallers
to keep showing the signal handler frame just after the
<emit signal blabla> line.
2023-05-20 02:30:00 +01:00
Nelson Benítez León
1a19095a36 gobject_gdb.py: fix regression caused by bfbe7127d5
commit bfbe7127d5 which did a code refactor in
gobject_gdb.py introduced a bug by failing to
return the signal name when a signal had no
'detail', this was preventing pretty printing
name for signals with no 'detail'.
2023-05-15 18:04:37 +01:00
Philip Withnall
d270b6c3db py: Various flake8 cleanups
None of these are particularly significant, but they do get the CI
output clean.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
905b22a17e py: Reformat all Python files consistently
This commit is the unmodified results of running
```
black $(git ls-files '*.py')
```
with black version 19.10b0. See #2046.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Thomas Hindoe Paaboel Andersen
a8b416f9fe python: avoid equality check for None
PEP8 says that:
"Comparisons to singletons like None should always be done with is or
is not, never the equality operators."

glib uses a mix of "== None" and "is None". This patch changes all
cases to the latter.
2018-07-12 23:48:41 +02:00
Michael Olbrich
d2c49106a4 gobject_gdb.py: add pretty printer for GType and GTypeClass*
This is useful for printing GValues and the content of GObjects (not the
pointer).

https://bugzilla.gnome.org/show_bug.cgi?id=794895
2018-04-11 14:31:53 +01:00
Michael Olbrich
abe329343f gobject_gdb.py: 'address' is a property of gdb.Value not a function
'address' started out as a function, but it was changed to a property
before the gdb Python support was release with gdb 7.0.

https://bugzilla.gnome.org/show_bug.cgi?id=794194
2018-03-13 11:28:06 +00:00
Tom Tromey
b7145a1d72 Rename gdb macros with _gdb suffix to avoid ns clashes
glib installs a gdb helper file named `glib.py`.
Then the "hook" file updates `sys.path` and does `import glib`.

This will fail if glib has already been imported into gdb, say
using `from gi.repository import GLib`.  This is due to a namespace clash.

One fix would be to rename the gdb helper files to not clash with
other Python modules.  This should be done for all such helper files.

https://bugzilla.gnome.org/show_bug.cgi?id=760186
2016-05-23 10:52:10 -04:00