I like writing code in Vala recently. I'm currently writing a little parser for Pidgin logs. However, when I try running it under gdb, I often get python tracebacks within my gdb backtrace that of the type TypeError: 'gdb.Value' object is not callable.
#4 0x08052d20 in pidgin_html_log_parser_parse (self=Traceback (most recent call last): File "/usr/share/glib-2.0/gdb/gobject.py", line 72, in to_string name = g_type_name_from_instance (self.val) File "/usr/share/glib-2.0/gdb/gobject.py", line 59, in g_type_name_from_instance name = g_type_to_name (gtype) File "/usr/share/glib-2.0/gdb/gobject.py", line 24, in g_type_to_name typenode = lookup_fundamental_type (typenode) File "/usr/share/glib-2.0/gdb/gobject.py", line 17, in lookup_fundamental_type return val[typenode >> 2].address() TypeError: 'gdb.Value' object is not callable , log_path=0x805deb8 "/home/user/file.html", protocol= 0x8057448 [Protocol], my_account=0x80574c0 [Account], their_account=0x8057230 [Account], error=0xbfffef98) at /home/user/files/mine/development/projects/myproject/PidginLog.c:3009
After thinking about it for a little while, I realised that the issue must be that my class is somehow not a GObject. I was failing to extend from GLib.Object!
So, the affected classes have now changed from:
class Foo { ... }to
class Foo : GLib.Object { ... }and all is well with the world once more.
I'm surprised that there were few other questions about this online. Perhaps everyone else is more mindful than I or fewer people use Vala than I thought.
Andre over here uses Vala a lot -- the likelihood that I'll pick it up increases as I see more people use it :P
ReplyDelete