Commit 07493105 authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Anas Nashif
Browse files

subsys/debug: remove `CONFIG_EXCEPTION_STACK_TRACE_SYMTAB`



Having `CONFIG_EXCEPTION_STACK_TRACE_SYMTAB` to select the
`CONFIG_SYMTAB` or to explicitly not print the symbol name
during exception stack unwind seems unnecessary, as the extra
code to print the symbol name is negligible when compared with
the symbol table, so just remove it.

Signed-off-by: default avatarYong Cong Sin <ycsin@meta.com>
Signed-off-by: default avatarYong Cong Sin <yongcong.sin@gmail.com>
parent ab676fdb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -248,20 +248,20 @@ static bool in_fatal_stack_bound(uintptr_t addr, const struct k_thread *const th
#define PR_REG "%016" PRIxPTR
#endif

#ifdef CONFIG_EXCEPTION_STACK_TRACE_SYMTAB
#ifdef CONFIG_SYMTAB
#define LOG_STACK_TRACE(idx, ra, name, offset)                                                     \
	LOG_ERR("     %2d: ra: " PR_REG " [%s+0x%x]", idx, ra, name, offset)
#else
#define LOG_STACK_TRACE(idx, ra, name, offset) LOG_ERR("     %2d: ra: " PR_REG, idx, ra)
#endif /* CONFIG_EXCEPTION_STACK_TRACE_SYMTAB */
#endif /* CONFIG_SYMTAB */

static bool print_trace_address(void *arg, unsigned long ra)
{
	int *i = arg;
#ifdef CONFIG_EXCEPTION_STACK_TRACE_SYMTAB
#ifdef CONFIG_SYMTAB
	uint32_t offset = 0;
	const char *name = symtab_find_symbol_name(ra, &offset);
#endif
#endif /* CONFIG_SYMTAB */

	LOG_STACK_TRACE((*i)++, ra, name, offset);

+0 −9
Original line number Diff line number Diff line
@@ -387,15 +387,6 @@ config EXCEPTION_STACK_TRACE
	  print a stack trace of function memory addresses when an
	  exception is reported.

config EXCEPTION_STACK_TRACE_SYMTAB
	bool "Print function names in the stack trace"
	select SYMTAB
	depends on EXCEPTION_STACK_TRACE
	help
	  Enable this if you want to print the function names in the
	  stack trace output. This will generate the symtab and
	  can consume a lot of ROM if there's a lot of functions.

#
# Miscellaneous debugging options
#
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ tests:
      - qemu_cortex_a53
    extra_configs:
      - CONFIG_FRAME_POINTER=y
      - CONFIG_EXCEPTION_STACK_TRACE_SYMTAB=y
      - CONFIG_SYMTAB=y
    harness_config:
      type: multi_line
      regex: