mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
dmnt2: remove memory-map output which does nothing for us
This commit is contained in:
parent
4cc5e9cdfd
commit
aba7e4ca7d
2 changed files with 0 additions and 72 deletions
|
@ -772,7 +772,6 @@ namespace ams::dmnt {
|
|||
AnnexBufferContents_Processes,
|
||||
AnnexBufferContents_Threads,
|
||||
AnnexBufferContents_Libraries,
|
||||
AnnexBufferContents_MemoryMap,
|
||||
};
|
||||
|
||||
constinit AnnexBufferContents g_annex_buffer_contents = AnnexBufferContents_Invalid;
|
||||
|
@ -1954,7 +1953,6 @@ namespace ams::dmnt {
|
|||
AppendReply(m_reply_packet, ";augmented-libraries-svr4-read+");
|
||||
AppendReply(m_reply_packet, ";qXfer:threads:read+");
|
||||
AppendReply(m_reply_packet, ";qXfer:exec-file:read+");
|
||||
AppendReply(m_reply_packet, ";qXfer:memory-map:read+");
|
||||
AppendReply(m_reply_packet, ";swbreak+");
|
||||
AppendReply(m_reply_packet, ";hwbreak+");
|
||||
AppendReply(m_reply_packet, ";vContSupported+");
|
||||
|
@ -1981,8 +1979,6 @@ namespace ams::dmnt {
|
|||
}
|
||||
} else if (ParsePrefix(m_receive_packet, "libraries:read::")) {
|
||||
this->qXferLibrariesRead();
|
||||
} else if (ParsePrefix(m_receive_packet, "memory-map:read::")) {
|
||||
this->qXferMemoryMapRead();
|
||||
} else if (ParsePrefix(m_receive_packet, "exec-file:read:")) {
|
||||
SetReply(m_reply_packet, "l%s", m_debug_process.GetProcessName());
|
||||
} else {
|
||||
|
@ -2079,73 +2075,6 @@ namespace ams::dmnt {
|
|||
GetAnnexBufferContents(m_reply_packet, offset, length);
|
||||
}
|
||||
|
||||
void GdbServerImpl::qXferMemoryMapRead() {
|
||||
/* Handle the qXfer. */
|
||||
u32 offset, length;
|
||||
|
||||
/* Parse offset/length. */
|
||||
ParseOffsetLength(m_receive_packet, offset, length);
|
||||
|
||||
/* Acquire access to the annex buffer. */
|
||||
std::scoped_lock lk(g_annex_buffer_lock);
|
||||
|
||||
/* If doing a fresh read, generate the module list. */
|
||||
if (offset == 0 || g_annex_buffer_contents != AnnexBufferContents_MemoryMap) {
|
||||
/* Set header. */
|
||||
SetReply(g_annex_buffer, "<memory-map>\n");
|
||||
|
||||
/* Iterate over all mappings. */
|
||||
uintptr_t cur_addr = 0;
|
||||
svc::MemoryInfo prev_info = {};
|
||||
size_t prev_size = 0;
|
||||
while (true) {
|
||||
/* Get current mapping. */
|
||||
svc::MemoryInfo mem_info;
|
||||
if (R_FAILED(m_debug_process.QueryMemory(std::addressof(mem_info), cur_addr))) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* If the mapping is present, add it. */
|
||||
if (mem_info.state != svc::MemoryState_Free && mem_info.state != svc::MemoryState_Inaccessible && mem_info.permission != svc::MemoryPermission_None) {
|
||||
if (prev_size != 0 && mem_info.state == prev_info.state && mem_info.permission == prev_info.permission && mem_info.attribute == prev_info.attribute && mem_info.base_address == prev_info.base_address + prev_size) {
|
||||
prev_size += mem_info.size;
|
||||
} else {
|
||||
if (prev_size != 0) {
|
||||
AppendReply(g_annex_buffer, "<memory type=\"ram\" start=\"0x%lx\" length=\"0x%lx\" />", prev_info.base_address, prev_size);
|
||||
}
|
||||
|
||||
prev_info = mem_info;
|
||||
prev_size = mem_info.size;
|
||||
}
|
||||
} else {
|
||||
if (prev_size != 0) {
|
||||
AppendReply(g_annex_buffer, "<memory type=\"ram\" start=\"0x%lx\" length=\"0x%lx\" />", prev_info.base_address, prev_size);
|
||||
|
||||
prev_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const uintptr_t next_address = mem_info.base_address + mem_info.size;
|
||||
if (next_address <= cur_addr) {
|
||||
break;
|
||||
}
|
||||
|
||||
cur_addr = next_address;
|
||||
}
|
||||
|
||||
if (prev_size != 0) {
|
||||
AppendReply(g_annex_buffer, "<memory type=\"ram\" start=\"0x%lx\" length=\"0x%lx\" />", prev_info.base_address, prev_size);
|
||||
}
|
||||
|
||||
AppendReply(g_annex_buffer, "</memory-map>");
|
||||
|
||||
g_annex_buffer_contents = AnnexBufferContents_MemoryMap;
|
||||
}
|
||||
|
||||
/* Copy out the module list. */
|
||||
GetAnnexBufferContents(m_reply_packet, offset, length);
|
||||
}
|
||||
|
||||
void GdbServerImpl::qXferOsdataRead() {
|
||||
/* Handle the qXfer. */
|
||||
u32 offset, length;
|
||||
|
|
|
@ -104,7 +104,6 @@ namespace ams::dmnt {
|
|||
void qXfer();
|
||||
void qXferFeaturesRead();
|
||||
void qXferLibrariesRead();
|
||||
void qXferMemoryMapRead();
|
||||
void qXferOsdataRead();
|
||||
bool qXferThreadsRead();
|
||||
|
||||
|
|
Loading…
Reference in a new issue