mbed OS5に対応したMilkcocoaライブラリのテストバージョンです。

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
jksoft
Date:
Tue Jan 24 13:41:36 2017 +0000
Revision:
24:6ba1245bf049
??????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 24:6ba1245bf049 1 /*******************************************************************************
jksoft 24:6ba1245bf049 2 * Copyright (c) 2014 IBM Corp.
jksoft 24:6ba1245bf049 3 *
jksoft 24:6ba1245bf049 4 * All rights reserved. This program and the accompanying materials
jksoft 24:6ba1245bf049 5 * are made available under the terms of the Eclipse Public License v1.0
jksoft 24:6ba1245bf049 6 * and Eclipse Distribution License v1.0 which accompany this distribution.
jksoft 24:6ba1245bf049 7 *
jksoft 24:6ba1245bf049 8 * The Eclipse Public License is available at
jksoft 24:6ba1245bf049 9 * http://www.eclipse.org/legal/epl-v10.html
jksoft 24:6ba1245bf049 10 * and the Eclipse Distribution License is available at
jksoft 24:6ba1245bf049 11 * http://www.eclipse.org/org/documents/edl-v10.php.
jksoft 24:6ba1245bf049 12 *
jksoft 24:6ba1245bf049 13 * Contributors:
jksoft 24:6ba1245bf049 14 * Ian Craggs - initial API and implementation and/or initial documentation
jksoft 24:6ba1245bf049 15 * Ian Craggs - fix for bug #434081
jksoft 24:6ba1245bf049 16 *******************************************************************************/
jksoft 24:6ba1245bf049 17
jksoft 24:6ba1245bf049 18 #ifndef STACKTRACE_H_
jksoft 24:6ba1245bf049 19 #define STACKTRACE_H_
jksoft 24:6ba1245bf049 20
jksoft 24:6ba1245bf049 21 #include <stdio.h>
jksoft 24:6ba1245bf049 22 #define NOSTACKTRACE 1
jksoft 24:6ba1245bf049 23
jksoft 24:6ba1245bf049 24 #if defined(NOSTACKTRACE)
jksoft 24:6ba1245bf049 25 #define FUNC_ENTRY
jksoft 24:6ba1245bf049 26 #define FUNC_ENTRY_NOLOG
jksoft 24:6ba1245bf049 27 #define FUNC_ENTRY_MED
jksoft 24:6ba1245bf049 28 #define FUNC_ENTRY_MAX
jksoft 24:6ba1245bf049 29 #define FUNC_EXIT
jksoft 24:6ba1245bf049 30 #define FUNC_EXIT_NOLOG
jksoft 24:6ba1245bf049 31 #define FUNC_EXIT_MED
jksoft 24:6ba1245bf049 32 #define FUNC_EXIT_MAX
jksoft 24:6ba1245bf049 33 #define FUNC_EXIT_RC(x)
jksoft 24:6ba1245bf049 34 #define FUNC_EXIT_MED_RC(x)
jksoft 24:6ba1245bf049 35 #define FUNC_EXIT_MAX_RC(x)
jksoft 24:6ba1245bf049 36
jksoft 24:6ba1245bf049 37 #else
jksoft 24:6ba1245bf049 38
jksoft 24:6ba1245bf049 39 #if defined(WIN32)
jksoft 24:6ba1245bf049 40 #define inline __inline
jksoft 24:6ba1245bf049 41 #define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 42 #define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1)
jksoft 24:6ba1245bf049 43 #define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 44 #define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 45 #define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 46 #define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1)
jksoft 24:6ba1245bf049 47 #define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 48 #define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 49 #define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 50 #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 51 #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 52 #else
jksoft 24:6ba1245bf049 53 #define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 54 #define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1)
jksoft 24:6ba1245bf049 55 #define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 56 #define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 57 #define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 58 #define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1)
jksoft 24:6ba1245bf049 59 #define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 60 #define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 61 #define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM)
jksoft 24:6ba1245bf049 62 #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM)
jksoft 24:6ba1245bf049 63 #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM)
jksoft 24:6ba1245bf049 64
jksoft 24:6ba1245bf049 65 void StackTrace_entry(const char* name, int line, int trace);
jksoft 24:6ba1245bf049 66 void StackTrace_exit(const char* name, int line, void* return_value, int trace);
jksoft 24:6ba1245bf049 67
jksoft 24:6ba1245bf049 68 void StackTrace_printStack(FILE* dest);
jksoft 24:6ba1245bf049 69 char* StackTrace_get(unsigned long);
jksoft 24:6ba1245bf049 70
jksoft 24:6ba1245bf049 71 #endif
jksoft 24:6ba1245bf049 72
jksoft 24:6ba1245bf049 73 #endif
jksoft 24:6ba1245bf049 74
jksoft 24:6ba1245bf049 75
jksoft 24:6ba1245bf049 76
jksoft 24:6ba1245bf049 77
jksoft 24:6ba1245bf049 78 #endif /* STACKTRACE_H_ */