1501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown/*
2501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Copyright (C) 2011 The Android Open Source Project
3501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
4501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Licensed under the Apache License, Version 2.0 (the "License");
5501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * you may not use this file except in compliance with the License.
6501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * You may obtain a copy of the License at
7501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
8501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *      http://www.apache.org/licenses/LICENSE-2.0
9501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
10501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Unless required by applicable law or agreed to in writing, software
11501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * distributed under the License is distributed on an "AS IS" BASIS,
12501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * See the License for the specific language governing permissions and
14501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * limitations under the License.
15501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown */
16501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
17501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown/* Architecture dependent functions. */
18501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
19501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#ifndef _CORKSCREW_BACKTRACE_ARCH_H
20501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#define _CORKSCREW_BACKTRACE_ARCH_H
21501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
22501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#include "ptrace-arch.h"
23501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#include <corkscrew/backtrace.h>
24501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
25501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#include <signal.h>
26501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
27501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#ifdef __cplusplus
28501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brownextern "C" {
29501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#endif
30501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
31f0c5872637a63e28e3cd314cfc915c07f76df9c6Jeff Brown/* Rewind the program counter by one instruction. */
32f0c5872637a63e28e3cd314cfc915c07f76df9c6Jeff Brownuintptr_t rewind_pc_arch(const memory_t* memory, uintptr_t pc);
33f0c5872637a63e28e3cd314cfc915c07f76df9c6Jeff Brown
34501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brownssize_t unwind_backtrace_signal_arch(siginfo_t* siginfo, void* sigcontext,
35f0c5872637a63e28e3cd314cfc915c07f76df9c6Jeff Brown        const map_info_t* map_info_list,
36501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown        backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth);
37501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
38501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brownssize_t unwind_backtrace_ptrace_arch(pid_t tid, const ptrace_context_t* context,
39501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown        backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth);
40501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
41501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#ifdef __cplusplus
42501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown}
43501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#endif
44501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
45501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#endif // _CORKSCREW_BACKTRACE_ARCH_H
46