[gvd-devel] GVD questions/bug reports.

Emmanuel Briot briot@gnat.com
Fri, 13 Jul 2001 12:37:10 +0200


Tomer Kol writes:
 > I've recently came acorss GVD, and downloaded it to give it a try.
 > It seems a s very nice program with a lot of potential.
 > However, I've encountered a few problems. I dont' know ada (yet?) so at
 > least for now I cannot fix these myself.
 > (I used the precompiled 1.2 binaries on a debian potato system.)
 > 
 > 1. In preferences->general. the last extension is ignored unless followed
 >    by ";". The default list created if I don't have a prior configuration
 >    does not have this last semicolon.

This seems to be related to gdb, rather than gvd: I tried using a .aa extension
for a C++ file, and gdb reports the language as being 'c', which explains why
keywords like 'class',... are not highlighted in the text.
We do not have a fix for that yet.


 > 2. If a C++ class contains a static member, it cannot be diaplyed
 >    graphically.
 >    If I have a class with a static int member, uUsing log-level 4, it
 >    seems that GVD issues "ptype static int", which gdb does not
 >    understand because of the "static" part.


This is now fixed in gvd. Indeed, gdb reports the "static" keyword as part of
the type, which was confusing gvd. The fix is simple if you feel like
recompiling gvd:

 >    Classes with virtual methods, and/or without new data members.
 >    Are these problems realy fixed or the "fixed" referes to the workaround
 >    (using tooltips)? Was it fixed since 1.2? (the files are dated April
 >    28th, so I was hoping there may be a newer version).
 > 
 >    Trying to display such classe I was asked to report a GVD bug.

This one is now fixed in gvd. In fact, it appears that gdb displays C++ classes
in several different ways, we were expecting something like:

       , _vptr. = 0x8049b60 <X::B virtual table>

but on your example, we got:

       , _vptr. = 0x9049b60}, "    (ie no <..>)

The fix is actually simply, if you feel like recompiling gvd:
in the file debugger-gdb-cpp.adb.

For the above two problems, apply the following patch:

Emmanuel



in debugger-gdb-cpp.adb, apply the following patch

diff -r1.9 -r1.11
192a193,204
>       --  A class can have static members, that are reported as:
>       --    type = class CL {\n
>       --        private:\n
>       --        static double x;\n
>       --  Thus, we must ignore the static keyword
> 
>       if Looking_At (Type_Str, Tmp, "static ") then
>          Index := Tmp + 7;
>       else
>          Index := Tmp;
>       end if;
> 
197,198c209,210
<       if Looking_At (Type_Str, Tmp, "class ") then
<          Index := Tmp + 6; --  skips "class "
---
>       if Looking_At (Type_Str, Index, "class ") then
>          Index := Index + 6; --  skips "class "
201,202c213,214
<       elsif Looking_At (Type_Str, Tmp, "union ") then
<          Index := Tmp + 6;
---
>       elsif Looking_At (Type_Str, Index, "union ") then
>          Index := Index + 6;
261a274,276
>          --
>          --  We can also have the following format:
>          --     ", _vptr. = 0x9049b60}, "    (ie no <..>)
265,266c280,282
<             Skip_To_Char (Type_Str, Index, '>');
<             Index := Index + 1;
---
>             while Type_Str (Index) /= '}' loop
>                Index := Index + 1;
>             end loop;