mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-17 13:10:12 +08:00
gdb, btrace: fix error diagnostics
When we improved error messages in
cd393cec3a
gdb, btrace: improve error messages
we cleared the original errno. When the error reason can not be explained
in a more detailed error message, and we fall back to the default error
message, it now gives Success as error.
Restore the original errno to fix that.
This commit is contained in:
parent
5eb2254a1d
commit
b792eb47f2
@ -422,7 +422,8 @@ cpu_supports_bts (void)
|
||||
static void
|
||||
diagnose_perf_event_open_fail ()
|
||||
{
|
||||
switch (errno)
|
||||
int orig_errno = errno;
|
||||
switch (orig_errno)
|
||||
{
|
||||
case EPERM:
|
||||
case EACCES:
|
||||
@ -443,7 +444,7 @@ diagnose_perf_event_open_fail ()
|
||||
break;
|
||||
}
|
||||
|
||||
error (_("Failed to start recording: %s"), safe_strerror (errno));
|
||||
error (_("Failed to start recording: %s"), safe_strerror (orig_errno));
|
||||
}
|
||||
|
||||
/* Get the linux version of a btrace_target_info. */
|
||||
|
Loading…
Reference in New Issue
Block a user