cobalt/debug: Detect DSOs via presence of vm_file
PATCH v2 1/1 cobalt/debug: Detect DSOs via presence of vm_file
From: Jan Kiszka <[email protected]>
VM_DENYWRITE was removed in 5.15, so we need a different criteria. Presence of a file-backing seems to be a good one.
Signed-off-by Jan Kiszka <[email protected]>
---
Changes in v2:
- fixed inverted logic
- adjusted description
kernel/cobalt/debug.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
kernel/cobalt/debug.c +5 -7
@@ -250,13 +250,12 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,continue ;/* -* Hack. Unlike DSOs, executables and interpreters -* (e.g. dynamic linkers) are protected against write -* attempts. Use this to determine when $pc should be -* fixed up by subtracting the mapping base address in -* the DSO case. +* Interpreter-generated executable mappings are not +* file-backed. Use this to determine when $pc should be fixed +* up by subtracting the mapping base address in the DSO case. */ -if (!(vma->vm_flags &VM_DENYWRITE )) + file = vma->vm_file; +if (file !=NULL ) pc -= vma->vm_start; spot.backtrace[depth].pc = pc;
@@ -266,7 +265,6 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,* record the PC value, which may still give some hint * downstream. */ - file = vma->vm_file;if (file ==NULL ) goto next_frame;
Signature · 1 line
2.31.1