* std::string and MI
@ 2008-11-27 12:39 André Pönitz
2008-12-02 17:37 ` Tom Tromey
2008-12-03 17:27 ` Daniel Jacobowitz
0 siblings, 2 replies; 3+ messages in thread
From: André Pönitz @ 2008-11-27 12:39 UTC (permalink / raw)
To: gdb
Hi all.
For the following code
#include <string>
struct string {};
namespace foo { struct string {}; }
int main()
{
std::string s;
foo::string f;
string t;
}
I get after issuing a "-stack-list-locals 2" the response
^done,locals=[{name="s",type="string"},{name="f",type="foo::string"},
{name="t",type="string"}]
Similarily, "-var-create s * s" followed by "-var-info-type s" produces
^done,type="string"
In both cases the 'std::' namespace is missing from the type.
As the "namespace foo" example above shows, this can't be the general
problem with namespaces, as "foo::string" is reported as I expected.
Does anybody know how to tweak gdb's settings so that it produces the
std:: namespace, too? [Getting back the "real" "std::basic_string<char...>"
would be fine for me as well]
Incidentally: Would it be possible to extend the MI commands that output
types to also produce the mangled types? (This could be restricted to the
cases where these actually differs from the unmangled ones, but I really
don't mind duplicated output)
Regards,
Andre'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: std::string and MI
2008-11-27 12:39 std::string and MI André Pönitz
@ 2008-12-02 17:37 ` Tom Tromey
2008-12-03 17:27 ` Daniel Jacobowitz
1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2008-12-02 17:37 UTC (permalink / raw)
To: André Pönitz; +Cc: gdb
>>>>> "André" == André Pönitz <apoenitz@trolltech.com> writes:
[...]
André> In both cases the 'std::' namespace is missing from the type.
André> As the "namespace foo" example above shows, this can't be the general
André> problem with namespaces, as "foo::string" is reported as I expected.
André> Does anybody know how to tweak gdb's settings so that it produces the
André> std:: namespace, too?
I didn't look at this example, but in other cases where "whatis"
printed something odd, I have tracked the problem down to weird debug
info. You might take a look at that. IOW, it may not be gdb's
decision. There's a GCC PR or two in this area.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: std::string and MI
2008-11-27 12:39 std::string and MI André Pönitz
2008-12-02 17:37 ` Tom Tromey
@ 2008-12-03 17:27 ` Daniel Jacobowitz
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2008-12-03 17:27 UTC (permalink / raw)
To: André Pönitz; +Cc: gdb
On Thu, Nov 27, 2008 at 01:38:56PM +0100, André Pönitz wrote:
> I get after issuing a "-stack-list-locals 2" the response
>
> ^done,locals=[{name="s",type="string"},{name="f",type="foo::string"},
> {name="t",type="string"}]
>
> Similarily, "-var-create s * s" followed by "-var-info-type s" produces
>
> ^done,type="string"
>
> In both cases the 'std::' namespace is missing from the type.
I'll second Tom - I think I opened a GCC bug report about this.
> Incidentally: Would it be possible to extend the MI commands that output
> types to also produce the mangled types? (This could be restricted to the
> cases where these actually differs from the unmangled ones, but I really
> don't mind duplicated output)
There's not really any such thing in the debug info. Some GCC debug
info includes mangled names for functions, but it's not always there
and it is never present for types. We'd have to reconstruct it from
linkage names and map to parameters; it would be very hit-or-miss.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-03 17:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-27 12:39 std::string and MI André Pönitz
2008-12-02 17:37 ` Tom Tromey
2008-12-03 17:27 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox