1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17/* Architecture dependent functions. */
18
19#ifndef _CORKSCREW_BACKTRACE_ARCH_H
20#define _CORKSCREW_BACKTRACE_ARCH_H
21
22#include "ptrace-arch.h"
23#include <corkscrew/backtrace.h>
24
25#include <signal.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* Rewind the program counter by one instruction. */
32uintptr_t rewind_pc_arch(const memory_t* memory, uintptr_t pc);
33
34ssize_t unwind_backtrace_signal_arch(siginfo_t* siginfo, void* sigcontext,
35        const map_info_t* map_info_list,
36        backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth);
37
38ssize_t unwind_backtrace_ptrace_arch(pid_t tid, const ptrace_context_t* context,
39        backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif // _CORKSCREW_BACKTRACE_ARCH_H
46