Re: [PATCH 2/6] Don't reset errno/bfd_error on 'throw_perror_with_name'

Sergio Durigan Junior
2020-02-28T20:01:17Z

On Friday, February 28 2020, Pedro Alves wrote:

> On 2/26/20 8:05 PM, Sergio Durigan Junior wrote:
>>
>> git blame tells me that this piece of code is pretty old; the commit
>> that "introduced" it is:
>>
>> commit c906108c21474dfb4ed285bcc0ac6fe02cd400cc
>> Author: Stan Shebs <shebs@codesourcery.com>
>> Date: Fri Apr 16 01:35:26 1999 +0000
>>
>> Initial creation of sourceware repository
>>
>> so yeah...
>
> This is not the oldest commit in the tree. Using git log
> starting at the hash, you should be able to find older commits
> which touch the file. The thing is that history around the time
> of that "initial creation" commit, is quite messy, because the
> CVS tree back then was deleted and recreated a number of times
> and merged in some odd ways.

Sorry, I didn't mean to say that this is the oldest commit in the tree.
But even doing a bit more search, I could only find this commit:

commit 8eec331072987d38064745a33ae89cc5d195029c
Author: Steve Chamberlain <sac@cygnus>
Date: Sat Mar 19 03:16:10 1994 +0000

* utils.c (prompt_for_continue): Call readline, not gdb_readline.

which did:

- bfd_error = no_error;
+ bfd_set_error (bfd_error_no_error);

This means the code is really old (pre-1994), and I could not track when
it was added. And I don't think it matters much at this point: even if
I could find the exact commit that added it, I doubt I'd be able to find
the rationale.

--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible