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