Skip to content

Commit 806c53a

Browse files
committed
Move the check earlier
1 parent 73711a3 commit 806c53a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Python/remote_debug.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,18 +722,18 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c
722722
}
723723

724724
const char *path = line + path_pos;
725+
if (path[0] == '[' && path[strlen(path)-1] == ']') {
726+
// Skip [heap], [stack], [anon:cpython:pymalloc], etc.
727+
continue;
728+
}
729+
725730
const char *filename = strrchr(path, '/');
726731
if (filename) {
727732
filename++; // Move past the '/'
728733
} else {
729734
filename = path; // No directories, or an empty string
730735
}
731736

732-
if (filename[0] == '[' && filename[strlen(filename)-1] == ']') {
733-
// Skip anonymous mapping: [heap], [anon:cpython:pymalloc], etc.
734-
continue;
735-
}
736-
737737
if (strstr(filename, substr)) {
738738
retval = search_elf_file_for_section(handle, secname, start, path);
739739
if (retval) {

0 commit comments

Comments
 (0)