2
* Copyright (C) 2007 The Android Open Source Project
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
#ifndef ANDROID_CALLSTACK_H
18
#define ANDROID_CALLSTACK_H
21
#include <sys/types.h>
23
#include <utils/String8.h>
24
#include <corkscrew/backtrace.h>
26
// ---------------------------------------------------------------------------
38
CallStack(const CallStack& rhs);
41
CallStack& operator = (const CallStack& rhs);
43
bool operator == (const CallStack& rhs) const;
44
bool operator != (const CallStack& rhs) const;
45
bool operator < (const CallStack& rhs) const;
46
bool operator >= (const CallStack& rhs) const;
47
bool operator > (const CallStack& rhs) const;
48
bool operator <= (const CallStack& rhs) const;
50
const void* operator [] (int index) const;
54
void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH);
56
// Dump a stack trace to the log
57
void dump(const char* prefix = 0) const;
59
// Return a string (possibly very long) containing the complete stack trace
60
String8 toString(const char* prefix = 0) const;
62
size_t size() const { return mCount; }
66
backtrace_frame_t mStack[MAX_DEPTH];
69
}; // namespace android
72
// ---------------------------------------------------------------------------
74
#endif // ANDROID_CALLSTACK_H