This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH 0/3] Pretty-printing for errno
- From: Pedro Alves <palves at redhat dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: Phil Muldoon <pmuldoon at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, gdb at sourceware dot org, Joseph Myers <joseph at codesourcery dot com>, Florian Weimer <fweimer at redhat dot com>, Tom Tromey <tom at tromey dot com>, Siddhesh Poyarekar <siddhesh at gotplt dot org>
- Date: Mon, 4 Sep 2017 22:25:00 +0100
- Subject: Re: [RFC PATCH 0/3] Pretty-printing for errno
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BDF727EABF
- References: <20170622224456.1358-1-zackw@panix.com> <b2e7bc3b-d914-37ec-0215-2937949a848c@redhat.com> <3a7946e9-d178-f878-9774-64ff44bcf5df@redhat.com> <9490d183-a57b-b336-3131-6580e4773818@redhat.com> <be8d9730-96c5-79fa-b9bc-2afc02a17ddf@redhat.com> <CAKCAbMgAwZOG95hpAAAVYJd4SP6j3aAahOf=WWedjNJkj7_JsA@mail.gmail.com> <2f28f69b-406f-65e5-40e1-ae65632ea4f0@redhat.com> <CAKCAbMj8Rf374bss0ct+H+XMOu_o+_WWR2mQ-s8fb4-3_d7GjA@mail.gmail.com> <1d38297f-f430-ca73-6d3f-a67144d08eea@redhat.com> <d9fc4b9d-21b9-98fb-c87a-38b2e0587a9a@redhat.com>
On 07/13/2017 03:30 AM, Pedro Alves wrote:
> On 06/30/2017 07:11 PM, Pedro Alves wrote:
>> On 06/30/2017 06:27 PM, Zack Weinberg wrote:
>>> Pedro Alves wrote:
>>>> The next problem is that without debug info for __errno_location,
>>>> gdb has no clue of its prototype, only that its a function, and so
>>>> it assumes that it has type "int()", i.e., that it returns int,
>>>> while in reality it returns int * / __error_t *. (Falling back
>>>> to assuming "int" is IMO not the best idea, but I don't know
>>>> the history behind it.)
>>>
>>> Probably because that's the pre-C89 legacy default function signature?
>>
>> Yes, most likely.
>
> FYI, shortly after this discussion, yet another user showed up
> on #gdb confused by "p getenv("PATH") returning weird negative
> integer numbers [because he had no debug info for getenv...], so I
> decided to do something about it. I've now sent a patch series
> that stops GDB from assuming no-debug-info symbols have
> type int:
>
> [PATCH 00/13] No-debug-info debugging improvements
> https://sourceware.org/ml/gdb-patches/2017-07/msg00112.html
>
> Comments welcome.
FYI, this is now all in gdb master. I believe all the gdb issues
uncovered by the errno printer have been addressed. Let me know
if you're aware of something still not working properly.
Thanks,
Pedro Alves