From f384359c850809a1f75483dbe3978bef490a8cdd Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 May 2021 10:01:11 -0400 Subject: [PATCH] Fix #1016, additional codes from symbol table dump Adds documentation for OS_ERR_OUTPUT_TOO_LARGE and OS_ERR_NAME_TOO_LONG. These are primarily validated via coverage test, as symbol table dump is only possible on VxWorks. --- src/os/inc/osapi-module.h | 2 ++ src/unit-tests/osloader-test/ut_osloader_symtable_test.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/os/inc/osapi-module.h b/src/os/inc/osapi-module.h index c9b78f74b..ed5c52c5b 100644 --- a/src/os/inc/osapi-module.h +++ b/src/os/inc/osapi-module.h @@ -180,6 +180,8 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const * @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED * @retval #OS_INVALID_POINTER if the filename argument is NULL * @retval #OS_FS_ERR_PATH_INVALID if the filename argument is not valid + * @retval #OS_ERR_NAME_TOO_LONG if any of the symbol names are too long @covtest + * @retval #OS_ERR_OUTPUT_TOO_LARGE if the size_limit was reached before completing all symbols @covtest * @retval #OS_ERROR if an other/unspecified error occurs @covtest */ int32 OS_SymbolTableDump(const char *filename, size_t size_limit); diff --git a/src/unit-tests/osloader-test/ut_osloader_symtable_test.c b/src/unit-tests/osloader-test/ut_osloader_symtable_test.c index c28a80ffe..b9dcad61d 100644 --- a/src/unit-tests/osloader-test/ut_osloader_symtable_test.c +++ b/src/unit-tests/osloader-test/ut_osloader_symtable_test.c @@ -187,7 +187,10 @@ void UT_os_symbol_table_dump_test() /*-----------------------------------------------------*/ /* #3 Nominal */ - UT_NOMINAL_OR_NOTIMPL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 32000)); + if (UT_NOMINAL_OR_NOTIMPL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 32000))) + { + UT_RETVAL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 0), OS_ERR_OUTPUT_TOO_LARGE); + } } /*================================================================================*