Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Modules/_remote_debugging/_remote_debugging.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ typedef struct {
#define SIZEOF_GEN_OBJ sizeof(PyGenObject)
#define SIZEOF_INTERP_FRAME sizeof(_PyInterpreterFrame)
#define SIZEOF_LLIST_NODE sizeof(struct llist_node)
#define SIZEOF_PAGE_CACHE_ENTRY sizeof(page_cache_entry_t)
#define SIZEOF_PYOBJECT sizeof(PyObject)
#define SIZEOF_SET_OBJ sizeof(PySetObject)
#define SIZEOF_TASK_OBJ 4096
Expand Down
10 changes: 1 addition & 9 deletions Python/remote_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ get_page_size(void) {
typedef struct page_cache_entry {
uintptr_t page_addr; // page-aligned base address
char *data;
int valid;
struct page_cache_entry *next;
} page_cache_entry_t;

#define MAX_PAGES 1024
Expand Down Expand Up @@ -211,17 +209,13 @@ _Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
PyMem_RawFree(handle->pages[i].data);
}
handle->pages[i].data = NULL;
handle->pages[i].valid = 0;
}
handle->page_cache_count = 0;
}

UNUSED static void
_Py_RemoteDebug_ClearCache(proc_handle_t *handle)
{
for (int i = 0; i < handle->page_cache_count; i++) {
handle->pages[i].valid = 0;
}
handle->page_cache_count = 0;
}

Expand All @@ -244,7 +238,6 @@ _Py_RemoteDebug_InitProcHandle(proc_handle_t *handle, pid_t pid) {
handle->page_cache_count = 0;
for (int i = 0; i < MAX_PAGES; i++) {
handle->pages[i].data = NULL;
handle->pages[i].valid = 0;
}

handle->pid = pid;
Expand Down Expand Up @@ -1539,7 +1532,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
// between profiler samples, so entries are packed at the front.
for (int i = 0; i < handle->page_cache_count; i++) {
page_cache_entry_t *entry = &handle->pages[i];
if (entry->valid && entry->page_addr == page_base) {
if (entry->page_addr == page_base) {
memcpy(out, entry->data + offset_in_page, size);
return 0;
}
Expand All @@ -1566,7 +1559,6 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
}

entry->page_addr = page_base;
entry->valid = 1;
handle->page_cache_count++;
memcpy(out, entry->data + offset_in_page, size);
return 0;
Expand Down
Loading