This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdbhooks.py: dump-fn, dot-fn: cast ret values of fopen/fclose


On 09-07-19 16:10, Vladislav Ivanishin wrote:
> Hi,
> 
> Without the patch, I see these error messages with gdb 8.3:
> 
>     (gdb) Python Exception <class 'gdb.error'> 'fclose@@GLIBC_2.2.5' has
>     unknown return type; cast the call to its declared return type:
>     (gdb) Error occurred in Python: 'fclose@@GLIBC_2.2.5' has unknown
>     return type; cast the call to its declared return type
> 
> One doesn't have to use python to reproduce that: start debugging cc1
> and issue
> 
>     (gdb) call fopen ("", "")
> 
> This actually looks like a GDB bug: from looking at cc1's (built with
> either -g, or -ggdb3) DWARF with either dwarfdump, or readelf I see that
> there is info about the return type (for fopen it's FILE *, and `ptype
> FILE` in gdb gives the full struct).
> 
> Tom, you contributed the {dot,dump}-fn functions.  Do they still work
> for you without the patch?  (And if so, do you happen to have debuginfo
> for libc installed on you machine?)
> 

I just observed the same problem, and managed to make it go away by
installing libc debuginfo.

> I think, the patch itself is obvious (as a workaround).  I've only
> tested it with the version of GDB I have (8.3, which is the latest
> release), but expect this to work for older versions as well.
> 
> (Comparisons of gdb.Value's returned from parse_and_eval, like fp == 0
> and their conversion to python strings in "%s" % fp work automagically.)
> 
> 

LGTM. I think you can check this in under the obvious rule.

Thanks,
- Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]