[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gdba problems with C++ code
From: |
Nick Roberts |
Subject: |
Re: gdba problems with C++ code |
Date: |
Tue, 5 Sep 2006 09:22:48 +1200 |
Werner LEMBERG writes:
>
> [Emacs CVS 2006-07-30]
>
> I tried to debug troff, which is written in C++.
>
> Starting gdba, I just added `troff' as the only argument (in addition
> to -annotate=3). Setting a breakpoint on `process_input_stack', I
> started the program. Hitting the breakpoint, the *locals of troff*
> window shows, among other things,
>
> trap_bol_stack = [struct/union]
>
> Creating a watch expression shows me
>
> +trap_bol_stack int_stack
>
> (where the `+' sign stands for the small icon) in a separate speedbar
> frame, as expected. But clicking on that with mouse-2 gives nothing.
If int_stack is just a structure or union it should work.
Or is it a data type that is special to C++?
> In the *gud-troff* buffer I can do the following:
>
> (gdb) p trap_bol_stack
> $1 = {top = 0xbfe6bc68}
>
> thus I've expected that clicking on the watch expression opens a tree,
> showing me the value of `top'.
If it has only one element it should look something like:
[-] trap_bol_stack int_stack
[+] top top_type
depending on the data type of top.
> The same happens for more complex structures too: It isn't possible
> for me to get a tree of the variables within the structure.
What operating system are you using? What is the exact version of GDB are you
using? e.g on FC5 I get:
GNU gdb Red Hat Linux (6.3.0.0-1.122rh)
> This
> makes gdba completely useless for me.
That may be so if all you do when debugging is watch the values of complex data
types. Most other people do many other things.
> Am I doing something wrong? Isn't C++ supported? I use gdb 6.3 in
> case it matters.
As it says in the manual (it would be a good idea to read it, if you haven't)
and the file header for gdb-ui.el, watch expressions work best with GDB 6.4
onwards. With 6.3 and more complex structures it may be just that you're not
waiting long enough. Current GDB is 6.5, it might help to update to that.
--
Nick http://www.inet.net.nz/~nickrob