le_backtrace.h

Go to the documentation of this file.
1 /**
2  * @page c_backtrace Call Stack Backtrace Functionality
3  *
4  * Provides a function to dump the current call stack.
5  *
6  * <HR>
7  *
8  * Copyright (C) Sierra Wireless Inc.
9  */
10 
11 /** @file le_backtrace.h
12  *
13  * Legato @ref c_backtrace include file.
14  *
15  * Copyright (C) Sierra Wireless Inc.
16  */
17 
18 #ifndef LEGATO_BACKTRACE_INCLUDE_GUARD
19 #define LEGATO_BACKTRACE_INCLUDE_GUARD
20 
21 //--------------------------------------------------------------------------------------------------
22 /**
23  * Dump the current call stack to stderr.
24  *
25  * @param msg String to print as the title of the backtrace.
26  */
27 //--------------------------------------------------------------------------------------------------
28 #if LE_CONFIG_ENABLE_BACKTRACE
29 # define LE_BACKTRACE(msg) _le_backtrace(msg)
30 void _le_backtrace(const char *msg);
31 #else
32 # define LE_BACKTRACE(msg) ((void) (msg))
33 #endif
34 
35 #endif // LEGATO_BACKTRACE_INCLUDE_GUARD