xiaoxiang781216 commented on code in PR #13546:
URL: https://github.com/apache/nuttx/pull/13546#discussion_r1767690069


##########
arch/xtensa/Kconfig:
##########
@@ -238,26 +238,14 @@ config XTENSA_CP_INITSET
                is provided by CONFIG_XTENSA_CP_INITSET.  Each bit corresponds 
to one
                coprocessor with the same bit layout as for the CPENABLE 
register.
 
-config XTENSA_DUMPBT_ON_ASSERT
-       bool "Dump backtrace on assertions"
-       default y
-       depends on DEBUG_ALERT
-       ---help---
-               Enable a backtrace dump on assertions.
-
-config XTENSA_BTDEPTH
-       int "Backtrace depth"
-       default 50
-       depends on XTENSA_DUMPBT_ON_ASSERT
-       ---help---
-               This is the depth of the backtrace.
-
 config XTENSA_INTBACKTRACE
-       bool "Full backtrace from interrupts"
-       default n
-       depends on XTENSA_DUMPBT_ON_ASSERT
+       bool

Review Comment:
   how to disable this option if without the prompt string?



##########
tools/espressif/btdecode.sh:
##########
@@ -0,0 +1,144 @@
+#!/usr/bin/env bash
+############################################################################
+# tools/espressif/btdecode.sh

Review Comment:
   it's a general tool, let's move out of espressif folder



##########
tools/espressif/btdecode.sh:
##########
@@ -0,0 +1,144 @@
+#!/usr/bin/env bash
+############################################################################
+# tools/espressif/btdecode.sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# This script can be used to decode the backtrace that's dumped on assertions.
+#
+# On assertions we can find the raw backtrace dump similar to:
+# ...
+# sched_dumpstack: backtrace| 0: 0x400e1a2a 0x40082912
+# sched_dumpstack: backtrace| 1: 0x400e39ac 0x400ef7c3 0x400ef7fc 0x400e8116 
0x400e7910 0x400e7be8 0x400e6c5c 0x400e6ad6
+# sched_dumpstack: backtrace| 1: 0x400e6a99 0x400e4005 0x400e2754
+# sched_dumpstack: backtrace| 2: 0x400f13ee 0x400e4005 0x400e2754
+# ...
+#
+# Copy that to a file and call this script as:
+#    ./tools/espressif/btdecode.sh esp32 backtrace_file
+#
+# The result should be similar to the following:
+#    0x400e1a2a: function_name at file.c:line
+#    0x40082912: function_name at file.c:line
+
+USAGE="USAGE: ${0} chip backtrace_file"
+VALID_CHIPS=("esp32" "esp32s2" "esp32s3" "esp32c3" "esp32c6" "esp32h2")
+
+# Make sure we have the required argument(s)
+
+if [ -z "$2" ]; then
+  echo "No backtrace supplied!"
+  echo "$USAGE"
+  exit 1
+fi
+
+# Check if the chip argument is valid
+
+chip=$1
+if [[ ! " ${VALID_CHIPS[@]} " =~ " ${chip} " ]]; then
+  echo "Invalid chip specified! Valid options are: ${VALID_CHIPS[*]}"
+  echo "$USAGE"
+  exit 4
+fi
+
+# Set the appropriate addr2line tool based on the chip
+
+case $chip in

Review Comment:
   let's support specify toolchain directly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to