Re: [RFC PATCH 0/3] Pretty-printing for errno

Zack Weinberg
2017-06-30T00:28:50Z

On Thu, Jun 29, 2017 at 1:28 PM, Pedro Alves <palves@redhat.com> wrote:
> With this code:
>
> typedef int zzz;
> zzz z;
>
> gdb:
>
> (gdb) whatis z
> type = zzz
> (gdb) whatis (zzz)0
> type = zzz
> (gdb) whatis zzz
> type = int

For the glibc patch to go through, this case also needs to work:

typedef int error_t;
error_t var;
extern error_t *errloc(void);

int main(void)
{
return *errloc();
}

(compiled to .o file)

(gdb) ptype errloc
No symbol "errloc" in current context.

This might be a problem with inadequate debugging information
generated by the compiler -- it does work correctly if a function
*definition* is visible. But we need it to work given only the above,
possibly with no debug symbols in the shared library defining
"errloc".

zw