Re: [Vala] Debugging



Applied the patch to gdb 7.3.1 (Fedora 16)

------------------------------------------

[brian duffybr2 gdb-7.3.1]$ patch -p1 < gdb-vala-20101223.diff
patching file gdb/ChangeLog
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file gdb/ChangeLog.rej
patching file gdb/Makefile.in
Hunk #1 succeeded at 730 (offset 24 lines).
Hunk #2 succeeded at 880 (offset 32 lines).
patching file gdb/buildsym.c
Hunk #1 succeeded at 604 (offset 4 lines).
Hunk #2 succeeded at 622 (offset 4 lines).
patching file gdb/c-lang.h
Hunk #1 succeeded at 97 with fuzz 1 (offset 7 lines).
patching file gdb/defs.h
patching file gdb/dwarf2read.c
Hunk #1 succeeded at 11118 (offset 389 lines).
patching file gdb/symfile.c
Hunk #1 succeeded at 2710 (offset 17 lines).
patching file gdb/vala-lang.c
patching file gdb/vala-lang.h
patching file gdb/vala-print.c

--------------------------------------------

./configure
make
make install

--------------------------------------------

Ran gdb on my vala executable file
This executable is just the clutter-demo.vala from vala home page
With unpatched gdb the "print clutter_actor_get_width(r) line works
but not with this patched version.
Obviously, the goal is "print r.width"
--------------------------------------------

[brian duffybr2 Debug]$ gdb foodie
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/brian/BitBucketRepos/foodie/bin/Debug/foodie...done.
(gdb) break 46
Breakpoint 1 at 0x80495b3: file
/home/brian/BitBucketRepos/foodie/clutter-demo.vala, line 46.
(gdb) run
Starting program: /home/brian/BitBucketRepos/foodie/bin/Debug/foodie
[Thread debugging using libthread_db enabled]

Breakpoint 1, ClutterDemo.create_rectangles (self=0x8065e20)
    at /home/brian/BitBucketRepos/foodie/clutter-demo.vala:46
46            stage.add_actor (r);
(gdb) print r.width
There is no member named width.
(gdb) print clutter_actor_get_width(r)
Internal error: `self' is not an aggregate
(gdb) quit

--------------------------------------------

How can I test if your patches are doing what they are designed to do so
far?

Thanks

Brian

On Sun, Dec 18, 2011 at 6:54 AM, Abderrahim Kitouni <a kitouni gmail com>wrote:

Hello,

                    في س، 17-12-2011 عند 11:41 -0500 ، كتب Brian Duffy:
Okay, that was enlightening. I certainly am glad that I have some way to
investigate the clutter property but I can't help but wonder how hard it
would be for gdb to be able to print that value if I can print it right
from my vala code to the external console with a simple printf
statement. I
guess it gets back to the fact that gdb is for debugging C and has no
knowledge of the hoops Vala is jumping through to get its printf function
to print out the value of that property. I see that as a problem, but not
as big a problem as writing my app in C versus Vala ;-)

That's it. I have written a gdb patch to add support for vala. It still
doesn't support properties, but I hope you can find it useful.
http://mail.gnome.org/archives/vala-list/2010-December/msg00121.html
(I'm not sure it still applies on the latest version, but it shouldn't
be too hard to fix)

If there is interest in this, I'll try to improve it.

Regards,
Abderrahim




-- 
Duff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]