Compare commits
6 Commits
android-40
...
android-43
Author | SHA1 | Date | |
---|---|---|---|
42c8c5a059 | |||
ddedaa8875 | |||
0e3a995bf4 | |||
755bcc459b | |||
a8c4f01f6c | |||
fbda084acb |
@ -1,3 +1,11 @@
|
|||||||
|
| Pull Request | Commit | Title | Author | Merged? |
|
||||||
|
|----|----|----|----|----|
|
||||||
|
|
||||||
|
|
||||||
|
End of merge log. You can find the original README.md below the break.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
||||||
SPDX-License-Identifier: GPL-2.0-or-later
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
@ -134,7 +134,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# GCC bugs
|
# GCC bugs
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
# These diagnostics would be great if they worked, but are just completely broken
|
# These diagnostics would be great if they worked, but are just completely broken
|
||||||
# and produce bogus errors on external libraries like fmt.
|
# and produce bogus errors on external libraries like fmt.
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
|
@ -263,6 +263,23 @@ void GDBStub::ExecuteCommand(std::string_view packet, std::vector<DebuggerAction
|
|||||||
|
|
||||||
std::vector<u8> mem(size);
|
std::vector<u8> mem(size);
|
||||||
if (system.ApplicationMemory().ReadBlock(addr, mem.data(), size)) {
|
if (system.ApplicationMemory().ReadBlock(addr, mem.data(), size)) {
|
||||||
|
// Restore any bytes belonging to replaced instructions.
|
||||||
|
auto it = replaced_instructions.lower_bound(addr);
|
||||||
|
for (; it != replaced_instructions.end() && it->first < addr + size; it++) {
|
||||||
|
// Get the bytes of the instruction we previously replaced.
|
||||||
|
const u32 original_bytes = it->second;
|
||||||
|
|
||||||
|
// Calculate where to start writing to the output buffer.
|
||||||
|
const size_t output_offset = it->first - addr;
|
||||||
|
|
||||||
|
// Calculate how many bytes to write.
|
||||||
|
// The loop condition ensures output_offset < size.
|
||||||
|
const size_t n = std::min<size_t>(size - output_offset, sizeof(u32));
|
||||||
|
|
||||||
|
// Write the bytes to the output buffer.
|
||||||
|
std::memcpy(mem.data() + output_offset, &original_bytes, n);
|
||||||
|
}
|
||||||
|
|
||||||
SendReply(Common::HexToString(mem));
|
SendReply(Common::HexToString(mem));
|
||||||
} else {
|
} else {
|
||||||
SendReply(GDB_STUB_REPLY_ERR);
|
SendReply(GDB_STUB_REPLY_ERR);
|
||||||
|
@ -18,7 +18,9 @@ enum class Errno : u32 {
|
|||||||
AGAIN = 11,
|
AGAIN = 11,
|
||||||
INVAL = 22,
|
INVAL = 22,
|
||||||
MFILE = 24,
|
MFILE = 24,
|
||||||
|
PIPE = 32,
|
||||||
MSGSIZE = 90,
|
MSGSIZE = 90,
|
||||||
|
CONNABORTED = 103,
|
||||||
CONNRESET = 104,
|
CONNRESET = 104,
|
||||||
NOTCONN = 107,
|
NOTCONN = 107,
|
||||||
TIMEDOUT = 110,
|
TIMEDOUT = 110,
|
||||||
|
@ -23,10 +23,14 @@ Errno Translate(Network::Errno value) {
|
|||||||
return Errno::INVAL;
|
return Errno::INVAL;
|
||||||
case Network::Errno::MFILE:
|
case Network::Errno::MFILE:
|
||||||
return Errno::MFILE;
|
return Errno::MFILE;
|
||||||
|
case Network::Errno::PIPE:
|
||||||
|
return Errno::PIPE;
|
||||||
case Network::Errno::NOTCONN:
|
case Network::Errno::NOTCONN:
|
||||||
return Errno::NOTCONN;
|
return Errno::NOTCONN;
|
||||||
case Network::Errno::TIMEDOUT:
|
case Network::Errno::TIMEDOUT:
|
||||||
return Errno::TIMEDOUT;
|
return Errno::TIMEDOUT;
|
||||||
|
case Network::Errno::CONNABORTED:
|
||||||
|
return Errno::CONNABORTED;
|
||||||
case Network::Errno::CONNRESET:
|
case Network::Errno::CONNRESET:
|
||||||
return Errno::CONNRESET;
|
return Errno::CONNRESET;
|
||||||
case Network::Errno::INPROGRESS:
|
case Network::Errno::INPROGRESS:
|
||||||
|
@ -39,6 +39,11 @@ namespace Network {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
enum class CallType {
|
||||||
|
Send,
|
||||||
|
Other,
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
using socklen_t = int;
|
using socklen_t = int;
|
||||||
@ -96,7 +101,7 @@ bool EnableNonBlock(SOCKET fd, bool enable) {
|
|||||||
return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR;
|
return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
Errno TranslateNativeError(int e) {
|
Errno TranslateNativeError(int e, CallType call_type = CallType::Other) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case 0:
|
case 0:
|
||||||
return Errno::SUCCESS;
|
return Errno::SUCCESS;
|
||||||
@ -112,6 +117,14 @@ Errno TranslateNativeError(int e) {
|
|||||||
return Errno::AGAIN;
|
return Errno::AGAIN;
|
||||||
case WSAECONNREFUSED:
|
case WSAECONNREFUSED:
|
||||||
return Errno::CONNREFUSED;
|
return Errno::CONNREFUSED;
|
||||||
|
case WSAECONNABORTED:
|
||||||
|
if (call_type == CallType::Send) {
|
||||||
|
// Winsock yields WSAECONNABORTED from `send` in situations where Unix
|
||||||
|
// systems, and actual Switches, yield EPIPE.
|
||||||
|
return Errno::PIPE;
|
||||||
|
} else {
|
||||||
|
return Errno::CONNABORTED;
|
||||||
|
}
|
||||||
case WSAECONNRESET:
|
case WSAECONNRESET:
|
||||||
return Errno::CONNRESET;
|
return Errno::CONNRESET;
|
||||||
case WSAEHOSTUNREACH:
|
case WSAEHOSTUNREACH:
|
||||||
@ -198,7 +211,7 @@ bool EnableNonBlock(int fd, bool enable) {
|
|||||||
return fcntl(fd, F_SETFL, flags) == 0;
|
return fcntl(fd, F_SETFL, flags) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Errno TranslateNativeError(int e) {
|
Errno TranslateNativeError(int e, CallType call_type = CallType::Other) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case 0:
|
case 0:
|
||||||
return Errno::SUCCESS;
|
return Errno::SUCCESS;
|
||||||
@ -208,6 +221,10 @@ Errno TranslateNativeError(int e) {
|
|||||||
return Errno::INVAL;
|
return Errno::INVAL;
|
||||||
case EMFILE:
|
case EMFILE:
|
||||||
return Errno::MFILE;
|
return Errno::MFILE;
|
||||||
|
case EPIPE:
|
||||||
|
return Errno::PIPE;
|
||||||
|
case ECONNABORTED:
|
||||||
|
return Errno::CONNABORTED;
|
||||||
case ENOTCONN:
|
case ENOTCONN:
|
||||||
return Errno::NOTCONN;
|
return Errno::NOTCONN;
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
@ -236,13 +253,13 @@ Errno TranslateNativeError(int e) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Errno GetAndLogLastError() {
|
Errno GetAndLogLastError(CallType call_type = CallType::Other) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int e = WSAGetLastError();
|
int e = WSAGetLastError();
|
||||||
#else
|
#else
|
||||||
int e = errno;
|
int e = errno;
|
||||||
#endif
|
#endif
|
||||||
const Errno err = TranslateNativeError(e);
|
const Errno err = TranslateNativeError(e, call_type);
|
||||||
if (err == Errno::AGAIN || err == Errno::TIMEDOUT || err == Errno::INPROGRESS) {
|
if (err == Errno::AGAIN || err == Errno::TIMEDOUT || err == Errno::INPROGRESS) {
|
||||||
// These happen during normal operation, so only log them at debug level.
|
// These happen during normal operation, so only log them at debug level.
|
||||||
LOG_DEBUG(Network, "Socket operation error: {}", Common::NativeErrorToString(e));
|
LOG_DEBUG(Network, "Socket operation error: {}", Common::NativeErrorToString(e));
|
||||||
@ -731,13 +748,17 @@ std::pair<s32, Errno> Socket::Send(std::span<const u8> message, int flags) {
|
|||||||
ASSERT(message.size() < static_cast<size_t>(std::numeric_limits<int>::max()));
|
ASSERT(message.size() < static_cast<size_t>(std::numeric_limits<int>::max()));
|
||||||
ASSERT(flags == 0);
|
ASSERT(flags == 0);
|
||||||
|
|
||||||
|
int native_flags = 0;
|
||||||
|
#if YUZU_UNIX
|
||||||
|
native_flags |= MSG_NOSIGNAL; // do not send us SIGPIPE
|
||||||
|
#endif
|
||||||
const auto result = send(fd, reinterpret_cast<const char*>(message.data()),
|
const auto result = send(fd, reinterpret_cast<const char*>(message.data()),
|
||||||
static_cast<int>(message.size()), 0);
|
static_cast<int>(message.size()), native_flags);
|
||||||
if (result != SOCKET_ERROR) {
|
if (result != SOCKET_ERROR) {
|
||||||
return {static_cast<s32>(result), Errno::SUCCESS};
|
return {static_cast<s32>(result), Errno::SUCCESS};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {-1, GetAndLogLastError()};
|
return {-1, GetAndLogLastError(CallType::Send)};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<s32, Errno> Socket::SendTo(u32 flags, std::span<const u8> message,
|
std::pair<s32, Errno> Socket::SendTo(u32 flags, std::span<const u8> message,
|
||||||
@ -759,7 +780,7 @@ std::pair<s32, Errno> Socket::SendTo(u32 flags, std::span<const u8> message,
|
|||||||
return {static_cast<s32>(result), Errno::SUCCESS};
|
return {static_cast<s32>(result), Errno::SUCCESS};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {-1, GetAndLogLastError()};
|
return {-1, GetAndLogLastError(CallType::Send)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Errno Socket::Close() {
|
Errno Socket::Close() {
|
||||||
|
@ -33,10 +33,12 @@ enum class Errno {
|
|||||||
BADF,
|
BADF,
|
||||||
INVAL,
|
INVAL,
|
||||||
MFILE,
|
MFILE,
|
||||||
|
PIPE,
|
||||||
NOTCONN,
|
NOTCONN,
|
||||||
AGAIN,
|
AGAIN,
|
||||||
CONNREFUSED,
|
CONNREFUSED,
|
||||||
CONNRESET,
|
CONNRESET,
|
||||||
|
CONNABORTED,
|
||||||
HOSTUNREACH,
|
HOSTUNREACH,
|
||||||
NETDOWN,
|
NETDOWN,
|
||||||
NETUNREACH,
|
NETUNREACH,
|
||||||
|
Reference in New Issue
Block a user