acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_callstack.h
1/*
2 Copyright (ca) 2002
3 Author: Konstantin Boukreev
5 Created: 16.01.2002 12:36:26
6 Version: 1.0.0
7
8 Permission to use, copy, modify, distribute and sell this software
9 and its documentation for any purpose is hereby granted without fee,
10 provided that the above copyright notice appear in all copies and
11 that both that copyright notice and this permission notice appear
12 in supporting documentation. Konstantin Boukreev makes no representations
13 about the suitability of this software for any purpose.
14 It is provided "as is" without express or implied warranty.
15
16 the exception class holding the call stack's information
17
18 exception2 : std_exception
19
20 try {
21 }
22 catch(exception2& ex) {
23 std_cout << ex.trace_call();
24 }
25
26*/
27#pragma once
28
29
30//class CLASS_DECL_ACME callstack :
31// virtual public ::matter
32//{
33//public:
34
35
36 /*
37
38 format argument
39 %m : module
40 %f : file
41 %l : line
42 %ld : line's displacement
43 %s : symbol
44 %sd : symbol's displacement
45
46 for example
47 "%f(%l) : %m at %s\n"
48 "%m.%s + %sd bytes, in %f:line %l\n"
49
50 */
51
52
53 //::i8 _str[4096];
54 //::i8 _strBuf[4096];
55 //::i8 _strFile[4096];
56 //::i8 _strSymbol[4096];
57 //::i8 _strS[4 * 1024 * 1024];
58
59
60 /*const_char_pointer m_pszFormat;
61 string m_strCallStack;
62 ::i32 m_iCount;
63
64 void * m_caller_address;
65*/
66
67
68
69
70//#if defined(__ANDROID__)
71//CLASS_DECL_ACME string unwind_callstack(const ::scoped_string & scopedstrFormat = callstack_default_format(), ::i32 iSkip = CALLSTACK_DEFAULT_SKIP_TRIGGER, ::i32 iCount = -1);
72//#else
73//CLASS_DECL_ACME string get_callstack(const ::scoped_string & scopedstrFormat = callstack_default_format(), ::i32 iSkip = CALLSTACK_DEFAULT_SKIP_TRIGGER, void * caller_address = nullptr, ::i32 iCount = -1);
74//#endif
75
76
77
78// ~callstack() override;
79
80//
81// //static void global_enable_stack_trace(bool bEnable = true);
82// static const_char_pointer default_format() { return "%f(%l) %s\n"; }
83//
84// //string get_dup(const ::scoped_string & scopedstrFormat = default_format(), ::i32 uiSkip = CALLSTACK_DEFAULT_SKIP_TRIGGER, ::i32 iCount = -1);
85//
86// void trace(const ::scoped_string & scopedstrFormat = default_format(), ::i32 uiSkip = CALLSTACK_DEFAULT_SKIP_TRIGGER, ::i32 iCount = -1);
87//
88// //string xxxstack_trace() const;
89//
90//};
91//
92//
93//