debug/assert: decouple configuration of show file name feature

add new config CONFIG_ASSERTIONS_FILENAME to library call assert(3) to decouple with CONFIG_DEBUG_ASSERTIONS

| Function         |CONFIG                            | Show filename/line |
| ---              | ---                              | ---                |
|assert(), ASSERT()|CONFIG_ASSERTIONS_FILENAME=y      | Yes                |
|assert(), ASSERT()|CONFIG_ASSERTIONS_FILENAME=n      | No                 |
|DEBUGASSERT()     |CONFIG_DEBUG_ASSERTIONS_FILENAME=y| Yes                |
|DEBUGASSERT()     |CONFIG_DEBUG_ASSERTIONS_FILENAME=n| No                 |

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-10-19 14:37:48 +08:00
committed by Xiang Xiao
parent 2d8fc9522f
commit a521fd7b82
2 changed files with 63 additions and 42 deletions

View File

@@ -638,6 +638,15 @@ config NDEBUG
bool "Define NDEBUG globally"
default !DEBUG_ASSERTIONS
config ASSERTIONS_FILENAME
bool "Enable library call assert(3) show the file name"
default DEBUG_ASSERTIONS_FILENAME || !DEFAULT_SMALL
depends on !NDEBUG
---help---
This option can display the file information of the library call assert(3)
function when it is enabled. This option maybe will take up a lot
of space from applications.
config DEBUG_ALERT
bool
default n