Two patches - ptrace single stepping + modpost.c
RFC 1/1 Two patches - ptrace single stepping + modpost.c
Ok, here's two patches I'd like to get sorted out and merged into 2.5 or whatever.
The first: add a flag to tsk->ptrace to indicate whether we're single stepping or not. This is used by the ARM ptrace code in arch/arm/kernel/signal.c to decide whether we need to halt the process for the debugger during signal processing, or remove and set single stepping breakpoints.
Other architectures which use similar schemes (eg, alpha) might also like this; it looks like Alpha may be a little buggy; it appears to carry the single stepping status across signal handling. What happens if the debugger decides to disable single stepping when the debugged process receives a signal?
include/linux/ptrace.h +1 -0
@@ -65,6 +65,7 @@#define PT_TRACE_EXIT 0x00000200#define PT_TRACE_MASK 0x000003f4 +#define PT_SINGLESTEP 0x80000000/* single stepping (used on ARM) */ #include <linux/compiler.h> /* For unlikely. */ #include <linux/sched.h> /* For struct task_struct. */
The second: this allows modpost.c to build on ARM. For some unknown reason, EM_SPARC* are not present in my system headers. This isn't the right solution since it would interfere with cross-building SPARC. Are EM_SPARC* normally defined as preprocessor macros or enums?
scripts/modpost.c +2 -1
@@ -296,13 +296,14 @@/* ignore global offset table */ if (strcmp (symname,"_GLOBAL_OFFSET_TABLE_" ) ==0 )break ; +#if defined(__sparc__) || defined(__sparc_v9__)if (info->hdr->e_machine ==EM_SPARC || info->hdr->e_machine ==EM_SPARCV9 ) {/* Ignore register directives. */ if (ELF_ST_TYPE (sym->st_info) ==STT_REGISTER )break ; } - +#endif if (memcmp (symname,MODULE_SYMBOL_PREFIX ,strlen (MODULE_SYMBOL_PREFIX )) ==0 ) { s = alloc_symbol(symname +
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 5 lines · Russell King
Other architectures which use similar schemes (eg, alpha) might also like this; it looks like Alpha may be a little buggy; it appears to carry the single stepping status across signal handling. What happens if the debugger decides to disable single stepping when the debugged process receives a signal?
Alpha was buggy, indeed. Hopefully fixed in current bk. However, we don't need special flag for single stepping - we use thread_info->bpt_nsaved as such flag.
Ivan.