FYI: [python/Ada] gdb.lookup_type fails to looking primitive type

Joel Brobecker brobecker@adacore.com
Wed Jan 21 09:44:00 GMT 2015


> > Not that I'm expecting anyone to go back and change things,
> > but maybe for future reference it'd be better to print the result
> > and record the expected output, instead of expecting no output.
> > Performing a lookup action, and then expecting no output,
> > is just too confusing to me.
> 
> The only issue I have with that is that I'd like to do something
> whose behavior is defined. Looking at the GDB manual, I can't see
> anything said about what to expect when converting a gdb.Type to
> a string... If we clarify that, I have no problem adding the extra
> "print" in the test.

I tried looking into the code as to what the semantics of printing
the gdb.Type object should be, and couldn't figure it out. It seems
to be printing the type name, but I'm not sure why. So, instead of
waiting for a clarification that may never come, I propose the
following.

gdb/ChangeLog:

        * gdb.python/py-lookup-type.exp (test_lookup_type): Change
        the second test to print the name attribute of value
        returned by the call to gdb.lookup_type, and adjust
        the expected output accordingly.

Tested on x86_64-linux.

Does this change answer your concerns?

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-check-gdb.lookup_type-return-value-in-gdb.python-py-.patch
Type: text/x-diff
Size: 1304 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150121/6ffbd6da/attachment.bin>


More information about the Gdb-patches mailing list