mirror of
https://github.com/espressif/openthread.git
synced 2026-09-15 05:30:09 +00:00
[gcov] use __gcov_dump() instead for gcc 11 (#7629)
__gcov_flush is removed from gcc 11. This commit moves reset setup to a single header file.
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
#include "cli/cli_config.h"
|
||||
#include "common/code_utils.hpp"
|
||||
|
||||
#include "lib/platform/reset_util.h"
|
||||
|
||||
/**
|
||||
* This function initializes the CLI app.
|
||||
*
|
||||
@@ -47,19 +49,6 @@
|
||||
*/
|
||||
extern void otAppCliInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
jmp_buf gResetJump;
|
||||
|
||||
void __gcov_flush();
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_ENABLE_COVERAGE
|
||||
#define OPENTHREAD_ENABLE_COVERAGE 0
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
@@ -93,16 +82,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
otInstance *instance;
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
if (setjmp(gResetJump))
|
||||
{
|
||||
alarm(0);
|
||||
#if OPENTHREAD_ENABLE_COVERAGE
|
||||
__gcov_flush();
|
||||
#endif
|
||||
execvp(argv[0], argv);
|
||||
}
|
||||
#endif
|
||||
OT_SETUP_RESET_JUMP(argv);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
size_t otInstanceBufferLength = 0;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "openthread-system.h"
|
||||
|
||||
#include "lib/platform/reset_util.h"
|
||||
/**
|
||||
* This function initializes the NCP app.
|
||||
*
|
||||
@@ -44,19 +45,6 @@
|
||||
*/
|
||||
extern void otAppNcpInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
jmp_buf gResetJump;
|
||||
|
||||
void __gcov_flush();
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_ENABLE_COVERAGE
|
||||
#define OPENTHREAD_ENABLE_COVERAGE 0
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
@@ -78,16 +66,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
otInstance *instance;
|
||||
|
||||
#if OPENTHREAD_EXAMPLES_SIMULATION
|
||||
if (setjmp(gResetJump))
|
||||
{
|
||||
alarm(0);
|
||||
#if OPENTHREAD_ENABLE_COVERAGE
|
||||
__gcov_flush();
|
||||
#endif
|
||||
execvp(argv[0], argv);
|
||||
}
|
||||
#endif
|
||||
OT_SETUP_RESET_JUMP(argv);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
size_t otInstanceBufferLength = 0;
|
||||
|
||||
Reference in New Issue
Block a user