You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/31 10:02:36 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #3256: libc/execinfo: add backstace support based on EABI Unwinder

anchao opened a new pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256


   ## Summary
   
   libc/execinfo: add backstace support based on EABI Unwinder 
   libc/execinfo: add dump_stack support
   
   1. Flags < -funwind-tables > is required
   2. Keep the section ".exidx" in linker script
   
   ## Impact
   
   N/A
   
   ## Testing
   
   
   ```
   diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c
   index fcc04112..4b85a41b 100644
   --- a/examples/hello/hello_main.c
   +++ b/examples/hello/hello_main.c
   @@ -24,6 +24,7 @@
    
    #include <nuttx/config.h>
    #include <stdio.h>
   +#include <execinfo.h>
    
    /****************************************************************************
     * Public Functions
   @@ -36,5 +37,6 @@
    int main(int argc, FAR char *argv[])
    {
      printf("Hello, World!!\n");
   +  dump_stack();
      return 0;
    }
   ```
   
   ```
   ap> hello
   Hello, World!!
   [   73.800676] [42] [  INFO] [BackTrace]:   0xc0d9bfe  0xc0f3330  0xc0dba0a   0x210838
   ```
   
   ```
   $ arm-none-eabi-addr2line -e nuttx 0xc0d9bfe  0xc0f3330  0xc0dba0a   0x210838
   nuttx/libs/libc/debug/lib_dumpstack.c:52
   apps/examples/hello/hello_main.c:42
   nuttx/libs/libc/sched/task_startup.c:165
   nuttx/sched/task/task_start.c:144
   ```
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 merged pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
davids5 merged pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#discussion_r604902483



##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx
+		using the information automatically generated by the
+		compiler. The resulting nuttx image is slightly bigger but

Review comment:
       Done

##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx

Review comment:
       Done




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#issuecomment-811692925


   let's ignore:
   ```
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:38:2: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:53:7: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:54:28: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:64:41: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:74:6: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:74:25: error: Mixed case identifier found
   Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/libs/libc/debug/lib_backtrace.c:116:2: error: Mixed case identifier found
   ```
   since unwind API is defined by toolchain, we can't change them.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#discussion_r604889380



##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx
+		using the information automatically generated by the
+		compiler. The resulting nuttx image is slightly bigger but

Review comment:
       Or at least written correctly: NuttX :-D




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#issuecomment-811919851


   @xiaoxiang781216, @anchao - should the allowed words be added to the whitelist as a commit in this PR?


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#issuecomment-812599457


   @anchao please provide a new patch to update g_white_list in tools/nxstyle.c.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#discussion_r604835123



##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx

Review comment:
       ```suggestion
   		This option enables stack unwinding support in NuttX
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#issuecomment-822365926


   Done, @xiaoxiang781216 @davids5  please review again, thanks


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#discussion_r604835369



##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx
+		using the information automatically generated by the
+		compiler. The resulting nuttx image is slightly bigger but

Review comment:
       ```suggestion
   		compiler. The resulting image is slightly bigger but
   ```
   nit: I think `nuttx` may be omitted here




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3256: libc/execinfo: add backtrace support based on EABI Unwinder

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #3256:
URL: https://github.com/apache/incubator-nuttx/pull/3256#discussion_r604889380



##########
File path: libs/libc/debug/Kconfig
##########
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+# These are library functions that may be overriden by architecture-
+# specific implementations.  Not all architectures support implementations
+# for every library function.
+
+menu "Library Debugging"
+
+config EABI_UNWINDER
+	bool "EABI Stack Unwinder"
+	default "n"
+	---help---
+		This option enables stack unwinding support in the nuttx
+		using the information automatically generated by the
+		compiler. The resulting nuttx image is slightly bigger but

Review comment:
       Or at least spelled correctly: NuttX :-D




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org