[3.14] gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628) (#142630)

gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628)
(cherry picked from commit e0bca091a4)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2025-12-12 14:38:09 +01:00 committed by GitHub
parent c3fbe286c0
commit 8e496013b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -720,6 +720,11 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c
}
const char *path = line + path_pos;
if (path[0] == '[' && path[strlen(path)-1] == ']') {
// Skip [heap], [stack], [anon:cpython:pymalloc], etc.
continue;
}
const char *filename = strrchr(path, '/');
if (filename) {
filename++; // Move past the '/'