From 11a9625eaf99a54718f36747b44d12eb4c4e8c08 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 7 Feb 2018 21:14:05 -0600 Subject: [PATCH] debug: remove DEBUG_INFO option This feature is X86 only and is not used or being tested. It is legacy feature and no one can prove it actually works. Remove it until we have proper documentation and samples and multi architecture support. Signed-off-by: Anas Nashif --- arch/posix/core/offsets/offsets.c | 4 -- arch/x86/core/CMakeLists.txt | 2 - arch/x86/core/debug/debug_frames.c | 21 ----------- arch/x86/core/intstub.S | 52 -------------------------- arch/x86/core/offsets/offsets.c | 4 -- arch/x86/core/swap.S | 4 +- arch/x86/core/thread.c | 2 +- arch/x86/include/kernel_arch_data.h | 3 -- arch/xtensa/include/kernel_arch_data.h | 3 -- include/arch/x86/arch.h | 6 --- include/debug/debug_info.h | 42 --------------------- 11 files changed, 2 insertions(+), 141 deletions(-) delete mode 100644 arch/x86/core/debug/debug_frames.c delete mode 100644 include/debug/debug_info.h diff --git a/arch/posix/core/offsets/offsets.c b/arch/posix/core/offsets/offsets.c index 2de2aa9c27d..bd3af1f43f0 100644 --- a/arch/posix/core/offsets/offsets.c +++ b/arch/posix/core/offsets/offsets.c @@ -31,10 +31,6 @@ #include -#ifdef CONFIG_DEBUG_INFO -GEN_OFFSET_SYM(_kernel_arch_t, isf); -#endif - #if defined(CONFIG_FP_SHARING) GEN_OFFSET_SYM(_thread_arch_t, excNestCount); #endif diff --git a/arch/x86/core/CMakeLists.txt b/arch/x86/core/CMakeLists.txt index e2a0d6725a8..3fd44567e0e 100644 --- a/arch/x86/core/CMakeLists.txt +++ b/arch/x86/core/CMakeLists.txt @@ -5,8 +5,6 @@ endif() zephyr_compile_options($<$:-Wa,--divide>) -add_subdirectory_ifdef(CONFIG_DEBUG_INFO debug) - zephyr_sources( cache.c cache_s.S diff --git a/arch/x86/core/debug/debug_frames.c b/arch/x86/core/debug/debug_frames.c deleted file mode 100644 index f6895f1a63f..00000000000 --- a/arch/x86/core/debug/debug_frames.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2015 Wind River Systems, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief Stack frames for debugging purposes - * - * This file contains a routine useful for debugging that gets a pointer to - * the current interrupt stack frame. - */ - -#include -#include - -NANO_ISF *sys_debug_current_isf_get(void) -{ - return _kernel.arch.isf; -} diff --git a/arch/x86/core/intstub.S b/arch/x86/core/intstub.S index 25a99282511..7b06c2e814b 100644 --- a/arch/x86/core/intstub.S +++ b/arch/x86/core/intstub.S @@ -139,19 +139,6 @@ SECTION_FUNC(TEXT, _interrupt_enter) */ pushl %edi -#ifdef CONFIG_DEBUG_INFO - /* - * Push the cooperative registers on the existing stack as they are - * required by debug tools. - */ - - pushl %esi - pushl %ebx - pushl %ebp - - leal 40(%esp), %ecx /* Calculate ESP before interrupt occurred */ - pushl %ecx /* Save calculated ESP */ -#endif #if defined(CONFIG_INT_LATENCY_BENCHMARK) || \ defined(CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT) || \ @@ -194,11 +181,7 @@ SECTION_FUNC(TEXT, _interrupt_enter) /* use interrupt stack if not nested */ cmpl $1, _kernel_offset_to_nested(%ecx) -#ifdef CONFIG_DEBUG_INFO - jne nested_save_isf -#else jne alreadyOnIntStack -#endif /* * switch to base of the interrupt stack: save esp in edi, then load @@ -213,31 +196,12 @@ SECTION_FUNC(TEXT, _interrupt_enter) pushl %edi /* Save stack pointer */ -#ifdef CONFIG_DEBUG_INFO - /* - * The saved stack pointer happens to match the address of the - * interrupt stack frame. To simplify the exit case, push a dummy ISF - * for the "old" ISF and save it to the _kernel.isf. - */ - pushl %edi - movl %edi, _kernel_offset_to_isf(%ecx) -#endif - #ifdef CONFIG_SYS_POWER_MANAGEMENT cmpl $0, _kernel_offset_to_idle(%ecx) jne handle_idle /* fast path is !idle, in the pipeline */ #endif /* CONFIG_SYS_POWER_MANAGEMENT */ -#ifdef CONFIG_DEBUG_INFO - jmp alreadyOnIntStack - -nested_save_isf: - movl _kernel_offset_to_isf(%ecx), %edi /* Get old ISF */ - movl %esp, _kernel_offset_to_isf(%ecx) /* Save new ISF */ - pushl %edi /* Save old ISF */ -#endif - /* fall through to nested case */ alreadyOnIntStack: @@ -290,9 +254,6 @@ alreadyOnIntStack: /* determine whether exiting from a nested interrupt */ movl $_kernel, %ecx -#ifdef CONFIG_DEBUG_INFO - popl _kernel_offset_to_isf(%ecx) /* Restore old ISF */ -#endif decl _kernel_offset_to_nested(%ecx) /* dec interrupt nest count */ jne nestedInterrupt /* 'iret' if nested case */ @@ -333,13 +294,6 @@ alreadyOnIntStack: popl %esp /* switch back to outgoing thread's stack */ -#ifdef CONFIG_DEBUG_INFO - popl %ebp /* Discard saved ESP */ - popl %ebp - popl %ebx - popl %esi -#endif - #if defined(CONFIG_TIMESLICING) call _update_time_slice_before_swap #endif @@ -417,12 +371,6 @@ nestedInterrupt: call _int_latency_stop #endif -#ifdef CONFIG_DEBUG_INFO - popl %ebp /* Discard saved ESP */ - popl %ebp - popl %ebx - popl %esi -#endif popl %edi popl %ecx /* pop volatile registers in reverse order */ popl %edx diff --git a/arch/x86/core/offsets/offsets.c b/arch/x86/core/offsets/offsets.c index 79cb99072a4..5d2473ffec6 100644 --- a/arch/x86/core/offsets/offsets.c +++ b/arch/x86/core/offsets/offsets.c @@ -32,10 +32,6 @@ #include -#ifdef CONFIG_DEBUG_INFO -GEN_OFFSET_SYM(_kernel_arch_t, isf); -#endif - #if defined(CONFIG_FP_SHARING) GEN_OFFSET_SYM(_thread_arch_t, excNestCount); #endif diff --git a/arch/x86/core/swap.S b/arch/x86/core/swap.S index 6ca582aef29..e7312b9bc60 100644 --- a/arch/x86/core/swap.S +++ b/arch/x86/core/swap.S @@ -393,7 +393,7 @@ time_read_not_needed: #endif ret -#if defined(CONFIG_DEBUG_INFO) || defined(CONFIG_X86_IAMCU) +#if defined(CONFIG_X86_IAMCU) /** * * @brief Adjust stack/parameters before invoking thread entry function @@ -464,8 +464,6 @@ SECTION_FUNC(TEXT, _x86_thread_entry_wrapper) pop %edx pop %ecx push $0 /* Null return address */ -#elif defined(CONFIG_DEBUG_INFO) - movl $0, (%esp) /* zero initialEFLAGS location */ #endif jmp *%edi #endif diff --git a/arch/x86/core/thread.c b/arch/x86/core/thread.c index a1b2e4e5881..5488230154d 100644 --- a/arch/x86/core/thread.c +++ b/arch/x86/core/thread.c @@ -28,7 +28,7 @@ /* Some configurations require that the stack/registers be adjusted before * _thread_entry. See discussion in swap.S for _x86_thread_entry_wrapper() */ -#if defined(CONFIG_DEBUG_INFO) || defined(CONFIG_X86_IAMCU) +#if defined(CONFIG_X86_IAMCU) #define WRAPPER_REQUIRED #endif diff --git a/arch/x86/include/kernel_arch_data.h b/arch/x86/include/kernel_arch_data.h index 9f82a292f02..88b4836a8d7 100644 --- a/arch/x86/include/kernel_arch_data.h +++ b/arch/x86/include/kernel_arch_data.h @@ -401,9 +401,6 @@ extern "C" { struct _kernel_arch { -#if defined(CONFIG_DEBUG_INFO) - NANO_ISF *isf; /* ptr to interrupt stack frame */ -#endif }; typedef struct _kernel_arch _kernel_arch_t; diff --git a/arch/xtensa/include/kernel_arch_data.h b/arch/xtensa/include/kernel_arch_data.h index a694a54214d..048e6fca4af 100644 --- a/arch/xtensa/include/kernel_arch_data.h +++ b/arch/xtensa/include/kernel_arch_data.h @@ -48,9 +48,6 @@ extern "C" { typedef struct __esf __esf_t; struct _kernel_arch { -#if defined(CONFIG_DEBUG_INFO) - NANO_ISF *isf; /* ptr to interrupt stack frame */ -#endif }; typedef struct _kernel_arch _kernel_arch_t; diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h index 4c3e2ffb4ec..ce79104df07 100644 --- a/include/arch/x86/arch.h +++ b/include/arch/x86/arch.h @@ -350,12 +350,6 @@ struct _x86_syscall_stack_frame { */ typedef struct nanoIsf { -#ifdef CONFIG_DEBUG_INFO - unsigned int esp; - unsigned int ebp; - unsigned int ebx; - unsigned int esi; -#endif /* CONFIG_DEBUG_INFO */ unsigned int edi; unsigned int ecx; unsigned int edx; diff --git a/include/debug/debug_info.h b/include/debug/debug_info.h deleted file mode 100644 index 2d13662421c..00000000000 --- a/include/debug/debug_info.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2015-2016 Wind River Systems, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief Information necessary for debugging - * - * @internal No routine is provided for getting the current exception stack - * frame as the exception handler already has knowledge of the ESF. - */ - -#ifndef __DEBUG_INFO_H -#define __DEBUG_INFO_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifndef _ASMLANGUAGE - -/** - * @brief Get the current interrupt stack frame - * - * @details This routine (only called from an ISR) returns a - * pointer to the current interrupt stack frame. - * - * @return pointer the current interrupt stack frame - */ -extern NANO_ISF *sys_debug_current_isf_get(void); - -#endif /* _ASMLANGUAGE */ - -#ifdef __cplusplus -} -#endif - -#endif /* __DEBUG_INFO_H */