mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-19 00:56:57 -04:00
Remove libunwind source code; Modify Android.mk files
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
HERE_PATH := $(LOCAL_PATH)
|
||||
|
||||
include $(HERE_PATH)/crash_dump/libunwind/Android.mk
|
||||
# include $(HERE_PATH)/crash_dump/libbacktrace/Android.mk
|
||||
# include $(HERE_PATH)/crash_dump/debuggerd/Android.mk
|
||||
# include $(HERE_PATH)/crash_dump/libunwind/Android.mk
|
||||
include $(HERE_PATH)/crash_dump/libbacktrace/Android.mk
|
||||
include $(HERE_PATH)/crash_dump/debuggerd/Android.mk
|
||||
|
||||
LOCAL_PATH := $(HERE_PATH)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -26,11 +26,11 @@ ifneq ($(build_target),$(filter $(build_target),SHARED_LIBRARY STATIC_LIBRARY))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(build_type),target)
|
||||
include $(LLVM_DEVICE_BUILD_MK)
|
||||
else
|
||||
include $(LLVM_HOST_BUILD_MK)
|
||||
endif
|
||||
# ifeq ($(build_type),target)
|
||||
# include $(LLVM_DEVICE_BUILD_MK)
|
||||
# else
|
||||
# include $(LLVM_HOST_BUILD_MK)
|
||||
# endif
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES += \
|
||||
$(LOCAL_PATH)/Android.mk \
|
||||
|
||||
@@ -19,6 +19,7 @@ LOCAL_PATH:= $(call my-dir)
|
||||
libbacktrace_common_cflags := \
|
||||
-Wall \
|
||||
-Werror \
|
||||
-I$(HERE_PATH)/crash_dump/libunwind/include
|
||||
|
||||
libbacktrace_common_conlyflags := \
|
||||
-std=gnu99 \
|
||||
@@ -38,8 +39,8 @@ build_host := true
|
||||
endif
|
||||
endif
|
||||
|
||||
LLVM_ROOT_PATH := external/llvm
|
||||
include $(LLVM_ROOT_PATH)/llvm.mk
|
||||
# LLVM_ROOT_PATH := external/llvm
|
||||
# include $(LLVM_ROOT_PATH)/llvm.mk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# The libbacktrace library.
|
||||
@@ -55,13 +56,10 @@ libbacktrace_src_files := \
|
||||
UnwindMap.cpp \
|
||||
UnwindPtrace.cpp \
|
||||
|
||||
libbacktrace_shared_libraries := \
|
||||
libbase \
|
||||
liblog \
|
||||
libunwind \
|
||||
libbacktrace_shared_ldlibs := -llog -lunwind
|
||||
# -lbase
|
||||
|
||||
libbacktrace_static_libraries := \
|
||||
libcutils
|
||||
# libbacktrace_shared_libraries := libunwind
|
||||
|
||||
module := libbacktrace
|
||||
module_tag := optional
|
||||
@@ -71,10 +69,11 @@ include $(LOCAL_PATH)/Android.build.mk
|
||||
build_type := host
|
||||
libbacktrace_multilib := both
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
libbacktrace_static_libraries := \
|
||||
libbase \
|
||||
liblog \
|
||||
libunwind \
|
||||
libbacktrace_static_ldlibs := -llog -lunwind
|
||||
# -lbase
|
||||
|
||||
# libbacktrace_static_libraries := libunwind
|
||||
|
||||
|
||||
build_target := STATIC_LIBRARY
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
@@ -120,111 +119,8 @@ module := libbacktrace_offline
|
||||
build_type := target
|
||||
build_target := STATIC_LIBRARY
|
||||
libbacktrace_offline_multilib := both
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
# i don't know if this lib is required or not
|
||||
# include $(LOCAL_PATH)/Android.build.mk
|
||||
build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
# include $(LOCAL_PATH)/Android.build.mk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# The libbacktrace_test library needed by backtrace_test.
|
||||
#-------------------------------------------------------------------------
|
||||
libbacktrace_test_cflags := \
|
||||
-O0 \
|
||||
|
||||
libbacktrace_test_src_files := \
|
||||
backtrace_testlib.c \
|
||||
|
||||
libbacktrace_test_strip_module := false
|
||||
|
||||
module := libbacktrace_test
|
||||
module_tag := debug
|
||||
build_type := target
|
||||
build_target := SHARED_LIBRARY
|
||||
libbacktrace_test_multilib := both
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# The backtrace_test executable.
|
||||
#-------------------------------------------------------------------------
|
||||
backtrace_test_cflags := \
|
||||
-fno-builtin \
|
||||
-O0 \
|
||||
-g \
|
||||
|
||||
backtrace_test_cflags_target := \
|
||||
-DENABLE_PSS_TESTS \
|
||||
|
||||
backtrace_test_src_files := \
|
||||
backtrace_offline_test.cpp \
|
||||
backtrace_test.cpp \
|
||||
GetPss.cpp \
|
||||
thread_utils.c \
|
||||
|
||||
backtrace_test_ldlibs_host := \
|
||||
-lpthread \
|
||||
-lrt \
|
||||
|
||||
backtrace_test_shared_libraries := \
|
||||
libbacktrace_test \
|
||||
libbacktrace \
|
||||
libbase \
|
||||
libcutils \
|
||||
liblog \
|
||||
libunwind \
|
||||
|
||||
backtrace_test_shared_libraries_target += \
|
||||
libdl \
|
||||
libutils \
|
||||
libLLVM \
|
||||
|
||||
backtrace_test_static_libraries := \
|
||||
libbacktrace_offline \
|
||||
|
||||
backtrace_test_static_libraries_target := \
|
||||
libziparchive \
|
||||
libz \
|
||||
|
||||
backtrace_test_static_libraries_host := \
|
||||
libziparchive-host \
|
||||
libz \
|
||||
libutils \
|
||||
libLLVMObject \
|
||||
libLLVMBitReader \
|
||||
libLLVMMC \
|
||||
libLLVMMCParser \
|
||||
libLLVMCore \
|
||||
libLLVMSupport \
|
||||
|
||||
backtrace_test_ldlibs_host += \
|
||||
-ldl \
|
||||
|
||||
backtrace_test_strip_module := false
|
||||
|
||||
module := backtrace_test
|
||||
module_tag := debug
|
||||
build_type := target
|
||||
build_target := NATIVE_TEST
|
||||
backtrace_test_multilib := both
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Special truncated libbacktrace library for mac.
|
||||
#----------------------------------------------------------------------------
|
||||
ifeq ($(HOST_OS),darwin)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libbacktrace
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
BacktraceMap.cpp \
|
||||
|
||||
LOCAL_MULTILIB := both
|
||||
|
||||
include $(BUILD_HOST_SHARED_LIBRARY)
|
||||
|
||||
endif # HOST_OS-darwin
|
||||
|
||||
69
app/src/main/jni/crash_dump/libunwind/.gitignore
vendored
69
app/src/main/jni/crash_dump/libunwind/.gitignore
vendored
@@ -1,69 +0,0 @@
|
||||
*.la
|
||||
*.a
|
||||
*.o
|
||||
*.lo
|
||||
*~
|
||||
|
||||
.libs/
|
||||
.deps/
|
||||
|
||||
.dirstamp
|
||||
Makefile
|
||||
Makefile.in
|
||||
|
||||
INSTALL
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
config.log
|
||||
config.status
|
||||
config/
|
||||
configure
|
||||
libtool
|
||||
|
||||
doc/common.tex
|
||||
|
||||
src/[GL]cursor_i.h
|
||||
src/mk_[GL]cursor_i.s
|
||||
|
||||
include/config.h
|
||||
include/config.h.in
|
||||
include/libunwind-common.h
|
||||
include/stamp-h1
|
||||
|
||||
tests/[GL]test-bt
|
||||
tests/[GL]test-concurrent
|
||||
tests/[GL]test-dyn1
|
||||
tests/[GL]test-exc
|
||||
tests/[GL]test-init
|
||||
tests/[GL]test-resume-sig
|
||||
tests/[GL]test-resume-sig-rt
|
||||
tests/[GL]perf-simple
|
||||
tests/Ltest-nomalloc
|
||||
tests/Ltest-nocalloc
|
||||
tests/Lperf-simple
|
||||
tests/check-namespace.sh
|
||||
tests/crasher
|
||||
tests/forker
|
||||
tests/mapper
|
||||
tests/rs-race
|
||||
tests/test-async-sig
|
||||
tests/test-coredump-unwind
|
||||
tests/test-flush-cache
|
||||
tests/test-init-remote
|
||||
tests/test-mem
|
||||
tests/test-ptrace
|
||||
tests/test-setjmp
|
||||
tests/test-strerror
|
||||
tests/test-proc-info
|
||||
tests/test-ptrace-misc
|
||||
tests/test-varargs
|
||||
tests/test-static-link
|
||||
tests/[GL]test-trace
|
||||
tests/[GL]perf-trace
|
||||
tests/Ltest-cxx-exceptions
|
||||
tests/[GL]ia64-test-nat
|
||||
tests/[GL]ia64-test-rbs
|
||||
tests/[GL]ia64-test-readonly
|
||||
tests/[GL]ia64-test-stack
|
||||
tests/ia64-test-dyn1
|
||||
tests/ia64-test-sig
|
||||
@@ -1 +0,0 @@
|
||||
David Mosberger <dmosberger@gmail.org>
|
||||
@@ -1,486 +0,0 @@
|
||||
//
|
||||
// Copyright (C) 2014 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Set to true to enable a debug build of the libraries.
|
||||
// To control what is logged, set the environment variable UNW_DEBUG_LEVEL=x,
|
||||
// where x controls the verbosity (from 1 to 20).
|
||||
libunwind_debug = ["false"]
|
||||
|
||||
libunwind_common_cppflags = [
|
||||
"-Wno-old-style-cast",
|
||||
]
|
||||
|
||||
libunwind_common_cflags = [
|
||||
"-Wno-unused-parameter",
|
||||
"-Werror",
|
||||
]
|
||||
|
||||
// gcc 4.8 appears to be overeager declaring that a variable is uninitialized,
|
||||
// under certain circumstances. Turn off this warning only for target so that
|
||||
// coverage is still present for the host code. When the entire build system
|
||||
// is switched to 4.9, then this can be removed.
|
||||
libunwind_common_cflags_target = ["-Wno-maybe-uninitialized"]
|
||||
|
||||
// src/mi/backtrace.c is misdetected as a bogus header guard by clang 3.5
|
||||
// src/x86_64/Gstash_frame.c has unnecessary calls to labs.
|
||||
libunwind_common_clang_cflags = [
|
||||
"-Wno-header-guard",
|
||||
"-Wno-absolute-value",
|
||||
// The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
|
||||
"-Wno-inline-asm",
|
||||
]
|
||||
|
||||
libunwind_common_cflags += [
|
||||
"-DHAVE_CONFIG_H",
|
||||
"-D_GNU_SOURCE",
|
||||
"-DNDEBUG",
|
||||
]
|
||||
|
||||
libunwind_common_debug_cflags = [
|
||||
"-UNDEBUG",
|
||||
"-DDEBUG",
|
||||
"-U_FORTIFY_SOURCE",
|
||||
]
|
||||
|
||||
libunwind_common_c_local_includes = [
|
||||
"src",
|
||||
"include",
|
||||
]
|
||||
|
||||
libunwind_common_arch_includes = {
|
||||
arm: {
|
||||
local_include_dirs: ["include/tdep-arm"],
|
||||
},
|
||||
arm64: {
|
||||
local_include_dirs: ["include/tdep-aarch64"],
|
||||
},
|
||||
mips: {
|
||||
local_include_dirs: ["include/tdep-mips"],
|
||||
},
|
||||
mips64: {
|
||||
local_include_dirs: ["include/tdep-mips"],
|
||||
},
|
||||
x86: {
|
||||
local_include_dirs: ["include/tdep-x86"],
|
||||
},
|
||||
x86_64: {
|
||||
local_include_dirs: ["include/tdep-x86_64"],
|
||||
},
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// libunwind shared and static library
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
cc_library {
|
||||
name: "libunwind",
|
||||
host_supported: true,
|
||||
srcs: [
|
||||
"src/mi/init.c",
|
||||
"src/mi/flush_cache.c",
|
||||
"src/mi/mempool.c",
|
||||
"src/mi/strerror.c",
|
||||
"src/mi/backtrace.c",
|
||||
"src/mi/dyn-cancel.c",
|
||||
"src/mi/dyn-info-list.c",
|
||||
"src/mi/dyn-register.c",
|
||||
"src/mi/map.c",
|
||||
"src/mi/Lmap.c",
|
||||
"src/mi/Ldyn-extract.c",
|
||||
"src/mi/Lfind_dynamic_proc_info.c",
|
||||
"src/mi/Lget_proc_info_by_ip.c",
|
||||
"src/mi/Lget_proc_name.c",
|
||||
"src/mi/Lput_dynamic_unwind_info.c",
|
||||
"src/mi/Ldestroy_addr_space.c",
|
||||
"src/mi/Lget_reg.c",
|
||||
"src/mi/Lset_reg.c",
|
||||
"src/mi/Lget_fpreg.c",
|
||||
"src/mi/Lset_fpreg.c",
|
||||
"src/mi/Lset_caching_policy.c",
|
||||
"src/mi/Gdyn-extract.c",
|
||||
"src/mi/Gdyn-remote.c",
|
||||
"src/mi/Gfind_dynamic_proc_info.c",
|
||||
"src/mi/Gget_accessors.c",
|
||||
"src/mi/Gget_proc_info_by_ip.c",
|
||||
"src/mi/Gget_proc_name.c",
|
||||
"src/mi/Gput_dynamic_unwind_info.c",
|
||||
"src/mi/Gdestroy_addr_space.c",
|
||||
"src/mi/Gget_reg.c",
|
||||
"src/mi/Gset_reg.c",
|
||||
"src/mi/Gget_fpreg.c",
|
||||
"src/mi/Gset_fpreg.c",
|
||||
"src/mi/Gset_caching_policy.c",
|
||||
"src/dwarf/Lexpr.c",
|
||||
"src/dwarf/Lfde.c",
|
||||
"src/dwarf/Lparser.c",
|
||||
"src/dwarf/Lpe.c",
|
||||
"src/dwarf/Lstep_dwarf.c",
|
||||
"src/dwarf/Lfind_proc_info-lsb.c",
|
||||
"src/dwarf/Lfind_unwind_table.c",
|
||||
"src/dwarf/Gexpr.c",
|
||||
"src/dwarf/Gfde.c",
|
||||
"src/dwarf/Gfind_proc_info-lsb.c",
|
||||
"src/dwarf/Gfind_unwind_table.c",
|
||||
"src/dwarf/Gparser.c",
|
||||
"src/dwarf/Gpe.c",
|
||||
"src/dwarf/Gstep_dwarf.c",
|
||||
"src/dwarf/global.c",
|
||||
"src/os-common.c",
|
||||
"src/os-linux.c",
|
||||
"src/Los-common.c",
|
||||
|
||||
// ptrace files for remote unwinding.
|
||||
"src/ptrace/_UPT_accessors.c",
|
||||
"src/ptrace/_UPT_access_fpreg.c",
|
||||
"src/ptrace/_UPT_access_mem.c",
|
||||
"src/ptrace/_UPT_access_reg.c",
|
||||
"src/ptrace/_UPT_create.c",
|
||||
"src/ptrace/_UPT_destroy.c",
|
||||
"src/ptrace/_UPT_find_proc_info.c",
|
||||
"src/ptrace/_UPT_get_dyn_info_list_addr.c",
|
||||
"src/ptrace/_UPT_put_unwind_info.c",
|
||||
"src/ptrace/_UPT_get_proc_name.c",
|
||||
"src/ptrace/_UPT_reg_offset.c",
|
||||
"src/ptrace/_UPT_resume.c",
|
||||
],
|
||||
|
||||
cflags: libunwind_common_cflags,
|
||||
clang_cflags: libunwind_common_clang_cflags,
|
||||
local_include_dirs: libunwind_common_c_local_includes,
|
||||
|
||||
arch: {
|
||||
arm: {
|
||||
srcs: [
|
||||
"src/arm/is_fpreg.c",
|
||||
"src/arm/regname.c",
|
||||
"src/arm/Gcreate_addr_space.c",
|
||||
"src/arm/Gget_proc_info.c",
|
||||
"src/arm/Gget_save_loc.c",
|
||||
"src/arm/Gglobal.c",
|
||||
"src/arm/Ginit.c",
|
||||
"src/arm/Ginit_local.c",
|
||||
"src/arm/Ginit_remote.c",
|
||||
"src/arm/Gregs.c",
|
||||
"src/arm/Gresume.c",
|
||||
"src/arm/Gstep.c",
|
||||
"src/arm/Lcreate_addr_space.c",
|
||||
"src/arm/Lget_proc_info.c",
|
||||
"src/arm/Lget_save_loc.c",
|
||||
"src/arm/Lglobal.c",
|
||||
"src/arm/Linit.c",
|
||||
"src/arm/Linit_local.c",
|
||||
"src/arm/Linit_remote.c",
|
||||
"src/arm/Lregs.c",
|
||||
"src/arm/Lresume.c",
|
||||
"src/arm/Lstep.c",
|
||||
|
||||
"src/arm/getcontext.S",
|
||||
"src/arm/Gis_signal_frame.c",
|
||||
"src/arm/Gex_tables.c",
|
||||
"src/arm/Lis_signal_frame.c",
|
||||
"src/arm/Lex_tables.c",
|
||||
],
|
||||
},
|
||||
arm64: {
|
||||
srcs: [
|
||||
"src/aarch64/is_fpreg.c",
|
||||
"src/aarch64/regname.c",
|
||||
"src/aarch64/Gcreate_addr_space.c",
|
||||
"src/aarch64/Gget_proc_info.c",
|
||||
"src/aarch64/Gget_save_loc.c",
|
||||
"src/aarch64/Gglobal.c",
|
||||
"src/aarch64/Ginit.c",
|
||||
"src/aarch64/Ginit_local.c",
|
||||
"src/aarch64/Ginit_remote.c",
|
||||
"src/aarch64/Gregs.c",
|
||||
"src/aarch64/Gresume.c",
|
||||
"src/aarch64/Gstep.c",
|
||||
"src/aarch64/Lcreate_addr_space.c",
|
||||
"src/aarch64/Lget_proc_info.c",
|
||||
"src/aarch64/Lget_save_loc.c",
|
||||
"src/aarch64/Lglobal.c",
|
||||
"src/aarch64/Linit.c",
|
||||
"src/aarch64/Linit_local.c",
|
||||
"src/aarch64/Linit_remote.c",
|
||||
"src/aarch64/Lregs.c",
|
||||
"src/aarch64/Lresume.c",
|
||||
"src/aarch64/Lstep.c",
|
||||
|
||||
"src/aarch64/Gis_signal_frame.c",
|
||||
"src/aarch64/Lis_signal_frame.c",
|
||||
],
|
||||
},
|
||||
mips: {
|
||||
srcs: [
|
||||
"src/mips/is_fpreg.c",
|
||||
"src/mips/regname.c",
|
||||
"src/mips/Gcreate_addr_space.c",
|
||||
"src/mips/Gget_proc_info.c",
|
||||
"src/mips/Gget_save_loc.c",
|
||||
"src/mips/Gglobal.c",
|
||||
"src/mips/Ginit.c",
|
||||
"src/mips/Ginit_local.c",
|
||||
"src/mips/Ginit_remote.c",
|
||||
"src/mips/Gregs.c",
|
||||
"src/mips/Gresume.c",
|
||||
"src/mips/Gstep.c",
|
||||
"src/mips/Lcreate_addr_space.c",
|
||||
"src/mips/Lget_proc_info.c",
|
||||
"src/mips/Lget_save_loc.c",
|
||||
"src/mips/Lglobal.c",
|
||||
"src/mips/Linit.c",
|
||||
"src/mips/Linit_local.c",
|
||||
"src/mips/Linit_remote.c",
|
||||
"src/mips/Lregs.c",
|
||||
"src/mips/Lresume.c",
|
||||
"src/mips/Lstep.c",
|
||||
|
||||
"src/mips/getcontext-android.S",
|
||||
"src/mips/Gis_signal_frame.c",
|
||||
"src/mips/Lis_signal_frame.c",
|
||||
],
|
||||
},
|
||||
// mips and mips64 use the same sources but define _MIP_SIM differently
|
||||
// to change the behavior.
|
||||
// mips uses o32 abi (_MIPS_SIM == _ABIO32).
|
||||
// mips64 uses n64 abi (_MIPS_SIM == _ABI64).
|
||||
mips64: {
|
||||
srcs: [
|
||||
"src/mips/is_fpreg.c",
|
||||
"src/mips/regname.c",
|
||||
"src/mips/Gcreate_addr_space.c",
|
||||
"src/mips/Gget_proc_info.c",
|
||||
"src/mips/Gget_save_loc.c",
|
||||
"src/mips/Gglobal.c",
|
||||
"src/mips/Ginit.c",
|
||||
"src/mips/Ginit_local.c",
|
||||
"src/mips/Ginit_remote.c",
|
||||
"src/mips/Gregs.c",
|
||||
"src/mips/Gresume.c",
|
||||
"src/mips/Gstep.c",
|
||||
"src/mips/Lcreate_addr_space.c",
|
||||
"src/mips/Lget_proc_info.c",
|
||||
"src/mips/Lget_save_loc.c",
|
||||
"src/mips/Lglobal.c",
|
||||
"src/mips/Linit.c",
|
||||
"src/mips/Linit_local.c",
|
||||
"src/mips/Linit_remote.c",
|
||||
"src/mips/Lregs.c",
|
||||
"src/mips/Lresume.c",
|
||||
"src/mips/Lstep.c",
|
||||
|
||||
"src/mips/getcontext-android.S",
|
||||
"src/mips/Gis_signal_frame.c",
|
||||
"src/mips/Lis_signal_frame.c",
|
||||
],
|
||||
},
|
||||
x86: {
|
||||
srcs: [
|
||||
"src/x86/is_fpreg.c",
|
||||
"src/x86/regname.c",
|
||||
"src/x86/Gcreate_addr_space.c",
|
||||
"src/x86/Gget_proc_info.c",
|
||||
"src/x86/Gget_save_loc.c",
|
||||
"src/x86/Gglobal.c",
|
||||
"src/x86/Ginit.c",
|
||||
"src/x86/Ginit_local.c",
|
||||
"src/x86/Ginit_remote.c",
|
||||
"src/x86/Gregs.c",
|
||||
"src/x86/Gresume.c",
|
||||
"src/x86/Gstep.c",
|
||||
"src/x86/Lcreate_addr_space.c",
|
||||
"src/x86/Lget_proc_info.c",
|
||||
"src/x86/Lget_save_loc.c",
|
||||
"src/x86/Lglobal.c",
|
||||
"src/x86/Linit.c",
|
||||
"src/x86/Linit_local.c",
|
||||
"src/x86/Linit_remote.c",
|
||||
"src/x86/Lregs.c",
|
||||
"src/x86/Lresume.c",
|
||||
"src/x86/Lstep.c",
|
||||
|
||||
"src/x86/getcontext-linux.S",
|
||||
"src/x86/Gos-linux.c",
|
||||
"src/x86/Los-linux.c",
|
||||
],
|
||||
},
|
||||
x86_64: {
|
||||
srcs: [
|
||||
"src/x86_64/is_fpreg.c",
|
||||
"src/x86_64/regname.c",
|
||||
"src/x86_64/Gcreate_addr_space.c",
|
||||
"src/x86_64/Gget_proc_info.c",
|
||||
"src/x86_64/Gget_save_loc.c",
|
||||
"src/x86_64/Gglobal.c",
|
||||
"src/x86_64/Ginit.c",
|
||||
"src/x86_64/Ginit_local.c",
|
||||
"src/x86_64/Ginit_remote.c",
|
||||
"src/x86_64/Gregs.c",
|
||||
"src/x86_64/Gresume.c",
|
||||
"src/x86_64/Gstep.c",
|
||||
"src/x86_64/Lcreate_addr_space.c",
|
||||
"src/x86_64/Lget_proc_info.c",
|
||||
"src/x86_64/Lget_save_loc.c",
|
||||
"src/x86_64/Lglobal.c",
|
||||
"src/x86_64/Linit.c",
|
||||
"src/x86_64/Linit_local.c",
|
||||
"src/x86_64/Linit_remote.c",
|
||||
"src/x86_64/Lregs.c",
|
||||
"src/x86_64/Lresume.c",
|
||||
"src/x86_64/Lstep.c",
|
||||
|
||||
"src/x86_64/getcontext.S",
|
||||
"src/x86_64/Gstash_frame.c",
|
||||
"src/x86_64/Gtrace.c",
|
||||
"src/x86_64/Gos-linux.c",
|
||||
"src/x86_64/Lstash_frame.c",
|
||||
"src/x86_64/Ltrace.c",
|
||||
"src/x86_64/Los-linux.c",
|
||||
"src/x86_64/setcontext.S",
|
||||
],
|
||||
},
|
||||
} + libunwind_common_arch_includes,
|
||||
|
||||
multilib: {
|
||||
lib32: {
|
||||
srcs: ["src/elf32.c"],
|
||||
},
|
||||
lib64: {
|
||||
srcs: ["src/elf64.c"],
|
||||
},
|
||||
},
|
||||
|
||||
target: {
|
||||
android: {
|
||||
shared_libs: ["libdl"],
|
||||
cflags: libunwind_common_cflags_target,
|
||||
},
|
||||
host: {
|
||||
ldflags: ["-nostdlib"],
|
||||
host_ldlibs: [
|
||||
"-lc",
|
||||
"-lpthread",
|
||||
],
|
||||
},
|
||||
darwin: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
|
||||
export_include_dirs: ["include"],
|
||||
stl: "none",
|
||||
|
||||
shared_libs: ["liblzma"],
|
||||
|
||||
/*debug: {
|
||||
shared_libs: ["liblog"],
|
||||
cflags: libunwind_common_debug_cflags,
|
||||
},*/
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// libunwindbacktrace static library
|
||||
//-----------------------------------------------------------------------
|
||||
cc_library_static {
|
||||
name: "libunwindbacktrace",
|
||||
host_supported: true,
|
||||
srcs: [
|
||||
"src/unwind/BacktraceWrapper.c",
|
||||
"src/unwind/DeleteException.c",
|
||||
"src/unwind/FindEnclosingFunction.c",
|
||||
"src/unwind/ForcedUnwind.c",
|
||||
"src/unwind/GetBSP.c",
|
||||
"src/unwind/GetCFA.c",
|
||||
"src/unwind/GetDataRelBase.c",
|
||||
"src/unwind/GetGR.c",
|
||||
"src/unwind/GetIP.c",
|
||||
"src/unwind/GetIPInfo.c",
|
||||
"src/unwind/GetLanguageSpecificData.c",
|
||||
"src/unwind/GetRegionStart.c",
|
||||
"src/unwind/GetTextRelBase.c",
|
||||
"src/unwind/RaiseException.c",
|
||||
"src/unwind/Resume.c",
|
||||
"src/unwind/Resume_or_Rethrow.c",
|
||||
"src/unwind/SetGR.c",
|
||||
"src/unwind/SetIP.c",
|
||||
],
|
||||
|
||||
cflags: libunwind_common_cflags + [
|
||||
"-Wno-old-style-declaration",
|
||||
"-fvisibility=hidden",
|
||||
],
|
||||
|
||||
clang_cflags: libunwind_common_clang_cflags,
|
||||
local_include_dirs: libunwind_common_c_local_includes,
|
||||
|
||||
arch: libunwind_common_arch_includes,
|
||||
|
||||
target: {
|
||||
android: {
|
||||
cflags: libunwind_common_cflags_target,
|
||||
},
|
||||
darwin: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
|
||||
whole_static_libs: ["libunwind"],
|
||||
stl: "none",
|
||||
}
|
||||
|
||||
/*
|
||||
//-----------------------------------------------------------------------
|
||||
// libunwind testing
|
||||
//-----------------------------------------------------------------------
|
||||
libunwind-unit-tests_cflags = [
|
||||
"-fno-builtin",
|
||||
"-O0",
|
||||
"-g",
|
||||
]
|
||||
|
||||
libunwind-unit-tests_c_local_includes = ["include"]
|
||||
|
||||
libunwind-unit-tests_src_files = ["android/tests/local_test.cpp"]
|
||||
|
||||
libunwind-unit-tests_shared_libraries = ["libunwind"]
|
||||
|
||||
libunwind-unit-tests_multilib = ["both"]
|
||||
module = ["libunwind-unit-tests"]
|
||||
module_tag = ["optional"]
|
||||
build_type = ["target"]
|
||||
build_target = ["NATIVE_TEST"]
|
||||
// ANDROIDMK TRANSLATION ERROR: unsupported include
|
||||
// include $(LOCAL_PATH)/Android.build.mk
|
||||
build_type = ["host"]
|
||||
// ANDROIDMK TRANSLATION ERROR: unsupported include
|
||||
// include $(LOCAL_PATH)/Android.build.mk
|
||||
// Run the unit tests built for x86 or x86_64.
|
||||
// ANDROIDMK TRANSLATION ERROR: unsupported conditional
|
||||
// ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
|
||||
// ANDROIDMK TRANSLATION ERROR: unsupported conditional
|
||||
// ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86))
|
||||
LINKER = ["linker64"]
|
||||
TEST_SUFFIX = ["64"]
|
||||
// ANDROIDMK TRANSLATION ERROR: else from unsupported contitional
|
||||
// else
|
||||
LINKER = ["linker"]
|
||||
TEST_SUFFIX = ["32"]
|
||||
// ANDROIDMK TRANSLATION ERROR: endif from unsupported contitional
|
||||
// endif
|
||||
|
||||
// ANDROIDMK TRANSLATION ERROR: endif from unsupported contitional
|
||||
// endif
|
||||
*/
|
||||
@@ -1,127 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64 x86_64))
|
||||
# Many init services failed to start with clang for x86_64, mips, mips64
|
||||
LOCAL_CLANG := false
|
||||
endif
|
||||
|
||||
LOCAL_MODULE := $(libunwind_module)
|
||||
LOCAL_MODULE_TAGS := $(libunwind_module_tag)
|
||||
ifeq ($(libunwind_build_type),host)
|
||||
# Always make host multilib, and always use clang.
|
||||
LOCAL_MULTILIB := both
|
||||
LOCAL_CLANG := true
|
||||
else
|
||||
LOCAL_MULTILIB := $($(libunwind_module)_multilib)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring LIBRARY, $(libunwind_build_target)),LIBRARY)
|
||||
ifeq ($(LOCAL_MULTILIB),both)
|
||||
LOCAL_MODULE_STEM_32 := $(libunwind_module)32
|
||||
LOCAL_MODULE_STEM_64 := $(libunwind_module)64
|
||||
endif
|
||||
endif
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := \
|
||||
$(LOCAL_PATH)/Android.mk \
|
||||
$(LOCAL_PATH)/Android.build.mk \
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
$(libunwind_common_cflags) \
|
||||
$(libunwind_common_cflags_$(libunwind_build_type)) \
|
||||
$($(libunwind_module)_cflags) \
|
||||
$($(libunwind_module)_cflags_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_CLANG_CFLAGS += \
|
||||
$(libunwind_common_clang_cflags) \
|
||||
$(libunwind_common_clang_cflags_$(libunwind_build_type)) \
|
||||
$($(libunwind_module)_clang_cflags) \
|
||||
$($(libunwind_module)_clang_cflags_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_CONLYFLAGS += \
|
||||
$(libunwind_common_conlyflags) \
|
||||
$(libunwind_common_conlyflags_$(libunwind_build_type)) \
|
||||
$($(libunwind_module)_conlyflags) \
|
||||
$($(libunwind_module)_conlyflags_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_CPPFLAGS += \
|
||||
$(libunwind_common_cppflags) \
|
||||
$($(libunwind_module)_cppflags) \
|
||||
$($(libunwind_module)_cppflags_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(libunwind_common_c_includes) \
|
||||
$($(libunwind_module)_c_includes) \
|
||||
$($(libunwind_module)_c_includes_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||
$($(libunwind_module)_export_c_include_dirs)
|
||||
|
||||
$(foreach arch,$(libunwind_arches), \
|
||||
$(eval LOCAL_C_INCLUDES_$(arch) := $(libunwind_common_c_includes_$(arch))))
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$($(libunwind_module)_src_files) \
|
||||
$($(libunwind_module)_src_files_$(build_type)) \
|
||||
|
||||
$(foreach arch,$(libunwind_arches), \
|
||||
$(eval LOCAL_SRC_FILES_$(arch) := $($(libunwind_module)_src_files_$(arch))))
|
||||
|
||||
LOCAL_SRC_FILES_32 := $($(libunwind_module)_src_files_32)
|
||||
LOCAL_SRC_FILES_64 := $($(libunwind_module)_src_files_64)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
$($(libunwind_module)_static_libraries) \
|
||||
$($(libunwind_module)_static_libraries_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$($(libunwind_module)_whole_static_libraries) \
|
||||
$($(libunwind_module)_whole_static_libraries_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$($(libunwind_module)_shared_libraries) \
|
||||
$($(libunwind_module)_shared_libraries_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_LDLIBS := \
|
||||
$($(libunwind_module)_ldlibs) \
|
||||
$($(libunwind_module)_ldlibs_$(libunwind_build_type)) \
|
||||
|
||||
LOCAL_LDFLAGS := \
|
||||
$($(libunwind_module)_ldflags) \
|
||||
$($(libunwind_module)_ldflags_$(libunwind_build_type)) \
|
||||
|
||||
# Translate arm64 to aarch64 in c includes and src files.
|
||||
LOCAL_C_INCLUDES_arm64 := \
|
||||
$(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64))
|
||||
|
||||
LOCAL_SRC_FILES_arm64 := \
|
||||
$(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64))
|
||||
|
||||
LOCAL_SANITIZE := never
|
||||
|
||||
ifeq ($(libunwind_build_type),target)
|
||||
include $(BUILD_$(libunwind_build_target))
|
||||
endif
|
||||
|
||||
ifeq ($(libunwind_build_type),host)
|
||||
# Only build if host builds are supported.
|
||||
ifeq ($(libunwind_build_host),true)
|
||||
include $(BUILD_HOST_$(libunwind_build_target))
|
||||
endif
|
||||
endif
|
||||
@@ -1,297 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
libunwind_build_host := false
|
||||
ifeq ($(HOST_OS),linux)
|
||||
libunwind_build_host := true
|
||||
endif
|
||||
|
||||
# Set to true to enable a debug build of the libraries.
|
||||
# To control what is logged, set the environment variable UNW_DEBUG_LEVEL=x,
|
||||
# where x controls the verbosity (from 1 to 20).
|
||||
libunwind_debug := false
|
||||
|
||||
libunwind_common_cppflags := \
|
||||
-Wno-old-style-cast \
|
||||
|
||||
libunwind_common_cflags := \
|
||||
-Wno-unused-parameter \
|
||||
-Werror \
|
||||
|
||||
# gcc 4.8 appears to be overeager declaring that a variable is uninitialized,
|
||||
# under certain circumstances. Turn off this warning only for target so that
|
||||
# coverage is still present for the host code. When the entire build system
|
||||
# is switched to 4.9, then this can be removed.
|
||||
libunwind_common_cflags_target := \
|
||||
-Wno-maybe-uninitialized \
|
||||
|
||||
# src/mi/backtrace.c is misdetected as a bogus header guard by clang 3.5
|
||||
# src/x86_64/Gstash_frame.c has unnecessary calls to labs.
|
||||
libunwind_common_clang_cflags += \
|
||||
-Wno-header-guard \
|
||||
-Wno-absolute-value \
|
||||
|
||||
# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
|
||||
libunwind_common_clang_cflags += \
|
||||
-Wno-inline-asm
|
||||
|
||||
ifneq ($(libunwind_debug),true)
|
||||
libunwind_common_cflags += \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DNDEBUG \
|
||||
-D_GNU_SOURCE \
|
||||
|
||||
else
|
||||
libunwind_common_cflags += \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DDEBUG \
|
||||
-D_GNU_SOURCE \
|
||||
-U_FORTIFY_SOURCE \
|
||||
|
||||
endif
|
||||
|
||||
libunwind_common_c_includes := \
|
||||
$(LOCAL_PATH)/src \
|
||||
$(LOCAL_PATH)/include \
|
||||
|
||||
# Since mips and mips64 use the same source, only generate includes/srcs
|
||||
# for the below set of arches.
|
||||
libunwind_generate_arches := arm arm64 mips x86 x86_64
|
||||
# The complete list of arches used by Android.build.mk to set arch
|
||||
# variables.
|
||||
libunwind_arches := $(libunwind_generate_arches) mips64
|
||||
|
||||
$(foreach arch,$(libunwind_generate_arches), \
|
||||
$(eval libunwind_common_c_includes_$(arch) := $(LOCAL_PATH)/include/tdep-$(arch)))
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# libunwind shared library
|
||||
#-----------------------------------------------------------------------
|
||||
libunwind_src_files := \
|
||||
src/mi/init.c \
|
||||
src/mi/flush_cache.c \
|
||||
src/mi/mempool.c \
|
||||
src/mi/strerror.c \
|
||||
src/mi/backtrace.c \
|
||||
src/mi/dyn-cancel.c \
|
||||
src/mi/dyn-info-list.c \
|
||||
src/mi/dyn-register.c \
|
||||
src/mi/map.c \
|
||||
src/mi/Lmap.c \
|
||||
src/mi/Ldyn-extract.c \
|
||||
src/mi/Lfind_dynamic_proc_info.c \
|
||||
src/mi/Lget_proc_info_by_ip.c \
|
||||
src/mi/Lget_proc_name.c \
|
||||
src/mi/Lput_dynamic_unwind_info.c \
|
||||
src/mi/Ldestroy_addr_space.c \
|
||||
src/mi/Lget_reg.c \
|
||||
src/mi/Lset_reg.c \
|
||||
src/mi/Lget_fpreg.c \
|
||||
src/mi/Lset_fpreg.c \
|
||||
src/mi/Lset_caching_policy.c \
|
||||
src/mi/Gdyn-extract.c \
|
||||
src/mi/Gdyn-remote.c \
|
||||
src/mi/Gfind_dynamic_proc_info.c \
|
||||
src/mi/Gget_accessors.c \
|
||||
src/mi/Gget_proc_info_by_ip.c \
|
||||
src/mi/Gget_proc_name.c \
|
||||
src/mi/Gput_dynamic_unwind_info.c \
|
||||
src/mi/Gdestroy_addr_space.c \
|
||||
src/mi/Gget_reg.c \
|
||||
src/mi/Gset_reg.c \
|
||||
src/mi/Gget_fpreg.c \
|
||||
src/mi/Gset_fpreg.c \
|
||||
src/mi/Gset_caching_policy.c \
|
||||
src/dwarf/Lexpr.c \
|
||||
src/dwarf/Lfde.c \
|
||||
src/dwarf/Lparser.c \
|
||||
src/dwarf/Lpe.c \
|
||||
src/dwarf/Lstep_dwarf.c \
|
||||
src/dwarf/Lfind_proc_info-lsb.c \
|
||||
src/dwarf/Lfind_unwind_table.c \
|
||||
src/dwarf/Gexpr.c \
|
||||
src/dwarf/Gfde.c \
|
||||
src/dwarf/Gfind_proc_info-lsb.c \
|
||||
src/dwarf/Gfind_unwind_table.c \
|
||||
src/dwarf/Gparser.c \
|
||||
src/dwarf/Gpe.c \
|
||||
src/dwarf/Gstep_dwarf.c \
|
||||
src/dwarf/global.c \
|
||||
src/os-common.c \
|
||||
src/os-linux.c \
|
||||
src/Los-common.c \
|
||||
|
||||
# ptrace files for remote unwinding.
|
||||
libunwind_src_files += \
|
||||
src/ptrace/_UPT_accessors.c \
|
||||
src/ptrace/_UPT_access_fpreg.c \
|
||||
src/ptrace/_UPT_access_mem.c \
|
||||
src/ptrace/_UPT_access_reg.c \
|
||||
src/ptrace/_UPT_create.c \
|
||||
src/ptrace/_UPT_destroy.c \
|
||||
src/ptrace/_UPT_find_proc_info.c \
|
||||
src/ptrace/_UPT_get_dyn_info_list_addr.c \
|
||||
src/ptrace/_UPT_put_unwind_info.c \
|
||||
src/ptrace/_UPT_get_proc_name.c \
|
||||
src/ptrace/_UPT_reg_offset.c \
|
||||
src/ptrace/_UPT_resume.c \
|
||||
|
||||
# Arch specific source files.
|
||||
$(foreach arch,$(libunwind_generate_arches), \
|
||||
$(eval libunwind_src_files_$(arch) += \
|
||||
src/$(arch)/is_fpreg.c \
|
||||
src/$(arch)/regname.c \
|
||||
src/$(arch)/Gcreate_addr_space.c \
|
||||
src/$(arch)/Gget_proc_info.c \
|
||||
src/$(arch)/Gget_save_loc.c \
|
||||
src/$(arch)/Gglobal.c \
|
||||
src/$(arch)/Ginit.c \
|
||||
src/$(arch)/Ginit_local.c \
|
||||
src/$(arch)/Ginit_remote.c \
|
||||
src/$(arch)/Gregs.c \
|
||||
src/$(arch)/Gresume.c \
|
||||
src/$(arch)/Gstep.c \
|
||||
src/$(arch)/Lcreate_addr_space.c \
|
||||
src/$(arch)/Lget_proc_info.c \
|
||||
src/$(arch)/Lget_save_loc.c \
|
||||
src/$(arch)/Lglobal.c \
|
||||
src/$(arch)/Linit.c \
|
||||
src/$(arch)/Linit_local.c \
|
||||
src/$(arch)/Linit_remote.c \
|
||||
src/$(arch)/Lregs.c \
|
||||
src/$(arch)/Lresume.c \
|
||||
src/$(arch)/Lstep.c \
|
||||
))
|
||||
|
||||
libunwind_src_files_arm += \
|
||||
src/arm/getcontext.S \
|
||||
src/arm/Gis_signal_frame.c \
|
||||
src/arm/Gex_tables.c \
|
||||
src/arm/Lis_signal_frame.c \
|
||||
src/arm/Lex_tables.c \
|
||||
|
||||
libunwind_src_files_arm64 += \
|
||||
src/aarch64/Gis_signal_frame.c \
|
||||
src/aarch64/Lis_signal_frame.c \
|
||||
|
||||
libunwind_src_files_mips += \
|
||||
src/mips/getcontext-android.S \
|
||||
src/mips/Gis_signal_frame.c \
|
||||
src/mips/Lis_signal_frame.c \
|
||||
|
||||
libunwind_src_files_x86 += \
|
||||
src/x86/getcontext-linux.S \
|
||||
src/x86/Gos-linux.c \
|
||||
src/x86/Los-linux.c \
|
||||
|
||||
libunwind_src_files_x86_64 += \
|
||||
src/x86_64/getcontext.S \
|
||||
src/x86_64/Gstash_frame.c \
|
||||
src/x86_64/Gtrace.c \
|
||||
src/x86_64/Gos-linux.c \
|
||||
src/x86_64/Lstash_frame.c \
|
||||
src/x86_64/Ltrace.c \
|
||||
src/x86_64/Los-linux.c \
|
||||
src/x86_64/setcontext.S \
|
||||
|
||||
# mips and mips64 use the same sources but define _MIP_SIM differently
|
||||
# to change the behavior.
|
||||
# mips uses o32 abi (_MIPS_SIM == _ABIO32).
|
||||
# mips64 uses n64 abi (_MIPS_SIM == _ABI64).
|
||||
libunwind_common_c_includes_mips64 := $(LOCAL_PATH)/include/tdep-mips
|
||||
libunwind_src_files_mips64 := $(libunwind_src_files_mips)
|
||||
|
||||
# 64-bit architectures
|
||||
libunwind_src_files_arm64 += src/elf64.c
|
||||
libunwind_src_files_mips64 += src/elf64.c
|
||||
libunwind_src_files_x86_64 += src/elf64.c
|
||||
|
||||
# 32-bit architectures
|
||||
libunwind_src_files_arm += src/elf32.c
|
||||
libunwind_src_files_mips += src/elf32.c
|
||||
libunwind_src_files_x86 += src/elf32.c
|
||||
|
||||
libunwind_shared_libraries += liblzma
|
||||
|
||||
libunwind_shared_libraries_target := \
|
||||
libdl \
|
||||
|
||||
libunwind_ldflags_host := \
|
||||
-nostdlib
|
||||
|
||||
libunwind_ldlibs_host := \
|
||||
-lc \
|
||||
-lpthread \
|
||||
|
||||
libunwind_export_c_include_dirs := \
|
||||
$(LOCAL_PATH)/include
|
||||
|
||||
ifeq ($(libunwind_debug),true)
|
||||
libunwind_shared_libraries += \
|
||||
liblog \
|
||||
|
||||
endif
|
||||
|
||||
libunwind_module := libunwind
|
||||
libunwind_module_tag := optional
|
||||
libunwind_build_type := target
|
||||
libunwind_build_target := SHARED_LIBRARY
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
libunwind_build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
libunwind_build_type := target
|
||||
libunwind_build_target := STATIC_LIBRARY
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
libunwind_build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# libunwindbacktrace static library
|
||||
#-----------------------------------------------------------------------
|
||||
libunwindbacktrace_src_files += \
|
||||
src/unwind/BacktraceWrapper.c \
|
||||
src/unwind/DeleteException.c \
|
||||
src/unwind/FindEnclosingFunction.c \
|
||||
src/unwind/ForcedUnwind.c \
|
||||
src/unwind/GetBSP.c \
|
||||
src/unwind/GetCFA.c \
|
||||
src/unwind/GetDataRelBase.c \
|
||||
src/unwind/GetGR.c \
|
||||
src/unwind/GetIP.c \
|
||||
src/unwind/GetIPInfo.c \
|
||||
src/unwind/GetLanguageSpecificData.c \
|
||||
src/unwind/GetRegionStart.c \
|
||||
src/unwind/GetTextRelBase.c \
|
||||
src/unwind/RaiseException.c \
|
||||
src/unwind/Resume.c \
|
||||
src/unwind/Resume_or_Rethrow.c \
|
||||
src/unwind/SetGR.c \
|
||||
src/unwind/SetIP.c \
|
||||
|
||||
libunwindbacktrace_cflags += \
|
||||
-Wno-old-style-declaration \
|
||||
-fvisibility=hidden
|
||||
|
||||
libunwind_module := libunwindbacktrace
|
||||
libunwind_module_tag := optional
|
||||
libunwind_build_type := target
|
||||
libunwind_build_target := STATIC_LIBRARY
|
||||
libunwindbacktrace_whole_static_libraries := libunwind
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
libunwind_build_type := host
|
||||
include $(LOCAL_PATH)/Android.build.mk
|
||||
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2002 Hewlett-Packard Co.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,55 +0,0 @@
|
||||
***********************************************************
|
||||
|
||||
Discontinued. See git log instead at
|
||||
|
||||
http://www.kernel.org/git/gitweb.cgi?p=libs/libunwind/libunwind.git;a=log
|
||||
|
||||
***********************************************************
|
||||
|
||||
2002-11-08 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* src/ia64/unwind_i.h (ia64_getfp): Change from macro to inline
|
||||
function. Check "loc" argument for being NULL before dereferencing it.
|
||||
(ia64_putfp): Ditto.
|
||||
(ia64_get): Ditto.
|
||||
(ia64_put): Ditto.
|
||||
|
||||
2002-01-18 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* src/ia64/parser.c (__ia64_unw_create_state_record): Set
|
||||
IA64_FLAG_HAS_HANDLER if the unwind info descriptors indicate that
|
||||
there a handler.
|
||||
|
||||
* src/ia64/regs.c (__ia64_access_reg): Return zero for UNW_REG_HANDLER
|
||||
in frames that don't have a personality routine.
|
||||
|
||||
* src/ia64/unwind_i.h (IA64_FLAG_HAS_HANDLER): New flag.
|
||||
|
||||
* src/ia64/regs.c (__ia64_access_reg): When reading UNW_REG_HANDLER,
|
||||
account for the fact that the personality address is gp-relative.
|
||||
|
||||
* src/ia64/parser.c (__ia64_unw_create_state_record): Fix
|
||||
initialization of segbase and len.
|
||||
|
||||
2002-01-17 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* include/unwind-ia64.h: Include via "unwind.h" to ensure
|
||||
the file is picked up from same directory.
|
||||
|
||||
2002-01-16 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* include/unwind.h: Define UNW_ESTOPUNWIND. This error code may
|
||||
be returned by acquire_unwind_info() to force termination of
|
||||
unwinding. An application may want to do this when encountering a
|
||||
call frame for dynamically generated code, for example.
|
||||
|
||||
* unwind.h: Pass opaque argument pointer to acquire_unwind_info()
|
||||
and release_unwind_info() like we do for access_mem() etc.
|
||||
|
||||
2002-01-14 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* Version 0.0 released.
|
||||
|
||||
2002-01-11 David Mosberger-Tang <David.Mosberger@acm.org>
|
||||
|
||||
* ChangeLog created.
|
||||
@@ -1,18 +0,0 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,86 +0,0 @@
|
||||
include_HEADERS = include/libunwind-dynamic.h \
|
||||
include/libunwind-ptrace.h \
|
||||
include/libunwind-coredump.h
|
||||
|
||||
if ARCH_AARCH64
|
||||
include_HEADERS += include/libunwind-aarch64.h
|
||||
endif
|
||||
if ARCH_ARM
|
||||
include_HEADERS += include/libunwind-arm.h
|
||||
endif
|
||||
if ARCH_IA64
|
||||
include_HEADERS += include/libunwind-ia64.h
|
||||
endif
|
||||
if ARCH_HPPA
|
||||
include_HEADERS += include/libunwind-hppa.h
|
||||
endif
|
||||
if ARCH_MIPS
|
||||
include_HEADERS += include/libunwind-mips.h
|
||||
endif
|
||||
if ARCH_X86
|
||||
include_HEADERS += include/libunwind-x86.h
|
||||
endif
|
||||
if ARCH_X86_64
|
||||
include_HEADERS += include/libunwind-x86_64.h
|
||||
endif
|
||||
if ARCH_PPC32
|
||||
include_HEADERS += include/libunwind-ppc32.h
|
||||
endif
|
||||
if ARCH_PPC64
|
||||
include_HEADERS += include/libunwind-ppc64.h
|
||||
endif
|
||||
if ARCH_SH
|
||||
include_HEADERS += include/libunwind-sh.h
|
||||
endif
|
||||
|
||||
if !REMOTE_ONLY
|
||||
include_HEADERS += include/libunwind.h include/unwind.h
|
||||
endif
|
||||
|
||||
nodist_include_HEADERS = include/libunwind-common.h
|
||||
|
||||
SUBDIRS = src tests doc
|
||||
|
||||
noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \
|
||||
include/compiler.h include/libunwind_i.h include/mempool.h \
|
||||
include/remote.h \
|
||||
include/tdep-aarch64/dwarf-config.h \
|
||||
include/tdep-aarch64/jmpbuf.h \
|
||||
include/tdep-aarch64/libunwind_i.h \
|
||||
include/tdep-arm/dwarf-config.h include/tdep-arm/ex_tables.h \
|
||||
include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h \
|
||||
include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h \
|
||||
include/tdep-ia64/libunwind_i.h include/tdep-ia64/script.h \
|
||||
include/tdep-hppa/libunwind_i.h \
|
||||
include/tdep-hppa/jmpbuf.h include/tdep-hppa/dwarf-config.h \
|
||||
include/tdep-mips/libunwind_i.h \
|
||||
include/tdep-mips/jmpbuf.h include/tdep-mips/dwarf-config.h \
|
||||
include/tdep-x86/libunwind_i.h \
|
||||
include/tdep-x86/jmpbuf.h include/tdep-x86/dwarf-config.h \
|
||||
include/tdep-x86_64/libunwind_i.h \
|
||||
include/tdep-x86_64/jmpbuf.h include/tdep-x86_64/dwarf-config.h \
|
||||
include/tdep-ppc32/dwarf-config.h \
|
||||
include/tdep-ppc32/jmpbuf.h include/tdep-ppc32/libunwind_i.h \
|
||||
include/tdep-ppc64/dwarf-config.h \
|
||||
include/tdep-ppc64/jmpbuf.h include/tdep-ppc64/libunwind_i.h \
|
||||
include/tdep-sh/dwarf-config.h \
|
||||
include/tdep-sh/jmpbuf.h include/tdep-sh/libunwind_i.h \
|
||||
include/tdep/libunwind_i.h \
|
||||
include/tdep/jmpbuf.h include/tdep/dwarf-config.h
|
||||
|
||||
EXTRA_DIST = include/libunwind-common.h.in
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
Makefile.in \
|
||||
INSTALL \
|
||||
aclocal.m4 \
|
||||
configure \
|
||||
config/compile \
|
||||
config/config.guess \
|
||||
config/config.sub \
|
||||
config/depcomp \
|
||||
config/install-sh \
|
||||
config/ltmain.sh \
|
||||
config/missing \
|
||||
include/config.h.in \
|
||||
include/config.h.in~
|
||||
@@ -1,229 +0,0 @@
|
||||
-*-Mode: outline-*-
|
||||
|
||||
* News for v1.1:
|
||||
|
||||
** coredump unwind support
|
||||
** New arch: SuperH
|
||||
** Improved support for PowerPC, ARM
|
||||
** Lots of cleanups, perf tweaks
|
||||
** pkg-config support
|
||||
|
||||
* News for v1.0:
|
||||
|
||||
** Fast unwind (rbp, rsp, rip only) on x86_64 with a fallback to
|
||||
slow code path (Lassi Tuura)
|
||||
** Improved local and remote unwinding on ARM (Ken Werner)
|
||||
** Testing, stability and many fixes on x86 (Paul Pluzhnikov)
|
||||
** FreeBSD port and clean separation of OS specific bits
|
||||
(Konstantin Belousov)
|
||||
** Thanks for all the bug reports, contributions and testing!
|
||||
|
||||
* News for v0.99:
|
||||
|
||||
** Greatly improved x86-64 support thanks to Arun Sharma.
|
||||
** Support for PPC64 added by Jose Flavio Aguilar Paulino.
|
||||
|
||||
* News for v0.98.6:
|
||||
|
||||
** Fix address-leak triggered by invalid byte-order. Fixed by Andreas Schwab.
|
||||
** On ia64, get_static_proc_name() no longer uses a weak reference to
|
||||
_Uelf64_get_proc_name(), since that was causing problems with archive
|
||||
libraries and no longer served any apparent purpose. Fixed by
|
||||
Curt Wohlgemuth.
|
||||
|
||||
* News for v0.98.5:
|
||||
|
||||
** Fix a typo in the man-page of unw_create_addr_space().
|
||||
** Fix an off-by-1 bug in the handling of the dynamic ALIAS directive
|
||||
for ia64. Reported by Todd L. Miller.
|
||||
** Fix a bug in libunwind-ptrace which could cause crash due to extraneous
|
||||
munmap() calls.
|
||||
|
||||
* News for v0.98.4:
|
||||
|
||||
** Fix a typo in _ReadSLEB.c which caused hangs when throwing exceptions
|
||||
from Intel ICC-compiled programs. Reported by Tommy Hoffner.
|
||||
|
||||
* News for v0.98.3:
|
||||
|
||||
** Make it possible to link against libunwind-ia64.a only (i.e., without
|
||||
requiring libunwind.a as well). This keeps apps which need only
|
||||
remote unwinding cleaner, since they logically have no dependency
|
||||
on libunwind.a.
|
||||
** Dont link against libatomic_ops for now. Due to a packaging bug on
|
||||
Debian, linking against this library causes libunwind.so to get
|
||||
a dependency on libatomic_ops.so, which is not at all what we want.
|
||||
Fortunately, we don't have to link against that library on x86 or
|
||||
ia64 since the library is strictly needed only for platforms with
|
||||
poor atomic operation support. Once the libatomic_ops package is fixed,
|
||||
we can re-enable linking against libatomic_ops.
|
||||
|
||||
* News for v0.98.2:
|
||||
|
||||
** Fixed bug which caused _UPT_get_dyn_info_list_addr() to sometimes fail
|
||||
needlessly. Found by Todd L. Miller.
|
||||
|
||||
** When using GCC to build libunwind on ia64, libunwind.so had an
|
||||
unresolved reference to __divdi3. This is undesirable since it
|
||||
creates an implicit dependency on libgcc. This problem has been
|
||||
fixed in the 0.98.2 release by explicitly linking against libgcc.a
|
||||
when building libunwind.
|
||||
|
||||
* News for v0.98.1:
|
||||
|
||||
** Fixed a bug which caused "make install" to install libunwind-common.h.in
|
||||
instead of libunwind-common.h.
|
||||
** Fixed a bug in the ia64 {sig,}longjmp() which showed on
|
||||
SuSE Linux 9 because it's using a newer compiler & the EPC-based system
|
||||
call stubs.
|
||||
** Fixed incorrect offsets in tests/ia64-test-nat-asm.S.
|
||||
Warning: you'll need a GNU assembler dated later than 21-Sep-2004 to
|
||||
get this file translated correctly. With an old assembler, "make check"
|
||||
will get lots of failures when running Gia64-test-nat or Lia64-test-nat!
|
||||
** Convert tests/bt into a full-blown test-case. It's designed to
|
||||
trigger a (rarely-encountered) bug in the GNU assembler on ia64.
|
||||
The assembler has been fixed and once the libraries (libc etc)
|
||||
have been rebuilt, this test will pass.
|
||||
** Added test-case tests/run-ptrace-misc which, on ia64, triggers a bug in
|
||||
current GCC (including v3.4.2) which causes bad unwind info.
|
||||
|
||||
* News for v0.98:
|
||||
|
||||
** Update libunwind to be compliant with the updated/expanded
|
||||
ia64 unwind specificiation by HJ Lu [1]. This is needed for
|
||||
GCC 3.4 compatibility.
|
||||
|
||||
[1] http://www.kernel.org/pub/linux/devel/gcc/unwind/
|
||||
|
||||
** Initial support for x86-64 has been added courtesy of Max Asbock.
|
||||
Along with this came a bunch of DWARF2 unwinder fixes.
|
||||
|
||||
** A new rountine unw_strerror() has been added courtesy of
|
||||
Thomas Hallgren.
|
||||
|
||||
** Including <libunwind.h> now defines 4 macros that can be used
|
||||
to determine the version number of libunwind. Specifically,
|
||||
UNW_VERSION_MAJOR, UNW_VERSION_MINOR, UNW_VERSION, and
|
||||
UNW_VERSION_CODE are defined by the header now.
|
||||
|
||||
** Bug fixes
|
||||
*** Fix a memory-leak in _UPT_get_dyn_info_list_addr() courtesy of Ed Connell.
|
||||
*** Fix a crash in libunwind-ptrace courtesy of Mark Young.
|
||||
*** Fix a bug in ia64-version of unw_init_remote() which prevented
|
||||
it from working correctly for the local address space. Reported by
|
||||
Troy Heber.
|
||||
*** Many other small and not so small fixes.
|
||||
|
||||
* News for v0.97:
|
||||
|
||||
** unw_get_proc_name() may now be called from signal-handler.
|
||||
|
||||
** The ptrace-helper routines are now declared in libunwind-ptrace.h.
|
||||
Applications which use ptrace-based unwinding should include
|
||||
<libunwind-ptrace.h> to get the _UPT_*() routines declared.
|
||||
|
||||
** libunwind has been split into a "local-only" and a "generic" versions.
|
||||
The former is optimized for local unwinding (within a process) and
|
||||
is called libunwind.so (shared version) or libunwind.a (archive
|
||||
version). The generic version is not limited to unwinding within a
|
||||
process and is called libunwind-generic.so (shared version)
|
||||
libunwind-generic.a (archive version). Similarly, the ptrace()
|
||||
support has been separated out into a convenience library called
|
||||
libunwind-ptrace.a. For the most part, backwards-compatibility
|
||||
is retained. However, when building an application which uses
|
||||
libunwind, it may be necessary to change the linker command-line
|
||||
as shown in the table below:
|
||||
|
||||
Application which does: Before v0.97: With v0.97:
|
||||
----------------------- ------------- -----------
|
||||
local unwinding only: -lunwind -lunwind
|
||||
remote unwinding: -lunwind -lunwind-generic
|
||||
cross unwinding: -lunwind-PLAT -lunwind-PLAT
|
||||
ptrace-based unwinding: -lunwind -lunwind-ptrace -lunwind-generic
|
||||
|
||||
The motivation for this splitting is to keep libunwind.so as minimal
|
||||
as possible. This library will eventually be loaded by most (if not
|
||||
all) executables and hence it is important to ensure that it can
|
||||
be loaded as quickly as possible.
|
||||
|
||||
** unw_getcontext() tuned on IA-64.
|
||||
|
||||
The unw_getcontext() routine used to be provided by (GNU) libc
|
||||
(getcontext()). This caused unnecessary overhead (e.g., an
|
||||
unnecessary system-call to sigprocmask()). The new
|
||||
unw_getcontext() only does the work really needed for libunwind and
|
||||
hence performs much better. However, this change implies that
|
||||
programs linked against libunwind v0.97 won't be
|
||||
backwards-compatible with earlier versions (there would be an
|
||||
unresolved symbol for _Uia64_getcontext()).
|
||||
|
||||
** Fix NaT-bit handling on IA-64.
|
||||
|
||||
New test-cases have been added to test the handling of the NaT bit
|
||||
(and floating-point NaT values) and all discovered/known bugs have
|
||||
been fixed.
|
||||
|
||||
** Initial DWARF-based unwinder for x86.
|
||||
|
||||
There is a beginning for a DWARF-based unwinder for x86. Work for
|
||||
x86-64-support based on this DWARF unwinder is currently underway
|
||||
at IBM and it is expected that this support will be merged into the
|
||||
official tree soon.
|
||||
|
||||
|
||||
* News for v0.96:
|
||||
|
||||
** _Unwind_*() routines defined by the C++ ABI are now included in
|
||||
libunwind.
|
||||
|
||||
|
||||
* News for v0.95:
|
||||
|
||||
** Bigger, better, faster, or so the theory goes.
|
||||
|
||||
|
||||
* News for v0.93:
|
||||
|
||||
** More bug-fixes & improved HP-UX support.
|
||||
|
||||
|
||||
* News for v0.92:
|
||||
|
||||
** Bug-fix release. IA-64 unwinder can now be built with Intel compiler (ECC).
|
||||
|
||||
|
||||
* News for v0.91:
|
||||
|
||||
** Lots of documentation updates
|
||||
** Some portability fixes.
|
||||
|
||||
|
||||
* News for v0.9:
|
||||
|
||||
** The libunwind API is mostly feature-complete at this point (hence the
|
||||
version jump from v0.2 to v0.9).
|
||||
|
||||
|
||||
* News for v0.2:
|
||||
|
||||
** Automated configuration/build with autoconf and automake.
|
||||
** Added support for building libunwind as a shared library.
|
||||
** Added support for remote unwinding.
|
||||
** Added support for cross-building.
|
||||
** Added two new routines to the API:
|
||||
- unw_is_fpreg()
|
||||
- unw_get_save_loc()
|
||||
** Added multi-architecture supports (lets a single application use
|
||||
the unwind libraries for multiple target architectures; this is useful,
|
||||
e.g., useful for building a debugger that can support multiple targets
|
||||
such as x86, ia64, etc.)
|
||||
|
||||
|
||||
* News for v0.1:
|
||||
|
||||
** Added support for exception handling.
|
||||
|
||||
|
||||
* News for v0.0:
|
||||
|
||||
** It's a brand new package.
|
||||
@@ -1,18 +0,0 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,214 +0,0 @@
|
||||
-*- mode: Outline -*-
|
||||
|
||||
This is version 1.0 of the unwind library. This library supports
|
||||
several architecture/operating-system combinations:
|
||||
|
||||
Linux/x86-64: Works well.
|
||||
Linux/x86: Works well.
|
||||
Linux/ARM: Works well.
|
||||
Linux/IA-64: Fully tested and supported.
|
||||
Linux/PARISC: Works well, but C library missing unwind-info.
|
||||
HP-UX/IA-64: Mostly works but known to have some serious limitations.
|
||||
Linux/AArch64: Newly added.
|
||||
Linux/PPC64: Newly added.
|
||||
Linux/SuperH: Newly added.
|
||||
FreeBSD/i386: Newly added.
|
||||
FreeBSD/x86-64: Newly added (FreeBSD architecture is known as amd64).
|
||||
|
||||
|
||||
* General Build Instructions
|
||||
|
||||
In general, this library can be built and installed with the following
|
||||
commands:
|
||||
|
||||
$ autoreconf -i # Needed only for building from git. Depends on libtool.
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make install prefix=PREFIX
|
||||
|
||||
where PREFIX is the installation prefix. By default, a prefix of
|
||||
/usr/local is used, such that libunwind.a is installed in
|
||||
/usr/local/lib and unwind.h is installed in /usr/local/include. For
|
||||
testing, you may want to use a prefix of /usr/local instead.
|
||||
|
||||
|
||||
* Building with Intel compiler
|
||||
|
||||
** Version 8 and later
|
||||
|
||||
Starting with version 8, the preferred name for the IA-64 Intel
|
||||
compiler is "icc" (same name as on x86). Thus, the configure-line
|
||||
should look like this:
|
||||
|
||||
$ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \
|
||||
LDFLAGS="-L$PWD/src/.libs"
|
||||
|
||||
|
||||
* Building on HP-UX
|
||||
|
||||
For the time being, libunwind must be built with GCC on HP-UX.
|
||||
|
||||
libunwind should be configured and installed on HP-UX like this:
|
||||
|
||||
$ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64"
|
||||
|
||||
Caveat: Unwinding of 32-bit (ILP32) binaries is not supported
|
||||
at the moment.
|
||||
|
||||
** Workaround for older versions of GCC
|
||||
|
||||
GCC v3.0 and GCC v3.2 ship with a bad version of sys/types.h. The
|
||||
workaround is to issue the following commands before running
|
||||
"configure":
|
||||
|
||||
$ mkdir $top_dir/include/sys
|
||||
$ cp /usr/include/sys/types.h $top_dir/include/sys
|
||||
|
||||
GCC v3.3.2 or later have been fixed and do not require this
|
||||
workaround.
|
||||
|
||||
* Building for PowerPC64 / Linux
|
||||
|
||||
For building for power64 you should use:
|
||||
|
||||
$ ./configure CFLAGS="-g -O2 -m64" CXXFLAGS="-g -O2 -m64"
|
||||
|
||||
If your power support altivec registers:
|
||||
$ ./configure CFLAGS="-g -O2 -m64 -maltivec" CXXFLAGS="-g -O2 -m64 -maltivec"
|
||||
|
||||
To check if your processor has support for vector registers (altivec):
|
||||
cat /proc/cpuinfo | grep altivec
|
||||
and should have something like this:
|
||||
cpu : PPC970, altivec supported
|
||||
|
||||
If libunwind seems to not work (backtracing failing), try to compile
|
||||
it with -O0, without optimizations. There are some compiler problems
|
||||
depending on the version of your gcc.
|
||||
|
||||
* Building on FreeBSD
|
||||
|
||||
General building instructions apply. To build and execute several tests,
|
||||
you need libexecinfo library available in ports as devel/libexecinfo.
|
||||
|
||||
Development of the port was done of FreeBSD 8.0-STABLE. The library
|
||||
was build with the system compiler that is modified version of gcc 4.2.1,
|
||||
as well as the gcc 4.4.3.
|
||||
|
||||
* Regression Testing
|
||||
|
||||
After building the library, you can run a set of regression tests with:
|
||||
|
||||
$ make check
|
||||
|
||||
** Expected results on IA-64 Linux
|
||||
|
||||
Unless you have a very recent C library and compiler installed, it is
|
||||
currently expected to have the following tests fail on IA-64 Linux:
|
||||
|
||||
Gtest-init (should pass starting with glibc-2.3.x/gcc-3.4)
|
||||
Ltest-init (should pass starting with glibc-2.3.x/gcc-3.4)
|
||||
test-ptrace (should pass starting with glibc-2.3.x/gcc-3.4)
|
||||
run-ia64-test-dyn1 (should pass starting with glibc-2.3.x)
|
||||
|
||||
This does not mean that libunwind cannot be used with older compilers
|
||||
or C libraries, it just means that for certain corner cases, unwinding
|
||||
will fail. Since they're corner cases, it is not likely for
|
||||
applications to trigger them.
|
||||
|
||||
Note: If you get lots of errors in Gia64-test-nat and Lia64-test-nat, it's
|
||||
almost certainly a sign of an old assembler. The GNU assembler used
|
||||
to encode previous-stack-pointer-relative offsets incorrectly.
|
||||
This bug was fixed on 21-Sep-2004 so any later assembler will be
|
||||
fine.
|
||||
|
||||
** Expected results on x86 Linux
|
||||
|
||||
The following tests are expected to fail on x86 Linux:
|
||||
|
||||
Gtest-resume-sig (fails to get SIGUSR2)
|
||||
Ltest-resume-sig (likewise)
|
||||
Gtest-dyn1 (no dynamic unwind info support yet)
|
||||
Ltest-dyn1 (no dynamic unwind info support yet)
|
||||
test-setjmp (longjmp() not implemented yet)
|
||||
run-check-namespace (no _Ux86_getcontext yet)
|
||||
test-ptrace
|
||||
|
||||
** Expected results on x86-64 Linux
|
||||
|
||||
The following tests are expected to fail on x86-64 Linux:
|
||||
|
||||
Gtest-dyn1 (no dynamic unwind info support yet)
|
||||
Ltest-dyn1 (no dynamic unwind info support yet)
|
||||
Gtest-init (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18743)
|
||||
Ltest-init (likewise)
|
||||
test-async-sig (crashes due to bad unwind-info?)
|
||||
test-setjmp (longjmp() not implemented yet)
|
||||
run-check-namespace (no _Ux86_64_getcontext yet)
|
||||
run-ptrace-mapper (??? investigate)
|
||||
run-ptrace-misc (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18748
|
||||
and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18749)
|
||||
|
||||
** Expected results on PARISC Linux
|
||||
|
||||
Caveat: GCC v3.4 or newer is needed on PA-RISC Linux. Earlier
|
||||
versions of the compiler failed to generate the exception-handling
|
||||
program header (GNU_EH_FRAME) needed for unwinding.
|
||||
|
||||
The following tests are expected to fail on x86-64 Linux:
|
||||
|
||||
Gtest-bt (backtrace truncated at kill() due to lack of unwind-info)
|
||||
Ltest-bt (likewise)
|
||||
Gtest-resume-sig (Gresume.c:my_rt_sigreturn() is wrong somehow)
|
||||
Ltest-resume-sig (likewise)
|
||||
Gtest-init (likewise)
|
||||
Ltest-init (likewise)
|
||||
Gtest-dyn1 (no dynamic unwind info support yet)
|
||||
Ltest-dyn1 (no dynamic unwind info support yet)
|
||||
test-setjmp (longjmp() not implemented yet)
|
||||
run-check-namespace (toolchain doesn't support HIDDEN yet)
|
||||
|
||||
** Expected results on HP-UX
|
||||
|
||||
"make check" is currently unsupported for HP-UX. You can try to run
|
||||
it, but most tests will fail (and some may fail to terminate). The
|
||||
only test programs that are known to work at this time are:
|
||||
|
||||
tests/bt
|
||||
tests/Gperf-simple
|
||||
tests/test-proc-info
|
||||
tests/test-static-link
|
||||
tests/Gtest-init
|
||||
tests/Ltest-init
|
||||
tests/Gtest-resume-sig
|
||||
tests/Ltest-resume-sig
|
||||
|
||||
** Expected results on PPC64 Linux
|
||||
|
||||
"make check" should run with no more than 10 out of 24 tests failed.
|
||||
|
||||
|
||||
* Performance Testing
|
||||
|
||||
This distribution includes a few simple performance tests which give
|
||||
some idea of the basic cost of various libunwind operations. After
|
||||
building the library, you can run these tests with the following
|
||||
commands:
|
||||
|
||||
$ cd tests
|
||||
$ make perf
|
||||
|
||||
* Contacting the Developers
|
||||
|
||||
Please direct all questions regarding this library to:
|
||||
|
||||
libunwind-devel@nongnu.org
|
||||
|
||||
You can do this by sending a mail to libunwind-request@nongnu.org with
|
||||
a body of:
|
||||
|
||||
subscribe libunwind-devel
|
||||
|
||||
or you can subscribe and manage your subscription via the
|
||||
web-interface at:
|
||||
|
||||
https://savannah.nongnu.org/mail/?group=libunwind
|
||||
@@ -1,97 +0,0 @@
|
||||
- Update the libunwind man page for the new/fixed cache-flushing behavior.
|
||||
Effectively, that unw_flush_cache() doesn't have to be called by
|
||||
applications except for extraordinary circumstances (e.g., if application
|
||||
implements its own runtime loader).
|
||||
- document split local-only/generic libraries and separate libunwind-ptrace.a
|
||||
convenience-library
|
||||
- document new "tdep" member in unw_proc_info_t structure
|
||||
- for DWARF 2, use a dummy CIE entry with an augmentation that
|
||||
provides the dyn-info-list-address
|
||||
|
||||
=== taken care of:
|
||||
|
||||
Testing:
|
||||
+ ensure that saving r4-r7 in a stacked register properly preserves
|
||||
the NaT bit, even in the face of register-rotation
|
||||
+ ensure that IA64_INSN_MOVE_STACKED works correctly in the face of
|
||||
register rotation
|
||||
+ on Linux, test access to f32-f127 in a signal handler (e.g., verify
|
||||
that fph partition gets initialized properly)
|
||||
+ According to Nicholas S. Wourms <nwourms@netscape.net>, adding this to the
|
||||
Makefile.am:
|
||||
AUTOMAKE_OPTIONS = 1.6 subdir-objects
|
||||
ensures that object-files are build in separate subdirectories and that
|
||||
in turn makes it possible for source files in different directories to
|
||||
have the same filename, thus avoiding the need for those ugly -x86, -ia64,
|
||||
etc., postfixes.
|
||||
+ Switch ia64 (and rest over) to using Debug() instead of debug()
|
||||
+ implement non-local versions of dwarf_readXX()
|
||||
+ consolidate mostly architecture-independent code such as
|
||||
unw_get_accessors() into shared files
|
||||
+ caching is pretty fundamentally broken, what should happen is this:
|
||||
o On unw_init_local()/unw_init_remote(), libunwind should validate
|
||||
that the cached information is still valid and, if not, flush the
|
||||
cache on its own. Rationale: once unw_init_local() has been
|
||||
called, it is clear that the unwind info for the calling thread
|
||||
cannot change (otherwise the program would be buggy anyhow) and
|
||||
hence it is sufficient to validate the cache at this point.
|
||||
Similarly, once unw_init_remote() has been called, the target
|
||||
address space must have been stopped, because the unwinding would
|
||||
otherwise be unreliable anyhow.
|
||||
o glibc currently lacks a feature for dl_iterate_phdr() to support
|
||||
safe caching; I proposed on 12/16/2003 that glibc maintain two
|
||||
atomic counters which get inremented whenever something is added
|
||||
to/removed from the dl_iterate_phdr-list. Once we have such counters,
|
||||
we can use them in libunwind to implement an efficient version of a
|
||||
cache-validation routine.
|
||||
Once this has been fixed, update the libunwind man page accordingly.
|
||||
Effectively, what this means is that unw_flush_cache() doesn't have
|
||||
to be called by applications except for extraordinary circumstances
|
||||
(e.g., if application implements its own runtime loader).
|
||||
+ man-page for unw_is_fpreg()
|
||||
+ man-page for _U_dyn_cancel()
|
||||
+ man-page for _U_dyn_register()
|
||||
+ global data is not protected by a lock; causes problems if two threads
|
||||
call ia64_init() at almost the same time
|
||||
+ cache the value of *cfm_loc; each rotate_FOO() call needs it!
|
||||
+ implement the remote-lookup of the dynamic registration list
|
||||
+ when doing sigreturn, must restore fp regs (and perhaps other regs) the same
|
||||
way as the (user-level) gate.S sigreturn path does!
|
||||
+ unw_resume() must at least restore gp (r1)! consider restoring all
|
||||
scratch regs (but what's the performance impact on exception handling?);
|
||||
alternative: restore scratch regs that may be used during procedure
|
||||
call/return (e.g., r8-r11, f8-f11)
|
||||
+ implement unw_resume() for the case where the current register frame is split
|
||||
across multiple backing stores
|
||||
+ document restricions on using unw_resume():
|
||||
+ implement remote cases of unw_resume()
|
||||
+ test both with UNW_LOCAL_ONLY and without where this makes sense
|
||||
+ allow region-length (insn_count) in unw_dyn_region_info_t to be negative
|
||||
to indicate counting from the end of the procedure (to make it possible
|
||||
for differently-sized procedures to share the same region list if they
|
||||
share the same prologue/epilogue).
|
||||
+ it appears that it is currently not possible to read register UNW_IA64_TP;
|
||||
fix that => no, attempts to access r13 will result in access_reg() callbacks,
|
||||
as desired; for local-case, access to r13 will fail though (since
|
||||
getcontext() doesn't, and shouldn't, capture r13)
|
||||
+ document the special nature of UNW_IA64_GP: read-only, but adjusted
|
||||
automatically if the IP is changed
|
||||
+ use pthread-mutexes where necessary, atomic ops where possible
|
||||
+ man-page for unw_init_local()
|
||||
+ man-page for unw_init_remote()
|
||||
+ man-page for unw_create_addr_space()
|
||||
+ man-page for unw_destroy_addr_space()
|
||||
+ man-page for unw_get_proc_info()
|
||||
+ man-page for unw_get_proc_name()
|
||||
+ man-page for unw_get_accessors()
|
||||
+ man-page for unw_regname()
|
||||
+ man-page for unw_flush_cache()
|
||||
+ man-page for unw_set_caching_policy()
|
||||
+ man-page for unw_getcontext()
|
||||
+ man-page for unw_is_signal_frame()
|
||||
+ man-page for unw_step()
|
||||
+ man-page for unw_get_reg()
|
||||
+ man-page for unw_set_reg()
|
||||
+ man-page for unw_get_fpreg()
|
||||
+ man-page for unw_set_fpreg()
|
||||
+ test with Intel compiler
|
||||
@@ -1,57 +0,0 @@
|
||||
AC_DEFUN([LIBUNWIND___THREAD],
|
||||
[dnl Check whether the compiler supports the __thread keyword.
|
||||
if test "x$enable___thread" != xno; then
|
||||
AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
|
||||
[cat > conftest.c <<\EOF
|
||||
__thread int a = 42;
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
|
||||
libc_cv_gcc___thread=yes
|
||||
else
|
||||
libc_cv_gcc___thread=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test "$libc_cv_gcc___thread" = yes; then
|
||||
AC_DEFINE(HAVE___THREAD, 1,
|
||||
[Define to 1 if __thread keyword is supported by the C compiler.])
|
||||
fi
|
||||
else
|
||||
libc_cv_gcc___thread=no
|
||||
fi])
|
||||
|
||||
AC_DEFUN([CHECK_ATOMIC_OPS],
|
||||
[dnl Check whether the system has the atomic_ops package installed.
|
||||
AC_CHECK_HEADERS(atomic_ops.h)
|
||||
#
|
||||
# Don't link against libatomic_ops for now. We don't want libunwind
|
||||
# to depend on libatomic_ops.so. Fortunately, none of the platforms
|
||||
# we care about so far need libatomic_ops.a (everything is done via
|
||||
# inline macros).
|
||||
#
|
||||
# AC_CHECK_LIB(atomic_ops, main)
|
||||
])
|
||||
|
||||
# ANDROID support update.
|
||||
AC_DEFUN([CHECK_ANDROID],
|
||||
[dnl Check whether the system has __ANDROID__ defined.
|
||||
if test "x$enable_conserve_stack" != xno; then
|
||||
AC_CACHE_CHECK([for __ANDROID__], ac_cv_android,
|
||||
[cat > conftest.c <<\EOF
|
||||
#if !defined(__ANDROID__)
|
||||
value = fail
|
||||
#endif
|
||||
EOF
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
|
||||
ac_cv_android=yes
|
||||
else
|
||||
ac_cv_android=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test "$ac_cv_android" = yes; then
|
||||
AC_DEFINE([CONSERVE_STACK], [],
|
||||
[Allocate large structures rather than place them on the stack.])
|
||||
fi
|
||||
else
|
||||
ac_cv_android=no
|
||||
fi])
|
||||
# End of ANDROID update.
|
||||
@@ -1,26 +0,0 @@
|
||||
This version of libunwind based on libunwind 1.1.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
To configure a libunwind install for arm:
|
||||
|
||||
source build/envsetup.sh
|
||||
lunch aosp_arm-eng
|
||||
make -jXX
|
||||
cd external/libuwnind
|
||||
android/conf_arm.sh
|
||||
|
||||
To configure a libunwind install for mips:
|
||||
|
||||
source build/envsetup.sh
|
||||
lunch aosp_mips-eng
|
||||
make -jXX
|
||||
cd external/libuwnind
|
||||
android/conf_mips.sh
|
||||
|
||||
To configure a libunwind install for x86:
|
||||
|
||||
source build/envsetup.sh
|
||||
lunch aosp_x86-eng
|
||||
make -jXX
|
||||
cd external/libuwnind
|
||||
android/conf_x86.sh
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OUT" == "" ]]; then
|
||||
echo "In order for this script to function, please choose an arm target"
|
||||
echo "using source build/envsetup.sh and lunch XXX\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
arm_cc="${ANDROID_TOOLCHAIN}/arm-linux-androideabi-gcc"
|
||||
arm_cpp="${ANDROID_TOOLCHAIN}/arm-linux-androideabi-g++"
|
||||
|
||||
includes=(
|
||||
"-isystem ${ANDROID_BUILD_TOP}/system/core/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
|
||||
"-isystem ${OUT}/obj/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-arm/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-arm"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/arm"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
|
||||
"-include ${ANDROID_BUILD_TOP}/build/core/combo/include/arch/linux-arm/AndroidConfig.h"
|
||||
"-I ${ANDROID_BUILD_TOP}/build/core/combo/include/arch/linux-arm/"
|
||||
)
|
||||
|
||||
ldflags=(
|
||||
"-nostdlib"
|
||||
"-Bdynamic"
|
||||
"-fPIE"
|
||||
"-pie"
|
||||
"-Wl,-dynamic-linker,/system/bin/linker"
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,-z,nocopyreloc"
|
||||
"-L${OUT}/obj/lib"
|
||||
"-Wl,-rpath-link=${OUT}/obj/lib"
|
||||
"-Wl,--whole-archive"
|
||||
"-Wl,--no-whole-archive"
|
||||
"-lc"
|
||||
"-lstdc++"
|
||||
"-lm"
|
||||
"-Wl,-z,noexecstack"
|
||||
"-Wl,-z,relro"
|
||||
"-Wl,-z,now"
|
||||
"-Wl,--warn-shared-textrel"
|
||||
"-Wl,--fatal-warnings"
|
||||
"-Wl,--icf=safe"
|
||||
"-Wl,--no-undefined"
|
||||
"-ldl"
|
||||
)
|
||||
|
||||
eval ./configure CC=\"${arm_cc} ${includes[@]}\" \
|
||||
CPP=\"${arm_cc} ${includes[@]} -E\" \
|
||||
CXX=\"${arm_cpp} ${includes[@]}\" \
|
||||
CXXCPP=\"${arm_cpp} ${includes[@]} -E\" \
|
||||
LDFLAGS=\"${ldflags[@]}\" \
|
||||
--host=arm
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OUT" == "" ]]; then
|
||||
echo "In order for this script to function, please choose an arm target"
|
||||
echo "using source build/envsetup.sh and lunch XXX\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cc="${ANDROID_TOOLCHAIN}/mipsel-linux-android-gcc"
|
||||
cpp="${ANDROID_TOOLCHAIN}/mipsel-linux-android-g++"
|
||||
|
||||
includes=(
|
||||
"-isystem ${ANDROID_BUILD_TOP}/system/core/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
|
||||
"-isystem ${OUT}/obj/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-mips/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-mips"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/mips"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
|
||||
)
|
||||
|
||||
ldflags=(
|
||||
"-nostdlib"
|
||||
"-Bdynamic"
|
||||
"-fPIE"
|
||||
"-pie"
|
||||
"-Wl,-dynamic-linker,/system/bin/linker"
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,-z,nocopyreloc"
|
||||
"-L${OUT}/obj/lib"
|
||||
"-Wl,-rpath-link=${OUT}/obj/lib"
|
||||
"-Wl,--whole-archive"
|
||||
"-Wl,--no-whole-archive"
|
||||
"-lc"
|
||||
"-lstdc++"
|
||||
"-lm"
|
||||
"-Wl,-z,noexecstack"
|
||||
"-Wl,-z,relro"
|
||||
"-Wl,-z,now"
|
||||
"-Wl,--warn-shared-textrel"
|
||||
"-EL"
|
||||
"-Wl,--no-undefined"
|
||||
"-ldl"
|
||||
)
|
||||
|
||||
eval ./configure CC=\"${cc} ${includes[@]}\" \
|
||||
CPP=\"${cc} ${includes[@]} -E\" \
|
||||
CXX=\"${cpp} ${includes[@]}\" \
|
||||
CXXCPP=\"${cpp} ${includes[@]} -E\" \
|
||||
LDFLAGS=\"${ldflags[@]}\" \
|
||||
--host=mips
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OUT" == "" ]]; then
|
||||
echo "In order for this script to function, please choose an arm target"
|
||||
echo "using source build/envsetup.sh and lunch XXX\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cc="${ANDROID_TOOLCHAIN}/i686-linux-android-gcc"
|
||||
cpp="${ANDROID_TOOLCHAIN}/i686-linux-android-g++"
|
||||
|
||||
includes=(
|
||||
"-isystem ${ANDROID_BUILD_TOP}/system/core/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
|
||||
"-isystem ${OUT}/obj/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-x86/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-x86"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/i387"
|
||||
"-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
|
||||
)
|
||||
|
||||
ldflags=(
|
||||
"-m32"
|
||||
"-Wl,-z,noexecstack"
|
||||
"-Wl,-z,relro"
|
||||
"-Wl,-z,now"
|
||||
"-Wl,--warn-shared-textrel"
|
||||
"-Wl,--gc-sections"
|
||||
"-nostdlib"
|
||||
"-Bdynamic"
|
||||
"-Wl,-dynamic-linker,/system/bin/linker"
|
||||
"-Wl,-z,nocopyreloc"
|
||||
"-fPIE"
|
||||
"-pie"
|
||||
"-L${OUT}/obj/lib"
|
||||
"-Wl,-rpath-link=${OUT}/obj/lib"
|
||||
"-Wl,--whole-archive"
|
||||
"-Wl,--no-whole-archive"
|
||||
"-lc"
|
||||
"-lstdc++"
|
||||
"-lm"
|
||||
"-Wl,--no-undefined"
|
||||
"-ldl"
|
||||
)
|
||||
|
||||
eval ./configure CC=\"${cc} ${includes[@]}\" \
|
||||
CPP=\"${cc} ${includes[@]} -E\" \
|
||||
CXX=\"${cpp} ${includes[@]}\" \
|
||||
CXXCPP=\"${cpp} ${includes[@]} -E\" \
|
||||
LDFLAGS=\"${ldflags[@]}\" \
|
||||
--host=i386
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
|
||||
#define EXTRA_CONTEXT_BYTES 1024
|
||||
|
||||
TEST(libbacktrace, getcontext_size) {
|
||||
unw_context_t* context;
|
||||
context = reinterpret_cast<unw_context_t*>(malloc(sizeof(unw_context_t) + EXTRA_CONTEXT_BYTES));
|
||||
ASSERT_TRUE(context != NULL);
|
||||
uint8_t* extra = reinterpret_cast<uint8_t*>(reinterpret_cast<uintptr_t>(context) + sizeof(unw_context_t));
|
||||
for (size_t i = 0; i < EXTRA_CONTEXT_BYTES; i++) {
|
||||
extra[i] = (i % 255) + 1;
|
||||
}
|
||||
ASSERT_TRUE(unw_getcontext(context) == 0);
|
||||
/* Check that nothing was written past the end of the structure. */
|
||||
for (size_t i = 0; i < EXTRA_CONTEXT_BYTES; i++) {
|
||||
ASSERT_EQ((i % 255) + 1, extra[i]);
|
||||
}
|
||||
|
||||
free(context);
|
||||
}
|
||||
1321
app/src/main/jni/crash_dump/libunwind/aux/config.guess
vendored
1321
app/src/main/jni/crash_dump/libunwind/aux/config.guess
vendored
File diff suppressed because it is too large
Load Diff
1443
app/src/main/jni/crash_dump/libunwind/aux/config.sub
vendored
1443
app/src/main/jni/crash_dump/libunwind/aux/config.sub
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,390 +0,0 @@
|
||||
define(pkg_major, 1)
|
||||
define(pkg_minor, 1)
|
||||
define(pkg_extra, )
|
||||
define(pkg_maintainer, libunwind-devel@nongnu.org)
|
||||
define(mkvers, $1.$2$3)
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT([libunwind],[mkvers(pkg_major, pkg_minor, pkg_extra)],[pkg_maintainer])
|
||||
AC_CONFIG_SRCDIR(src/mi/backtrace.c)
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE([1.6 subdir-objects])
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CONFIG_HEADERS([include/config.h])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
LT_INIT
|
||||
AM_PROG_AS
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_LIB(uca, __uc_get_grs)
|
||||
OLD_LIBS=${LIBS}
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
LIBS=${OLD_LIBS}
|
||||
case "$ac_cv_search_dlopen" in
|
||||
-l*) DLLIB=$ac_cv_search_dlopen;;
|
||||
*) DLLIB="";;
|
||||
esac
|
||||
|
||||
CHECK_ATOMIC_OPS
|
||||
|
||||
# ANDROID support update.
|
||||
CHECK_ANDROID
|
||||
# End of ANDROID update.
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h sys/endian.h execinfo.h \
|
||||
ia64intrin.h sys/uc_access.h unistd.h signal.h sys/types.h \
|
||||
sys/procfs.h sys/ptrace.h byteswap.h elf.h sys/elf.h link.h sys/link.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_SIZEOF(off_t)
|
||||
|
||||
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
|
||||
|
||||
AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include <link.h>])
|
||||
AC_CHECK_TYPES([struct elf_prstatus, struct prstatus], [], [],
|
||||
[$ac_includes_default
|
||||
#if HAVE_SYS_PROCFS_H
|
||||
# include <sys/procfs.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
AC_CHECK_DECLS([PTRACE_POKEUSER, PTRACE_POKEDATA,
|
||||
PTRACE_TRACEME, PTRACE_CONT, PTRACE_SINGLESTEP,
|
||||
PTRACE_SYSCALL, PT_IO, PT_GETREGS,
|
||||
PT_GETFPREGS, PT_CONTINUE, PT_TRACE_ME,
|
||||
PT_STEP, PT_SYSCALL], [], [],
|
||||
[$ac_includes_default
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include <sys/ptrace.h>
|
||||
])
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
|
||||
ttrace mincore)
|
||||
|
||||
AC_MSG_CHECKING([if building with AltiVec])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifndef __ALTIVEC__
|
||||
# error choke
|
||||
#endif
|
||||
]])], [use_altivec=yes],[use_altivec=no])
|
||||
AM_CONDITIONAL(USE_ALTIVEC, [test x$use_altivec = xyes])
|
||||
AC_MSG_RESULT([$use_altivec])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifndef __powerpc64__
|
||||
# error choke
|
||||
#endif
|
||||
]])], [ppc_bits=64], [ppc_bits=32])
|
||||
|
||||
AC_DEFUN([SET_ARCH],[
|
||||
AS_CASE([$1],
|
||||
[arm*],[$2=arm],
|
||||
[i?86],[$2=x86],
|
||||
[hppa*],[$2=hppa],
|
||||
[mips*],[$2=mips],
|
||||
[powerpc*],[$2=ppc$ppc_bits],
|
||||
[sh*],[$2=sh],
|
||||
[amd64],[$2=x86_64],
|
||||
[$2=$1])
|
||||
]) dnl SET_ARCH
|
||||
|
||||
SET_ARCH([$build_cpu],[build_arch])
|
||||
SET_ARCH([$host_cpu],[host_arch])
|
||||
SET_ARCH([$target_cpu],[target_arch])
|
||||
|
||||
AC_ARG_ENABLE(coredump,
|
||||
AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),,
|
||||
[AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([if we should build libunwind-coredump])
|
||||
AC_MSG_RESULT([$enable_coredump])
|
||||
|
||||
AC_ARG_ENABLE(ptrace,
|
||||
AS_HELP_STRING([--enable-ptrace],[building libunwind-ptrace library]),,
|
||||
[AC_CHECK_HEADER([sys/ptrace.h], [enable_ptrace=yes], [enable_ptrace=no])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([if we should build libunwind-ptrace])
|
||||
AC_MSG_RESULT([$enable_ptrace])
|
||||
|
||||
AC_ARG_ENABLE(setjmp,
|
||||
AS_HELP_STRING([--enable-setjmp],[building libunwind-setjmp library]),,
|
||||
[AS_IF([test x$target_arch == x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([if we should build libunwind-setjmp])
|
||||
AC_MSG_RESULT([$enable_setjmp])
|
||||
|
||||
AC_MSG_CHECKING([for build architecture])
|
||||
AC_MSG_RESULT([$build_arch])
|
||||
AC_MSG_CHECKING([for host architecture])
|
||||
AC_MSG_RESULT([$host_arch])
|
||||
AC_MSG_CHECKING([for target architecture])
|
||||
AC_MSG_RESULT([$target_arch])
|
||||
AC_MSG_CHECKING([for target operating system])
|
||||
AC_MSG_RESULT([$target_os])
|
||||
|
||||
AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
|
||||
AM_CONDITIONAL(BUILD_PTRACE, test x$enable_ptrace = xyes)
|
||||
AM_CONDITIONAL(BUILD_SETJMP, test x$enable_setjmp = xyes)
|
||||
AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
|
||||
AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64)
|
||||
AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
|
||||
AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
|
||||
AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
|
||||
AM_CONDITIONAL(ARCH_MIPS, test x$target_arch = xmips)
|
||||
AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86)
|
||||
AM_CONDITIONAL(ARCH_X86_64, test x$target_arch = xx86_64)
|
||||
AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32)
|
||||
AM_CONDITIONAL(ARCH_PPC64, test x$target_arch = xppc64)
|
||||
AM_CONDITIONAL(ARCH_SH, test x$target_arch = xsh)
|
||||
AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null)
|
||||
AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null)
|
||||
AM_CONDITIONAL(OS_FREEBSD, expr x$target_os : xfreebsd >/dev/null)
|
||||
AM_CONDITIONAL(OS_QNX, expr x$target_os : xnto-qnx >/dev/null)
|
||||
|
||||
AC_MSG_CHECKING([for ELF helper width])
|
||||
case "${target_arch}" in
|
||||
(arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);;
|
||||
(aarch64|ia64|ppc64|x86_64) use_elf64=yes; AC_MSG_RESULT([64]);;
|
||||
(mips) use_elfxx=yes; AC_MSG_RESULT([xx]);;
|
||||
*) AC_MSG_ERROR([Unknown ELF target: ${target_arch}])
|
||||
esac
|
||||
AM_CONDITIONAL(USE_ELF32, [test x$use_elf32 = xyes])
|
||||
AM_CONDITIONAL(USE_ELF64, [test x$use_elf64 = xyes])
|
||||
AM_CONDITIONAL(USE_ELFXX, [test x$use_elfxx = xyes])
|
||||
|
||||
AC_MSG_CHECKING([whether to include DWARF support])
|
||||
if test x$target_arch != xia64; then
|
||||
use_dwarf=yes
|
||||
else
|
||||
use_dwarf=no
|
||||
fi
|
||||
AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes])
|
||||
AC_MSG_RESULT([$use_dwarf])
|
||||
|
||||
if test x$target_arch = xppc64; then
|
||||
libdir='${exec_prefix}/lib64'
|
||||
AC_MSG_NOTICE([PowerPC64 detected, lib will be installed ${libdir}]);
|
||||
AC_SUBST([libdir])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to restrict build to remote support])
|
||||
if test x$target_arch != x$host_arch; then
|
||||
CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
|
||||
remote_only=yes
|
||||
else
|
||||
remote_only=no
|
||||
fi
|
||||
AC_MSG_RESULT([$remote_only])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable debug support])
|
||||
AC_ARG_ENABLE(debug,
|
||||
AS_HELP_STRING([--enable-debug],[turn on debug support (slows down execution)]))
|
||||
if test x$enable_debug = xyes; then
|
||||
CPPFLAGS="${CPPFLAGS} -DDEBUG"
|
||||
else
|
||||
CPPFLAGS="${CPPFLAGS} -DNDEBUG"
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_debug])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable C++ exception support])
|
||||
AC_ARG_ENABLE(cxx_exceptions,
|
||||
AS_HELP_STRING([--enable-cxx-exceptions],[use libunwind to handle C++ exceptions]),,
|
||||
[
|
||||
# C++ exception handling doesn't work too well on x86
|
||||
case $target_arch in
|
||||
x86*) enable_cxx_exceptions=no;;
|
||||
aarch64*) enable_cxx_exceptions=no;;
|
||||
arm*) enable_cxx_exceptions=no;;
|
||||
mips*) enable_cxx_exceptions=no;;
|
||||
*) enable_cxx_exceptions=yes;;
|
||||
esac
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test x$enable_cxx_exceptions = xyes])
|
||||
AC_MSG_RESULT([$enable_cxx_exceptions])
|
||||
|
||||
AC_MSG_CHECKING([whether to load .debug_frame sections])
|
||||
AC_ARG_ENABLE(debug_frame,
|
||||
AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if available]),, [
|
||||
case "${target_arch}" in
|
||||
(arm) enable_debug_frame=yes;;
|
||||
(*) enable_debug_frame=no;;
|
||||
esac])
|
||||
if test x$enable_debug_frame = xyes; then
|
||||
AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_debug_frame])
|
||||
|
||||
AC_MSG_CHECKING([whether to block signals during mutex ops])
|
||||
AC_ARG_ENABLE(block_signals,
|
||||
AS_HELP_STRING([--enable-block-signals],[Block signals before performing mutex operations]),,
|
||||
[enable_block_signals=yes])
|
||||
if test x$enable_block_signals = xyes; then
|
||||
AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex operations])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_block_signals])
|
||||
|
||||
AC_MSG_CHECKING([whether to validate memory addresses before use])
|
||||
AC_ARG_ENABLE(conservative_checks,
|
||||
AS_HELP_STRING([--enable-conservative-checks],[Validate all memory addresses before use]),,
|
||||
[enable_conservative_checks=yes])
|
||||
if test x$enable_conservative_checks = xyes; then
|
||||
AC_DEFINE(CONSERVATIVE_CHECKS, 1,
|
||||
[Define to 1 if you want every memory access validated])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_conservative_checks])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable msabi support])
|
||||
AC_ARG_ENABLE(msabi_support,
|
||||
AS_HELP_STRING([--enable-msabi-support],[Enables support for Microsoft ABI extensions]))
|
||||
if test x$enable_msabi_support = xyes; then
|
||||
AC_DEFINE([CONFIG_MSABI_SUPPORT], [], [Support for Microsoft ABI extensions])
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_msabi_support])
|
||||
|
||||
LIBLZMA=
|
||||
AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
|
||||
AC_ARG_ENABLE(minidebuginfo,
|
||||
AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
|
||||
AC_MSG_RESULT([$enable_minidebuginfo])
|
||||
if test x$enable_minidebuginfo != xno; then
|
||||
AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
|
||||
[LIBLZMA=-llzma
|
||||
AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
|
||||
enable_minidebuginfo=yes],
|
||||
[if test x$enable_minidebuginfo = xyes; then
|
||||
AC_MSG_FAILURE([liblzma not found])
|
||||
fi])
|
||||
fi
|
||||
AC_SUBST([LIBLZMA])
|
||||
AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes)
|
||||
|
||||
LIBUNWIND___THREAD
|
||||
|
||||
AC_MSG_CHECKING([for Intel compiler])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
|
||||
#error choke me
|
||||
#endif]])],[intel_compiler=yes],[intel_compiler=no])
|
||||
|
||||
if test x$GCC = xyes -a x$intel_compiler != xyes; then
|
||||
CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
|
||||
fi
|
||||
AC_MSG_RESULT([$intel_compiler])
|
||||
|
||||
AC_MSG_CHECKING([for QCC compiler])
|
||||
AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no])
|
||||
AC_MSG_RESULT([$qcc_compiler])
|
||||
|
||||
if test x$intel_compiler = xyes; then
|
||||
AC_MSG_CHECKING([if linker supports -static-libcxa])
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -static-libcxa"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_static_libcxa=yes],[have_static_libcxa=no])
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
if test "x$have_static_libcxa" = xyes; then
|
||||
LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa"
|
||||
fi
|
||||
AC_MSG_RESULT([$have_static_libcxa])
|
||||
fi
|
||||
|
||||
if test x$qcc_compiler = xyes; then
|
||||
LDFLAGS_NOSTARTFILES="-XCClinker -Wc,-nostartfiles"
|
||||
else
|
||||
LDFLAGS_NOSTARTFILES="-XCClinker -nostartfiles"
|
||||
fi
|
||||
|
||||
if test x$GCC = xyes -a x$intel_compiler != xyes -a x$qcc_compiler != xyes; then
|
||||
LIBCRTS="-lgcc"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for __builtin___clear_cache])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]], [[__builtin___clear_cache(0, 0)]])],
|
||||
[have__builtin___clear_cache=yes],
|
||||
[have__builtin___clear_cache=no])
|
||||
if test x$have__builtin___clear_cache = xyes; then
|
||||
AC_DEFINE([HAVE__BUILTIN___CLEAR_CACHE], [1],
|
||||
[Defined if __builtin___clear_cache() is available])
|
||||
fi
|
||||
AC_MSG_RESULT([$have__builtin___clear_cache])
|
||||
|
||||
AC_MSG_CHECKING([for __builtin_unreachable])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])],
|
||||
[have__builtin_unreachable=yes],
|
||||
[have__builtin_unreachable=no])
|
||||
if test x$have__builtin_unreachable = xyes; then
|
||||
AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1],
|
||||
[Defined if __builtin_unreachable() is available])
|
||||
fi
|
||||
AC_MSG_RESULT([$have__builtin_unreachable])
|
||||
|
||||
AC_MSG_CHECKING([for __sync atomics])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]], [[
|
||||
__sync_bool_compare_and_swap((int *)0, 0, 1);
|
||||
__sync_fetch_and_add((int *)0, 1);
|
||||
]])],
|
||||
[have_sync_atomics=yes],
|
||||
[have_sync_atomics=no])
|
||||
if test x$have_sync_atomics = xyes; then
|
||||
AC_DEFINE([HAVE_SYNC_ATOMICS], [1],
|
||||
[Defined if __sync atomics are available])
|
||||
fi
|
||||
AC_MSG_RESULT([$have_sync_atomics])
|
||||
|
||||
CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"
|
||||
|
||||
arch="$target_arch"
|
||||
ARCH=`echo $target_arch | tr [a-z] [A-Z]`
|
||||
|
||||
dnl create shell variables from the M4 macros:
|
||||
PKG_MAJOR=pkg_major
|
||||
PKG_MINOR=pkg_minor
|
||||
PKG_EXTRA=pkg_extra
|
||||
PKG_MAINTAINER=pkg_maintainer
|
||||
|
||||
old_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(backtrace, execinfo)
|
||||
LIBS="$old_LIBS"
|
||||
|
||||
AC_SUBST(build_arch)
|
||||
AC_SUBST(target_os)
|
||||
AC_SUBST(arch)
|
||||
AC_SUBST(ARCH)
|
||||
AC_SUBST(LDFLAGS_STATIC_LIBCXA)
|
||||
AC_SUBST(LDFLAGS_NOSTARTFILES)
|
||||
AC_SUBST(LIBCRTS)
|
||||
AC_SUBST(PKG_MAJOR)
|
||||
AC_SUBST(PKG_MINOR)
|
||||
AC_SUBST(PKG_EXTRA)
|
||||
AC_SUBST(PKG_MAINTAINER)
|
||||
AC_SUBST(enable_cxx_exceptions)
|
||||
AC_SUBST(enable_debug_frame)
|
||||
AC_SUBST(DLLIB)
|
||||
|
||||
AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh
|
||||
doc/Makefile doc/common.tex include/libunwind-common.h
|
||||
include/libunwind.h include/tdep/libunwind_i.h)
|
||||
AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc
|
||||
src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc
|
||||
src/libunwind-generic.pc)
|
||||
AC_OUTPUT
|
||||
@@ -1,73 +0,0 @@
|
||||
# man pages that go into section 3:
|
||||
man3_MANS = libunwind.man libunwind-dynamic.man libunwind-ia64.man \
|
||||
libunwind-ptrace.man libunwind-setjmp.man \
|
||||
unw_backtrace.man \
|
||||
unw_flush_cache.man \
|
||||
unw_get_accessors.man \
|
||||
unw_get_proc_info.man \
|
||||
unw_get_proc_info_by_ip.man \
|
||||
unw_get_proc_name.man \
|
||||
unw_get_fpreg.man \
|
||||
unw_get_reg.man \
|
||||
unw_getcontext.man \
|
||||
unw_init_local.man unw_init_remote.man \
|
||||
unw_is_fpreg.man \
|
||||
unw_is_signal_frame.man \
|
||||
unw_create_addr_space.man \
|
||||
unw_destroy_addr_space.man \
|
||||
unw_regname.man unw_resume.man \
|
||||
unw_set_caching_policy.man \
|
||||
unw_set_fpreg.man \
|
||||
unw_set_reg.man \
|
||||
unw_step.man \
|
||||
unw_strerror.man \
|
||||
_U_dyn_register.man \
|
||||
_U_dyn_cancel.man
|
||||
|
||||
EXTRA_DIST = NOTES libunwind.trans \
|
||||
libunwind.tex libunwind-dynamic.tex libunwind-ia64.tex \
|
||||
libunwind-ptrace.tex libunwind-setjmp.tex \
|
||||
unw_backtrace.tex \
|
||||
unw_flush_cache.tex \
|
||||
unw_get_accessors.tex \
|
||||
unw_get_proc_info.tex \
|
||||
unw_get_proc_info_by_ip.tex \
|
||||
unw_get_proc_name.tex \
|
||||
unw_get_fpreg.tex \
|
||||
unw_get_reg.tex \
|
||||
unw_getcontext.tex \
|
||||
unw_init_local.tex unw_init_remote.tex \
|
||||
unw_is_fpreg.tex \
|
||||
unw_is_signal_frame.tex \
|
||||
unw_create_addr_space.tex unw_destroy_addr_space.tex \
|
||||
unw_regname.tex unw_resume.tex unw_set_caching_policy.tex \
|
||||
unw_set_fpreg.tex \
|
||||
unw_set_reg.tex \
|
||||
unw_step.tex \
|
||||
unw_strerror.tex \
|
||||
_U_dyn_register.tex \
|
||||
_U_dyn_cancel.tex \
|
||||
$(man3_MANS)
|
||||
|
||||
L2M = latex2man
|
||||
L2P = pdflatex
|
||||
L2M_CMD = $(L2M) -t $(srcdir)/libunwind.trans
|
||||
L2H_CMD = $(L2M) -H -t $(srcdir)/libunwind.trans
|
||||
|
||||
.tex.man:
|
||||
$(L2M_CMD) $< $@
|
||||
-cp $@ $(srcdir)/$@
|
||||
|
||||
html:
|
||||
for n in $(man3_MANS); do \
|
||||
page=`basename $$n .man`; \
|
||||
$(L2H_CMD) $(srcdir)/$$page.tex "$$page(3).raw"; \
|
||||
done
|
||||
|
||||
pdf:
|
||||
for n in $(man3_MANS); do \
|
||||
page=`basename $$n .man`; \
|
||||
$(L2P) $(srcdir)/$$page.tex "$$page(3).pdf"; \
|
||||
done
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
@@ -1,127 +0,0 @@
|
||||
The central data structure of the unwind API is the unwind cursor.
|
||||
This structure tracks the register contents. The unwind API defines a
|
||||
handful of well-known frame "registers":
|
||||
|
||||
- ip: the instruction pointer (pc)
|
||||
- rp: the return pointer (rp, aka "return address" or "return link")
|
||||
- sp: the stack pointer (memory stack pointer, in the case of ia64)
|
||||
- fp: the frame pointer
|
||||
- first_ip: the starting address of the current "procedure"
|
||||
- handler: a pointer to an architecture & language-specific
|
||||
"personality" routine
|
||||
- lsda: a pointer to an architecture & language-specific
|
||||
data-area
|
||||
|
||||
The API defines no well-known preserved registers. Each architecture
|
||||
can define additional registers as needed. Of course, a portable
|
||||
application may only rely on well-known registers. The names for
|
||||
preserved registers are defined in the architecture-specific header
|
||||
file <unwind-ARCH.h>. For example, to get the IA-64-specific register
|
||||
names, an application would do:
|
||||
|
||||
#include <unwind-ia64.h>
|
||||
|
||||
The API is designed to handle two primary cases: unwinding within the
|
||||
current (local) process and unwinding of another ("remote") process
|
||||
(e.g., through ptrace()). In the local case, the initial machine
|
||||
state is captured by an unwind context (currently the same as
|
||||
ucontext_t). In the remote case, the initial machine state is
|
||||
captured by an unwind accessor structure, which provides callback
|
||||
routines for reading/writing memory and registers and for obtaining
|
||||
unwind information.
|
||||
|
||||
Once a cursor has been initialized, you can step through the call
|
||||
chain with the unw_step() routine. The frame registers and the
|
||||
preserved state can then be accessed with unw_get_reg() or modified
|
||||
with unw_set_reg(). For floating-point registers, there are separate
|
||||
unw_get_fpreg() and unw_set_fpreg() routines (on some arches, e.g.,
|
||||
Alpha, these could be just aliases for unw_{g,s}et_reg()). The
|
||||
unw_resume() routine can be used to resume execution at an arbitrary
|
||||
point in the call-chain (as identified by an unwind cursor). This is
|
||||
intended for exception handling and, at least for now, the intention
|
||||
is to support this routine only for the local case. Kevin, if you
|
||||
feel gdb could benefit from such a routine, I'd be interested to hear
|
||||
about it.
|
||||
|
||||
Note that it is perfectly legal to make copies of the unwind cursor.
|
||||
This makes it possible, e.g., to obtain an unwind context, modify the
|
||||
state in an earlier call frame, and then resume execution at the point
|
||||
at which the unwind context was captured.
|
||||
|
||||
Here is a quick example of how to use the unwind API to do a simple
|
||||
stack trace:
|
||||
|
||||
unw_cursor_t cursor;
|
||||
unw_word_t ip, sp;
|
||||
unw_context_t uc;
|
||||
|
||||
unw_getcontext(&uc);
|
||||
unw_init_local(&cursor, &uc);
|
||||
do
|
||||
{
|
||||
unw_get_reg(&cursor, UNW_REG_IP, &ip);
|
||||
unw_get_reg(&cursor, UNW_REG_SP, &sp);
|
||||
printf ("ip=%016lx sp=%016lx\n", ip, sp);
|
||||
}
|
||||
while (unw_step (&cursor) > 0);
|
||||
|
||||
Note that this particular example should work on pretty much any
|
||||
architecture, as it doesn't rely on any arch-specific registers.
|
||||
|
||||
* Multiarchitecture support
|
||||
|
||||
If libunwind is configured for a target other than the local (native)
|
||||
host, the library is installed as libunwind-$ARCH, where $ARCH is
|
||||
the target architecture name (e.g., ia32, ia64, or alpha). Similarly,
|
||||
the header file is installed as libunwind-$ARCH.
|
||||
|
||||
With this setup, an application should:
|
||||
|
||||
- include <libunwind.h>, and
|
||||
- link against -lunwind
|
||||
|
||||
if the application needs to use the unwinder of the host. An
|
||||
application wanting to use the unwinder for a different target (e.g.,
|
||||
a cross-debugger) should:
|
||||
|
||||
- include <libunwind-$ARCH.h>, and
|
||||
- link against -lunwind-$ARCH
|
||||
|
||||
The global symbols exported by -lunwind-$ARCH are unique such that the
|
||||
same application can be linked against the separate unwind libraries
|
||||
of multiple targets. However, a single compilation unit can include
|
||||
the header file for only one target. For example, foo.c might include
|
||||
<libunwind-ia64.h> and bar.c might include <libunwind.h> and the
|
||||
entire application would have to be linked against both -lunwind and
|
||||
-lunwind-ia64.
|
||||
|
||||
Note: the unwind header files of all targets have a common dependency
|
||||
on libunwind-common.h. To avoid version conflicts, it is necessary to
|
||||
ensure that the unwind libraries for all targets were derived from the
|
||||
same release of libunwind. That is, if the unwind library for one
|
||||
target is upgraded to a newer version, the libraries for all other
|
||||
targets also need to be upgraded.
|
||||
|
||||
Note 2: The assumption is that a cross-unwinder can handle all
|
||||
interesting flavors of a target. For example, the unwinder for the
|
||||
ia64 target is expected to be able to handle both Linux and HP-UX.
|
||||
|
||||
* IA-64 Specific Information
|
||||
|
||||
Apart from the normal frame-registers, the IA-64 implementation of
|
||||
libunwind provides the means to access the current value of the
|
||||
register backing store pointer (bsp). One quirk with this
|
||||
frame-register is that it corresponds to the address that would be in
|
||||
register ar.bsp after flushing the current register stack to the
|
||||
backing store (i.e., as if a "flushrs" instruction had been executed).
|
||||
Of course, given this value and the contents of the current frame
|
||||
marker (CFM), it's easy to calculate the original value of ar.bsp:
|
||||
|
||||
unw_word_t cfm, bsp, bsp_after_flushrs, sof;
|
||||
|
||||
unw_get_reg (&cursor, UNW_IA64_BSP, &bsp_after_flushrs);
|
||||
unw_get_reg (&cursor, UNW_IA64_CFM, &cfm);
|
||||
bsp = ia64_rse_skip_regs (bsp_after_flushrs, -(cfm & 0x7f));
|
||||
|
||||
** Dynamic Unwind Info
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "\\_U\\_DYN\\_CANCEL" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
_U_dyn_cancel
|
||||
\-\- cancel unwind\-info for dynamically generated code
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
void
|
||||
_U_dyn_cancel(unw_dyn_info_t *di);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The _U_dyn_cancel()
|
||||
routine cancels the registration of the
|
||||
unwind\-info for a dynamically generated procedure. Argument di
|
||||
is the pointer to the unw_dyn_info_t
|
||||
structure that
|
||||
describes the procedure\&'s unwind\-info.
|
||||
.PP
|
||||
The _U_dyn_cancel()
|
||||
routine is guaranteed to execute in
|
||||
constant time (in the absence of contention from concurrent calls to
|
||||
_U_dyn_register()
|
||||
or _U_dyn_cancel()).
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
_U_dyn_cancel()
|
||||
is thread\-safe but \fInot\fP
|
||||
safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind\-dynamic(3),
|
||||
_U_dyn_register(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,46 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{\_U\_dyn\_cancel}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_cancel}\_U\_dyn\_cancel -- cancel unwind-info for dynamically generated code
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{\_U\_dyn\_cancel}() routine cancels the registration of the
|
||||
unwind-info for a dynamically generated procedure. Argument \Var{di}
|
||||
is the pointer to the \Type{unw\_dyn\_info\_t} structure that
|
||||
describes the procedure's unwind-info.
|
||||
|
||||
The \Func{\_U\_dyn\_cancel}() routine is guaranteed to execute in
|
||||
constant time (in the absence of contention from concurrent calls to
|
||||
\Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()).
|
||||
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{\_U\_dyn\_cancel}() is thread-safe but \emph{not} safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_register(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,68 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "\\_U\\_DYN\\_REGISTER" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
_U_dyn_register
|
||||
\-\- register unwind\-info for dynamically generated code
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
void
|
||||
_U_dyn_register(unw_dyn_info_t *di);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The _U_dyn_register()
|
||||
routine registers unwind\-info for a
|
||||
dynamically generated procedure. The procedure\&'s unwind\-info is
|
||||
described by a structure of type unw_dyn_info_t
|
||||
(see
|
||||
libunwind\-dynamic(3)).
|
||||
A pointer to this structure is
|
||||
passed in argument di\&.
|
||||
.PP
|
||||
The _U_dyn_register()
|
||||
routine is guaranteed to execute in
|
||||
constant time (in the absence of contention from concurrent calls to
|
||||
_U_dyn_register()
|
||||
or _U_dyn_cancel()).
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
_U_dyn_register()
|
||||
is thread\-safe but \fInot\fP
|
||||
safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind\-dynamic(3),
|
||||
_U_dyn_cancel(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,47 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{\_U\_dyn\_register}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_register}\_U\_dyn\_register -- register unwind-info for dynamically generated code
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{\_U\_dyn\_register}() routine registers unwind-info for a
|
||||
dynamically generated procedure. The procedure's unwind-info is
|
||||
described by a structure of type \Type{unw\_dyn\_info\_t} (see
|
||||
\SeeAlso{libunwind-dynamic(3)}). A pointer to this structure is
|
||||
passed in argument \Var{di}.
|
||||
|
||||
The \Func{\_U\_dyn\_register}() routine is guaranteed to execute in
|
||||
constant time (in the absence of contention from concurrent calls to
|
||||
\Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()).
|
||||
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{\_U\_dyn\_register}() is thread-safe but \emph{not} safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_cancel(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,11 +0,0 @@
|
||||
\setVersion{@VERSION@}
|
||||
|
||||
\sloppy
|
||||
|
||||
\newcommand{\Lt}{\symbol{"3C}}
|
||||
\newcommand{\Gt}{\symbol{"3E}}
|
||||
\newcommand{\Type}[1]{\File{#1}} % see libunwind.trans
|
||||
\newcommand{\Func}[1]{\Prog{#1}} % see libunwind.trans
|
||||
\newcommand{\Var}[1]{\Prog{#1}} % see libunwind.trans
|
||||
\newcommand{\Const}[1]{\File{#1}} % see libunwind.trans
|
||||
\newcommand{\SeeAlso}[2]{\File{#1}} % see libunwind.trans
|
||||
@@ -1,538 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "LIBUNWIND\-DYNAMIC" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
libunwind\-dynamic
|
||||
\-\- libunwind\-support for runtime\-generated code
|
||||
.PP
|
||||
.SH INTRODUCTION
|
||||
|
||||
.PP
|
||||
For libunwind
|
||||
to do its job, it needs to be able to reconstruct
|
||||
the \fIframe state\fP
|
||||
of each frame in a call\-chain. The frame state
|
||||
describes the subset of the machine\-state that consists of the
|
||||
\fIframe registers\fP
|
||||
(typically the instruction\-pointer and the
|
||||
stack\-pointer) and all callee\-saved registers (preserved registers).
|
||||
The frame state describes each register either by providing its
|
||||
current value (for frame registers) or by providing the location at
|
||||
which the current value is stored (callee\-saved registers).
|
||||
.PP
|
||||
For statically generated code, the compiler normally takes care of
|
||||
emitting \fIunwind\-info\fP
|
||||
which provides the minimum amount of
|
||||
information needed to reconstruct the frame\-state for each instruction
|
||||
in a procedure. For dynamically generated code, the runtime code
|
||||
generator must use the dynamic unwind\-info interface provided by
|
||||
libunwind
|
||||
to supply the equivalent information. This manual
|
||||
page describes the format of this information in detail.
|
||||
.PP
|
||||
For the purpose of this discussion, a \fIprocedure\fP
|
||||
is defined to
|
||||
be an arbitrary piece of \fIcontiguous\fP
|
||||
code. Normally, each
|
||||
procedure directly corresponds to a function in the source\-language
|
||||
but this is not strictly required. For example, a runtime
|
||||
code\-generator could translate a given function into two separate
|
||||
(discontiguous) procedures: one for frequently\-executed (hot) code and
|
||||
one for rarely\-executed (cold) code. Similarly, simple
|
||||
source\-language functions (usually leaf functions) may get translated
|
||||
into code for which the default unwind\-conventions apply and for such
|
||||
code, it is not strictly necessary to register dynamic unwind\-info.
|
||||
.PP
|
||||
A procedure logically consists of a sequence of \fIregions\fP\&.
|
||||
Regions are nested in the sense that the frame state at the end of one
|
||||
region is, by default, assumed to be the frame state for the next
|
||||
region. Each region is thought of as being divided into a
|
||||
\fIprologue\fP,
|
||||
a \fIbody\fP,
|
||||
and an \fIepilogue\fP\&.
|
||||
Each of them
|
||||
can be empty. If non\-empty, the prologue sets up the frame state for
|
||||
the body. For example, the prologue may need to allocate some space
|
||||
on the stack and save certain callee\-saved registers. The body
|
||||
performs the actual work of the procedure but does not change the
|
||||
frame state in any way. If non\-empty, the epilogue restores the
|
||||
previous frame state and as such it undoes or cancels the effect of
|
||||
the prologue. In fact, a single epilogue may undo the effect of the
|
||||
prologues of several (nested) regions.
|
||||
.PP
|
||||
We should point out that even though the prologue, body, and epilogue
|
||||
are logically separate entities, optimizing code\-generators will
|
||||
generally interleave instructions from all three entities. For this
|
||||
reason, the dynamic unwind\-info interface of libunwind
|
||||
makes no
|
||||
distinction whatsoever between prologue and body. Similarly, the
|
||||
exact set of instructions that make up an epilogue is also irrelevant.
|
||||
The only point in the epilogue that needs to be described explicitly
|
||||
by the dynamic unwind\-info is the point at which the stack\-pointer
|
||||
gets restored. The reason this point needs to be described is that
|
||||
once the stack\-pointer is restored, all values saved in the
|
||||
deallocated portion of the stack frame become invalid and hence
|
||||
libunwind
|
||||
needs to know about it. The portion of the frame
|
||||
state not saved on the stack is assume to remain valid through the end
|
||||
of the region. For this reason, there is usually no need to describe
|
||||
instructions which restore the contents of callee\-saved registers.
|
||||
.PP
|
||||
Within a region, each instruction that affects the frame state in some
|
||||
fashion needs to be described with an operation descriptor. For this
|
||||
purpose, each instruction in the region is assigned a unique index.
|
||||
Exactly how this index is derived depends on the architecture. For
|
||||
example, on RISC and EPIC\-style architecture, instructions have a
|
||||
fixed size so it\&'s possible to simply number the instructions. In
|
||||
contrast, most CISC use variable\-length instruction encodings, so it
|
||||
is usually necessary to use a byte\-offset as the index. Given the
|
||||
instruction index, the operation descriptor specifies the effect of
|
||||
the instruction in an abstract manner. For example, it might express
|
||||
that the instruction stores calle\-saved register r1
|
||||
at offset 16
|
||||
in the stack frame.
|
||||
.PP
|
||||
.SH PROCEDURES
|
||||
|
||||
.PP
|
||||
A runtime code\-generator registers the dynamic unwind\-info of a
|
||||
procedure by setting up a structure of type unw_dyn_info_t
|
||||
and calling _U_dyn_register(),
|
||||
passing the address of the
|
||||
structure as the sole argument. The members of the
|
||||
unw_dyn_info_t
|
||||
structure are described below:
|
||||
.TP
|
||||
void *next
|
||||
Private to libunwind\&.
|
||||
Must not be used
|
||||
by the application.
|
||||
.TP
|
||||
void *prev
|
||||
Private to libunwind\&.
|
||||
Must not be used
|
||||
by the application.
|
||||
.TP
|
||||
unw_word_t start_ip
|
||||
The start\-address of the
|
||||
instructions of the procedure (remember: procedure are defined to be
|
||||
contiguous pieces of code, so a single code\-range is sufficient).
|
||||
.TP
|
||||
unw_word_t end_ip
|
||||
The end\-address of the
|
||||
instructions of the procedure (non\-inclusive, that is,
|
||||
end_ip\-start_ip
|
||||
is the size of the procedure in
|
||||
bytes).
|
||||
.TP
|
||||
unw_word_t gp
|
||||
The global\-pointer value in use
|
||||
for this procedure. The exact meaing of the global\-pointer is
|
||||
architecture\-specific and on some architecture, it is not used at
|
||||
all.
|
||||
.TP
|
||||
int32_t format
|
||||
The format of the unwind\-info.
|
||||
This member can be one of UNW_INFO_FORMAT_DYNAMIC,
|
||||
UNW_INFO_FORMAT_TABLE,
|
||||
or
|
||||
UNW_INFO_FORMAT_REMOTE_TABLE\&.
|
||||
.TP
|
||||
union u
|
||||
This union contains one sub\-member
|
||||
structure for every possible unwind\-info format:
|
||||
.RS
|
||||
.TP
|
||||
unw_dyn_proc_info_t pi
|
||||
This member is used
|
||||
for format UNW_INFO_FORMAT_DYNAMIC\&.
|
||||
.TP
|
||||
unw_dyn_table_info_t ti
|
||||
This member is used
|
||||
for format UNW_INFO_FORMAT_TABLE\&.
|
||||
.TP
|
||||
unw_dyn_remote_table_info_t rti
|
||||
This member
|
||||
is used for format UNW_INFO_FORMAT_REMOTE_TABLE\&.
|
||||
.RE
|
||||
.RS
|
||||
.PP
|
||||
The format of these sub\-members is described in detail below.
|
||||
.RE
|
||||
.PP
|
||||
.SS PROC\-INFO FORMAT
|
||||
.PP
|
||||
This is the preferred dynamic unwind\-info format and it is generally
|
||||
the one used by full\-blown runtime code\-generators. In this format,
|
||||
the details of a procedure are described by a structure of type
|
||||
unw_dyn_proc_info_t\&.
|
||||
This structure contains the following
|
||||
members:
|
||||
.PP
|
||||
.RE
|
||||
.TP
|
||||
unw_word_t name_ptr
|
||||
The address of a
|
||||
(human\-readable) name of the procedure or 0 if no such name is
|
||||
available. If non\-zero, The string stored at this address must be
|
||||
ASCII NUL terminated. For source languages that use name\-mangling
|
||||
(such as C++ or Java) the string stored at this address should be
|
||||
the \fIdemangled\fP
|
||||
version of the name.
|
||||
.PP
|
||||
.TP
|
||||
unw_word_t handler
|
||||
The address of the
|
||||
personality\-routine for this procedure. Personality\-routines are
|
||||
used in conjunction with exception handling. See the C++ ABI draft
|
||||
(http://www.codesourcery.com/cxx\-abi/) for an overview and a
|
||||
description of the personality routine. If the procedure has no
|
||||
personality routine, handler
|
||||
must be set to 0.
|
||||
.PP
|
||||
.TP
|
||||
uint32_t flags
|
||||
A bitmask of flags. At the
|
||||
moment, no flags have been defined and this member must be
|
||||
set to 0.
|
||||
.PP
|
||||
.TP
|
||||
unw_dyn_region_info_t *regions
|
||||
A NULL\-terminated
|
||||
linked list of region\-descriptors. See section ``Region
|
||||
descriptors\&'' below for more details.
|
||||
.PP
|
||||
.SS TABLE\-INFO FORMAT
|
||||
.PP
|
||||
This format is generally used when the dynamically generated code was
|
||||
derived from static code and the unwind\-info for the dynamic and the
|
||||
static versions is identical. For example, this format can be useful
|
||||
when loading statically\-generated code into an address\-space in a
|
||||
non\-standard fashion (i.e., through some means other than
|
||||
dlopen()).
|
||||
In this format, the details of a group of procedures
|
||||
is described by a structure of type unw_dyn_table_info\&.
|
||||
This structure contains the following members:
|
||||
.PP
|
||||
.TP
|
||||
unw_word_t name_ptr
|
||||
The address of a
|
||||
(human\-readable) name of the procedure or 0 if no such name is
|
||||
available. If non\-zero, The string stored at this address must be
|
||||
ASCII NUL terminated. For source languages that use name\-mangling
|
||||
(such as C++ or Java) the string stored at this address should be
|
||||
the \fIdemangled\fP
|
||||
version of the name.
|
||||
.PP
|
||||
.TP
|
||||
unw_word_t segbase
|
||||
The segment\-base value
|
||||
that needs to be added to the segment\-relative values stored in the
|
||||
unwind\-info. The exact meaning of this value is
|
||||
architecture\-specific.
|
||||
.PP
|
||||
.TP
|
||||
unw_word_t table_len
|
||||
The length of the
|
||||
unwind\-info (table_data)
|
||||
counted in units of words
|
||||
(unw_word_t).
|
||||
.PP
|
||||
.TP
|
||||
unw_word_t table_data
|
||||
A pointer to the actual
|
||||
data encoding the unwind\-info. The exact format is
|
||||
architecture\-specific (see architecture\-specific sections below).
|
||||
.PP
|
||||
.SS REMOTE TABLE\-INFO FORMAT
|
||||
.PP
|
||||
The remote table\-info format has the same basic purpose as the regular
|
||||
table\-info format. The only difference is that when libunwind
|
||||
uses the unwind\-info, it will keep the table data in the target
|
||||
address\-space (which may be remote). Consequently, the type of the
|
||||
table_data
|
||||
member is unw_word_t
|
||||
rather than a pointer.
|
||||
This implies that libunwind
|
||||
will have to access the table\-data
|
||||
via the address\-space\&'s access_mem()
|
||||
call\-back, rather than
|
||||
through a direct memory reference.
|
||||
.PP
|
||||
From the point of view of a runtime\-code generator, the remote
|
||||
table\-info format offers no advantage and it is expected that such
|
||||
generators will describe their procedures either with the proc\-info
|
||||
format or the normal table\-info format. The main reason that the
|
||||
remote table\-info format exists is to enable the
|
||||
address\-space\-specific find_proc_info()
|
||||
callback (see
|
||||
unw_create_addr_space(3))
|
||||
to return unwind tables whose
|
||||
data remains in remote memory. This can speed up unwinding (e.g., for
|
||||
a debugger) because it reduces the amount of data that needs to be
|
||||
loaded from remote memory.
|
||||
.PP
|
||||
.SH REGIONS DESCRIPTORS
|
||||
|
||||
.PP
|
||||
A region descriptor is a variable length structure that describes how
|
||||
each instruction in the region affects the frame state. Of course,
|
||||
most instructions in a region usualy do not change the frame state and
|
||||
for those, nothing needs to be recorded in the region descriptor. A
|
||||
region descriptor is a structure of type
|
||||
unw_dyn_region_info_t
|
||||
and has the following members:
|
||||
.TP
|
||||
unw_dyn_region_info_t *next
|
||||
A pointer to the
|
||||
next region. If this is the last region, next
|
||||
is NULL\&.
|
||||
.TP
|
||||
int32_t insn_count
|
||||
The length of the region in
|
||||
instructions. Each instruction is assumed to have a fixed size (see
|
||||
architecture\-specific sections for details). The value of
|
||||
insn_count
|
||||
may be negative in the last region of a procedure
|
||||
(i.e., it may be negative only if next
|
||||
is NULL).
|
||||
A
|
||||
negative value indicates that the region covers the last \fIN\fP
|
||||
instructions of the procedure, where \fIN\fP
|
||||
is the absolute value
|
||||
of insn_count\&.
|
||||
.TP
|
||||
uint32_t op_count
|
||||
The (allocated) length of
|
||||
the op_count
|
||||
array.
|
||||
.TP
|
||||
unw_dyn_op_t op
|
||||
An array of dynamic unwind
|
||||
directives. See Section ``Dynamic unwind directives\&'' for a
|
||||
description of the directives.
|
||||
.PP
|
||||
A region descriptor with an insn_count
|
||||
of zero is an
|
||||
\fIempty region\fP
|
||||
and such regions are perfectly legal. In fact,
|
||||
empty regions can be useful to establish a particular frame state
|
||||
before the start of another region.
|
||||
.PP
|
||||
A single region list can be shared across multiple procedures provided
|
||||
those procedures share a common prologue and epilogue (their bodies
|
||||
may differ, of course). Normally, such procedures consist of a canned
|
||||
prologue, the body, and a canned epilogue. This could be described by
|
||||
two regions: one covering the prologue and one covering the epilogue.
|
||||
Since the body length is variable, the latter region would need to
|
||||
specify a negative value in insn_count
|
||||
such that
|
||||
libunwind
|
||||
knows that the region covers the end of the procedure
|
||||
(up to the address specified by end_ip).
|
||||
.PP
|
||||
The region descriptor is a variable length structure to make it
|
||||
possible to allocate all the necessary memory with a single
|
||||
memory\-allocation request. To facilitate the allocation of a region
|
||||
descriptors libunwind
|
||||
provides a helper routine with the
|
||||
following synopsis:
|
||||
.PP
|
||||
size_t
|
||||
_U_dyn_region_size(int
|
||||
op_count);
|
||||
.PP
|
||||
This routine returns the number of bytes needed to hold a region
|
||||
descriptor with space for op_count
|
||||
unwind directives. Note
|
||||
that the length of the op
|
||||
array does not have to match exactly
|
||||
with the number of directives in a region. Instead, it is sufficient
|
||||
if the op
|
||||
array contains at least as many entries as there are
|
||||
directives, since the end of the directives can always be indicated
|
||||
with the UNW_DYN_STOP
|
||||
directive.
|
||||
.PP
|
||||
.SH DYNAMIC UNWIND DIRECTIVES
|
||||
|
||||
.PP
|
||||
A dynamic unwind directive describes how the frame state changes
|
||||
at a particular point within a region. The description is in
|
||||
the form of a structure of type unw_dyn_op_t\&.
|
||||
This
|
||||
structure has the following members:
|
||||
.TP
|
||||
int8_t tag
|
||||
The operation tag. Must be one
|
||||
of the unw_dyn_operation_t
|
||||
values described below.
|
||||
.TP
|
||||
int8_t qp
|
||||
The qualifying predicate that controls
|
||||
whether or not this directive is active. This is useful for
|
||||
predicated architecturs such as IA\-64 or ARM, where the contents of
|
||||
another (callee\-saved) register determines whether or not an
|
||||
instruction is executed (takes effect). If the directive is always
|
||||
active, this member should be set to the manifest constant
|
||||
_U_QP_TRUE
|
||||
(this constant is defined for all
|
||||
architectures, predicated or not).
|
||||
.TP
|
||||
int16_t reg
|
||||
The number of the register affected
|
||||
by the instruction.
|
||||
.TP
|
||||
int32_t when
|
||||
The region\-relative number of
|
||||
the instruction to which this directive applies. For example,
|
||||
a value of 0 means that the effect described by this directive
|
||||
has taken place once the first instruction in the region has
|
||||
executed.
|
||||
.TP
|
||||
unw_word_t val
|
||||
The value to be applied by the
|
||||
operation tag. The exact meaning of this value varies by tag. See
|
||||
Section ``Operation tags\&'' below.
|
||||
.PP
|
||||
It is perfectly legitimate to specify multiple dynamic unwind
|
||||
directives with the same when
|
||||
value, if a particular instruction
|
||||
has a complex effect on the frame state.
|
||||
.PP
|
||||
Empty regions by definition contain no actual instructions and as such
|
||||
the directives are not tied to a particular instruction. By
|
||||
convention, the when
|
||||
member should be set to 0, however.
|
||||
.PP
|
||||
There is no need for the dynamic unwind directives to appear
|
||||
in order of increasing when
|
||||
values. If the directives happen to
|
||||
be sorted in that order, it may result in slightly faster execution,
|
||||
but a runtime code\-generator should not go to extra lengths just to
|
||||
ensure that the directives are sorted.
|
||||
.PP
|
||||
IMPLEMENTATION NOTE: should libunwind
|
||||
implementations for
|
||||
certain architectures prefer the list of unwind directives to be
|
||||
sorted, it is recommended that such implementations first check
|
||||
whether the list happens to be sorted already and, if not, sort the
|
||||
directives explicitly before the first use. With this approach, the
|
||||
overhead of explicit sorting is only paid when there is a real benefit
|
||||
and if the runtime code\-generator happens to generated sorted lists
|
||||
naturally, the performance penalty is limited to a simple O(N) check.
|
||||
.PP
|
||||
.SS OPERATIONS TAGS
|
||||
.PP
|
||||
The possible operation tags are defined by enumeration type
|
||||
unw_dyn_operation_t
|
||||
which defines the following
|
||||
values:
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_STOP
|
||||
Marks the end of the dynamic unwind
|
||||
directive list. All remaining entries in the op
|
||||
array of the
|
||||
region\-descriptor are ignored. This tag is guaranteed to have a
|
||||
value of 0.
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_SAVE_REG
|
||||
Marks an instruction which saves
|
||||
register reg
|
||||
to register val\&.
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_SPILL_FP_REL
|
||||
Marks an instruction which
|
||||
spills register reg
|
||||
to a frame\-pointer\-relative location. The
|
||||
frame\-pointer\-relative offset is given by the value stored in member
|
||||
val\&.
|
||||
See the architecture\-specific sections for a description
|
||||
of the stack frame layout.
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_SPILL_SP_REL
|
||||
Marks an instruction which
|
||||
spills register reg
|
||||
to a stack\-pointer\-relative location. The
|
||||
stack\-pointer\-relative offset is given by the value stored in member
|
||||
val\&.
|
||||
See the architecture\-specific sections for a description
|
||||
of the stack frame layout.
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_ADD
|
||||
Marks an instruction which adds
|
||||
the constant value val
|
||||
to register reg\&.
|
||||
To add subtract
|
||||
a constant value, store the two\&'s\-complement of the value in
|
||||
val\&.
|
||||
The set of registers that can be specified for this tag
|
||||
is described in the architecture\-specific sections below.
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_POP_FRAMES
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_LABEL_STATE
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_COPY_STATE
|
||||
.PP
|
||||
.TP
|
||||
UNW_DYN_ALIAS
|
||||
.PP
|
||||
unw_dyn_op_t
|
||||
.PP
|
||||
_U_dyn_op_save_reg();
|
||||
_U_dyn_op_spill_fp_rel();
|
||||
_U_dyn_op_spill_sp_rel();
|
||||
_U_dyn_op_add();
|
||||
_U_dyn_op_pop_frames();
|
||||
_U_dyn_op_label_state();
|
||||
_U_dyn_op_copy_state();
|
||||
_U_dyn_op_alias();
|
||||
_U_dyn_op_stop();
|
||||
.PP
|
||||
.SH IA\-64 SPECIFICS
|
||||
|
||||
.PP
|
||||
\- meaning of segbase member in table\-info/table\-remote\-info format
|
||||
\- format of table_data in table\-info/table\-remote\-info format
|
||||
\- instruction size: each bundle is counted as 3 instructions, regardless
|
||||
of template (MLX)
|
||||
\- describe stack\-frame layout, especially with regards to sp\-relative
|
||||
and fp\-relative addressing
|
||||
\- UNW_DYN_ADD can only add to ``sp\&'' (always a negative value); use
|
||||
POP_FRAMES otherwise
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
_U_dyn_register(3),
|
||||
_U_dyn_cancel(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,401 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{libunwind-dynamic}{David Mosberger-Tang}{Programming Library}{Introduction to dynamic unwind-info}libunwind-dynamic -- libunwind-support for runtime-generated code
|
||||
\end{Name}
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
For \Prog{libunwind} to do its job, it needs to be able to reconstruct
|
||||
the \emph{frame state} of each frame in a call-chain. The frame state
|
||||
describes the subset of the machine-state that consists of the
|
||||
\emph{frame registers} (typically the instruction-pointer and the
|
||||
stack-pointer) and all callee-saved registers (preserved registers).
|
||||
The frame state describes each register either by providing its
|
||||
current value (for frame registers) or by providing the location at
|
||||
which the current value is stored (callee-saved registers).
|
||||
|
||||
For statically generated code, the compiler normally takes care of
|
||||
emitting \emph{unwind-info} which provides the minimum amount of
|
||||
information needed to reconstruct the frame-state for each instruction
|
||||
in a procedure. For dynamically generated code, the runtime code
|
||||
generator must use the dynamic unwind-info interface provided by
|
||||
\Prog{libunwind} to supply the equivalent information. This manual
|
||||
page describes the format of this information in detail.
|
||||
|
||||
For the purpose of this discussion, a \emph{procedure} is defined to
|
||||
be an arbitrary piece of \emph{contiguous} code. Normally, each
|
||||
procedure directly corresponds to a function in the source-language
|
||||
but this is not strictly required. For example, a runtime
|
||||
code-generator could translate a given function into two separate
|
||||
(discontiguous) procedures: one for frequently-executed (hot) code and
|
||||
one for rarely-executed (cold) code. Similarly, simple
|
||||
source-language functions (usually leaf functions) may get translated
|
||||
into code for which the default unwind-conventions apply and for such
|
||||
code, it is not strictly necessary to register dynamic unwind-info.
|
||||
|
||||
A procedure logically consists of a sequence of \emph{regions}.
|
||||
Regions are nested in the sense that the frame state at the end of one
|
||||
region is, by default, assumed to be the frame state for the next
|
||||
region. Each region is thought of as being divided into a
|
||||
\emph{prologue}, a \emph{body}, and an \emph{epilogue}. Each of them
|
||||
can be empty. If non-empty, the prologue sets up the frame state for
|
||||
the body. For example, the prologue may need to allocate some space
|
||||
on the stack and save certain callee-saved registers. The body
|
||||
performs the actual work of the procedure but does not change the
|
||||
frame state in any way. If non-empty, the epilogue restores the
|
||||
previous frame state and as such it undoes or cancels the effect of
|
||||
the prologue. In fact, a single epilogue may undo the effect of the
|
||||
prologues of several (nested) regions.
|
||||
|
||||
We should point out that even though the prologue, body, and epilogue
|
||||
are logically separate entities, optimizing code-generators will
|
||||
generally interleave instructions from all three entities. For this
|
||||
reason, the dynamic unwind-info interface of \Prog{libunwind} makes no
|
||||
distinction whatsoever between prologue and body. Similarly, the
|
||||
exact set of instructions that make up an epilogue is also irrelevant.
|
||||
The only point in the epilogue that needs to be described explicitly
|
||||
by the dynamic unwind-info is the point at which the stack-pointer
|
||||
gets restored. The reason this point needs to be described is that
|
||||
once the stack-pointer is restored, all values saved in the
|
||||
deallocated portion of the stack frame become invalid and hence
|
||||
\Prog{libunwind} needs to know about it. The portion of the frame
|
||||
state not saved on the stack is assume to remain valid through the end
|
||||
of the region. For this reason, there is usually no need to describe
|
||||
instructions which restore the contents of callee-saved registers.
|
||||
|
||||
Within a region, each instruction that affects the frame state in some
|
||||
fashion needs to be described with an operation descriptor. For this
|
||||
purpose, each instruction in the region is assigned a unique index.
|
||||
Exactly how this index is derived depends on the architecture. For
|
||||
example, on RISC and EPIC-style architecture, instructions have a
|
||||
fixed size so it's possible to simply number the instructions. In
|
||||
contrast, most CISC use variable-length instruction encodings, so it
|
||||
is usually necessary to use a byte-offset as the index. Given the
|
||||
instruction index, the operation descriptor specifies the effect of
|
||||
the instruction in an abstract manner. For example, it might express
|
||||
that the instruction stores calle-saved register \Var{r1} at offset 16
|
||||
in the stack frame.
|
||||
|
||||
\section{Procedures}
|
||||
|
||||
A runtime code-generator registers the dynamic unwind-info of a
|
||||
procedure by setting up a structure of type \Type{unw\_dyn\_info\_t}
|
||||
and calling \Func{\_U\_dyn\_register}(), passing the address of the
|
||||
structure as the sole argument. The members of the
|
||||
\Type{unw\_dyn\_info\_t} structure are described below:
|
||||
\begin{itemize}
|
||||
\item[\Type{void~*}next] Private to \Prog{libunwind}. Must not be used
|
||||
by the application.
|
||||
\item[\Type{void~*}prev] Private to \Prog{libunwind}. Must not be used
|
||||
by the application.
|
||||
\item[\Type{unw\_word\_t} \Var{start\_ip}] The start-address of the
|
||||
instructions of the procedure (remember: procedure are defined to be
|
||||
contiguous pieces of code, so a single code-range is sufficient).
|
||||
\item[\Type{unw\_word\_t} \Var{end\_ip}] The end-address of the
|
||||
instructions of the procedure (non-inclusive, that is,
|
||||
\Var{end\_ip}-\Var{start\_ip} is the size of the procedure in
|
||||
bytes).
|
||||
\item[\Type{unw\_word\_t} \Var{gp}] The global-pointer value in use
|
||||
for this procedure. The exact meaing of the global-pointer is
|
||||
architecture-specific and on some architecture, it is not used at
|
||||
all.
|
||||
\item[\Type{int32\_t} \Var{format}] The format of the unwind-info.
|
||||
This member can be one of \Const{UNW\_INFO\_FORMAT\_DYNAMIC},
|
||||
\Const{UNW\_INFO\_FORMAT\_TABLE}, or
|
||||
\Const{UNW\_INFO\_FORMAT\_REMOTE\_TABLE}.
|
||||
\item[\Type{union} \Var{u}] This union contains one sub-member
|
||||
structure for every possible unwind-info format:
|
||||
\begin{description}
|
||||
\item[\Type{unw\_dyn\_proc\_info\_t} \Var{pi}] This member is used
|
||||
for format \Const{UNW\_INFO\_FORMAT\_DYNAMIC}.
|
||||
\item[\Type{unw\_dyn\_table\_info\_t} \Var{ti}] This member is used
|
||||
for format \Const{UNW\_INFO\_FORMAT\_TABLE}.
|
||||
\item[\Type{unw\_dyn\_remote\_table\_info\_t} \Var{rti}] This member
|
||||
is used for format \Const{UNW\_INFO\_FORMAT\_REMOTE\_TABLE}.
|
||||
\end{description}\
|
||||
The format of these sub-members is described in detail below.
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Proc-info format}
|
||||
|
||||
This is the preferred dynamic unwind-info format and it is generally
|
||||
the one used by full-blown runtime code-generators. In this format,
|
||||
the details of a procedure are described by a structure of type
|
||||
\Type{unw\_dyn\_proc\_info\_t}. This structure contains the following
|
||||
members:
|
||||
\begin{description}
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{name\_ptr}] The address of a
|
||||
(human-readable) name of the procedure or 0 if no such name is
|
||||
available. If non-zero, The string stored at this address must be
|
||||
ASCII NUL terminated. For source languages that use name-mangling
|
||||
(such as C++ or Java) the string stored at this address should be
|
||||
the \emph{demangled} version of the name.
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{handler}] The address of the
|
||||
personality-routine for this procedure. Personality-routines are
|
||||
used in conjunction with exception handling. See the C++ ABI draft
|
||||
(http://www.codesourcery.com/cxx-abi/) for an overview and a
|
||||
description of the personality routine. If the procedure has no
|
||||
personality routine, \Var{handler} must be set to 0.
|
||||
|
||||
\item[\Type{uint32\_t} \Var{flags}] A bitmask of flags. At the
|
||||
moment, no flags have been defined and this member must be
|
||||
set to 0.
|
||||
|
||||
\item[\Type{unw\_dyn\_region\_info\_t~*}\Var{regions}] A NULL-terminated
|
||||
linked list of region-descriptors. See section ``Region
|
||||
descriptors'' below for more details.
|
||||
|
||||
\end{description}
|
||||
|
||||
\subsection{Table-info format}
|
||||
|
||||
This format is generally used when the dynamically generated code was
|
||||
derived from static code and the unwind-info for the dynamic and the
|
||||
static versions is identical. For example, this format can be useful
|
||||
when loading statically-generated code into an address-space in a
|
||||
non-standard fashion (i.e., through some means other than
|
||||
\Func{dlopen}()). In this format, the details of a group of procedures
|
||||
is described by a structure of type \Type{unw\_dyn\_table\_info}.
|
||||
This structure contains the following members:
|
||||
\begin{description}
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{name\_ptr}] The address of a
|
||||
(human-readable) name of the procedure or 0 if no such name is
|
||||
available. If non-zero, The string stored at this address must be
|
||||
ASCII NUL terminated. For source languages that use name-mangling
|
||||
(such as C++ or Java) the string stored at this address should be
|
||||
the \emph{demangled} version of the name.
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{segbase}] The segment-base value
|
||||
that needs to be added to the segment-relative values stored in the
|
||||
unwind-info. The exact meaning of this value is
|
||||
architecture-specific.
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{table\_len}] The length of the
|
||||
unwind-info (\Var{table\_data}) counted in units of words
|
||||
(\Type{unw\_word\_t}).
|
||||
|
||||
\item[\Type{unw\_word\_t} \Var{table\_data}] A pointer to the actual
|
||||
data encoding the unwind-info. The exact format is
|
||||
architecture-specific (see architecture-specific sections below).
|
||||
|
||||
\end{description}
|
||||
|
||||
\subsection{Remote table-info format}
|
||||
|
||||
The remote table-info format has the same basic purpose as the regular
|
||||
table-info format. The only difference is that when \Prog{libunwind}
|
||||
uses the unwind-info, it will keep the table data in the target
|
||||
address-space (which may be remote). Consequently, the type of the
|
||||
\Var{table\_data} member is \Type{unw\_word\_t} rather than a pointer.
|
||||
This implies that \Prog{libunwind} will have to access the table-data
|
||||
via the address-space's \Func{access\_mem}() call-back, rather than
|
||||
through a direct memory reference.
|
||||
|
||||
From the point of view of a runtime-code generator, the remote
|
||||
table-info format offers no advantage and it is expected that such
|
||||
generators will describe their procedures either with the proc-info
|
||||
format or the normal table-info format. The main reason that the
|
||||
remote table-info format exists is to enable the
|
||||
address-space-specific \Func{find\_proc\_info}() callback (see
|
||||
\SeeAlso{unw\_create\_addr\_space}(3)) to return unwind tables whose
|
||||
data remains in remote memory. This can speed up unwinding (e.g., for
|
||||
a debugger) because it reduces the amount of data that needs to be
|
||||
loaded from remote memory.
|
||||
|
||||
\section{Regions descriptors}
|
||||
|
||||
A region descriptor is a variable length structure that describes how
|
||||
each instruction in the region affects the frame state. Of course,
|
||||
most instructions in a region usualy do not change the frame state and
|
||||
for those, nothing needs to be recorded in the region descriptor. A
|
||||
region descriptor is a structure of type
|
||||
\Type{unw\_dyn\_region\_info\_t} and has the following members:
|
||||
\begin{description}
|
||||
\item[\Type{unw\_dyn\_region\_info\_t~*}\Var{next}] A pointer to the
|
||||
next region. If this is the last region, \Var{next} is \Const{NULL}.
|
||||
\item[\Type{int32\_t} \Var{insn\_count}] The length of the region in
|
||||
instructions. Each instruction is assumed to have a fixed size (see
|
||||
architecture-specific sections for details). The value of
|
||||
\Var{insn\_count} may be negative in the last region of a procedure
|
||||
(i.e., it may be negative only if \Var{next} is \Const{NULL}). A
|
||||
negative value indicates that the region covers the last \emph{N}
|
||||
instructions of the procedure, where \emph{N} is the absolute value
|
||||
of \Var{insn\_count}.
|
||||
\item[\Type{uint32\_t} \Var{op\_count}] The (allocated) length of
|
||||
the \Var{op\_count} array.
|
||||
\item[\Type{unw\_dyn\_op\_t} \Var{op}] An array of dynamic unwind
|
||||
directives. See Section ``Dynamic unwind directives'' for a
|
||||
description of the directives.
|
||||
\end{description}
|
||||
A region descriptor with an \Var{insn\_count} of zero is an
|
||||
\emph{empty region} and such regions are perfectly legal. In fact,
|
||||
empty regions can be useful to establish a particular frame state
|
||||
before the start of another region.
|
||||
|
||||
A single region list can be shared across multiple procedures provided
|
||||
those procedures share a common prologue and epilogue (their bodies
|
||||
may differ, of course). Normally, such procedures consist of a canned
|
||||
prologue, the body, and a canned epilogue. This could be described by
|
||||
two regions: one covering the prologue and one covering the epilogue.
|
||||
Since the body length is variable, the latter region would need to
|
||||
specify a negative value in \Var{insn\_count} such that
|
||||
\Prog{libunwind} knows that the region covers the end of the procedure
|
||||
(up to the address specified by \Var{end\_ip}).
|
||||
|
||||
The region descriptor is a variable length structure to make it
|
||||
possible to allocate all the necessary memory with a single
|
||||
memory-allocation request. To facilitate the allocation of a region
|
||||
descriptors \Prog{libunwind} provides a helper routine with the
|
||||
following synopsis:
|
||||
|
||||
\noindent
|
||||
\Type{size\_t} \Func{\_U\_dyn\_region\_size}(\Type{int} \Var{op\_count});
|
||||
|
||||
This routine returns the number of bytes needed to hold a region
|
||||
descriptor with space for \Var{op\_count} unwind directives. Note
|
||||
that the length of the \Var{op} array does not have to match exactly
|
||||
with the number of directives in a region. Instead, it is sufficient
|
||||
if the \Var{op} array contains at least as many entries as there are
|
||||
directives, since the end of the directives can always be indicated
|
||||
with the \Const{UNW\_DYN\_STOP} directive.
|
||||
|
||||
\section{Dynamic unwind directives}
|
||||
|
||||
A dynamic unwind directive describes how the frame state changes
|
||||
at a particular point within a region. The description is in
|
||||
the form of a structure of type \Type{unw\_dyn\_op\_t}. This
|
||||
structure has the following members:
|
||||
\begin{description}
|
||||
\item[\Type{int8\_t} \Var{tag}] The operation tag. Must be one
|
||||
of the \Type{unw\_dyn\_operation\_t} values described below.
|
||||
\item[\Type{int8\_t} \Var{qp}] The qualifying predicate that controls
|
||||
whether or not this directive is active. This is useful for
|
||||
predicated architecturs such as IA-64 or ARM, where the contents of
|
||||
another (callee-saved) register determines whether or not an
|
||||
instruction is executed (takes effect). If the directive is always
|
||||
active, this member should be set to the manifest constant
|
||||
\Const{\_U\_QP\_TRUE} (this constant is defined for all
|
||||
architectures, predicated or not).
|
||||
\item[\Type{int16\_t} \Var{reg}] The number of the register affected
|
||||
by the instruction.
|
||||
\item[\Type{int32\_t} \Var{when}] The region-relative number of
|
||||
the instruction to which this directive applies. For example,
|
||||
a value of 0 means that the effect described by this directive
|
||||
has taken place once the first instruction in the region has
|
||||
executed.
|
||||
\item[\Type{unw\_word\_t} \Var{val}] The value to be applied by the
|
||||
operation tag. The exact meaning of this value varies by tag. See
|
||||
Section ``Operation tags'' below.
|
||||
\end{description}
|
||||
It is perfectly legitimate to specify multiple dynamic unwind
|
||||
directives with the same \Var{when} value, if a particular instruction
|
||||
has a complex effect on the frame state.
|
||||
|
||||
Empty regions by definition contain no actual instructions and as such
|
||||
the directives are not tied to a particular instruction. By
|
||||
convention, the \Var{when} member should be set to 0, however.
|
||||
|
||||
There is no need for the dynamic unwind directives to appear
|
||||
in order of increasing \Var{when} values. If the directives happen to
|
||||
be sorted in that order, it may result in slightly faster execution,
|
||||
but a runtime code-generator should not go to extra lengths just to
|
||||
ensure that the directives are sorted.
|
||||
|
||||
IMPLEMENTATION NOTE: should \Prog{libunwind} implementations for
|
||||
certain architectures prefer the list of unwind directives to be
|
||||
sorted, it is recommended that such implementations first check
|
||||
whether the list happens to be sorted already and, if not, sort the
|
||||
directives explicitly before the first use. With this approach, the
|
||||
overhead of explicit sorting is only paid when there is a real benefit
|
||||
and if the runtime code-generator happens to generated sorted lists
|
||||
naturally, the performance penalty is limited to a simple O(N) check.
|
||||
|
||||
\subsection{Operations tags}
|
||||
|
||||
The possible operation tags are defined by enumeration type
|
||||
\Type{unw\_dyn\_operation\_t} which defines the following
|
||||
values:
|
||||
\begin{description}
|
||||
|
||||
\item[\Const{UNW\_DYN\_STOP}] Marks the end of the dynamic unwind
|
||||
directive list. All remaining entries in the \Var{op} array of the
|
||||
region-descriptor are ignored. This tag is guaranteed to have a
|
||||
value of 0.
|
||||
|
||||
\item[\Const{UNW\_DYN\_SAVE\_REG}] Marks an instruction which saves
|
||||
register \Var{reg} to register \Var{val}.
|
||||
|
||||
\item[\Const{UNW\_DYN\_SPILL\_FP\_REL}] Marks an instruction which
|
||||
spills register \Var{reg} to a frame-pointer-relative location. The
|
||||
frame-pointer-relative offset is given by the value stored in member
|
||||
\Var{val}. See the architecture-specific sections for a description
|
||||
of the stack frame layout.
|
||||
|
||||
\item[\Const{UNW\_DYN\_SPILL\_SP\_REL}] Marks an instruction which
|
||||
spills register \Var{reg} to a stack-pointer-relative location. The
|
||||
stack-pointer-relative offset is given by the value stored in member
|
||||
\Var{val}. See the architecture-specific sections for a description
|
||||
of the stack frame layout.
|
||||
|
||||
\item[\Const{UNW\_DYN\_ADD}] Marks an instruction which adds
|
||||
the constant value \Var{val} to register \Var{reg}. To add subtract
|
||||
a constant value, store the two's-complement of the value in
|
||||
\Var{val}. The set of registers that can be specified for this tag
|
||||
is described in the architecture-specific sections below.
|
||||
|
||||
\item[\Const{UNW\_DYN\_POP\_FRAMES}]
|
||||
|
||||
\item[\Const{UNW\_DYN\_LABEL\_STATE}]
|
||||
|
||||
\item[\Const{UNW\_DYN\_COPY\_STATE}]
|
||||
|
||||
\item[\Const{UNW\_DYN\_ALIAS}]
|
||||
|
||||
\end{description}
|
||||
|
||||
unw\_dyn\_op\_t
|
||||
|
||||
\_U\_dyn\_op\_save\_reg();
|
||||
\_U\_dyn\_op\_spill\_fp\_rel();
|
||||
\_U\_dyn\_op\_spill\_sp\_rel();
|
||||
\_U\_dyn\_op\_add();
|
||||
\_U\_dyn\_op\_pop\_frames();
|
||||
\_U\_dyn\_op\_label\_state();
|
||||
\_U\_dyn\_op\_copy\_state();
|
||||
\_U\_dyn\_op\_alias();
|
||||
\_U\_dyn\_op\_stop();
|
||||
|
||||
\section{IA-64 specifics}
|
||||
|
||||
- meaning of segbase member in table-info/table-remote-info format
|
||||
- format of table\_data in table-info/table-remote-info format
|
||||
- instruction size: each bundle is counted as 3 instructions, regardless
|
||||
of template (MLX)
|
||||
- describe stack-frame layout, especially with regards to sp-relative
|
||||
and fp-relative addressing
|
||||
- UNW\_DYN\_ADD can only add to ``sp'' (always a negative value); use
|
||||
POP\_FRAMES otherwise
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{\_U\_dyn\_register(3)},
|
||||
\SeeAlso{\_U\_dyn\_cancel(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,314 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "LIBUNWIND\-IA64" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
libunwind\-ia64
|
||||
\-\- IA\-64\-specific support in libunwind
|
||||
.PP
|
||||
.SH INTRODUCTION
|
||||
|
||||
.PP
|
||||
The IA\-64 version of libunwind
|
||||
uses a platform\-string of
|
||||
ia64
|
||||
and, at least in theory, should be able to support all
|
||||
operating systems adhering to the processor\-specific ABI defined for
|
||||
the Itanium Processor Family. This includes both little\-endian Linux
|
||||
and big\-endian HP\-UX. Furthermore, to make it possible for a single
|
||||
library to unwind both 32\- and 64\-bit targets, the type
|
||||
unw_word_t
|
||||
is always defined to be 64 bits wide (independent
|
||||
of the natural word\-size of the host). Having said that, the current
|
||||
implementation has been tested only with IA\-64 Linux.
|
||||
.PP
|
||||
When targeting IA\-64, the libunwind
|
||||
header file defines the
|
||||
macro UNW_TARGET_IA64
|
||||
as 1 and the macro UNW_TARGET
|
||||
as ``ia64\&'' (without the quotation marks). The former makes it
|
||||
possible for platform\-dependent unwind code to use
|
||||
conditional\-compilation to select an appropriate implementation. The
|
||||
latter is useful for stringification purposes and to construct
|
||||
target\-platform\-specific symbols.
|
||||
.PP
|
||||
One special feature of IA\-64 is the use of NaT bits to support
|
||||
speculative execution. Often, NaT bits are thought of as the ``65\-th
|
||||
bit\&'' of a general register. However, to make everything fit into
|
||||
64\-bit wide unw_word_t
|
||||
values, libunwind
|
||||
treats the
|
||||
NaT\-bits like separate boolean registers, whose 64\-bit value is either
|
||||
TRUE (non\-zero) or FALSE (zero).
|
||||
.PP
|
||||
.SH MACHINE\-STATE
|
||||
|
||||
.PP
|
||||
The machine\-state (set of registers) that is accessible through
|
||||
libunwind
|
||||
depends on the type of stack frame that a cursor
|
||||
points to. For normal frames, all ``preserved\&'' (callee\-saved)
|
||||
registers are accessible. For signal\-trampoline frames, all registers
|
||||
(including ``scratch\&'' (caller\-saved) registers) are accessible. Most
|
||||
applications do not have to worry a\-priori about which registers are
|
||||
accessible when. In case of doubt, it is always safe to \fItry\fP
|
||||
to
|
||||
access a register (via unw_get_reg()
|
||||
or
|
||||
unw_get_fpreg())
|
||||
and if the register isn\&'t accessible, the
|
||||
call will fail with a return\-value of \-UNW_EBADREG\&.
|
||||
.PP
|
||||
As a special exception to the above general rule, scratch registers
|
||||
r15\-r18
|
||||
are always accessible, even in normal
|
||||
frames. This makes it possible to pass arguments, e.g., to exception
|
||||
handlers.
|
||||
.PP
|
||||
For a detailed description of the IA\-64 register usage convention,
|
||||
please see the ``Itanium Software Conventions and Runtime Architecture
|
||||
Guide\&'', available at:
|
||||
.ce 100
|
||||
\fBhttp://www.intel.com/design/itanium/downloads/245358.htm\fP
|
||||
.ce 0
|
||||
|
||||
.PP
|
||||
.SH REGISTER NAMES
|
||||
|
||||
.PP
|
||||
The IA\-64\-version of libunwind
|
||||
defines three kinds of register
|
||||
name macros: frame\-register macros, normal register macros, and
|
||||
convenience macros. Below, we describe each kind in turn:
|
||||
.PP
|
||||
.SS FRAME\-REGISTER MACROS
|
||||
.PP
|
||||
Frame\-registers are special (pseudo) registers because they always
|
||||
have a valid value, even though sometimes they do not get saved
|
||||
explicitly (e.g., if a memory stack frame is 16 bytes in size, the
|
||||
previous stack\-pointer value can be calculated simply as
|
||||
sp+16,
|
||||
so there is no need to save the stack\-pointer
|
||||
explicitly). Moreover, the set of frame register values uniquely
|
||||
identifies a stack frame. The IA\-64 architecture defines two stacks
|
||||
(a memory and a register stack). Including the instruction\-pointer
|
||||
(IP), this means there are three frame registers:
|
||||
.TP
|
||||
UNW_IA64_IP:
|
||||
Contains the instruction pointer (IP, or
|
||||
``program counter\&'') of the current stack frame. Given this value,
|
||||
the remaining machine\-state corresponds to the register\-values that
|
||||
were present in the CPU when it was just about to execute the
|
||||
instruction pointed to by UNW_IA64_IP\&.
|
||||
Bits 0 and 1 of
|
||||
this frame\-register encode the slot number of the instruction.
|
||||
\fBNote:\fP
|
||||
Due to the way the call instruction works on IA\-64,
|
||||
the slot number is usually zero, but can be non\-zero, e.g., in the
|
||||
stack\-frame of a signal\-handler trampoline.
|
||||
.TP
|
||||
UNW_IA64_SP:
|
||||
Contains the (memory) stack\-pointer
|
||||
value (SP).
|
||||
.TP
|
||||
UNW_IA64_BSP:
|
||||
Contains the register backing\-store
|
||||
pointer (BSP). \fBNote:\fP
|
||||
the value in this register is equal
|
||||
to the contents of register ar.bsp
|
||||
at the time the
|
||||
instruction at UNW_IA64_IP
|
||||
was about to begin execution.
|
||||
.PP
|
||||
.SS NORMAL REGISTER MACROS
|
||||
.PP
|
||||
The following normal register name macros are available:
|
||||
.TP
|
||||
UNW_IA64_GR:
|
||||
The base\-index for general (integer)
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular general register. For example, to access r4,
|
||||
the index UNW_IA64_GR+4
|
||||
should be used.
|
||||
Registers r0
|
||||
and r1
|
||||
(gp)
|
||||
are read\-only,
|
||||
and any attempt to write them will result in an error
|
||||
(\-UNW_EREADONLYREG).
|
||||
Even though r1
|
||||
is
|
||||
read\-only, libunwind
|
||||
will automatically adjust its value if
|
||||
the instruction\-pointer (UNW_IA64_IP)
|
||||
is modified. For
|
||||
example, if UNW_IA64_IP
|
||||
is set to a value inside a
|
||||
function func(),
|
||||
then reading
|
||||
UNW_IA64_GR+1
|
||||
will return the global\-pointer
|
||||
value for this function.
|
||||
.TP
|
||||
UNW_IA64_NAT:
|
||||
The base\-index for the NaT bits of the
|
||||
general (integer) registers. A non\-zero value in these registers
|
||||
corresponds to a set NaT\-bit. Add an index in the range from 0..127
|
||||
to get a particular NaT\-bit register. For example, to access the
|
||||
NaT bit of r4,
|
||||
the index UNW_IA64_NAT+4
|
||||
should be used.
|
||||
.TP
|
||||
UNW_IA64_FR:
|
||||
The base\-index for floating\-point
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular floating\-point register. For example, to access
|
||||
f2,
|
||||
the index UNW_IA64_FR+2
|
||||
should be
|
||||
used. Registers f0
|
||||
and f1
|
||||
are read\-only, and any
|
||||
attempt to write to indices UNW_IA64_FR+0
|
||||
or
|
||||
UNW_IA64_FR+1
|
||||
will result in an error
|
||||
(\-UNW_EREADONLYREG).
|
||||
.TP
|
||||
UNW_IA64_AR:
|
||||
The base\-index for application
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular application register. For example, to access
|
||||
ar40,
|
||||
the index UNW_IA64_AR+40
|
||||
should be
|
||||
used. The IA\-64 architecture defines several application registers
|
||||
as ``reserved for future use\&''\&. Attempting to access such registers
|
||||
results in an error (\-UNW_EBADREG).
|
||||
.TP
|
||||
UNW_IA64_BR:
|
||||
The base\-index for branch registers.
|
||||
Add an index in the range from 0..7 to get a particular branch
|
||||
register. For example, to access b6,
|
||||
the index
|
||||
UNW_IA64_BR+6
|
||||
should be used.
|
||||
.TP
|
||||
UNW_IA64_PR:
|
||||
Contains the set of predicate registers.
|
||||
This 64\-bit wide register contains registers p0
|
||||
through
|
||||
p63
|
||||
in the ``broad\-side\&'' format. Just like with the
|
||||
``move predicates\&'' instruction, the registers are mapped as if
|
||||
CFM.rrb.pr
|
||||
were set to 0. Thus, in general the value of
|
||||
predicate register pN
|
||||
with N>=16 can be found
|
||||
in bit 16 + ((N\-16)+CFM.rrb.pr) % 48\&.
|
||||
.TP
|
||||
UNW_IA64_CFM:
|
||||
Contains the current\-frame\-mask
|
||||
register.
|
||||
.PP
|
||||
.SS CONVENIENCE MACROS
|
||||
.PP
|
||||
Convenience macros are simply aliases for certain frequently used
|
||||
registers:
|
||||
.TP
|
||||
UNW_IA64_GP:
|
||||
Alias for UNW_IA64_GR+1,
|
||||
the global\-pointer register.
|
||||
.TP
|
||||
UNW_IA64_TP:
|
||||
Alias for UNW_IA64_GR+13,
|
||||
the thread\-pointer register.
|
||||
.TP
|
||||
UNW_IA64_AR_RSC:
|
||||
Alias for UNW_IA64_GR+16,
|
||||
the register\-stack configuration register.
|
||||
.TP
|
||||
UNW_IA64_AR_BSP:
|
||||
Alias for
|
||||
UNW_IA64_GR+17\&.
|
||||
This register index accesses the
|
||||
value of register ar.bsp
|
||||
as of the time it was last saved
|
||||
explicitly. This is rarely what you want. Normally, you\&'ll want to
|
||||
use UNW_IA64_BSP
|
||||
instead.
|
||||
.TP
|
||||
UNW_IA64_AR_BSPSTORE:
|
||||
Alias for UNW_IA64_GR+18,
|
||||
the register\-backing store write pointer.
|
||||
.TP
|
||||
UNW_IA64_AR_RNAT:
|
||||
Alias for UNW_IA64_GR+19,
|
||||
the register\-backing store NaT\-collection register.
|
||||
.TP
|
||||
UNW_IA64_AR_CCV:
|
||||
Alias for UNW_IA64_GR+32,
|
||||
the compare\-and\-swap value register.
|
||||
.TP
|
||||
UNW_IA64_AR_CSD:
|
||||
Alias for UNW_IA64_GR+25,
|
||||
the compare\-and\-swap\-data register (used by 16\-byte atomic operations).
|
||||
.TP
|
||||
UNW_IA64_AR_UNAT:
|
||||
Alias for UNW_IA64_GR+36,
|
||||
the user NaT\-collection register.
|
||||
.TP
|
||||
UNW_IA64_AR_FPSR:
|
||||
Alias for UNW_IA64_GR+40,
|
||||
the floating\-point status (and control) register.
|
||||
.TP
|
||||
UNW_IA64_AR_PFS:
|
||||
Alias for UNW_IA64_GR+64,
|
||||
the previous frame\-state register.
|
||||
.TP
|
||||
UNW_IA64_AR_LC:
|
||||
Alias for UNW_IA64_GR+65
|
||||
the loop\-count register.
|
||||
.TP
|
||||
UNW_IA64_AR_EC:
|
||||
Alias for UNW_IA64_GR+66,
|
||||
the epilogue\-count register.
|
||||
.PP
|
||||
.SH THE UNWIND\-CONTEXT TYPE
|
||||
|
||||
.PP
|
||||
On IA\-64, unw_context_t
|
||||
is simply an alias for
|
||||
ucontext_t
|
||||
(as defined by the Single UNIX Spec). This implies
|
||||
that it is possible to initialize a value of this type not just with
|
||||
unw_getcontext(),
|
||||
but also with getcontext(),
|
||||
for
|
||||
example. However, since this is an IA\-64\-specific extension to
|
||||
libunwind,
|
||||
portable code should not rely on this equivalence.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,216 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{libunwind-ia64}{David Mosberger-Tang}{Programming Library}{IA-64-specific support in libunwind}libunwind-ia64 -- IA-64-specific support in libunwind
|
||||
\end{Name}
|
||||
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
The IA-64 version of \Prog{libunwind} uses a platform-string of
|
||||
\texttt{ia64} and, at least in theory, should be able to support all
|
||||
operating systems adhering to the processor-specific ABI defined for
|
||||
the Itanium Processor Family. This includes both little-endian Linux
|
||||
and big-endian HP-UX. Furthermore, to make it possible for a single
|
||||
library to unwind both 32- and 64-bit targets, the type
|
||||
\Type{unw\_word\_t} is always defined to be 64 bits wide (independent
|
||||
of the natural word-size of the host). Having said that, the current
|
||||
implementation has been tested only with IA-64 Linux.
|
||||
|
||||
When targeting IA-64, the \Prog{libunwind} header file defines the
|
||||
macro \Const{UNW\_TARGET\_IA64} as 1 and the macro \Const{UNW\_TARGET}
|
||||
as ``ia64'' (without the quotation marks). The former makes it
|
||||
possible for platform-dependent unwind code to use
|
||||
conditional-compilation to select an appropriate implementation. The
|
||||
latter is useful for stringification purposes and to construct
|
||||
target-platform-specific symbols.
|
||||
|
||||
One special feature of IA-64 is the use of NaT bits to support
|
||||
speculative execution. Often, NaT bits are thought of as the ``65-th
|
||||
bit'' of a general register. However, to make everything fit into
|
||||
64-bit wide \Type{unw\_word\_t} values, \Prog{libunwind} treats the
|
||||
NaT-bits like separate boolean registers, whose 64-bit value is either
|
||||
TRUE (non-zero) or FALSE (zero).
|
||||
|
||||
|
||||
\section{Machine-State}
|
||||
|
||||
The machine-state (set of registers) that is accessible through
|
||||
\Prog{libunwind} depends on the type of stack frame that a cursor
|
||||
points to. For normal frames, all ``preserved'' (callee-saved)
|
||||
registers are accessible. For signal-trampoline frames, all registers
|
||||
(including ``scratch'' (caller-saved) registers) are accessible. Most
|
||||
applications do not have to worry a-priori about which registers are
|
||||
accessible when. In case of doubt, it is always safe to \emph{try} to
|
||||
access a register (via \Func{unw\_get\_reg}() or
|
||||
\Func{unw\_get\_fpreg}()) and if the register isn't accessible, the
|
||||
call will fail with a return-value of \texttt{-}\Const{UNW\_EBADREG}.
|
||||
|
||||
As a special exception to the above general rule, scratch registers
|
||||
\texttt{r15}-\texttt{r18} are always accessible, even in normal
|
||||
frames. This makes it possible to pass arguments, e.g., to exception
|
||||
handlers.
|
||||
|
||||
For a detailed description of the IA-64 register usage convention,
|
||||
please see the ``Itanium Software Conventions and Runtime Architecture
|
||||
Guide'', available at:
|
||||
\begin{center}
|
||||
\URL{http://www.intel.com/design/itanium/downloads/245358.htm}
|
||||
\end{center}
|
||||
|
||||
|
||||
\section{Register Names}
|
||||
|
||||
The IA-64-version of \Prog{libunwind} defines three kinds of register
|
||||
name macros: frame-register macros, normal register macros, and
|
||||
convenience macros. Below, we describe each kind in turn:
|
||||
|
||||
|
||||
\subsection{Frame-register Macros}
|
||||
|
||||
Frame-registers are special (pseudo) registers because they always
|
||||
have a valid value, even though sometimes they do not get saved
|
||||
explicitly (e.g., if a memory stack frame is 16 bytes in size, the
|
||||
previous stack-pointer value can be calculated simply as
|
||||
\texttt{sp+16}, so there is no need to save the stack-pointer
|
||||
explicitly). Moreover, the set of frame register values uniquely
|
||||
identifies a stack frame. The IA-64 architecture defines two stacks
|
||||
(a memory and a register stack). Including the instruction-pointer
|
||||
(IP), this means there are three frame registers:
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_IA64\_IP}:] Contains the instruction pointer (IP, or
|
||||
``program counter'') of the current stack frame. Given this value,
|
||||
the remaining machine-state corresponds to the register-values that
|
||||
were present in the CPU when it was just about to execute the
|
||||
instruction pointed to by \Const{UNW\_IA64\_IP}. Bits 0 and 1 of
|
||||
this frame-register encode the slot number of the instruction.
|
||||
\textbf{Note:} Due to the way the call instruction works on IA-64,
|
||||
the slot number is usually zero, but can be non-zero, e.g., in the
|
||||
stack-frame of a signal-handler trampoline.
|
||||
\item[\Const{UNW\_IA64\_SP}:] Contains the (memory) stack-pointer
|
||||
value (SP).
|
||||
\item[\Const{UNW\_IA64\_BSP}:] Contains the register backing-store
|
||||
pointer (BSP). \textbf{Note:} the value in this register is equal
|
||||
to the contents of register \texttt{ar.bsp} at the time the
|
||||
instruction at \Const{UNW\_IA64\_IP} was about to begin execution.
|
||||
\end{Description}
|
||||
|
||||
|
||||
\subsection{Normal Register Macros}
|
||||
|
||||
The following normal register name macros are available:
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_IA64\_GR}:] The base-index for general (integer)
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular general register. For example, to access \texttt{r4},
|
||||
the index \Const{UNW\_IA64\_GR}\texttt{+4} should be used.
|
||||
Registers \texttt{r0} and \texttt{r1} (\texttt{gp}) are read-only,
|
||||
and any attempt to write them will result in an error
|
||||
(\texttt{-}\Const{UNW\_EREADONLYREG}). Even though \texttt{r1} is
|
||||
read-only, \Prog{libunwind} will automatically adjust its value if
|
||||
the instruction-pointer (\Const{UNW\_IA64\_IP}) is modified. For
|
||||
example, if \Const{UNW\_IA64\_IP} is set to a value inside a
|
||||
function \Func{func}(), then reading
|
||||
\Const{UNW\_IA64\_GR}\texttt{+1} will return the global-pointer
|
||||
value for this function.
|
||||
\item[\Const{UNW\_IA64\_NAT}:] The base-index for the NaT bits of the
|
||||
general (integer) registers. A non-zero value in these registers
|
||||
corresponds to a set NaT-bit. Add an index in the range from 0..127
|
||||
to get a particular NaT-bit register. For example, to access the
|
||||
NaT bit of \texttt{r4}, the index \Const{UNW\_IA64\_NAT}\texttt{+4}
|
||||
should be used.
|
||||
\item[\Const{UNW\_IA64\_FR}:] The base-index for floating-point
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular floating-point register. For example, to access
|
||||
\texttt{f2}, the index \Const{UNW\_IA64\_FR}\texttt{+2} should be
|
||||
used. Registers \texttt{f0} and \texttt{f1} are read-only, and any
|
||||
attempt to write to indices \Const{UNW\_IA64\_FR}\texttt{+0} or
|
||||
\Const{UNW\_IA64\_FR}\texttt{+1} will result in an error
|
||||
(\texttt{-}\Const{UNW\_EREADONLYREG}).
|
||||
\item[\Const{UNW\_IA64\_AR}:] The base-index for application
|
||||
registers. Add an index in the range from 0..127 to get a
|
||||
particular application register. For example, to access
|
||||
\texttt{ar40}, the index \Const{UNW\_IA64\_AR}\texttt{+40} should be
|
||||
used. The IA-64 architecture defines several application registers
|
||||
as ``reserved for future use''. Attempting to access such registers
|
||||
results in an error (\texttt{-}\Const{UNW\_EBADREG}).
|
||||
\item[\Const{UNW\_IA64\_BR}:] The base-index for branch registers.
|
||||
Add an index in the range from 0..7 to get a particular branch
|
||||
register. For example, to access \texttt{b6}, the index
|
||||
\Const{UNW\_IA64\_BR}\texttt{+6} should be used.
|
||||
\item[\Const{UNW\_IA64\_PR}:] Contains the set of predicate registers.
|
||||
This 64-bit wide register contains registers \texttt{p0} through
|
||||
\texttt{p63} in the ``broad-side'' format. Just like with the
|
||||
``move predicates'' instruction, the registers are mapped as if
|
||||
\texttt{CFM.rrb.pr} were set to 0. Thus, in general the value of
|
||||
predicate register \texttt{p}$N$ with $N$>=16 can be found
|
||||
in bit \texttt{16 + (($N$-16)+CFM.rrb.pr) \% 48}.
|
||||
\item[\Const{UNW\_IA64\_CFM}:] Contains the current-frame-mask
|
||||
register.
|
||||
\end{Description}
|
||||
|
||||
|
||||
\subsection{Convenience Macros}
|
||||
|
||||
Convenience macros are simply aliases for certain frequently used
|
||||
registers:
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_IA64\_GP}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+1},
|
||||
the global-pointer register.
|
||||
\item[\Const{UNW\_IA64\_TP}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+13},
|
||||
the thread-pointer register.
|
||||
\item[\Const{UNW\_IA64\_AR\_RSC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+16},
|
||||
the register-stack configuration register.
|
||||
\item[\Const{UNW\_IA64\_AR\_BSP}:] Alias for
|
||||
\Const{UNW\_IA64\_GR}\texttt{+17}. This register index accesses the
|
||||
value of register \texttt{ar.bsp} as of the time it was last saved
|
||||
explicitly. This is rarely what you want. Normally, you'll want to
|
||||
use \Const{UNW\_IA64\_BSP} instead.
|
||||
\item[\Const{UNW\_IA64\_AR\_BSPSTORE}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+18},
|
||||
the register-backing store write pointer.
|
||||
\item[\Const{UNW\_IA64\_AR\_RNAT}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+19},
|
||||
the register-backing store NaT-collection register.
|
||||
\item[\Const{UNW\_IA64\_AR\_CCV}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+32},
|
||||
the compare-and-swap value register.
|
||||
\item[\Const{UNW\_IA64\_AR\_CSD}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+25},
|
||||
the compare-and-swap-data register (used by 16-byte atomic operations).
|
||||
\item[\Const{UNW\_IA64\_AR\_UNAT}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+36},
|
||||
the user NaT-collection register.
|
||||
\item[\Const{UNW\_IA64\_AR\_FPSR}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+40},
|
||||
the floating-point status (and control) register.
|
||||
\item[\Const{UNW\_IA64\_AR\_PFS}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+64},
|
||||
the previous frame-state register.
|
||||
\item[\Const{UNW\_IA64\_AR\_LC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+65}
|
||||
the loop-count register.
|
||||
\item[\Const{UNW\_IA64\_AR\_EC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+66},
|
||||
the epilogue-count register.
|
||||
\end{Description}
|
||||
|
||||
|
||||
\section{The Unwind-Context Type}
|
||||
|
||||
On IA-64, \Type{unw\_context\_t} is simply an alias for
|
||||
\Type{ucontext\_t} (as defined by the Single UNIX Spec). This implies
|
||||
that it is possible to initialize a value of this type not just with
|
||||
\Func{unw\_getcontext}(), but also with \Func{getcontext}(), for
|
||||
example. However, since this is an IA-64-specific extension to
|
||||
\Prog{libunwind}, portable code should not rely on this equivalence.
|
||||
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,220 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "LIBUNWIND\-PTRACE" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
libunwind\-ptrace
|
||||
\-\- ptrace() support in libunwind
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind\-ptrace.h>
|
||||
.br
|
||||
.PP
|
||||
unw_accessors_t
|
||||
_UPT_accessors;
|
||||
.br
|
||||
.PP
|
||||
void *_UPT_create(pid_t);
|
||||
.br
|
||||
void
|
||||
_UPT_destroy(void *);
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
_UPT_find_proc_info(unw_addr_space_t,
|
||||
unw_word_t,
|
||||
unw_proc_info_t *,
|
||||
int,
|
||||
void *);
|
||||
.br
|
||||
void
|
||||
_UPT_put_unwind_info(unw_addr_space_t,
|
||||
unw_proc_info_t *,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_get_dyn_info_list_addr(unw_addr_space_t,
|
||||
unw_word_t *,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_access_mem(unw_addr_space_t,
|
||||
unw_word_t,
|
||||
unw_word_t *,
|
||||
int,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_access_reg(unw_addr_space_t,
|
||||
unw_regnum_t,
|
||||
unw_word_t *,
|
||||
int,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_access_fpreg(unw_addr_space_t,
|
||||
unw_regnum_t,
|
||||
unw_fpreg_t *,
|
||||
int,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_get_proc_name(unw_addr_space_t,
|
||||
unw_word_t,
|
||||
char *,
|
||||
size_t,
|
||||
unw_word_t *,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
_UPT_resume(unw_addr_space_t,
|
||||
unw_cursor_t *,
|
||||
void *);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The ptrace(2)
|
||||
system\-call makes it possible for a process to
|
||||
gain access to the machine\-state and virtual memory of \fIanother\fP
|
||||
process. With the right set of call\-back routines, it is therefore
|
||||
possible to hook up libunwind
|
||||
to another process via
|
||||
ptrace(2).
|
||||
While it\&'s not very difficult to do so directly,
|
||||
libunwind
|
||||
further facilitates this task by providing
|
||||
ready\-to\-use callbacks for this purpose. The routines and variables
|
||||
implementing this facility use a name\-prefix of _UPT,
|
||||
which is
|
||||
stands for ``unwind\-via\-ptrace\&''\&.
|
||||
.PP
|
||||
An application that wants to use the _UPT\-facility
|
||||
first needs
|
||||
to create a new libunwind
|
||||
address\-space that represents the
|
||||
target process. This is done by calling
|
||||
unw_create_addr_space().
|
||||
In many cases, the application
|
||||
will simply want to pass the address of _UPT_accessors
|
||||
as the
|
||||
first argument to this routine. Doing so will ensure that
|
||||
libunwind
|
||||
will be able to properly unwind the target process.
|
||||
However, in special circumstances, an application may prefer to use
|
||||
only portions of the _UPT\-facility.
|
||||
For this reason, the
|
||||
individual callback routines (_UPT_find_proc_info(),
|
||||
_UPT_put_unwind_info(),
|
||||
etc.) are also available for direct
|
||||
use. Of course, the addresses of these routines could also be picked
|
||||
up from _UPT_accessors,
|
||||
but doing so would prevent static
|
||||
initialization. Also, when using _UPT_accessors,
|
||||
\fIall\fP
|
||||
the callback routines will be linked into the application, even if
|
||||
they are never actually called.
|
||||
.PP
|
||||
Next, the application can turn on ptrace\-mode on the target process,
|
||||
either by forking a new process, invoking PTRACE_TRACEME,
|
||||
and
|
||||
then starting the target program (via execve(2)),
|
||||
or by
|
||||
directly attaching to an already running process (via
|
||||
PTRACE_ATTACH).
|
||||
Either way, once the process\-ID (pid) of the
|
||||
target process is known, a _UPT\-info\-structure
|
||||
can be created
|
||||
by calling _UPT_create(),
|
||||
passing the pid of the target process
|
||||
as the only argument. The returned void\-pointer then needs to be
|
||||
passed as the ``argument\&'' pointer (third argument) to
|
||||
unw_init_remote().
|
||||
.PP
|
||||
The _UPT_resume()
|
||||
routine can be used to resume execution of
|
||||
the target process. It simply invokes ptrace(2)
|
||||
with a command
|
||||
value of PTRACE_CONT\&.
|
||||
.PP
|
||||
When the application is done using libunwind
|
||||
on the target
|
||||
process, _UPT_destroy()
|
||||
needs to be called, passing it the
|
||||
void\-pointer that was returned by the corresponding call to
|
||||
_UPT_create().
|
||||
This ensures that all memory and other
|
||||
resources are freed up.
|
||||
.PP
|
||||
.SH AVAILABILITY
|
||||
|
||||
.PP
|
||||
Since ptrace(2)
|
||||
works within a single machine only, the
|
||||
_UPT\-facility
|
||||
by definition is not available in
|
||||
libunwind\-versions
|
||||
configured for cross\-unwinding.
|
||||
.PP
|
||||
.SH THREAD SAFETY
|
||||
|
||||
.PP
|
||||
The _UPT\-facility
|
||||
assumes that a single _UPT\-info
|
||||
structure is never shared between threads. Because of this, no
|
||||
explicit locking is used. As long as only one thread uses
|
||||
a _UPT\-info
|
||||
structure at any given time, this facility
|
||||
is thread\-safe.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
_UPT_create()
|
||||
may return a NULL
|
||||
pointer if it fails
|
||||
to create the _UPT\-info\-structure
|
||||
for any reason. For the
|
||||
current implementation, the only reason this call may fail is when the
|
||||
system is out of memory.
|
||||
.PP
|
||||
.SH FILES
|
||||
|
||||
.PP
|
||||
.TP
|
||||
libunwind\-ptrace.h
|
||||
Headerfile to include when using the
|
||||
interface defined by this library.
|
||||
.TP
|
||||
\fB\-l\fPunwind\-ptrace \fB\-l\fPunwind\-generic
|
||||
Linker\-switches to add when building a program that uses the
|
||||
functions defined by this library.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
execve(2),
|
||||
libunwind(3),
|
||||
ptrace(2)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,134 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{libunwind-ptrace}{David Mosberger-Tang}{Programming Library}{ptrace() support in libunwind}libunwind-ptrace -- ptrace() support in libunwind
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind-ptrace.h$>$}\\
|
||||
|
||||
\noindent
|
||||
\Type{unw\_accessors\_t} \Var{\_UPT\_accessors};\\
|
||||
|
||||
\Type{void~*}\Func{\_UPT\_create}(\Type{pid\_t});\\
|
||||
\noindent
|
||||
\Type{void} \Func{\_UPT\_destroy}(\Type{void~*});\\
|
||||
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_find\_proc\_info}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_proc\_info\_t~*}, \Type{int}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{void} \Func{\_UPT\_put\_unwind\_info}(\Type{unw\_addr\_space\_t}, \Type{unw\_proc\_info\_t~*}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_get\_dyn\_info\_list\_addr}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t~*}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_access\_mem}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_word\_t~*}, \Type{int}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_access\_reg}(\Type{unw\_addr\_space\_t}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t~*}, \Type{int}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_access\_fpreg}(\Type{unw\_addr\_space\_t}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t~*}, \Type{int}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_get\_proc\_name}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{char~*}, \Type{size\_t}, \Type{unw\_word\_t~*}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{\_UPT\_resume}(\Type{unw\_addr\_space\_t}, \Type{unw\_cursor\_t~*}, \Type{void~*});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{ptrace}(2) system-call makes it possible for a process to
|
||||
gain access to the machine-state and virtual memory of \emph{another}
|
||||
process. With the right set of call-back routines, it is therefore
|
||||
possible to hook up \Prog{libunwind} to another process via
|
||||
\Func{ptrace}(2). While it's not very difficult to do so directly,
|
||||
\Prog{libunwind} further facilitates this task by providing
|
||||
ready-to-use callbacks for this purpose. The routines and variables
|
||||
implementing this facility use a name-prefix of \Func{\_UPT}, which is
|
||||
stands for ``unwind-via-ptrace''.
|
||||
|
||||
An application that wants to use the \Func{\_UPT}-facility first needs
|
||||
to create a new \Prog{libunwind} address-space that represents the
|
||||
target process. This is done by calling
|
||||
\Func{unw\_create\_addr\_space}(). In many cases, the application
|
||||
will simply want to pass the address of \Var{\_UPT\_accessors} as the
|
||||
first argument to this routine. Doing so will ensure that
|
||||
\Prog{libunwind} will be able to properly unwind the target process.
|
||||
However, in special circumstances, an application may prefer to use
|
||||
only portions of the \Prog{\_UPT}-facility. For this reason, the
|
||||
individual callback routines (\Func{\_UPT\_find\_proc\_info}(),
|
||||
\Func{\_UPT\_put\_unwind\_info}(), etc.) are also available for direct
|
||||
use. Of course, the addresses of these routines could also be picked
|
||||
up from \Var{\_UPT\_accessors}, but doing so would prevent static
|
||||
initialization. Also, when using \Var{\_UPT\_accessors}, \emph{all}
|
||||
the callback routines will be linked into the application, even if
|
||||
they are never actually called.
|
||||
|
||||
Next, the application can turn on ptrace-mode on the target process,
|
||||
either by forking a new process, invoking \Const{PTRACE\_TRACEME}, and
|
||||
then starting the target program (via \Func{execve}(2)), or by
|
||||
directly attaching to an already running process (via
|
||||
\Const{PTRACE\_ATTACH}). Either way, once the process-ID (pid) of the
|
||||
target process is known, a \Prog{\_UPT}-info-structure can be created
|
||||
by calling \Func{\_UPT\_create}(), passing the pid of the target process
|
||||
as the only argument. The returned void-pointer then needs to be
|
||||
passed as the ``argument'' pointer (third argument) to
|
||||
\Func{unw\_init\_remote}().
|
||||
|
||||
The \Func{\_UPT\_resume}() routine can be used to resume execution of
|
||||
the target process. It simply invokes \Func{ptrace}(2) with a command
|
||||
value of \Const{PTRACE\_CONT}.
|
||||
|
||||
When the application is done using \Prog{libunwind} on the target
|
||||
process, \Func{\_UPT\_destroy}() needs to be called, passing it the
|
||||
void-pointer that was returned by the corresponding call to
|
||||
\Func{\_UPT\_create}(). This ensures that all memory and other
|
||||
resources are freed up.
|
||||
|
||||
\section{Availability}
|
||||
|
||||
Since \Func{ptrace}(2) works within a single machine only, the
|
||||
\Prog{\_UPT}-facility by definition is not available in
|
||||
\Prog{libunwind}-versions configured for cross-unwinding.
|
||||
|
||||
\section{Thread Safety}
|
||||
|
||||
The \Prog{\_UPT}-facility assumes that a single \Prog{\_UPT}-info
|
||||
structure is never shared between threads. Because of this, no
|
||||
explicit locking is used. As long as only one thread uses
|
||||
a \Prog{\_UPT}-info structure at any given time, this facility
|
||||
is thread-safe.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
\Func{\_UPT\_create}() may return a \Const{NULL} pointer if it fails
|
||||
to create the \Prog{\_UPT}-info-structure for any reason. For the
|
||||
current implementation, the only reason this call may fail is when the
|
||||
system is out of memory.
|
||||
|
||||
\section{Files}
|
||||
|
||||
\begin{Description}
|
||||
\item[\File{libunwind-ptrace.h}] Headerfile to include when using the
|
||||
interface defined by this library.
|
||||
\item[\Opt{-l}\File{unwind-ptrace} \Opt{-l}\File{unwind-generic}]
|
||||
Linker-switches to add when building a program that uses the
|
||||
functions defined by this library.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
execve(2),
|
||||
\SeeAlso{libunwind(3)},
|
||||
ptrace(2)
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,132 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "LIBUNWIND\-SETJMP" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
libunwind\-setjmp
|
||||
\-\- libunwind\-based non\-local gotos
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <setjmp.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
setjmp(jmp_buf env);
|
||||
.br
|
||||
void
|
||||
longjmp(jmp_buf env,
|
||||
int val);
|
||||
.br
|
||||
int
|
||||
_setjmp(jmp_buf env);
|
||||
.br
|
||||
void
|
||||
_longjmp(jmp_buf env,
|
||||
int val);
|
||||
.br
|
||||
int
|
||||
sigsetjmp(sigjmp_buf env,
|
||||
int savemask);
|
||||
.br
|
||||
void
|
||||
siglongjmp(sigjmp_buf env,
|
||||
int val);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unwind\-setjmp
|
||||
library offers a libunwind\-based
|
||||
implementation of non\-local gotos. This implementation is intended to
|
||||
be a drop\-in replacement for the normal, system\-provided routines of
|
||||
the same name. The main advantage of using the unwind\-setjmp
|
||||
library is that setting up a non\-local goto via one of the
|
||||
setjmp()
|
||||
routines is very fast. Typically, just 2 or 3 words
|
||||
need to be saved in the jump\-buffer (plus one call to
|
||||
sigprocmask(2),
|
||||
in the case of sigsetjmp).
|
||||
On the
|
||||
other hand, executing a non\-local goto by calling one of the
|
||||
longjmp()
|
||||
routines tends to be much slower than with the
|
||||
system\-provided routines. In fact, the time spent on a
|
||||
longjmp()
|
||||
will be proportional to the number of call frames
|
||||
that exist between the points where setjmp()
|
||||
and
|
||||
longjmp()
|
||||
were called. For this reason, the
|
||||
unwind\-setjmp
|
||||
library is beneficial primarily in applications
|
||||
that frequently call setjmp()
|
||||
but only rarely call
|
||||
longjmp().
|
||||
.PP
|
||||
.SH CAVEATS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
.B *
|
||||
The correct operation of this library depends on the presence of
|
||||
correct unwind information. On newer platforms, this is rarely an
|
||||
issue. On older platforms, care needs to be taken to
|
||||
ensure that each of the functions whose stack frames may have to be
|
||||
unwound during a longjmp()
|
||||
have correct unwind information
|
||||
(on those platforms, there is usually a compiler\-switch, such as
|
||||
\fB\-funwind\-tables\fP,
|
||||
to request the generation of unwind
|
||||
information).
|
||||
.TP
|
||||
.B *
|
||||
The contents of jmp_buf and sigjmp_buf as setup
|
||||
and used by these routines is completely different from the ones
|
||||
used by the system\-provided routines. Thus, a jump\-buffer created
|
||||
by the libunwind\-based setjmp()/_setjmp
|
||||
may only be
|
||||
used in a call to the libunwind\-based
|
||||
longjmp()/_longjmp().
|
||||
The analogous applies for
|
||||
sigjmp_buf
|
||||
with sigsetjmp()
|
||||
and siglongjmp().
|
||||
.PP
|
||||
.SH FILES
|
||||
|
||||
.PP
|
||||
.TP
|
||||
\fB\-l\fPunwind\-setjmp
|
||||
The library an application should
|
||||
be linked against to ensure it uses the libunwind\-based non\-local
|
||||
goto routines.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
setjmp(3), longjmp(3),
|
||||
_setjmp(3), _longjmp(3),
|
||||
sigsetjmp(3), siglongjmp(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,87 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{libunwind-setjmp}{David Mosberger-Tang}{Programming Library}{libunwind-based non-local gotos}libunwind-setjmp -- libunwind-based non-local gotos
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$setjmp.h$>$}\\
|
||||
|
||||
\noindent
|
||||
\Type{int} \Func{setjmp}(\Type{jmp\_buf}~\Var{env});\\
|
||||
\Type{void} \Func{longjmp}(\Type{jmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
|
||||
\Type{int} \Func{\_setjmp}(\Type{jmp\_buf}~\Var{env});\\
|
||||
\Type{void} \Func{\_longjmp}(\Type{jmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
|
||||
\Type{int} \Func{sigsetjmp}(\Type{sigjmp\_buf}~\Var{env}, \Type{int}~\Var{savemask});\\
|
||||
\Type{void} \Func{siglongjmp}(\Type{sigjmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Prog{unwind-setjmp} library offers a \Prog{libunwind}-based
|
||||
implementation of non-local gotos. This implementation is intended to
|
||||
be a drop-in replacement for the normal, system-provided routines of
|
||||
the same name. The main advantage of using the \Prog{unwind-setjmp}
|
||||
library is that setting up a non-local goto via one of the
|
||||
\Func{setjmp}() routines is very fast. Typically, just 2 or 3 words
|
||||
need to be saved in the jump-buffer (plus one call to
|
||||
\Func{sigprocmask}(2), in the case of \Func{sigsetjmp}). On the
|
||||
other hand, executing a non-local goto by calling one of the
|
||||
\Func{longjmp}() routines tends to be much slower than with the
|
||||
system-provided routines. In fact, the time spent on a
|
||||
\Func{longjmp}() will be proportional to the number of call frames
|
||||
that exist between the points where \Func{setjmp}() and
|
||||
\Func{longjmp}() were called. For this reason, the
|
||||
\Prog{unwind-setjmp} library is beneficial primarily in applications
|
||||
that frequently call \Func{setjmp}() but only rarely call
|
||||
\Func{longjmp}().
|
||||
|
||||
\section{Caveats}
|
||||
|
||||
\begin{itemize}
|
||||
\item The correct operation of this library depends on the presence of
|
||||
correct unwind information. On newer platforms, this is rarely an
|
||||
issue. On older platforms, care needs to be taken to
|
||||
ensure that each of the functions whose stack frames may have to be
|
||||
unwound during a \Func{longjmp}() have correct unwind information
|
||||
(on those platforms, there is usually a compiler-switch, such as
|
||||
\Opt{-funwind-tables}, to request the generation of unwind
|
||||
information).
|
||||
\item The contents of \Type{jmp\_buf} and \Type{sigjmp\_buf} as setup
|
||||
and used by these routines is completely different from the ones
|
||||
used by the system-provided routines. Thus, a jump-buffer created
|
||||
by the libunwind-based \Func{setjmp}()/\Func{\_setjmp} may only be
|
||||
used in a call to the libunwind-based
|
||||
\Func{longjmp}()/\Func{\_longjmp}(). The analogous applies for
|
||||
\Type{sigjmp\_buf} with \Func{sigsetjmp}() and \Func{siglongjmp}().
|
||||
\end{itemize}
|
||||
|
||||
\section{Files}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Opt{-l}\File{unwind-setjmp}] The library an application should
|
||||
be linked against to ensure it uses the libunwind-based non-local
|
||||
goto routines.
|
||||
\end{Description}
|
||||
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
setjmp(3), longjmp(3),
|
||||
\_setjmp(3), \_longjmp(3),
|
||||
sigsetjmp(3), siglongjmp(3)
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,500 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:43 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "LIBUNWIND" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
libunwind
|
||||
\-\- a (mostly) platform\-independent unwind API
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_getcontext(unw_context_t *);
|
||||
.br
|
||||
int
|
||||
unw_init_local(unw_cursor_t *,
|
||||
unw_context_t *);
|
||||
.br
|
||||
int
|
||||
unw_init_remote(unw_cursor_t *,
|
||||
unw_addr_space_t,
|
||||
void *);
|
||||
.br
|
||||
int
|
||||
unw_step(unw_cursor_t *);
|
||||
.br
|
||||
int
|
||||
unw_get_reg(unw_cursor_t *,
|
||||
unw_regnum_t,
|
||||
unw_word_t *);
|
||||
.br
|
||||
int
|
||||
unw_get_fpreg(unw_cursor_t *,
|
||||
unw_regnum_t,
|
||||
unw_fpreg_t *);
|
||||
.br
|
||||
int
|
||||
unw_set_reg(unw_cursor_t *,
|
||||
unw_regnum_t,
|
||||
unw_word_t);
|
||||
.br
|
||||
int
|
||||
unw_set_fpreg(unw_cursor_t *,
|
||||
unw_regnum_t,
|
||||
unw_fpreg_t);
|
||||
.br
|
||||
int
|
||||
unw_resume(unw_cursor_t *);
|
||||
.br
|
||||
.PP
|
||||
unw_addr_space_t
|
||||
unw_local_addr_space;
|
||||
.br
|
||||
unw_addr_space_t
|
||||
unw_create_addr_space(unw_accessors_t,
|
||||
int);
|
||||
.br
|
||||
void
|
||||
unw_destroy_addr_space(unw_addr_space_t);
|
||||
.br
|
||||
unw_accessors_t
|
||||
unw_get_accessors(unw_addr_space_t);
|
||||
.br
|
||||
void
|
||||
unw_flush_cache(unw_addr_space_t,
|
||||
unw_word_t,
|
||||
unw_word_t);
|
||||
.br
|
||||
int
|
||||
unw_set_caching_policy(unw_addr_space_t,
|
||||
unw_caching_policy_t);
|
||||
.br
|
||||
.PP
|
||||
const char *unw_regname(unw_regnum_t);
|
||||
.br
|
||||
int
|
||||
unw_get_proc_info(unw_cursor_t *,
|
||||
unw_proc_info_t *);
|
||||
.br
|
||||
int
|
||||
unw_get_save_loc(unw_cursor_t *,
|
||||
int,
|
||||
unw_save_loc_t *);
|
||||
.br
|
||||
int
|
||||
unw_is_fpreg(unw_regnum_t);
|
||||
.br
|
||||
int
|
||||
unw_is_signal_frame(unw_cursor_t *);
|
||||
.br
|
||||
int
|
||||
unw_get_proc_name(unw_cursor_t *,
|
||||
char *,
|
||||
size_t,
|
||||
unw_word_t *);
|
||||
.br
|
||||
.PP
|
||||
void
|
||||
_U_dyn_register(unw_dyn_info_t *);
|
||||
.br
|
||||
void
|
||||
_U_dyn_cancel(unw_dyn_info_t *);
|
||||
.br
|
||||
.PP
|
||||
.SH LOCAL UNWINDING
|
||||
|
||||
.PP
|
||||
Libunwind
|
||||
is very easy to use when unwinding a stack from
|
||||
within a running program. This is called \fIlocal\fP
|
||||
unwinding. Say
|
||||
you want to unwind the stack while executing in some function
|
||||
F().
|
||||
In this function, you would call unw_getcontext()
|
||||
to get a snapshot of the CPU registers (machine\-state). Then you
|
||||
initialize an \fIunwind cursor\fP
|
||||
based on this snapshot. This is
|
||||
done with a call to unw_init_local().
|
||||
The cursor now points
|
||||
to the current frame, that is, the stack frame that corresponds to the
|
||||
current activation of function F().
|
||||
The unwind cursor can then
|
||||
be moved ``up\&'' (towards earlier stack frames) by calling
|
||||
unw_step().
|
||||
By repeatedly calling this routine, you can
|
||||
uncover the entire call\-chain that led to the activation of function
|
||||
F().
|
||||
A positive return value from unw_step()
|
||||
indicates
|
||||
that there are more frames in the chain, zero indicates that the end
|
||||
of the chain has been reached, and any negative value indicates that
|
||||
some sort of error has occurred.
|
||||
.PP
|
||||
While it is not possible to directly move the unwind cursor in the
|
||||
``down\&'' direction (towards newer stack frames), this effect can be
|
||||
achieved by making copies of an unwind cursor. For example, a program
|
||||
that sometimes has to move ``down\&'' by one stack frame could maintain
|
||||
two cursor variables: ``curr\&''
|
||||
and ``prev\&''\&.
|
||||
The former
|
||||
would be used as the current cursor and prev
|
||||
would be maintained
|
||||
as the ``previous frame\&'' cursor by copying the contents of curr
|
||||
to prev
|
||||
right before calling unw_step().
|
||||
With this
|
||||
approach, the program could move one step ``down\&'' simply by copying
|
||||
back prev
|
||||
to curr
|
||||
whenever that is necessary. In the most
|
||||
extreme case, a program could maintain a separate cursor for each call
|
||||
frame and that way it could move up and down the callframe\-chain at
|
||||
will.
|
||||
.PP
|
||||
Given an unwind cursor, it is possible to read and write the CPU
|
||||
registers that were preserved for the current stack frame (as
|
||||
identified by the cursor). Libunwind
|
||||
provides several routines
|
||||
for this purpose: unw_get_reg()
|
||||
reads an integer (general)
|
||||
register, unw_get_fpreg()
|
||||
reads a floating\-point register,
|
||||
unw_set_reg()
|
||||
writes an integer register, and
|
||||
unw_set_fpreg()
|
||||
writes a floating\-point register. Note that,
|
||||
by definition, only the \fIpreserved\fP
|
||||
machine state can be accessed
|
||||
during an unwind operation. Normally, this state consists of the
|
||||
\fIcallee\-saved\fP
|
||||
(``preserved\&'') registers. However, in some
|
||||
special circumstances (e.g., in a signal handler trampoline), even the
|
||||
\fIcaller\-saved\fP
|
||||
(``scratch\&'') registers are preserved in the stack
|
||||
frame and, in those cases, libunwind
|
||||
will grant access to them
|
||||
as well. The exact set of registers that can be accessed via the
|
||||
cursor depends, of course, on the platform. However, there are two
|
||||
registers that can be read on all platforms: the instruction pointer
|
||||
(IP), sometimes also known as the ``program counter\&'', and the stack
|
||||
pointer (SP). In libunwind,
|
||||
these registers are identified by
|
||||
the macros UNW_REG_IP
|
||||
and UNW_REG_SP,
|
||||
respectively.
|
||||
.PP
|
||||
Besides just moving the unwind cursor and reading/writing saved
|
||||
registers, libunwind
|
||||
also provides the ability to resume
|
||||
execution at an arbitrary stack frame. As you might guess, this is
|
||||
useful for implementing non\-local gotos and the exception handling
|
||||
needed by some high\-level languages such as Java. Resuming execution
|
||||
with a particular stack frame simply requires calling
|
||||
unw_resume()
|
||||
and passing the cursor identifying the target
|
||||
frame as the only argument.
|
||||
.PP
|
||||
Normally, libunwind
|
||||
supports both local and remote unwinding
|
||||
(the latter will be explained in the next section). However, if you
|
||||
tell libunwind that your program only needs local unwinding, then a
|
||||
special implementation can be selected which may run much faster than
|
||||
the generic implementation which supports both kinds of unwinding. To
|
||||
select this optimized version, simply define the macro
|
||||
UNW_LOCAL_ONLY
|
||||
before including the headerfile
|
||||
<libunwind.h>\&.
|
||||
It is perfectly OK for a single program to
|
||||
employ both local\-only and generic unwinding. That is, whether or not
|
||||
UNW_LOCAL_ONLY
|
||||
is defined is a choice that each source\-file
|
||||
(compilation\-unit) can make on its own. Independent of the setting(s)
|
||||
of UNW_LOCAL_ONLY,
|
||||
you\&'ll always link the same library into
|
||||
the program (normally \fB\-l\fPunwind).
|
||||
Furthermore, the
|
||||
portion of libunwind
|
||||
that manages unwind\-info for dynamically
|
||||
generated code is not affected by the setting of
|
||||
UNW_LOCAL_ONLY\&.
|
||||
.PP
|
||||
If we put all of the above together, here is how we could use
|
||||
libunwind
|
||||
to write a function ``show_backtrace()\&''
|
||||
which prints a classic stack trace:
|
||||
.PP
|
||||
.Vb
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
|
||||
void show_backtrace (void) {
|
||||
unw_cursor_t cursor; unw_context_t uc;
|
||||
unw_word_t ip, sp;
|
||||
|
||||
unw_getcontext(&uc);
|
||||
unw_init_local(&cursor, &uc);
|
||||
while (unw_step(&cursor) > 0) {
|
||||
unw_get_reg(&cursor, UNW_REG_IP, &ip);
|
||||
unw_get_reg(&cursor, UNW_REG_SP, &sp);
|
||||
printf ("ip = %lx, sp = %lx\\n", (long) ip, (long) sp);
|
||||
}
|
||||
}
|
||||
.Ve
|
||||
.PP
|
||||
.SH REMOTE UNWINDING
|
||||
|
||||
.PP
|
||||
Libunwind
|
||||
can also be used to unwind a stack in a ``remote\&''
|
||||
process. Here, ``remote\&'' may mean another process on the same
|
||||
machine or even a process on a completely different machine from the
|
||||
one that is running libunwind\&.
|
||||
Remote unwinding is typically
|
||||
used by debuggers and instruction\-set simulators, for example.
|
||||
.PP
|
||||
Before you can unwind a remote process, you need to create a new
|
||||
address\-space object for that process. This is achieved with the
|
||||
unw_create_addr_space()
|
||||
routine. The routine takes two
|
||||
arguments: a pointer to a set of \fIaccessor\fP
|
||||
routines and an
|
||||
integer that specifies the byte\-order of the target process. The
|
||||
accessor routines provide libunwind
|
||||
with the means to
|
||||
communicate with the remote process. In particular, there are
|
||||
callbacks to read and write the process\&'s memory, its registers, and
|
||||
to access unwind information which may be needed by libunwind\&.
|
||||
.PP
|
||||
With the address space created, unwinding can be initiated by a call
|
||||
to unw_init_remote().
|
||||
This routine is very similar to
|
||||
unw_init_local(),
|
||||
except that it takes an address\-space
|
||||
object and an opaque pointer as arguments. The routine uses these
|
||||
arguments to fetch the initial machine state. Libunwind
|
||||
never
|
||||
uses the opaque pointer on its own, but instead just passes it on to
|
||||
the accessor (callback) routines. Typically, this pointer is used to
|
||||
select, e.g., the thread within a process that is to be unwound.
|
||||
.PP
|
||||
Once a cursor has been initialized with unw_init_remote(),
|
||||
unwinding works exactly like in the local case. That is, you can use
|
||||
unw_step()
|
||||
to move ``up\&'' in the call\-chain, read and write
|
||||
registers, or resume execution at a particular stack frame by calling
|
||||
unw_resume\&.
|
||||
.PP
|
||||
.SH CROSS\-PLATFORM AND MULTI\-PLATFORM UNWINDING
|
||||
|
||||
.PP
|
||||
Libunwind
|
||||
has been designed to enable unwinding across
|
||||
platforms (architectures). Indeed, a single program can use
|
||||
libunwind
|
||||
to unwind an arbitrary number of target platforms,
|
||||
all at the same time!
|
||||
.PP
|
||||
We call the machine that is running libunwind
|
||||
the \fIhost\fP
|
||||
and the machine that is running the process being unwound the
|
||||
\fItarget\fP\&.
|
||||
If the host and the target platform are the same, we
|
||||
call it \fInative\fP
|
||||
unwinding. If they differ, we call it
|
||||
\fIcross\-platform\fP
|
||||
unwinding.
|
||||
.PP
|
||||
The principle behind supporting native, cross\-platform, and
|
||||
multi\-platform unwinding is very simple: for native unwinding, a
|
||||
program includes <libunwind.h>
|
||||
and uses the linker switch
|
||||
\fB\-l\fPunwind\&.
|
||||
For cross\-platform unwinding, a program
|
||||
includes <libunwind\-PLAT\&.h>
|
||||
and uses the linker
|
||||
switch \fB\-l\fPunwind\-PLAT,
|
||||
where PLAT
|
||||
is the name
|
||||
of the target platform (e.g., ia64
|
||||
for IA\-64, hppa\-elf
|
||||
for ELF\-based HP PA\-RISC, or x86
|
||||
for 80386). Multi\-platform
|
||||
unwinding works exactly like cross\-platform unwinding, the only
|
||||
limitation is that a single source file (compilation unit) can include
|
||||
at most one libunwind
|
||||
header file. In other words, the
|
||||
platform\-specific support for each supported target needs to be
|
||||
isolated in separate source files\-\-\-a limitation that shouldn\&'t be an
|
||||
issue in practice.
|
||||
.PP
|
||||
Note that, by definition, local unwinding is possible only for the
|
||||
native case. Attempting to call, e.g., unw_local_init()
|
||||
when
|
||||
targeting a cross\-platform will result in a link\-time error
|
||||
(unresolved references).
|
||||
.PP
|
||||
.SH THREAD\- AND SIGNAL\-SAFETY
|
||||
|
||||
.PP
|
||||
All libunwind
|
||||
routines are thread\-safe. What this means is
|
||||
that multiple threads may use libunwind
|
||||
simulatenously.
|
||||
However, any given cursor may be accessed by only one thread at
|
||||
any given time.
|
||||
.PP
|
||||
To ensure thread\-safety, some libunwind
|
||||
routines may have to
|
||||
use locking. Such routines \fImust not\fP
|
||||
be called from signal
|
||||
handlers (directly or indirectly) and are therefore \fInot\fP
|
||||
signal\-safe. The manual page for each libunwind
|
||||
routine
|
||||
identifies whether or not it is signal\-safe, but as a general rule,
|
||||
any routine that may be needed for \fIlocal\fP
|
||||
unwinding is
|
||||
signal\-safe (e.g., unw_step()
|
||||
for local unwinding is
|
||||
signal\-safe). For remote\-unwinding, \fInone\fP
|
||||
of the
|
||||
libunwind
|
||||
routines are guaranteed to be signal\-safe.
|
||||
.PP
|
||||
.SH UNWINDING THROUGH DYNAMICALLY GENERATED CODE
|
||||
|
||||
.PP
|
||||
Libunwind
|
||||
provides the routines _U_dyn_register()
|
||||
and
|
||||
_U_dyn_cancel()
|
||||
to register/cancel the information required to
|
||||
unwind through code that has been generated at runtime (e.g., by a
|
||||
just\-in\-time (JIT) compiler). It is important to register the
|
||||
information for \fIall\fP
|
||||
dynamically generated code because
|
||||
otherwise, a debugger may not be able to function properly or
|
||||
high\-level language exception handling may not work as expected.
|
||||
.PP
|
||||
The interface for registering and canceling dynamic unwind info has
|
||||
been designed for maximum efficiency, so as to minimize the
|
||||
performance impact on JIT\-compilers. In particular, both routines are
|
||||
guaranteed to execute in ``constant time\&'' (O(1)) and the
|
||||
data\-structure encapsulating the dynamic unwind info has been designed
|
||||
to facilitate sharing, such that similar procedures can share much of
|
||||
the underlying information.
|
||||
.PP
|
||||
For more information on the libunwind
|
||||
support for dynamically
|
||||
generated code, see libunwind\-dynamic(3)\&.
|
||||
.PP
|
||||
.SH CACHING OF UNWIND INFO
|
||||
|
||||
.PP
|
||||
To speed up execution, libunwind
|
||||
may aggressively cache the
|
||||
information it needs to perform unwinding. If a process changes
|
||||
during its lifetime, this creates a risk of libunwind
|
||||
using
|
||||
stale data. For example, this would happen if libunwind
|
||||
were
|
||||
to cache information about a shared library which later on gets
|
||||
unloaded (e.g., via \fIdlclose\fP(3)).
|
||||
.PP
|
||||
To prevent the risk of using stale data, libunwind
|
||||
provides two
|
||||
facilities: first, it is possible to flush the cached information
|
||||
associated with a specific address range in the target process (or the
|
||||
entire address space, if desired). This functionality is provided by
|
||||
unw_flush_cache().
|
||||
The second facility is provided by
|
||||
unw_set_caching_policy(),
|
||||
which lets a program
|
||||
select the exact caching policy in use for a given address\-space
|
||||
object. In particular, by selecting the policy
|
||||
UNW_CACHE_NONE,
|
||||
it is possible to turn off caching
|
||||
completely, therefore eliminating the risk of stale data alltogether
|
||||
(at the cost of slower execution). By default, caching is enabled for
|
||||
local unwinding only.
|
||||
.PP
|
||||
.SH FILES
|
||||
|
||||
.PP
|
||||
.TP
|
||||
libunwind.h
|
||||
Headerfile to include for native (same
|
||||
platform) unwinding.
|
||||
.TP
|
||||
libunwind\-PLAT\&.h
|
||||
Headerfile to include when
|
||||
the unwind target runs on platform PLAT\&.
|
||||
For example, to unwind
|
||||
an IA\-64 program, the header file libunwind\-ia64.h
|
||||
should be
|
||||
included.
|
||||
.TP
|
||||
\fB\-l\fPunwind
|
||||
Linker\-switch to add when building a
|
||||
program that does native (same platform) unwinding.
|
||||
.TP
|
||||
\fB\-l\fPunwind\-PLAT
|
||||
Linker\-switch to add when
|
||||
building a program that unwinds a program on platform PLAT\&.
|
||||
For example, to (cross\-)unwind an IA\-64 program, the linker switch
|
||||
\-lunwind\-ia64
|
||||
should be added. Note: multiple such switches
|
||||
may need to be specified for programs that can unwind programs on
|
||||
multiple platforms.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind\-dynamic(3),
|
||||
libunwind\-ia64(3),
|
||||
libunwind\-ptrace(3),
|
||||
libunwind\-setjmp(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_destroy_addr_space(3),
|
||||
unw_flush_cache(3),
|
||||
unw_get_accessors(3),
|
||||
unw_get_fpreg(3),
|
||||
unw_get_proc_info(3),
|
||||
unw_get_proc_name(3),
|
||||
unw_get_reg(3),
|
||||
unw_getcontext(3),
|
||||
unw_init_local(3),
|
||||
unw_init_remote(3),
|
||||
unw_is_fpreg(3),
|
||||
unw_is_signal_frame(3),
|
||||
unw_regname(3),
|
||||
unw_resume(3),
|
||||
unw_set_caching_policy(3),
|
||||
unw_set_fpreg(3),
|
||||
unw_set_reg(3),
|
||||
unw_step(3),
|
||||
unw_strerror(3),
|
||||
_U_dyn_register(3),
|
||||
_U_dyn_cancel(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,355 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{libunwind}{David Mosberger-Tang}{Programming Library}{Introduction to libunwind}libunwind -- a (mostly) platform-independent unwind API
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_getcontext}(\Type{unw\_context\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}, \Type{unw\_context\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_init\_remote}(\Type{unw\_cursor\_t~*}, \Type{unw\_addr\_space\_t}, \Type{void~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_step}(\Type{unw\_cursor\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_get\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_get\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_set\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_resume}(\Type{unw\_cursor\_t~*});\\
|
||||
|
||||
\noindent
|
||||
\Type{unw\_addr\_space\_t} \Var{unw\_local\_addr\_space};\\
|
||||
\noindent
|
||||
\Type{unw\_addr\_space\_t} \Func{unw\_create\_addr\_space}(\Type{unw\_accessors\_t}, \Type{int});\\
|
||||
\noindent
|
||||
\Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t});\\
|
||||
\noindent
|
||||
\Type{unw\_accessors\_t} \Func{unw\_get\_accessors}(\Type{unw\_addr\_space\_t});\\
|
||||
\noindent
|
||||
\Type{void} \Func{unw\_flush\_cache}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_word\_t});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_set\_caching\_policy}(\Type{unw\_addr\_space\_t}, \Type{unw\_caching\_policy\_t});\\
|
||||
|
||||
\noindent
|
||||
\Type{const char *}\Func{unw\_regname}(\Type{unw\_regnum\_t});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}, \Type{unw\_proc\_info\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_get\_save\_loc}(\Type{unw\_cursor\_t~*}, \Type{int}, \Type{unw\_save\_loc\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t});\\
|
||||
\Type{int} \Func{unw\_is\_signal\_frame}(\Type{unw\_cursor\_t~*});\\
|
||||
\noindent
|
||||
\Type{int} \Func{unw\_get\_proc\_name}(\Type{unw\_cursor\_t~*}, \Type{char~*}, \Type{size\_t}, \Type{unw\_word\_t~*});\\
|
||||
|
||||
\noindent
|
||||
\Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*});\\
|
||||
\noindent
|
||||
\Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*});\\
|
||||
|
||||
\section{Local Unwinding}
|
||||
|
||||
\Prog{Libunwind} is very easy to use when unwinding a stack from
|
||||
within a running program. This is called \emph{local} unwinding. Say
|
||||
you want to unwind the stack while executing in some function
|
||||
\Func{F}(). In this function, you would call \Func{unw\_getcontext}()
|
||||
to get a snapshot of the CPU registers (machine-state). Then you
|
||||
initialize an \emph{unwind~cursor} based on this snapshot. This is
|
||||
done with a call to \Func{unw\_init\_local}(). The cursor now points
|
||||
to the current frame, that is, the stack frame that corresponds to the
|
||||
current activation of function \Func{F}(). The unwind cursor can then
|
||||
be moved ``up'' (towards earlier stack frames) by calling
|
||||
\Func{unw\_step}(). By repeatedly calling this routine, you can
|
||||
uncover the entire call-chain that led to the activation of function
|
||||
\Func{F}(). A positive return value from \Func{unw\_step}() indicates
|
||||
that there are more frames in the chain, zero indicates that the end
|
||||
of the chain has been reached, and any negative value indicates that
|
||||
some sort of error has occurred.
|
||||
|
||||
While it is not possible to directly move the unwind cursor in the
|
||||
``down'' direction (towards newer stack frames), this effect can be
|
||||
achieved by making copies of an unwind cursor. For example, a program
|
||||
that sometimes has to move ``down'' by one stack frame could maintain
|
||||
two cursor variables: ``\Var{curr}'' and ``\Var{prev}''. The former
|
||||
would be used as the current cursor and \Var{prev} would be maintained
|
||||
as the ``previous frame'' cursor by copying the contents of \Var{curr}
|
||||
to \Var{prev} right before calling \Func{unw\_step}(). With this
|
||||
approach, the program could move one step ``down'' simply by copying
|
||||
back \Var{prev} to \Var{curr} whenever that is necessary. In the most
|
||||
extreme case, a program could maintain a separate cursor for each call
|
||||
frame and that way it could move up and down the callframe-chain at
|
||||
will.
|
||||
|
||||
Given an unwind cursor, it is possible to read and write the CPU
|
||||
registers that were preserved for the current stack frame (as
|
||||
identified by the cursor). \Prog{Libunwind} provides several routines
|
||||
for this purpose: \Func{unw\_get\_reg}() reads an integer (general)
|
||||
register, \Func{unw\_get\_fpreg}() reads a floating-point register,
|
||||
\Func{unw\_set\_reg}() writes an integer register, and
|
||||
\Func{unw\_set\_fpreg}() writes a floating-point register. Note that,
|
||||
by definition, only the \emph{preserved} machine state can be accessed
|
||||
during an unwind operation. Normally, this state consists of the
|
||||
\emph{callee-saved} (``preserved'') registers. However, in some
|
||||
special circumstances (e.g., in a signal handler trampoline), even the
|
||||
\emph{caller-saved} (``scratch'') registers are preserved in the stack
|
||||
frame and, in those cases, \Prog{libunwind} will grant access to them
|
||||
as well. The exact set of registers that can be accessed via the
|
||||
cursor depends, of course, on the platform. However, there are two
|
||||
registers that can be read on all platforms: the instruction pointer
|
||||
(IP), sometimes also known as the ``program counter'', and the stack
|
||||
pointer (SP). In \Prog{libunwind}, these registers are identified by
|
||||
the macros \Const{UNW\_REG\_IP} and \Const{UNW\_REG\_SP},
|
||||
respectively.
|
||||
|
||||
Besides just moving the unwind cursor and reading/writing saved
|
||||
registers, \Prog{libunwind} also provides the ability to resume
|
||||
execution at an arbitrary stack frame. As you might guess, this is
|
||||
useful for implementing non-local gotos and the exception handling
|
||||
needed by some high-level languages such as Java. Resuming execution
|
||||
with a particular stack frame simply requires calling
|
||||
\Func{unw\_resume}() and passing the cursor identifying the target
|
||||
frame as the only argument.
|
||||
|
||||
Normally, \Prog{libunwind} supports both local and remote unwinding
|
||||
(the latter will be explained in the next section). However, if you
|
||||
tell libunwind that your program only needs local unwinding, then a
|
||||
special implementation can be selected which may run much faster than
|
||||
the generic implementation which supports both kinds of unwinding. To
|
||||
select this optimized version, simply define the macro
|
||||
\Const{UNW\_LOCAL\_ONLY} before including the headerfile
|
||||
\File{$<$libunwind.h$>$}. It is perfectly OK for a single program to
|
||||
employ both local-only and generic unwinding. That is, whether or not
|
||||
\Const{UNW\_LOCAL\_ONLY} is defined is a choice that each source-file
|
||||
(compilation-unit) can make on its own. Independent of the setting(s)
|
||||
of \Const{UNW\_LOCAL\_ONLY}, you'll always link the same library into
|
||||
the program (normally \Opt{-l}\File{unwind}). Furthermore, the
|
||||
portion of \Prog{libunwind} that manages unwind-info for dynamically
|
||||
generated code is not affected by the setting of
|
||||
\Const{UNW\_LOCAL\_ONLY}.
|
||||
|
||||
If we put all of the above together, here is how we could use
|
||||
\Prog{libunwind} to write a function ``\Func{show\_backtrace}()''
|
||||
which prints a classic stack trace:
|
||||
|
||||
\begin{verbatim}
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
|
||||
void show_backtrace (void) {
|
||||
unw_cursor_t cursor; unw_context_t uc;
|
||||
unw_word_t ip, sp;
|
||||
|
||||
unw_getcontext(&uc);
|
||||
unw_init_local(&cursor, &uc);
|
||||
while (unw_step(&cursor) > 0) {
|
||||
unw_get_reg(&cursor, UNW_REG_IP, &ip);
|
||||
unw_get_reg(&cursor, UNW_REG_SP, &sp);
|
||||
printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp);
|
||||
}
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
\section{Remote Unwinding}
|
||||
|
||||
\Prog{Libunwind} can also be used to unwind a stack in a ``remote''
|
||||
process. Here, ``remote'' may mean another process on the same
|
||||
machine or even a process on a completely different machine from the
|
||||
one that is running \Prog{libunwind}. Remote unwinding is typically
|
||||
used by debuggers and instruction-set simulators, for example.
|
||||
|
||||
Before you can unwind a remote process, you need to create a new
|
||||
address-space object for that process. This is achieved with the
|
||||
\Func{unw\_create\_addr\_space}() routine. The routine takes two
|
||||
arguments: a pointer to a set of \emph{accessor} routines and an
|
||||
integer that specifies the byte-order of the target process. The
|
||||
accessor routines provide \Func{libunwind} with the means to
|
||||
communicate with the remote process. In particular, there are
|
||||
callbacks to read and write the process's memory, its registers, and
|
||||
to access unwind information which may be needed by \Func{libunwind}.
|
||||
|
||||
With the address space created, unwinding can be initiated by a call
|
||||
to \Func{unw\_init\_remote}(). This routine is very similar to
|
||||
\Func{unw\_init\_local}(), except that it takes an address-space
|
||||
object and an opaque pointer as arguments. The routine uses these
|
||||
arguments to fetch the initial machine state. \Prog{Libunwind} never
|
||||
uses the opaque pointer on its own, but instead just passes it on to
|
||||
the accessor (callback) routines. Typically, this pointer is used to
|
||||
select, e.g., the thread within a process that is to be unwound.
|
||||
|
||||
Once a cursor has been initialized with \Func{unw\_init\_remote}(),
|
||||
unwinding works exactly like in the local case. That is, you can use
|
||||
\Func{unw\_step}() to move ``up'' in the call-chain, read and write
|
||||
registers, or resume execution at a particular stack frame by calling
|
||||
\Func{unw\_resume}.
|
||||
|
||||
|
||||
\section{Cross-platform and Multi-platform Unwinding}
|
||||
|
||||
\Prog{Libunwind} has been designed to enable unwinding across
|
||||
platforms (architectures). Indeed, a single program can use
|
||||
\Prog{libunwind} to unwind an arbitrary number of target platforms,
|
||||
all at the same time!
|
||||
|
||||
We call the machine that is running \Prog{libunwind} the \emph{host}
|
||||
and the machine that is running the process being unwound the
|
||||
\emph{target}. If the host and the target platform are the same, we
|
||||
call it \emph{native} unwinding. If they differ, we call it
|
||||
\emph{cross-platform} unwinding.
|
||||
|
||||
The principle behind supporting native, cross-platform, and
|
||||
multi-platform unwinding is very simple: for native unwinding, a
|
||||
program includes \File{$<$libunwind.h$>$} and uses the linker switch
|
||||
\Opt{-l}\File{unwind}. For cross-platform unwinding, a program
|
||||
includes \File{$<$libunwind-}\Var{PLAT}\File{.h$>$} and uses the linker
|
||||
switch \Opt{-l}\File{unwind-}\Var{PLAT}, where \Var{PLAT} is the name
|
||||
of the target platform (e.g., \File{ia64} for IA-64, \File{hppa-elf}
|
||||
for ELF-based HP PA-RISC, or \File{x86} for 80386). Multi-platform
|
||||
unwinding works exactly like cross-platform unwinding, the only
|
||||
limitation is that a single source file (compilation unit) can include
|
||||
at most one \Prog{libunwind} header file. In other words, the
|
||||
platform-specific support for each supported target needs to be
|
||||
isolated in separate source files---a limitation that shouldn't be an
|
||||
issue in practice.
|
||||
|
||||
Note that, by definition, local unwinding is possible only for the
|
||||
native case. Attempting to call, e.g., \Func{unw\_local\_init}() when
|
||||
targeting a cross-platform will result in a link-time error
|
||||
(unresolved references).
|
||||
|
||||
|
||||
\section{Thread- and Signal-Safety}
|
||||
|
||||
|
||||
All \Prog{libunwind} routines are thread-safe. What this means is
|
||||
that multiple threads may use \Prog{libunwind} simulatenously.
|
||||
However, any given cursor may be accessed by only one thread at
|
||||
any given time.
|
||||
|
||||
To ensure thread-safety, some \Prog{libunwind} routines may have to
|
||||
use locking. Such routines \emph{must~not} be called from signal
|
||||
handlers (directly or indirectly) and are therefore \emph{not}
|
||||
signal-safe. The manual page for each \Prog{libunwind} routine
|
||||
identifies whether or not it is signal-safe, but as a general rule,
|
||||
any routine that may be needed for \emph{local} unwinding is
|
||||
signal-safe (e.g., \Func{unw\_step}() for local unwinding is
|
||||
signal-safe). For remote-unwinding, \emph{none} of the
|
||||
\Prog{libunwind} routines are guaranteed to be signal-safe.
|
||||
|
||||
|
||||
\section{Unwinding Through Dynamically Generated Code}
|
||||
|
||||
\Func{Libunwind} provides the routines \Func{\_U\_dyn\_register}() and
|
||||
\Func{\_U\_dyn\_cancel}() to register/cancel the information required to
|
||||
unwind through code that has been generated at runtime (e.g., by a
|
||||
just-in-time (JIT) compiler). It is important to register the
|
||||
information for \emph{all} dynamically generated code because
|
||||
otherwise, a debugger may not be able to function properly or
|
||||
high-level language exception handling may not work as expected.
|
||||
|
||||
The interface for registering and canceling dynamic unwind info has
|
||||
been designed for maximum efficiency, so as to minimize the
|
||||
performance impact on JIT-compilers. In particular, both routines are
|
||||
guaranteed to execute in ``constant time'' (O(1)) and the
|
||||
data-structure encapsulating the dynamic unwind info has been designed
|
||||
to facilitate sharing, such that similar procedures can share much of
|
||||
the underlying information.
|
||||
|
||||
For more information on the \Prog{libunwind} support for dynamically
|
||||
generated code, see \SeeAlso{libunwind-dynamic(3)}.
|
||||
|
||||
|
||||
\section{Caching of Unwind Info}
|
||||
|
||||
To speed up execution, \Prog{libunwind} may aggressively cache the
|
||||
information it needs to perform unwinding. If a process changes
|
||||
during its lifetime, this creates a risk of \Prog{libunwind} using
|
||||
stale data. For example, this would happen if \Prog{libunwind} were
|
||||
to cache information about a shared library which later on gets
|
||||
unloaded (e.g., via \Cmd{dlclose}{3}).
|
||||
|
||||
To prevent the risk of using stale data, \Prog{libunwind} provides two
|
||||
facilities: first, it is possible to flush the cached information
|
||||
associated with a specific address range in the target process (or the
|
||||
entire address space, if desired). This functionality is provided by
|
||||
\Func{unw\_flush\_cache}(). The second facility is provided by
|
||||
\Func{unw\_set\_caching\_policy}(), which lets a program
|
||||
select the exact caching policy in use for a given address-space
|
||||
object. In particular, by selecting the policy
|
||||
\Const{UNW\_CACHE\_NONE}, it is possible to turn off caching
|
||||
completely, therefore eliminating the risk of stale data alltogether
|
||||
(at the cost of slower execution). By default, caching is enabled for
|
||||
local unwinding only.
|
||||
|
||||
|
||||
\section{Files}
|
||||
|
||||
\begin{Description}
|
||||
\item[\File{libunwind.h}] Headerfile to include for native (same
|
||||
platform) unwinding.
|
||||
\item[\File{libunwind-}\Var{PLAT}\File{.h}] Headerfile to include when
|
||||
the unwind target runs on platform \Var{PLAT}. For example, to unwind
|
||||
an IA-64 program, the header file \File{libunwind-ia64.h} should be
|
||||
included.
|
||||
\item[\Opt{-l}\File{unwind}] Linker-switch to add when building a
|
||||
program that does native (same platform) unwinding.
|
||||
\item[\Opt{-l}\File{unwind-}\Var{PLAT}] Linker-switch to add when
|
||||
building a program that unwinds a program on platform \Var{PLAT}.
|
||||
For example, to (cross-)unwind an IA-64 program, the linker switch
|
||||
\File{-lunwind-ia64} should be added. Note: multiple such switches
|
||||
may need to be specified for programs that can unwind programs on
|
||||
multiple platforms.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind-dynamic(3)},
|
||||
\SeeAlso{libunwind-ia64(3)},
|
||||
\SeeAlso{libunwind-ptrace(3)},
|
||||
\SeeAlso{libunwind-setjmp(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_destroy\_addr\_space(3)},
|
||||
\SeeAlso{unw\_flush\_cache(3)},
|
||||
\SeeAlso{unw\_get\_accessors(3)},
|
||||
\SeeAlso{unw\_get\_fpreg(3)},
|
||||
\SeeAlso{unw\_get\_proc\_info(3)},
|
||||
\SeeAlso{unw\_get\_proc\_name(3)},
|
||||
\SeeAlso{unw\_get\_reg(3)},
|
||||
\SeeAlso{unw\_getcontext(3)},
|
||||
\SeeAlso{unw\_init\_local(3)},
|
||||
\SeeAlso{unw\_init\_remote(3)},
|
||||
\SeeAlso{unw\_is\_fpreg(3)},
|
||||
\SeeAlso{unw\_is\_signal\_frame(3)},
|
||||
\SeeAlso{unw\_regname(3)},
|
||||
\SeeAlso{unw\_resume(3)},
|
||||
\SeeAlso{unw\_set\_caching\_policy(3)},
|
||||
\SeeAlso{unw\_set\_fpreg(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)},
|
||||
\SeeAlso{unw\_step(3)},
|
||||
\SeeAlso{unw\_strerror(3)},
|
||||
\SeeAlso{\_U\_dyn\_register(3)},
|
||||
\SeeAlso{\_U\_dyn\_cancel(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,34 +0,0 @@
|
||||
$manMacro1a{'Type'} = $manMacro1a{File};
|
||||
$manMacro1b{'Type'} = $manMacro1b{File};
|
||||
$htmlMacro1a{'Type'} = $htmlMacro1a{File};
|
||||
$htmlMacro1b{'Type'} = $htmlMacro1b{File};
|
||||
$texiMacro1a{'Type'} = $texiMacro1a{File};
|
||||
$texiMacro1b{'Type'} = $texiMacro1b{File};
|
||||
$manMacro1a{'Func'} = $manMacro1a{Prog};
|
||||
$manMacro1b{'Func'} = $manMacro1b{Prog};
|
||||
$htmlMacro1a{'Func'} = $htmlMacro1a{Arg};
|
||||
$htmlMacro1b{'Func'} = $htmlMacro1b{Arg};
|
||||
$texiMacro1a{'Func'} = $texiMacro1a{Prog};
|
||||
$texiMacro1b{'Func'} = $texiMacro1b{Prog};
|
||||
$manMacro1a{'Var'} = $manMacro1a{Prog};
|
||||
$manMacro1b{'Var'} = $manMacro1b{Prog};
|
||||
$htmlMacro1a{'Var'} = $htmlMacro1a{Prog};
|
||||
$htmlMacro1b{'Var'} = $htmlMacro1b{Prog};
|
||||
$texiMacro1a{'Var'} = $texiMacro1a{Prog};
|
||||
$texiMacro1b{'Var'} = $texiMacro1b{Prog};
|
||||
$manMacro1a{'Const'} = $manMacro1a{File};
|
||||
$manMacro1b{'Const'} = $manMacro1b{File};
|
||||
$htmlMacro1a{'Const'} = $htmlMacro1a{File};
|
||||
$htmlMacro1b{'Const'} = $htmlMacro1b{File};
|
||||
$texiMacro1a{'Const'} = $texiMacro1a{File};
|
||||
$texiMacro1b{'Const'} = $texiMacro1b{File};
|
||||
|
||||
$manMacro1a{'SeeAlso'} = $manMacro1a{File};
|
||||
$manMacro1b{'SeeAlso'} = $manMacro1b{File};
|
||||
# special handling of SeeAlso in latex2man, so that argument gets doubled:
|
||||
$htmlMacro2a{'SeeAlso'} = "<a href=\"";
|
||||
$htmlMacro2b{'SeeAlso'} = ".html\">$htmlMacro1a{File}";
|
||||
$htmlMacro2c{'SeeAlso'} = "$htmlMacro1b{File}</a>";
|
||||
$texiMacro1a{'SeeAlso'} = $texiMacro1a{File};
|
||||
$texiMacro1b{'SeeAlso'} = $texiMacro1b{File};
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Fri Aug 31 13:39:04 EEST 2012
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_BACKTRACE" "3" "31 August 2012" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_backtrace
|
||||
\-\- return backtrace for the calling program
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_backtrace(void **buffer,
|
||||
int size);
|
||||
.br
|
||||
.PP
|
||||
#include <execinfo.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
backtrace(void **buffer,
|
||||
int size);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
unw_backtrace()
|
||||
is a convenient routine for obtaining the backtrace for
|
||||
the calling program. The routine fills up to size
|
||||
addresses in the array
|
||||
pointed by buffer\&.
|
||||
The routine is only available for local unwinding.
|
||||
.PP
|
||||
Note that many (but not all) systems provide practically identical function
|
||||
called backtrace().
|
||||
The prototype for this function is usually obtained
|
||||
by including the <execinfo.h>
|
||||
header file \-\- a prototype for
|
||||
backtrace()
|
||||
is not provided by libunwind\&.
|
||||
libunwind
|
||||
weakly
|
||||
aliases backtrace()
|
||||
to unw_backtrace(),
|
||||
so when a program
|
||||
calling backtrace()
|
||||
is linked against libunwind,
|
||||
it may end up
|
||||
calling unw_backtrace().
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The routine returns the number of addresses stored in the array pointed by
|
||||
buffer\&.
|
||||
The return value may be zero to indicate that no addresses were
|
||||
stored.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_step(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,54 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_backtrace}{David Mosberger-Tang}{Programming Library}{unw\_backtrace}unw\_backtrace -- return backtrace for the calling program
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\
|
||||
|
||||
\File{\#include $<$execinfo.h$>$}\\
|
||||
|
||||
\Type{int} \Func{backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
\Func{unw\_backtrace}() is a convenient routine for obtaining the backtrace for
|
||||
the calling program. The routine fills up to \Var{size} addresses in the array
|
||||
pointed by \Var{buffer}. The routine is only available for local unwinding.
|
||||
|
||||
Note that many (but not all) systems provide practically identical function
|
||||
called \Func{backtrace}(). The prototype for this function is usually obtained
|
||||
by including the \File{$<$execinfo.h$>$} header file -- a prototype for
|
||||
\Func{backtrace}() is not provided by \Prog{libunwind}. \Prog{libunwind} weakly
|
||||
aliases \Func{backtrace}() to \Func{unw\_backtrace}(), so when a program
|
||||
calling \Func{backtrace}() is linked against \Prog{libunwind}, it may end up
|
||||
calling \Func{unw\_backtrace}().
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The routine returns the number of addresses stored in the array pointed by
|
||||
\Var{buffer}. The return value may be zero to indicate that no addresses were
|
||||
stored.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_step(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,457 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_CREATE\\_ADDR\\_SPACE" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_create_addr_space
|
||||
\-\- create address space for remote unwinding
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
unw_addr_space_t
|
||||
unw_create_addr_space(unw_accessors_t *ap,
|
||||
int
|
||||
byteorder);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_create_addr_space()
|
||||
routine creates a new unwind
|
||||
address\-space and initializes it based on the call\-back routines
|
||||
passed via the ap
|
||||
pointer and the specified byteorder\&.
|
||||
The call\-back routines are described in detail below. The
|
||||
byteorder
|
||||
can be set to 0 to request the default byte\-order of
|
||||
the unwind target. To request a particular byte\-order,
|
||||
byteorder
|
||||
can be set to any constant defined by
|
||||
<endian.h>\&.
|
||||
In particular, __LITTLE_ENDIAN
|
||||
would
|
||||
request little\-endian byte\-order and __BIG_ENDIAN
|
||||
would
|
||||
request big\-endian byte\-order. Whether or not a particular byte\-order
|
||||
is supported depends on the target platform.
|
||||
.PP
|
||||
.SH CALL\-BACK ROUTINES
|
||||
|
||||
.PP
|
||||
Libunwind
|
||||
uses a set of call\-back routines to access the
|
||||
information it needs to unwind a chain of stack\-frames. These
|
||||
routines are specified via the ap
|
||||
argument, which points to a
|
||||
variable of type unw_accessors_t\&.
|
||||
The contents of this
|
||||
variable is copied into the newly\-created address space, so the
|
||||
variable must remain valid only for the duration of the call to
|
||||
unw_create_addr_space().
|
||||
.PP
|
||||
The first argument to every call\-back routine is an address\-space
|
||||
identifier (as)
|
||||
and the last argument is an arbitrary,
|
||||
application\-specified void\-pointer (arg).
|
||||
When invoking a
|
||||
call\-back routine, libunwind
|
||||
sets the as
|
||||
argument to the
|
||||
address\-space on whose behalf the invocation is made and the arg
|
||||
argument to the value that was specified when
|
||||
unw_init_remote(3)
|
||||
was called.
|
||||
.PP
|
||||
The synopsis and a detailed description of every call\-back routine
|
||||
follows below.
|
||||
.PP
|
||||
.SS CALL\-BACK ROUTINE SYNOPSIS
|
||||
.PP
|
||||
int
|
||||
find_proc_info(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
|
||||
ip,
|
||||
unw_proc_info_t *pip,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
|
||||
need_unwind_info,
|
||||
void *arg);
|
||||
.br
|
||||
void
|
||||
put_unwind_info(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_proc_info_t *pip,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
get_dyn_info_list_addr(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t *dilap,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
access_mem(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
|
||||
addr,
|
||||
unw_word_t *valp,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
|
||||
write,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
access_reg(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_regnum_t
|
||||
regnum,
|
||||
unw_word_t *valp,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
|
||||
write,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
access_fpreg(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_regnum_t
|
||||
regnum,
|
||||
unw_fpreg_t *fpvalp,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
|
||||
write,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
resume(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_cursor_t *cp,
|
||||
void *arg);
|
||||
.br
|
||||
int
|
||||
get_proc_name(unw_addr_space_t
|
||||
as,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
|
||||
addr,
|
||||
char *bufp,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPsize_t
|
||||
buf_len,
|
||||
unw_word_t *offp,
|
||||
.br
|
||||
\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPvoid *arg);
|
||||
.br
|
||||
.PP
|
||||
.SS FIND_PROC_INFO
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the find_proc_info()
|
||||
call\-back to
|
||||
locate the information need to unwind a particular procedure. The
|
||||
ip
|
||||
argument is an instruction\-address inside the procedure whose
|
||||
information is needed. The pip
|
||||
argument is a pointer to the
|
||||
variable used to return the desired information. The type of this
|
||||
variable is unw_proc_info_t\&.
|
||||
See
|
||||
unw_get_proc_info(3)
|
||||
for details. Argument
|
||||
need_unwind_info
|
||||
is zero if the call\-back does not need to
|
||||
provide values for the following members in the
|
||||
unw_proc_info_t
|
||||
structure: format,
|
||||
unwind_info_size,
|
||||
and unwind_info\&.
|
||||
If
|
||||
need_unwind_info
|
||||
is non\-zero, valid values need to be returned
|
||||
in these members. Furthermore, the contents of the memory addressed
|
||||
by the unwind_info
|
||||
member must remain valid until the info is
|
||||
released via the put_unwind_info
|
||||
call\-back (see below).
|
||||
.PP
|
||||
On successful completion, the find_proc_info()
|
||||
call\-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
unw_error_t
|
||||
error\-codes may be returned. In particular, this
|
||||
call\-back may return \-UNW_ESTOPUNWIND
|
||||
to signal the end of
|
||||
the frame\-chain.
|
||||
.PP
|
||||
.SS PUT_UNWIND_INFO
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the put_unwind_info()
|
||||
call\-back to
|
||||
release the resources (such as memory) allocated by a previous call to
|
||||
find_proc_info()
|
||||
with the need_unwind_info
|
||||
argument
|
||||
set to a non\-zero value. The pip
|
||||
argument has the same value as
|
||||
the argument of the same name in the previous matching call to
|
||||
find_proc_info().
|
||||
Note that libunwind
|
||||
does \fInot\fP
|
||||
invoke put_unwind_info
|
||||
for calls to find_proc_info()
|
||||
with a zero need_unwind_info
|
||||
argument.
|
||||
.PP
|
||||
.SS GET_DYN_INFO_LIST_ADDR
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the get_dyn_info_list_addr()
|
||||
call\-back to obtain the address of the head of the dynamic unwind\-info
|
||||
registration list. The variable stored at the returned address must
|
||||
have a type of unw_dyn_info_list_t
|
||||
(see
|
||||
_U_dyn_register(3)).
|
||||
The dliap
|
||||
argument is a pointer
|
||||
to a variable of type unw_word_t
|
||||
which is used to return the
|
||||
address of the dynamic unwind\-info registration list. If no dynamic
|
||||
unwind\-info registration list exist, the value pointed to by
|
||||
dliap
|
||||
must be cleared to zero. Libunwind
|
||||
will cache the
|
||||
value returned by get_dyn_info_list_addr()
|
||||
if caching is
|
||||
enabled for the given address\-space. The cache can be cleared with a
|
||||
call to unw_flush_cache().
|
||||
.PP
|
||||
On successful completion, the get_dyn_info_list_addr()
|
||||
call\-back must return zero. Otherwise, the negative value of one of
|
||||
the unw_error_t
|
||||
error\-codes may be returned.
|
||||
.PP
|
||||
.SS ACCESS_MEM
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the access_mem()
|
||||
call\-back to read
|
||||
from or write to a word of memory in the target address\-space. The
|
||||
address of the word to be accessed is passed in argument addr\&.
|
||||
To read memory, libunwind
|
||||
sets argument write
|
||||
to zero and
|
||||
valp
|
||||
to point to the word that receives the read value. To
|
||||
write memory, libunwind
|
||||
sets argument write
|
||||
to a non\-zero
|
||||
value and valp
|
||||
to point to the word that contains the value to
|
||||
be written. The word that valp
|
||||
points to is always in the
|
||||
byte\-order of the host\-platform, regardless of the byte\-order of the
|
||||
target. In other words, it is the responsibility of the call\-back
|
||||
routine to convert between the target\&'s and the host\&'s byte\-order, if
|
||||
necessary.
|
||||
.PP
|
||||
On successful completion, the access_mem()
|
||||
call\-back must return zero. Otherwise, the negative value of one of
|
||||
the unw_error_t
|
||||
error\-codes may be returned.
|
||||
.PP
|
||||
.SS ACCESS_REG
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the access_reg()
|
||||
call\-back to read
|
||||
from or write to a scalar (non\-floating\-point) CPU register. The
|
||||
index of the register to be accessed is passed in argument
|
||||
regnum\&.
|
||||
To read a register, libunwind
|
||||
sets argument
|
||||
write
|
||||
to zero and valp
|
||||
to point to the word that receives
|
||||
the read value. To write a register, libunwind
|
||||
sets argument
|
||||
write
|
||||
to a non\-zero value and valp
|
||||
to point to the word
|
||||
that contains the value to be written. The word that valp
|
||||
points to is always in the byte\-order of the host\-platform, regardless
|
||||
of the byte\-order of the target. In other words, it is the
|
||||
responsibility of the call\-back routine to convert between the
|
||||
target\&'s and the host\&'s byte\-order, if necessary.
|
||||
.PP
|
||||
On successful completion, the access_reg()
|
||||
call\-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
unw_error_t
|
||||
error\-codes may be returned.
|
||||
.PP
|
||||
.SS ACCESS_FPREG
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the access_fpreg()
|
||||
call\-back to read
|
||||
from or write to a floating\-point CPU register. The index of the
|
||||
register to be accessed is passed in argument regnum\&.
|
||||
To read a
|
||||
register, libunwind
|
||||
sets argument write
|
||||
to zero and
|
||||
fpvalp
|
||||
to point to a variable of type unw_fpreg_t
|
||||
that
|
||||
receives the read value. To write a register, libunwind
|
||||
sets
|
||||
argument write
|
||||
to a non\-zero value and fpvalp
|
||||
to point to
|
||||
the variable of type unw_fpreg_t
|
||||
that contains the value to
|
||||
be written. The word that fpvalp
|
||||
points to is always in the
|
||||
byte\-order of the host\-platform, regardless of the byte\-order of the
|
||||
target. In other words, it is the responsibility of the call\-back
|
||||
routine to convert between the target\&'s and the host\&'s byte\-order, if
|
||||
necessary.
|
||||
.PP
|
||||
On successful completion, the access_fpreg()
|
||||
call\-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
unw_error_t
|
||||
error\-codes may be returned.
|
||||
.PP
|
||||
.SS RESUME
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the resume()
|
||||
call\-back to resume
|
||||
execution in the target address space. Argument cp
|
||||
is the
|
||||
unwind\-cursor that identifies the stack\-frame in which execution
|
||||
should resume. By the time libunwind
|
||||
invokes the resume
|
||||
call\-back, it has already established the desired machine\- and
|
||||
memory\-state via calls to the access_reg(),
|
||||
access_fpreg,
|
||||
and access_mem()
|
||||
call\-backs. Thus, all
|
||||
the call\-back needs to do is perform whatever action is needed to
|
||||
actually resume execution.
|
||||
.PP
|
||||
The resume
|
||||
call\-back is invoked only in response to a call to
|
||||
unw_resume(3),
|
||||
so applications which never invoke
|
||||
unw_resume(3)
|
||||
need not define the resume
|
||||
callback.
|
||||
.PP
|
||||
On successful completion, the resume()
|
||||
call\-back must return
|
||||
zero. Otherwise, the negative value of one of the
|
||||
unw_error_t
|
||||
error\-codes may be returned. As a special case,
|
||||
when resuming execution in the local address space, the call\-back will
|
||||
not return on success.
|
||||
.PP
|
||||
.SS GET_PROC_NAME
|
||||
.PP
|
||||
Libunwind
|
||||
invokes the get_proc_name()
|
||||
call\-back to
|
||||
obtain the procedure\-name of a static (not dynamically generated)
|
||||
procedure. Argument addr
|
||||
is an instruction\-address within the
|
||||
procedure whose name is to be obtained. The bufp
|
||||
argument is a
|
||||
pointer to a character\-buffer used to return the procedure name. The
|
||||
size of this buffer is specified in argument buf_len\&.
|
||||
The
|
||||
returned name must be terminated by a NUL character. If the
|
||||
procedure\&'s name is longer than buf_len
|
||||
bytes, it must be
|
||||
truncated to buf_len\-1
|
||||
bytes, with the last byte in the
|
||||
buffer set to the NUL character and \-UNW_ENOMEM
|
||||
must be
|
||||
returned. Argument offp
|
||||
is a pointer to a word which is used to
|
||||
return the byte\-offset relative to the start of the procedure whose
|
||||
name is being returned. For example, if procedure foo()
|
||||
starts
|
||||
at address 0x40003000, then invoking get_proc_name()
|
||||
with
|
||||
addr
|
||||
set to 0x40003080 should return a value of 0x80 in the word
|
||||
pointed to by offp
|
||||
(assuming the procedure is at least 0x80
|
||||
bytes long).
|
||||
.PP
|
||||
On successful completion, the get_proc_name()
|
||||
call\-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
unw_error_t
|
||||
error\-codes may be returned.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_create_addr_space()
|
||||
returns a
|
||||
non\-NULL
|
||||
value that represents the newly created
|
||||
address\-space. Otherwise, NULL
|
||||
is returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_create_addr_space()
|
||||
is thread\-safe but \fInot\fP
|
||||
safe to use from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
_U_dyn_register(3),
|
||||
libunwind(3),
|
||||
unw_destroy_addr_space(3),
|
||||
unw_get_proc_info(3),
|
||||
unw_init_remote(3),
|
||||
unw_resume(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,265 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_create\_addr\_space}{David Mosberger-Tang}{Programming Library}{unw\_create\_addr\_space}unw\_create\_addr\_space -- create address space for remote unwinding
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{unw\_addr\_space\_t} \Func{unw\_create\_addr\_space}(\Type{unw\_accessors\_t~*}\Var{ap}, \Type{int} \Var{byteorder});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_create\_addr\_space}() routine creates a new unwind
|
||||
address-space and initializes it based on the call-back routines
|
||||
passed via the \Var{ap} pointer and the specified \Var{byteorder}.
|
||||
The call-back routines are described in detail below. The
|
||||
\Var{byteorder} can be set to 0 to request the default byte-order of
|
||||
the unwind target. To request a particular byte-order,
|
||||
\Var{byteorder} can be set to any constant defined by
|
||||
\File{$<$endian.h$>$}. In particular, \Const{\_\_LITTLE\_ENDIAN} would
|
||||
request little-endian byte-order and \Const{\_\_BIG\_ENDIAN} would
|
||||
request big-endian byte-order. Whether or not a particular byte-order
|
||||
is supported depends on the target platform.
|
||||
|
||||
\section{Call-back Routines}
|
||||
|
||||
\Prog{Libunwind} uses a set of call-back routines to access the
|
||||
information it needs to unwind a chain of stack-frames. These
|
||||
routines are specified via the \Var{ap} argument, which points to a
|
||||
variable of type \Type{unw\_accessors\_t}. The contents of this
|
||||
variable is copied into the newly-created address space, so the
|
||||
variable must remain valid only for the duration of the call to
|
||||
\Func{unw\_create\_addr\_space}().
|
||||
|
||||
The first argument to every call-back routine is an address-space
|
||||
identifier (\Var{as}) and the last argument is an arbitrary,
|
||||
application-specified void-pointer (\Var{arg}). When invoking a
|
||||
call-back routine, \Prog{libunwind} sets the \Var{as} argument to the
|
||||
address-space on whose behalf the invocation is made and the \Var{arg}
|
||||
argument to the value that was specified when
|
||||
\Func{unw\_init\_remote}(3) was called.
|
||||
|
||||
The synopsis and a detailed description of every call-back routine
|
||||
follows below.
|
||||
|
||||
\subsection{Call-back Routine Synopsis}
|
||||
|
||||
\Type{int} \Func{find\_proc\_info}(\Type{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{ip}, \Type{unw\_proc\_info\_t~*}\Var{pip},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{need\_unwind\_info}, \Type{void~*}arg);\\
|
||||
\Type{void} \Func{put\_unwind\_info}(\Type{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_proc\_info\_t~*}pip, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{get\_dyn\_info\_list\_addr}(\Type{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t~*}\Var{dilap}, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{access\_mem}(\Var{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{addr}, \Type{unw\_word\_t~*}\Var{valp},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{access\_reg}(\Var{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_regnum\_t} \Var{regnum}, \Type{unw\_word\_t~*}\Var{valp},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{access\_fpreg}(\Var{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_regnum\_t} \Var{regnum}, \Type{unw\_fpreg\_t~*}\Var{fpvalp},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{resume}(\Var{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_cursor\_t~*}\Var{cp}, \Type{void~*}\Var{arg});\\
|
||||
\Type{int} \Func{get\_proc\_name}(\Type{unw\_addr\_space\_t} \Var{as},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{addr}, \Type{char~*}\Var{bufp},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{size\_t} \Var{buf\_len}, \Type{unw\_word\_t~*}\Var{offp},\\
|
||||
\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{void~*}\Var{arg});\\
|
||||
|
||||
\subsection{find\_proc\_info}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{find\_proc\_info}() call-back to
|
||||
locate the information need to unwind a particular procedure. The
|
||||
\Var{ip} argument is an instruction-address inside the procedure whose
|
||||
information is needed. The \Var{pip} argument is a pointer to the
|
||||
variable used to return the desired information. The type of this
|
||||
variable is \Type{unw\_proc\_info\_t}. See
|
||||
\Func{unw\_get\_proc\_info(3)} for details. Argument
|
||||
\Var{need\_unwind\_info} is zero if the call-back does not need to
|
||||
provide values for the following members in the
|
||||
\Type{unw\_proc\_info\_t} structure: \Var{format},
|
||||
\Var{unwind\_info\_size}, and \Var{unwind\_info}. If
|
||||
\Var{need\_unwind\_info} is non-zero, valid values need to be returned
|
||||
in these members. Furthermore, the contents of the memory addressed
|
||||
by the \Var{unwind\_info} member must remain valid until the info is
|
||||
released via the \Func{put\_unwind\_info} call-back (see below).
|
||||
|
||||
On successful completion, the \Func{find\_proc\_info}() call-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
\Type{unw\_error\_t} error-codes may be returned. In particular, this
|
||||
call-back may return -\Const{UNW\_ESTOPUNWIND} to signal the end of
|
||||
the frame-chain.
|
||||
|
||||
\subsection{put\_unwind\_info}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{put\_unwind\_info}() call-back to
|
||||
release the resources (such as memory) allocated by a previous call to
|
||||
\Func{find\_proc\_info}() with the \Var{need\_unwind\_info} argument
|
||||
set to a non-zero value. The \Var{pip} argument has the same value as
|
||||
the argument of the same name in the previous matching call to
|
||||
\Func{find\_proc\_info}(). Note that \Prog{libunwind} does \emph{not}
|
||||
invoke \Func{put\_unwind\_info} for calls to \Func{find\_proc\_info}()
|
||||
with a zero \Var{need\_unwind\_info} argument.
|
||||
|
||||
|
||||
\subsection{get\_dyn\_info\_list\_addr}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{get\_dyn\_info\_list\_addr}()
|
||||
call-back to obtain the address of the head of the dynamic unwind-info
|
||||
registration list. The variable stored at the returned address must
|
||||
have a type of \Type{unw\_dyn\_info\_list\_t} (see
|
||||
\Func{\_U\_dyn\_register}(3)). The \Var{dliap} argument is a pointer
|
||||
to a variable of type \Type{unw\_word\_t} which is used to return the
|
||||
address of the dynamic unwind-info registration list. If no dynamic
|
||||
unwind-info registration list exist, the value pointed to by
|
||||
\Var{dliap} must be cleared to zero. \Prog{Libunwind} will cache the
|
||||
value returned by \Func{get\_dyn\_info\_list\_addr}() if caching is
|
||||
enabled for the given address-space. The cache can be cleared with a
|
||||
call to \Func{unw\_flush\_cache}().
|
||||
|
||||
On successful completion, the \Func{get\_dyn\_info\_list\_addr}()
|
||||
call-back must return zero. Otherwise, the negative value of one of
|
||||
the \Type{unw\_error\_t} error-codes may be returned.
|
||||
|
||||
\subsection{access\_mem}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{access\_mem}() call-back to read
|
||||
from or write to a word of memory in the target address-space. The
|
||||
address of the word to be accessed is passed in argument \Var{addr}.
|
||||
To read memory, \Prog{libunwind} sets argument \Var{write} to zero and
|
||||
\Var{valp} to point to the word that receives the read value. To
|
||||
write memory, \Prog{libunwind} sets argument \Var{write} to a non-zero
|
||||
value and \Var{valp} to point to the word that contains the value to
|
||||
be written. The word that \Var{valp} points to is always in the
|
||||
byte-order of the host-platform, regardless of the byte-order of the
|
||||
target. In other words, it is the responsibility of the call-back
|
||||
routine to convert between the target's and the host's byte-order, if
|
||||
necessary.
|
||||
|
||||
On successful completion, the \Func{access\_mem}()
|
||||
call-back must return zero. Otherwise, the negative value of one of
|
||||
the \Type{unw\_error\_t} error-codes may be returned.
|
||||
|
||||
\subsection{access\_reg}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{access\_reg}() call-back to read
|
||||
from or write to a scalar (non-floating-point) CPU register. The
|
||||
index of the register to be accessed is passed in argument
|
||||
\Var{regnum}. To read a register, \Prog{libunwind} sets argument
|
||||
\Var{write} to zero and \Var{valp} to point to the word that receives
|
||||
the read value. To write a register, \Prog{libunwind} sets argument
|
||||
\Var{write} to a non-zero value and \Var{valp} to point to the word
|
||||
that contains the value to be written. The word that \Var{valp}
|
||||
points to is always in the byte-order of the host-platform, regardless
|
||||
of the byte-order of the target. In other words, it is the
|
||||
responsibility of the call-back routine to convert between the
|
||||
target's and the host's byte-order, if necessary.
|
||||
|
||||
On successful completion, the \Func{access\_reg}() call-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
\Type{unw\_error\_t} error-codes may be returned.
|
||||
|
||||
\subsection{access\_fpreg}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{access\_fpreg}() call-back to read
|
||||
from or write to a floating-point CPU register. The index of the
|
||||
register to be accessed is passed in argument \Var{regnum}. To read a
|
||||
register, \Prog{libunwind} sets argument \Var{write} to zero and
|
||||
\Var{fpvalp} to point to a variable of type \Type{unw\_fpreg\_t} that
|
||||
receives the read value. To write a register, \Prog{libunwind} sets
|
||||
argument \Var{write} to a non-zero value and \Var{fpvalp} to point to
|
||||
the variable of type \Type{unw\_fpreg\_t} that contains the value to
|
||||
be written. The word that \Var{fpvalp} points to is always in the
|
||||
byte-order of the host-platform, regardless of the byte-order of the
|
||||
target. In other words, it is the responsibility of the call-back
|
||||
routine to convert between the target's and the host's byte-order, if
|
||||
necessary.
|
||||
|
||||
On successful completion, the \Func{access\_fpreg}() call-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
\Type{unw\_error\_t} error-codes may be returned.
|
||||
|
||||
\subsection{resume}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{resume}() call-back to resume
|
||||
execution in the target address space. Argument \Var{cp} is the
|
||||
unwind-cursor that identifies the stack-frame in which execution
|
||||
should resume. By the time \Prog{libunwind} invokes the \Func{resume}
|
||||
call-back, it has already established the desired machine- and
|
||||
memory-state via calls to the \Func{access\_reg}(),
|
||||
\Func{access\_fpreg}, and \Func{access\_mem}() call-backs. Thus, all
|
||||
the call-back needs to do is perform whatever action is needed to
|
||||
actually resume execution.
|
||||
|
||||
The \Func{resume} call-back is invoked only in response to a call to
|
||||
\Func{unw\_resume}(3), so applications which never invoke
|
||||
\Func{unw\_resume}(3) need not define the \Func{resume} callback.
|
||||
|
||||
On successful completion, the \Func{resume}() call-back must return
|
||||
zero. Otherwise, the negative value of one of the
|
||||
\Type{unw\_error\_t} error-codes may be returned. As a special case,
|
||||
when resuming execution in the local address space, the call-back will
|
||||
not return on success.
|
||||
|
||||
\subsection{get\_proc\_name}
|
||||
|
||||
\Prog{Libunwind} invokes the \Func{get\_proc\_name}() call-back to
|
||||
obtain the procedure-name of a static (not dynamically generated)
|
||||
procedure. Argument \Var{addr} is an instruction-address within the
|
||||
procedure whose name is to be obtained. The \Var{bufp} argument is a
|
||||
pointer to a character-buffer used to return the procedure name. The
|
||||
size of this buffer is specified in argument \Var{buf\_len}. The
|
||||
returned name must be terminated by a NUL character. If the
|
||||
procedure's name is longer than \Var{buf\_len} bytes, it must be
|
||||
truncated to \Var{buf\_len}\Prog{-1} bytes, with the last byte in the
|
||||
buffer set to the NUL character and -\Const{UNW\_ENOMEM} must be
|
||||
returned. Argument \Var{offp} is a pointer to a word which is used to
|
||||
return the byte-offset relative to the start of the procedure whose
|
||||
name is being returned. For example, if procedure \Func{foo}() starts
|
||||
at address 0x40003000, then invoking \Func{get\_proc\_name}() with
|
||||
\Var{addr} set to 0x40003080 should return a value of 0x80 in the word
|
||||
pointed to by \Var{offp} (assuming the procedure is at least 0x80
|
||||
bytes long).
|
||||
|
||||
On successful completion, the \Func{get\_proc\_name}() call-back must
|
||||
return zero. Otherwise, the negative value of one of the
|
||||
\Type{unw\_error\_t} error-codes may be returned.
|
||||
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_create\_addr\_space}() returns a
|
||||
non-\Const{NULL} value that represents the newly created
|
||||
address-space. Otherwise, \Const{NULL} is returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_create\_addr\_space}() is thread-safe but \emph{not}
|
||||
safe to use from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{\_U\_dyn\_register(3)},
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_destroy\_addr\_space(3)},
|
||||
\SeeAlso{unw\_get\_proc\_info(3)},
|
||||
\SeeAlso{unw\_init\_remote(3)},
|
||||
\SeeAlso{unw\_resume(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,57 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_DESTROY\\_ADDR\\_SPACE" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_destroy_addr_space
|
||||
\-\- destroy unwind address space
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
void
|
||||
unw_destroy_addr_space(unw_addr_space_t
|
||||
as);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_destroy_addr_space()
|
||||
routine destroys the
|
||||
address space specified by argument as
|
||||
and thereby releases
|
||||
all associated resources (such as memory).
|
||||
.PP
|
||||
Applications must not destroy the local address space
|
||||
unw_local_addr_space\&.
|
||||
Attempting to do so results in
|
||||
undefined behavior (e.g., the application may crash).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,40 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_destroy\_addr\_space}{David Mosberger-Tang}{Programming Library}{unw\_destroy\_addr\_space}unw\_destroy\_addr\_space -- destroy unwind address space
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t} \Var{as});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_destroy\_addr\_space}() routine destroys the
|
||||
address space specified by argument \Var{as} and thereby releases
|
||||
all associated resources (such as memory).
|
||||
|
||||
Applications must not destroy the local address space
|
||||
\Var{unw\_local\_addr\_space}. Attempting to do so results in
|
||||
undefined behavior (e.g., the application may crash).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,92 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_FLUSH\\_CACHE" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_flush_cache
|
||||
\-\- flush cached info
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
void
|
||||
unw_flush_cache(unw_addr_space_t
|
||||
as,
|
||||
unw_word_t
|
||||
lo,
|
||||
unw_word_t
|
||||
hi);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_flush_cache()
|
||||
routine flushes all cached info as it
|
||||
relates to address\-range lo
|
||||
to hi
|
||||
(non\-inclusive) in the
|
||||
target address\-space as\&.
|
||||
In addition, all info cached for
|
||||
address\-space as
|
||||
that is not tied to a particular code\-range is
|
||||
also flushed. For example, the address of the dynamic registration
|
||||
list is not tied to a code\-range and its cached value (if any) is
|
||||
flushed by a call to this routine. The address range specified by
|
||||
lo
|
||||
and hi
|
||||
should be understood as a hint:
|
||||
unw_flush_cache()
|
||||
may flush more information than requested,
|
||||
but \fInever\fP
|
||||
less. In other words, unw_flush_cache()
|
||||
may
|
||||
overflush, but not underflush.
|
||||
.PP
|
||||
As a special case, if arguments lo
|
||||
and hi
|
||||
are both 0, all
|
||||
information cached on behalf of address space as
|
||||
is flushed.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The unw_flush_cache()
|
||||
routine cannot fail and does not
|
||||
return a value.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
The unw_flush_cache()
|
||||
routine is thread\-safe as well as safe to
|
||||
use from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_set_caching_policy(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,57 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_flush\_cache}{David Mosberger-Tang}{Programming Library}{unw\_flush\_cache}unw\_flush\_cache -- flush cached info
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{void} \Func{unw\_flush\_cache}(\Type{unw\_addr\_space\_t} \Var{as}, \Type{unw\_word\_t} \Var{lo}, \Type{unw\_word\_t} \Var{hi});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_flush\_cache}() routine flushes all cached info as it
|
||||
relates to address-range \Var{lo} to \Var{hi} (non-inclusive) in the
|
||||
target address-space \Var{as}. In addition, all info cached for
|
||||
address-space \Var{as} that is not tied to a particular code-range is
|
||||
also flushed. For example, the address of the dynamic registration
|
||||
list is not tied to a code-range and its cached value (if any) is
|
||||
flushed by a call to this routine. The address range specified by
|
||||
\Var{lo} and \Var{hi} should be understood as a hint:
|
||||
\Func{unw\_flush\_cache}() may flush more information than requested,
|
||||
but \emph{never} less. In other words, \Func{unw\_flush\_cache}() may
|
||||
overflush, but not underflush.
|
||||
|
||||
As a special case, if arguments \Var{lo} and \Var{hi} are both 0, all
|
||||
information cached on behalf of address space \Var{as} is flushed.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The \Func{unw\_flush\_cache}() routine cannot fail and does not
|
||||
return a value.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
The \Func{unw\_flush\_cache}() routine is thread-safe as well as safe to
|
||||
use from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_set\_caching\_policy(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,79 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_ACCESSORS" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_accessors
|
||||
\-\- get pointer to accessor call\-backs
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
unw_accessors_t *unw_get_accessors(unw_addr_space_t as);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_accessors()
|
||||
routine returns a pointer to a
|
||||
unw_accessors_t
|
||||
structure, which contains the call\-back
|
||||
routines that were specified when address space as
|
||||
was created
|
||||
(see unw_create_addr_space(3)).
|
||||
The returned pointer is
|
||||
guaranteed to remain valid until address space as
|
||||
is destroyed
|
||||
by a call to unw_destroy_addr_space(3).
|
||||
.PP
|
||||
Note that unw_get_accessors()
|
||||
can be used to retrieve the
|
||||
call\-back routines for the local address space
|
||||
unw_local_addr_space\&.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The unw_get_accessors()
|
||||
routine cannot fail and always
|
||||
returns a valid (non\-NULL)
|
||||
pointer to an
|
||||
unw_accessors_t
|
||||
structure.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
The unw_get_accessors()
|
||||
routine is thread\-safe as well as
|
||||
safe to use from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_destroy_addr_space(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,55 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_accessors}{David Mosberger-Tang}{Programming Library}{unw\_get\_accessors}unw\_get\_accessors -- get pointer to accessor call-backs
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{unw\_accessors\_t~*}\Func{unw\_get\_accessors}(\Type{unw\_addr\_space\_t~}\Var{as});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_accessors}() routine returns a pointer to a
|
||||
\Type{unw\_accessors\_t} structure, which contains the call-back
|
||||
routines that were specified when address space \Var{as} was created
|
||||
(see \Func{unw\_create\_addr\_space}(3)). The returned pointer is
|
||||
guaranteed to remain valid until address space \Var{as} is destroyed
|
||||
by a call to \Func{unw\_destroy\_addr\_space}(3).
|
||||
|
||||
Note that \Func{unw\_get\_accessors}() can be used to retrieve the
|
||||
call-back routines for the local address space
|
||||
\Var{unw\_local\_addr\_space}.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The \Func{unw\_get\_accessors}() routine cannot fail and always
|
||||
returns a valid (non-\Const{NULL}) pointer to an
|
||||
\Type{unw\_accessors\_t} structure.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
The \Func{unw\_get\_accessors}() routine is thread-safe as well as
|
||||
safe to use from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_destroy\_addr\_space(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,111 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_FPREG" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_fpreg
|
||||
\-\- get contents of floating\-point register
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_get_fpreg(unw_cursor_t *cp,
|
||||
unw_regnum_t
|
||||
reg,
|
||||
unw_fpreg_t *valp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_fpreg()
|
||||
routine reads the value of floating\-point
|
||||
register reg
|
||||
in the stack frame identified by cursor cp
|
||||
and stores the value in the variable pointed to by valp\&.
|
||||
.PP
|
||||
The register numbering is target\-dependent and described in separate
|
||||
manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that cp
|
||||
is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee\-saved\&'') registers and frame\-related registers (such as the
|
||||
stack\-pointer). However, for signal frames (see
|
||||
unw_is_signal_frame(3)),
|
||||
it is usually possible to access
|
||||
all registers.
|
||||
.PP
|
||||
Note that unw_get_fpreg()
|
||||
can only read the contents of
|
||||
floating\-point registers. See unw_get_fpreg(3)
|
||||
for a way to
|
||||
read registers which fit in a single word.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_get_fpreg()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_get_fpreg()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
An attempt was made to read a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
.PP
|
||||
In addition, unw_get_fpreg()
|
||||
may return any error returned by
|
||||
the access_mem(),
|
||||
access_reg(),
|
||||
and
|
||||
access_fpreg()
|
||||
call\-backs (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
libunwind\-ia64(3),
|
||||
unw_get_reg(3),
|
||||
unw_is_fpreg(3),
|
||||
unw_is_signal_frame(3),
|
||||
unw_set_fpreg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,77 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_get\_fpreg}unw\_get\_fpreg -- get contents of floating-point register
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_get\_fpreg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_fpreg\_t~*}\Var{valp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_fpreg}() routine reads the value of floating-point
|
||||
register \Var{reg} in the stack frame identified by cursor \Var{cp}
|
||||
and stores the value in the variable pointed to by \Var{valp}.
|
||||
|
||||
The register numbering is target-dependent and described in separate
|
||||
manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that \Var{cp} is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee-saved'') registers and frame-related registers (such as the
|
||||
stack-pointer). However, for signal frames (see
|
||||
\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
|
||||
all registers.
|
||||
|
||||
Note that \Func{unw\_get\_fpreg}() can only read the contents of
|
||||
floating-point registers. See \Func{unw\_get\_fpreg}(3) for a way to
|
||||
read registers which fit in a single word.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_get\_fpreg}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_get\_fpreg}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] An attempt was made to read a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_get\_fpreg}() may return any error returned by
|
||||
the \Func{access\_mem}(), \Func{access\_reg}(), and
|
||||
\Func{access\_fpreg}() call-backs (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{libunwind-ia64(3)},
|
||||
\SeeAlso{unw\_get\_reg(3)},
|
||||
\SeeAlso{unw\_is\_fpreg(3)},
|
||||
\SeeAlso{unw\_is\_signal\_frame(3)},
|
||||
\SeeAlso{unw\_set\_fpreg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,203 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_PROC\\_INFO" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_proc_info
|
||||
\-\- get info on current procedure
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_get_proc_info(unw_cursor_t *cp,
|
||||
unw_proc_info_t *pip);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_proc_info()
|
||||
routine returns auxiliary
|
||||
information about the procedure that created the stack frame
|
||||
identified by argument cp\&.
|
||||
The pip
|
||||
argument is a pointer
|
||||
to a structure of type unw_proc_info_t
|
||||
which is used to
|
||||
return the information. The unw_proc_info_t
|
||||
has the
|
||||
following members:
|
||||
.TP
|
||||
unw_word_t start_ip
|
||||
The address of the first
|
||||
instruction of the procedure. If this address cannot be determined
|
||||
(e.g., due to lack of unwind information), the start_ip
|
||||
member is cleared to 0.
|
||||
.br
|
||||
.TP
|
||||
unw_word_t end_ip
|
||||
The address of the first
|
||||
instruction \fIbeyond\fP
|
||||
the end of the procedure. If this address
|
||||
cannot be determined (e.g., due to lack of unwind information),
|
||||
the end_ip
|
||||
member is cleared to 0.
|
||||
.br
|
||||
.TP
|
||||
unw_word_t lsda
|
||||
The address of the
|
||||
language\-specific data\-area (LSDA). This area normally contains
|
||||
language\-specific information needed during exception handling. If
|
||||
the procedure has no such area, this member is cleared to 0.
|
||||
.br
|
||||
.TP
|
||||
unw_word_t handler
|
||||
The address of the exception
|
||||
handler routine. This is sometimes called the \fIpersonality\fP
|
||||
routine. If the procedure does not define
|
||||
a personality routine, the handler
|
||||
member is cleared to 0.
|
||||
.br
|
||||
.TP
|
||||
unw_word_t gp
|
||||
The global\-pointer of the
|
||||
procedure. On platforms that do not use a global pointer, this
|
||||
member may contain an undefined value. On all other platforms, it
|
||||
must be set either to the correct global\-pointer value of the
|
||||
procedure or to 0 if the proper global\-pointer cannot be
|
||||
obtained for some reason.
|
||||
.br
|
||||
.TP
|
||||
unw_word_t flags
|
||||
A set of flags. There are
|
||||
currently no target\-independent flags. For the IA\-64 target, the
|
||||
flag UNW_PI_FLAG_IA64_RBS_SWITCH
|
||||
is set if the
|
||||
procedure may switch the register\-backing store.
|
||||
.br
|
||||
.TP
|
||||
int format
|
||||
The format of the unwind\-info for this
|
||||
procedure. If the unwind\-info consists of dynamic procedure info,
|
||||
format
|
||||
is equal to UNW_INFO_FORMAT_DYNAMIC\&.
|
||||
If the
|
||||
unwind\-info consists of a (target\-specific) unwind table, it is
|
||||
equal to to UNW_INFO_FORMAT_TABLE\&.
|
||||
All other values are
|
||||
reserved for future use by libunwind\&.
|
||||
This member exists
|
||||
for use by the find_proc_info()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
The
|
||||
unw_get_proc_info()
|
||||
routine
|
||||
may return an undefined value in this member.
|
||||
.br
|
||||
.TP
|
||||
int unwind_info_size
|
||||
The size of the unwind\-info
|
||||
in bytes. This member exists for use by the
|
||||
find_proc_info()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
The
|
||||
unw_get_proc_info()
|
||||
routine
|
||||
may return an undefined value in this member.
|
||||
.br
|
||||
.TP
|
||||
void *unwind_info
|
||||
The pointer to the unwind\-info.
|
||||
If no unwind info is available, this member must be set to
|
||||
NULL\&.
|
||||
This member exists for use by the
|
||||
find_proc_info()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
The
|
||||
unw_get_proc_info()
|
||||
routine
|
||||
may return an undefined value in this member.
|
||||
.br
|
||||
.PP
|
||||
Note that for the purposes of libunwind,
|
||||
the code of a
|
||||
procedure is assumed to occupy a single, contiguous range of
|
||||
addresses. For this reason, it is alwas possible to describe the
|
||||
extent of a procedure with the start_ip
|
||||
and end_ip
|
||||
members. If a single function/routine is split into multiple,
|
||||
discontiguous pieces, libunwind
|
||||
will treat each piece as a
|
||||
separate procedure.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_get_proc_info()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_get_proc_info()
|
||||
is thread\-safe. If cursor cp
|
||||
is
|
||||
in the local address\-space, this routine is also safe to use from a
|
||||
signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_ENOINFO
|
||||
Libunwind
|
||||
was unable to locate
|
||||
unwind\-info for the procedure.
|
||||
.TP
|
||||
UNW_EBADVERSION
|
||||
The unwind\-info for the procedure has
|
||||
version or format that is not understood by libunwind\&.
|
||||
.PP
|
||||
In addition, unw_get_proc_info()
|
||||
may return any error
|
||||
returned by the access_mem()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_get_proc_name(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,123 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_proc\_info}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info}unw\_get\_proc\_info -- get info on current procedure
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_proc\_info\_t~*}\Var{pip});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_proc\_info}() routine returns auxiliary
|
||||
information about the procedure that created the stack frame
|
||||
identified by argument \Var{cp}. The \Var{pip} argument is a pointer
|
||||
to a structure of type \Type{unw\_proc\_info\_t} which is used to
|
||||
return the information. The \Type{unw\_proc\_info\_t} has the
|
||||
following members:
|
||||
\begin{description}
|
||||
\item[\Type{unw\_word\_t} \Var{start\_ip}] The address of the first
|
||||
instruction of the procedure. If this address cannot be determined
|
||||
(e.g., due to lack of unwind information), the \Var{start\_ip}
|
||||
member is cleared to 0. \\
|
||||
\item[\Type{unw\_word\_t} \Var{end\_ip}] The address of the first
|
||||
instruction \emph{beyond} the end of the procedure. If this address
|
||||
cannot be determined (e.g., due to lack of unwind information),
|
||||
the \Var{end\_ip} member is cleared to 0. \\
|
||||
\item[\Type{unw\_word\_t} \Var{lsda}] The address of the
|
||||
language-specific data-area (LSDA). This area normally contains
|
||||
language-specific information needed during exception handling. If
|
||||
the procedure has no such area, this member is cleared to 0. \\
|
||||
\item[\Type{unw\_word\_t} \Var{handler}] The address of the exception
|
||||
handler routine. This is sometimes called the \emph{personality}
|
||||
routine. If the procedure does not define
|
||||
a personality routine, the \Var{handler} member is cleared to 0. \\
|
||||
\item[\Type{unw\_word\_t} \Var{gp}] The global-pointer of the
|
||||
procedure. On platforms that do not use a global pointer, this
|
||||
member may contain an undefined value. On all other platforms, it
|
||||
must be set either to the correct global-pointer value of the
|
||||
procedure or to 0 if the proper global-pointer cannot be
|
||||
obtained for some reason. \\
|
||||
\item[\Type{unw\_word\_t} \Var{flags}] A set of flags. There are
|
||||
currently no target-independent flags. For the IA-64 target, the
|
||||
flag \Const{UNW\_PI\_FLAG\_IA64\_RBS\_SWITCH} is set if the
|
||||
procedure may switch the register-backing store.\\
|
||||
\item[\Type{int} \Var{format}] The format of the unwind-info for this
|
||||
procedure. If the unwind-info consists of dynamic procedure info,
|
||||
\Var{format} is equal to \Const{UNW\_INFO\_FORMAT\_DYNAMIC}. If the
|
||||
unwind-info consists of a (target-specific) unwind table, it is
|
||||
equal to to \Const{UNW\_INFO\_FORMAT\_TABLE}. All other values are
|
||||
reserved for future use by \Prog{libunwind}. This member exists
|
||||
for use by the \Func{find\_proc\_info}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)). The
|
||||
\Func{unw\_get\_proc\_info}() routine
|
||||
may return an undefined value in this member. \\
|
||||
\item[\Type{int} \Var{unwind\_info\_size}] The size of the unwind-info
|
||||
in bytes. This member exists for use by the
|
||||
\Func{find\_proc\_info}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)). The
|
||||
\Func{unw\_get\_proc\_info}() routine
|
||||
may return an undefined value in this member.\\
|
||||
\item[\Type{void~*}\Var{unwind\_info}] The pointer to the unwind-info.
|
||||
If no unwind info is available, this member must be set to
|
||||
\Const{NULL}. This member exists for use by the
|
||||
\Func{find\_proc\_info}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)). The
|
||||
\Func{unw\_get\_proc\_info}() routine
|
||||
may return an undefined value in this member.\\
|
||||
\end{description}
|
||||
Note that for the purposes of \Prog{libunwind}, the code of a
|
||||
procedure is assumed to occupy a single, contiguous range of
|
||||
addresses. For this reason, it is alwas possible to describe the
|
||||
extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
|
||||
members. If a single function/routine is split into multiple,
|
||||
discontiguous pieces, \Prog{libunwind} will treat each piece as a
|
||||
separate procedure.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_get\_proc\_info}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_get\_proc\_info}() is thread-safe. If cursor \Var{cp} is
|
||||
in the local address-space, this routine is also safe to use from a
|
||||
signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
|
||||
unwind-info for the procedure.
|
||||
\item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
|
||||
version or format that is not understood by \Prog{libunwind}.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_get\_proc\_info}() may return any error
|
||||
returned by the \Func{access\_mem}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_get\_proc\_name(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,134 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_PROC\\_INFO\\_BY\\_IP" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_proc_info_by_ip
|
||||
\-\- get procedure info by IP
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_get_proc_info_by_ip(unw_addr_space_t as,
|
||||
unw_word_t ip,
|
||||
unw_proc_info_t *pip,
|
||||
void *arg);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_proc_info_by_ip()
|
||||
routine returns the same
|
||||
kind of auxiliary information about a procedure as
|
||||
unw_get_proc_info(),
|
||||
except that the info is looked up by
|
||||
instruction\-pointer (IP) instead of a cursor. This is more flexible
|
||||
because it is possible to look up the info for an arbitrary procedure,
|
||||
even if it is not part of the current call\-chain. However, since it
|
||||
is more flexible, it also tends to run slower (and often much slower)
|
||||
than unw_get_proc_info().
|
||||
.PP
|
||||
The routine expects the followins arguments: as
|
||||
is the
|
||||
address\-space in which the instruction\-pointer should be looked up.
|
||||
For a look\-up in the local address\-space,
|
||||
unw_local_addr_space
|
||||
can be passed for this argument.
|
||||
Argument ip
|
||||
is the instruction\-pointer for which the procedure
|
||||
info should be looked up and pip
|
||||
is a pointer to a structure of
|
||||
type unw_proc_info_t
|
||||
which is used to return the info.
|
||||
Lastly, arg
|
||||
is the address\-space argument that should be used
|
||||
when accessing the address\-space. It has the same purpose as the
|
||||
argument of the same name for unw_init_remote().
|
||||
When
|
||||
accessing the local address\-space (first argument is
|
||||
unw_local_addr_space),
|
||||
NULL
|
||||
must be passed for this
|
||||
argument.
|
||||
.PP
|
||||
Note that for the purposes of libunwind,
|
||||
the code of a
|
||||
procedure is assumed to occupy a single, contiguous range of
|
||||
addresses. For this reason, it is alwas possible to describe the
|
||||
extent of a procedure with the start_ip
|
||||
and end_ip
|
||||
members. If a single function/routine is split into multiple,
|
||||
discontiguous pieces, libunwind
|
||||
will treat each piece as a
|
||||
separate procedure.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_get_proc_info_by_ip()
|
||||
returns 0. Otherwise the negative value of one of the error\-codes
|
||||
below is returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_get_proc_info()
|
||||
is thread\-safe. If the local
|
||||
address\-space is passed in argument as,
|
||||
this routine is also
|
||||
safe to use from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_ENOINFO
|
||||
Libunwind
|
||||
was unable to locate
|
||||
unwind\-info for the procedure.
|
||||
.TP
|
||||
UNW_EBADVERSION
|
||||
The unwind\-info for the procedure has
|
||||
version or format that is not understood by libunwind\&.
|
||||
.PP
|
||||
In addition, unw_get_proc_info()
|
||||
may return any error
|
||||
returned by the access_mem()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_get_proc_name(3),
|
||||
unw_get_proc_info(3),
|
||||
unw_init_remote(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,91 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_proc\_info\_by\_ip}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info\_by\_ip}unw\_get\_proc\_info\_by\_ip -- get procedure info by IP
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_get\_proc\_info\_by\_ip}(\Type{unw\_addr\_space\_t~}\Var{as}, \Type{unw\_word\_t~}\Var{ip}, \Type{unw\_proc\_info\_t~*}\Var{pip}, \Type{void~*}\Var{arg});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_proc\_info\_by\_ip}() routine returns the same
|
||||
kind of auxiliary information about a procedure as
|
||||
\Func{unw\_get\_proc\_info}(), except that the info is looked up by
|
||||
instruction-pointer (IP) instead of a cursor. This is more flexible
|
||||
because it is possible to look up the info for an arbitrary procedure,
|
||||
even if it is not part of the current call-chain. However, since it
|
||||
is more flexible, it also tends to run slower (and often much slower)
|
||||
than \Func{unw\_get\_proc\_info}().
|
||||
|
||||
The routine expects the followins arguments: \Var{as} is the
|
||||
address-space in which the instruction-pointer should be looked up.
|
||||
For a look-up in the local address-space,
|
||||
\Var{unw\_local\_addr\_space} can be passed for this argument.
|
||||
Argument \Var{ip} is the instruction-pointer for which the procedure
|
||||
info should be looked up and \Var{pip} is a pointer to a structure of
|
||||
type \Type{unw\_proc\_info\_t} which is used to return the info.
|
||||
Lastly, \Var{arg} is the address-space argument that should be used
|
||||
when accessing the address-space. It has the same purpose as the
|
||||
argument of the same name for \Func{unw\_init\_remote}(). When
|
||||
accessing the local address-space (first argument is
|
||||
\Var{unw\_local\_addr\_space}), \Const{NULL} must be passed for this
|
||||
argument.
|
||||
|
||||
Note that for the purposes of \Prog{libunwind}, the code of a
|
||||
procedure is assumed to occupy a single, contiguous range of
|
||||
addresses. For this reason, it is alwas possible to describe the
|
||||
extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
|
||||
members. If a single function/routine is split into multiple,
|
||||
discontiguous pieces, \Prog{libunwind} will treat each piece as a
|
||||
separate procedure.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_get\_proc\_info\_by\_ip}()
|
||||
returns 0. Otherwise the negative value of one of the error-codes
|
||||
below is returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_get\_proc\_info}() is thread-safe. If the local
|
||||
address-space is passed in argument \Var{as}, this routine is also
|
||||
safe to use from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
|
||||
unwind-info for the procedure.
|
||||
\item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
|
||||
version or format that is not understood by \Prog{libunwind}.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_get\_proc\_info}() may return any error
|
||||
returned by the \Func{access\_mem}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_get\_proc\_name(3)},
|
||||
\SeeAlso{unw\_get\_proc\_info(3)},
|
||||
\SeeAlso{unw\_init\_remote(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,123 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_PROC\\_NAME" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_proc_name
|
||||
\-\- get name of current procedure
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_get_proc_name(unw_cursor_t *cp,
|
||||
char *bufp,
|
||||
size_t
|
||||
len,
|
||||
unw_word_t *offp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_proc_name()
|
||||
routine returns the name of the
|
||||
procedure that created the stack frame identified by argument
|
||||
cp\&.
|
||||
The bufp
|
||||
argument is a pointer to a character buffer
|
||||
that is at least len
|
||||
bytes long. This buffer is used to return
|
||||
the name of the procedure. The offp
|
||||
argument is a pointer to a
|
||||
word that is used to return the byte\-offset of the instruction\-pointer
|
||||
saved in the stack frame identified by cp,
|
||||
relative to the start
|
||||
of the procedure. For example, if procedure foo()
|
||||
starts at
|
||||
address 0x40003000, then invoking unw_get_proc_name()
|
||||
on a
|
||||
stack frame with an instruction\-pointer value of 0x40003080 would
|
||||
return a value of 0x80 in the word pointed to by offp
|
||||
(assuming
|
||||
the procedure is at least 0x80 bytes long).
|
||||
.PP
|
||||
Note that on some platforms there is no reliable way to distinguish
|
||||
between procedure names and ordinary labels. Furthermore, if symbol
|
||||
information has been stripped from a program, procedure names may be
|
||||
completely unavailable or may be limited to those exported via a
|
||||
dynamic symbol table. In such cases, unw_get_proc_name()
|
||||
may return the name of a label or a preceeding (nearby) procedure.
|
||||
However, the offset returned through offp
|
||||
is always relative to
|
||||
the returned name, which ensures that the value (address) of the
|
||||
returned name plus the returned offset will always be equal to the
|
||||
instruction\-pointer of the stack frame identified by cp\&.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_get_proc_name()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_get_proc_name()
|
||||
is thread\-safe. If cursor cp
|
||||
is
|
||||
in the local address\-space, this routine is also safe to use from a
|
||||
signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_ENOINFO
|
||||
Libunwind
|
||||
was unable to determine
|
||||
the name of the procedure.
|
||||
.TP
|
||||
UNW_ENOMEM
|
||||
The procedure name is too long to fit
|
||||
in the buffer provided. A truncated version of the name has been
|
||||
returned.
|
||||
.PP
|
||||
In addition, unw_get_proc_name()
|
||||
may return any error
|
||||
returned by the access_mem()
|
||||
call\-back (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_get_proc_info(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,82 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_proc\_name}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_name}unw\_get\_proc\_name -- get name of current procedure
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_get\_proc\_name}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{char~*}\Var{bufp}, \Type{size\_t} \Var{len}, \Type{unw\_word\_t~*}\Var{offp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_proc\_name}() routine returns the name of the
|
||||
procedure that created the stack frame identified by argument
|
||||
\Var{cp}. The \Var{bufp} argument is a pointer to a character buffer
|
||||
that is at least \Var{len} bytes long. This buffer is used to return
|
||||
the name of the procedure. The \Var{offp} argument is a pointer to a
|
||||
word that is used to return the byte-offset of the instruction-pointer
|
||||
saved in the stack frame identified by \Var{cp}, relative to the start
|
||||
of the procedure. For example, if procedure \Func{foo}() starts at
|
||||
address 0x40003000, then invoking \Func{unw\_get\_proc\_name}() on a
|
||||
stack frame with an instruction-pointer value of 0x40003080 would
|
||||
return a value of 0x80 in the word pointed to by \Var{offp} (assuming
|
||||
the procedure is at least 0x80 bytes long).
|
||||
|
||||
Note that on some platforms there is no reliable way to distinguish
|
||||
between procedure names and ordinary labels. Furthermore, if symbol
|
||||
information has been stripped from a program, procedure names may be
|
||||
completely unavailable or may be limited to those exported via a
|
||||
dynamic symbol table. In such cases, \Func{unw\_get\_proc\_name}()
|
||||
may return the name of a label or a preceeding (nearby) procedure.
|
||||
However, the offset returned through \Var{offp} is always relative to
|
||||
the returned name, which ensures that the value (address) of the
|
||||
returned name plus the returned offset will always be equal to the
|
||||
instruction-pointer of the stack frame identified by \Var{cp}.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_get\_proc\_name}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_get\_proc\_name}() is thread-safe. If cursor \Var{cp} is
|
||||
in the local address-space, this routine is also safe to use from a
|
||||
signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to determine
|
||||
the name of the procedure.
|
||||
\item[\Const{UNW\_ENOMEM}] The procedure name is too long to fit
|
||||
in the buffer provided. A truncated version of the name has been
|
||||
returned.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_get\_proc\_name}() may return any error
|
||||
returned by the \Func{access\_mem}() call-back (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_get\_proc\_info(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,112 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GET\\_REG" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_get_reg
|
||||
\-\- get register contents
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_get_reg(unw_cursor_t *cp,
|
||||
unw_regnum_t
|
||||
reg,
|
||||
unw_word_t *valp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_get_reg()
|
||||
routine reads the value of register
|
||||
reg
|
||||
in the stack frame identified by cursor cp
|
||||
and stores
|
||||
the value in the word pointed to by valp\&.
|
||||
.PP
|
||||
The register numbering is target\-dependent and described in separate
|
||||
manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that cp
|
||||
is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee\-saved\&'') registers and frame\-related registers (such as the
|
||||
stack\-pointer). However, for signal frames (see
|
||||
unw_is_signal_frame(3)),
|
||||
it is usually possible to access
|
||||
all registers.
|
||||
.PP
|
||||
Note that unw_get_reg()
|
||||
can only read the contents of
|
||||
registers whose values fit in a single word. See
|
||||
unw_get_fpreg(3)
|
||||
for a way to read registers which do not fit
|
||||
this constraint.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_get_reg()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_get_reg()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
An attempt was made to read a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
.PP
|
||||
In addition, unw_get_reg()
|
||||
may return any error returned by
|
||||
the access_mem(),
|
||||
access_reg(),
|
||||
and
|
||||
access_fpreg()
|
||||
call\-backs (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
libunwind\-ia64(3),
|
||||
unw_get_fpreg(3),
|
||||
unw_is_signal_frame(3),
|
||||
unw_set_reg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,77 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_get\_reg}{David Mosberger-Tang}{Programming Library}{unw\_get\_reg}unw\_get\_reg -- get register contents
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_get\_reg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_word\_t~*}\Var{valp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_get\_reg}() routine reads the value of register
|
||||
\Var{reg} in the stack frame identified by cursor \Var{cp} and stores
|
||||
the value in the word pointed to by \Var{valp}.
|
||||
|
||||
The register numbering is target-dependent and described in separate
|
||||
manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that \Var{cp} is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee-saved'') registers and frame-related registers (such as the
|
||||
stack-pointer). However, for signal frames (see
|
||||
\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
|
||||
all registers.
|
||||
|
||||
Note that \Func{unw\_get\_reg}() can only read the contents of
|
||||
registers whose values fit in a single word. See
|
||||
\Func{unw\_get\_fpreg}(3) for a way to read registers which do not fit
|
||||
this constraint.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_get\_reg}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_get\_reg}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] An attempt was made to read a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_get\_reg}() may return any error returned by
|
||||
the \Func{access\_mem}(), \Func{access\_reg}(), and
|
||||
\Func{access\_fpreg}() call-backs (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{libunwind-ia64(3)},
|
||||
\SeeAlso{unw\_get\_fpreg(3)},
|
||||
\SeeAlso{unw\_is\_signal\_frame(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,93 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_GETCONTEXT" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_getcontext
|
||||
\-\- get initial machine\-state
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_getcontext(unw_context_t *ucp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_getcontext()
|
||||
routine initializes the context structure
|
||||
pointed to by ucp
|
||||
with the machine\-state of the call\-site. The
|
||||
exact set of registers stored by unw_getcontext()
|
||||
is
|
||||
platform\-specific, but, in general, at least all preserved
|
||||
(``callee\-saved\&'') and all frame\-related registers, such as the
|
||||
stack\-pointer, will be stored.
|
||||
.PP
|
||||
This routine is normally implemented as a macro and applications
|
||||
should not attempt to take its address.
|
||||
.PP
|
||||
.SH PLATFORM\-SPECIFIC NOTES
|
||||
|
||||
.PP
|
||||
On IA\-64, unw_context_t
|
||||
has a layout that is compatible with
|
||||
that of ucontext_t
|
||||
and such structures can be initialized with
|
||||
getcontext()
|
||||
instead of unw_getcontext().
|
||||
However, the
|
||||
reverse is \fInot\fP
|
||||
true and it is \fInot\fP
|
||||
safe to use structures
|
||||
initialized by unw_getcontext()
|
||||
in places where a structure
|
||||
initialized by getcontext()
|
||||
is expected. The reason for this
|
||||
asymmetry is that unw_getcontext()
|
||||
is optimized for maximum
|
||||
performance and does not, for example, save the signal mask.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_getcontext()
|
||||
returns 0.
|
||||
Otherwise, a value of \-1 is returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_getcontext()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_init_local(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,63 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_getcontext}{David Mosberger-Tang}{Programming Library}{unw\_getcontext}unw\_getcontext -- get initial machine-state
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_getcontext}(\Type{unw\_context\_t~*}\Var{ucp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_getcontext}() routine initializes the context structure
|
||||
pointed to by \Var{ucp} with the machine-state of the call-site. The
|
||||
exact set of registers stored by \Func{unw\_getcontext}() is
|
||||
platform-specific, but, in general, at least all preserved
|
||||
(``callee-saved'') and all frame-related registers, such as the
|
||||
stack-pointer, will be stored.
|
||||
|
||||
This routine is normally implemented as a macro and applications
|
||||
should not attempt to take its address.
|
||||
|
||||
\section{Platform-specific Notes}
|
||||
|
||||
On IA-64, \Type{unw\_context\_t} has a layout that is compatible with
|
||||
that of \Type{ucontext\_t} and such structures can be initialized with
|
||||
\Func{getcontext}() instead of \Func{unw\_getcontext}(). However, the
|
||||
reverse is \emph{not} true and it is \emph{not} safe to use structures
|
||||
initialized by \Func{unw\_getcontext()} in places where a structure
|
||||
initialized by \Func{getcontext()} is expected. The reason for this
|
||||
asymmetry is that \Func{unw\_getcontext()} is optimized for maximum
|
||||
performance and does not, for example, save the signal mask.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_getcontext}() returns 0.
|
||||
Otherwise, a value of -1 is returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_getcontext}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_init\_local(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,119 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_INIT\\_LOCAL" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_init_local
|
||||
\-\- initialize cursor for local unwinding
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_init_local(unw_cursor_t *c,
|
||||
unw_context_t *ctxt);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_init_local()
|
||||
routine initializes the unwind cursor
|
||||
pointed to by c
|
||||
with the machine\-state in the context structure
|
||||
pointed to by ctxt\&.
|
||||
As such, the machine\-state pointed to by
|
||||
ctxt
|
||||
identifies the initial stack frame at which unwinding
|
||||
starts. The machine\-state must remain valid for the duration for
|
||||
which the cursor c
|
||||
is in use.
|
||||
.PP
|
||||
The unw_init_local()
|
||||
routine can be used only for unwinding in
|
||||
the address space of the current process (i.e., for local unwinding).
|
||||
For all other cases, unw_init_remote()
|
||||
must be used instead.
|
||||
From a behavioral point of view, the call:
|
||||
.PP
|
||||
.Vb
|
||||
ret = unw_init_local(&cursor, &ucontext);
|
||||
.Ve
|
||||
is equivalent to:
|
||||
.PP
|
||||
.Vb
|
||||
ret = unw_init_remote(&cursor, unw_local_addr_space,
|
||||
&ucontext);
|
||||
.Ve
|
||||
However, unwind performance may be better when using
|
||||
unw_init_local().
|
||||
Also, unw_init_local()
|
||||
is
|
||||
available even when UNW_LOCAL_ONLY
|
||||
has been defined before
|
||||
including <libunwind.h>,
|
||||
whereas unw_init_remote()
|
||||
is not.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_init_local()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_init_local()
|
||||
is thread\-safe as well as safe to use from a
|
||||
signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EINVAL
|
||||
unw_init_local()
|
||||
was called in a
|
||||
version of libunwind
|
||||
which supports remote unwinding only
|
||||
(this normally happens when calling unw_init_local()
|
||||
for a
|
||||
cross\-platform version of libunwind).
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
A register needed by unw_init_local()
|
||||
wasn\&'t accessible.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_init_remote(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,81 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_init\_local}{David Mosberger-Tang}{Programming Library}{unw\_init\_local}unw\_init\_local -- initialize cursor for local unwinding
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_context\_t~*}\Var{ctxt});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_init\_local}() routine initializes the unwind cursor
|
||||
pointed to by \Var{c} with the machine-state in the context structure
|
||||
pointed to by \Var{ctxt}. As such, the machine-state pointed to by
|
||||
\Var{ctxt} identifies the initial stack frame at which unwinding
|
||||
starts. The machine-state must remain valid for the duration for
|
||||
which the cursor \Var{c} is in use.
|
||||
|
||||
The \Func{unw\_init\_local}() routine can be used only for unwinding in
|
||||
the address space of the current process (i.e., for local unwinding).
|
||||
For all other cases, \Func{unw\_init\_remote}() must be used instead.
|
||||
From a behavioral point of view, the call:
|
||||
|
||||
\begin{verbatim}
|
||||
ret = unw_init_local(&cursor, &ucontext);
|
||||
\end{verbatim}
|
||||
is equivalent to:
|
||||
|
||||
\begin{verbatim}
|
||||
ret = unw_init_remote(&cursor, unw_local_addr_space,
|
||||
&ucontext);
|
||||
\end{verbatim}
|
||||
However, unwind performance may be better when using
|
||||
\Func{unw\_init\_local}(). Also, \Func{unw\_init\_local}() is
|
||||
available even when \Const{UNW\_LOCAL\_ONLY} has been defined before
|
||||
including \File{$<$libunwind.h$>$}, whereas \Func{unw\_init\_remote}()
|
||||
is not.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_init\_local}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_init\_local}() is thread-safe as well as safe to use from a
|
||||
signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EINVAL}] \Func{unw\_init\_local}() was called in a
|
||||
version of \Prog{libunwind} which supports remote unwinding only
|
||||
(this normally happens when calling \Func{unw\_init\_local}() for a
|
||||
cross-platform version of \Prog{libunwind}).
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] A register needed by \Func{unw\_init\_local}()
|
||||
wasn't accessible.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)}, \SeeAlso{unw\_init\_remote(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,123 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_INIT\\_REMOTE" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_init_remote
|
||||
\-\- initialize cursor for remote unwinding
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_init_remote(unw_cursor_t *c,
|
||||
unw_addr_space_t as,
|
||||
void *arg);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_init_remote()
|
||||
routine initializes the unwind cursor
|
||||
pointed to by c
|
||||
for unwinding in the address space identified by
|
||||
as\&.
|
||||
The as
|
||||
argument can either be set to
|
||||
unw_local_addr_space
|
||||
(local address space) or to an arbitrary
|
||||
address space created with unw_create_addr_space().
|
||||
.PP
|
||||
The arg
|
||||
void\-pointer tells the address space exactly what entity
|
||||
should be unwound. For example, if unw_local_addr_space
|
||||
is
|
||||
passed in as,
|
||||
then arg
|
||||
needs to be a pointer to a context
|
||||
structure containing the machine\-state of the initial stack frame.
|
||||
However, other address\-spaces may instead expect a process\-id, a
|
||||
thread\-id, or a pointer to an arbitrary structure which identifies the
|
||||
stack\-frame chain to be unwound. In other words, the interpretation
|
||||
of arg
|
||||
is entirely dependent on the address\-space in use;
|
||||
libunwind
|
||||
never interprets the argument in any way on its own.
|
||||
.PP
|
||||
Note that unw_init_remote()
|
||||
can be used to initiate unwinding
|
||||
in \fIany\fP
|
||||
process, including the local process in which the
|
||||
unwinder itself is running. However, for local unwinding, it is
|
||||
generally preferable to use unw_init_local()
|
||||
instead, because
|
||||
it is easier to use and because it may perform better.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_init_remote()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_init_remote()
|
||||
is thread\-safe. If the local address\-space
|
||||
is passed in argument as,
|
||||
this routine is also safe to use from
|
||||
a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EINVAL
|
||||
unw_init_remote()
|
||||
was called in a
|
||||
version of libunwind
|
||||
which supports local unwinding only
|
||||
(this normally happens when defining UNW_LOCAL_ONLY
|
||||
before
|
||||
including <libunwind.h>
|
||||
and then calling
|
||||
unw_init_remote()).
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
A register needed by unw_init_remote()
|
||||
wasn\&'t accessible.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_init_local(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,79 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_init\_remote}{David Mosberger-Tang}{Programming Library}{unw\_init\_remote}unw\_init\_remote -- initialize cursor for remote unwinding
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_init\_remote}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_addr\_space\_t~}\Var{as}, \Type{void~*}\Var{arg});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_init\_remote}() routine initializes the unwind cursor
|
||||
pointed to by \Var{c} for unwinding in the address space identified by
|
||||
\Var{as}. The \Var{as} argument can either be set to
|
||||
\Var{unw\_local\_addr\_space} (local address space) or to an arbitrary
|
||||
address space created with \Func{unw\_create\_addr\_space}().
|
||||
|
||||
The \Var{arg} void-pointer tells the address space exactly what entity
|
||||
should be unwound. For example, if \Var{unw\_local\_addr\_space} is
|
||||
passed in \Var{as}, then \Var{arg} needs to be a pointer to a context
|
||||
structure containing the machine-state of the initial stack frame.
|
||||
However, other address-spaces may instead expect a process-id, a
|
||||
thread-id, or a pointer to an arbitrary structure which identifies the
|
||||
stack-frame chain to be unwound. In other words, the interpretation
|
||||
of \Var{arg} is entirely dependent on the address-space in use;
|
||||
\Prog{libunwind} never interprets the argument in any way on its own.
|
||||
|
||||
Note that \Func{unw\_init\_remote}() can be used to initiate unwinding
|
||||
in \emph{any} process, including the local process in which the
|
||||
unwinder itself is running. However, for local unwinding, it is
|
||||
generally preferable to use \Func{unw\_init\_local}() instead, because
|
||||
it is easier to use and because it may perform better.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_init\_remote}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_init\_remote}() is thread-safe. If the local address-space
|
||||
is passed in argument \Var{as}, this routine is also safe to use from
|
||||
a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EINVAL}] \Func{unw\_init\_remote}() was called in a
|
||||
version of \Prog{libunwind} which supports local unwinding only
|
||||
(this normally happens when defining \Const{UNW\_LOCAL\_ONLY} before
|
||||
including \File{$<$libunwind.h$>$} and then calling
|
||||
\Func{unw\_init\_remote}()).
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] A register needed by \Func{unw\_init\_remote}()
|
||||
wasn't accessible.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)}, \SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_init\_local(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,73 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_IS\\_FPREG" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_is_fpreg
|
||||
\-\- check if a register is a floating\-point register
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_is_fpreg(unw_regnum_t
|
||||
reg);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_is_fpreg()
|
||||
routine checks whether register number
|
||||
reg
|
||||
is a floating\-point register.
|
||||
.PP
|
||||
This routine is normally implemented as a macro and applications
|
||||
should not attempt to take its address.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The unw_is_fpreg()
|
||||
routine returns a non\-zero value if
|
||||
reg
|
||||
is a floating\-point register. Otherwise, it returns a value
|
||||
of 0.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_is_fpreg()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_get_reg(3),
|
||||
unw_set_reg(3),
|
||||
unw_get_fpreg(3),
|
||||
unw_set_fpreg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,52 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_is\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_is\_fpreg}unw\_is\_fpreg -- check if a register is a floating-point register
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t} \Var{reg});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_is\_fpreg}() routine checks whether register number
|
||||
\Var{reg} is a floating-point register.
|
||||
|
||||
This routine is normally implemented as a macro and applications
|
||||
should not attempt to take its address.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The \Func{unw\_is\_fpreg}() routine returns a non-zero value if
|
||||
\Var{reg} is a floating-point register. Otherwise, it returns a value
|
||||
of 0.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_is\_fpreg}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_get\_reg(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)},
|
||||
\SeeAlso{unw\_get\_fpreg(3)},
|
||||
\SeeAlso{unw\_set\_fpreg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,88 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_IS\\_SIGNAL\\_FRAME" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_is_signal_frame
|
||||
\-\- check if current frame is a signal frame
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_is_signal_frame(unw_cursor_t *cp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_is_signal_frame()
|
||||
routine returns a positive value
|
||||
if the current frame identified by cp
|
||||
is a signal frame, and a
|
||||
value of 0 otherwise. For the purpose of this discussion, a signal
|
||||
frame is a frame that was created in response to a potentially
|
||||
asynchronous interruption. For UNIX and UNIX\-like platforms, such
|
||||
frames are normally created by the kernel when delivering a signal.
|
||||
In a kernel\-environment, a signal frame might, for example, correspond
|
||||
to a frame created in response to a device interrupt.
|
||||
.PP
|
||||
Signal frames are somewhat unusual because the asynchronous nature of
|
||||
the events that create them require storing the contents of registers
|
||||
that are normally treated as scratch (``caller\-saved\&'') registers.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_is_signal_frame()
|
||||
returns a
|
||||
positive value if the current frame is a signal frame, or 0 if it is
|
||||
not. Otherwise, a negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_is_signal_frame()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_ENOINFO
|
||||
Libunwind
|
||||
is unable to determine
|
||||
whether or not the current frame is a signal frame.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_get_reg(3),
|
||||
unw_set_reg(3),
|
||||
unw_get_fpreg(3),
|
||||
unw_set_fpreg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,67 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_is\_signal\_frame}{David Mosberger-Tang}{Programming Library}{unw\_is\_signal\_frame}unw\_is\_signal\_frame -- check if current frame is a signal frame
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_is\_signal\_frame}(\Type{unw\_cursor\_t~*}\Var{cp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_is\_signal\_frame}() routine returns a positive value
|
||||
if the current frame identified by \Var{cp} is a signal frame, and a
|
||||
value of 0 otherwise. For the purpose of this discussion, a signal
|
||||
frame is a frame that was created in response to a potentially
|
||||
asynchronous interruption. For UNIX and UNIX-like platforms, such
|
||||
frames are normally created by the kernel when delivering a signal.
|
||||
In a kernel-environment, a signal frame might, for example, correspond
|
||||
to a frame created in response to a device interrupt.
|
||||
|
||||
Signal frames are somewhat unusual because the asynchronous nature of
|
||||
the events that create them require storing the contents of registers
|
||||
that are normally treated as scratch (``caller-saved'') registers.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_is\_signal\_frame}() returns a
|
||||
positive value if the current frame is a signal frame, or 0 if it is
|
||||
not. Otherwise, a negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_is\_signal\_frame}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} is unable to determine
|
||||
whether or not the current frame is a signal frame.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_get\_reg(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)},
|
||||
\SeeAlso{unw\_get\_fpreg(3)},
|
||||
\SeeAlso{unw\_set\_fpreg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,68 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_REGNAME" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_regname
|
||||
\-\- get register name
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
const char *unw_regname(unw_regnum_t
|
||||
regnum);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_regname()
|
||||
routine returns a printable name for
|
||||
register regnum\&.
|
||||
If regnum
|
||||
is an invalid or otherwise
|
||||
unrecognized register number, a string consisting of three question
|
||||
marks is returned. The returned string is statically allocated and
|
||||
therefore guaranteed to remain valid until the application terminates.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The unw_regname()
|
||||
routine cannot fail and always returns a
|
||||
valid (non\-NULL)
|
||||
string.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
The unw_regname()
|
||||
routine is thread\-safe as well as safe to
|
||||
use from a signal handler.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,47 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_regname}{David Mosberger-Tang}{Programming Library}{unw\_regname}unw\_regname -- get register name
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{const char~*}\Func{unw\_regname}(\Type{unw\_regnum\_t} \Var{regnum});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_regname}() routine returns a printable name for
|
||||
register \Var{regnum}. If \Var{regnum} is an invalid or otherwise
|
||||
unrecognized register number, a string consisting of three question
|
||||
marks is returned. The returned string is statically allocated and
|
||||
therefore guaranteed to remain valid until the application terminates.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The \Func{unw\_regname}() routine cannot fail and always returns a
|
||||
valid (non-\Const{NULL}) string.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
The \Func{unw\_regname}() routine is thread-safe as well as safe to
|
||||
use from a signal handler.
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,146 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_RESUME" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_resume
|
||||
\-\- resume execution in a particular stack frame
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_resume(unw_cursor_t *cp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_resume()
|
||||
routine resumes execution at the stack frame
|
||||
identified by cp\&.
|
||||
The behavior of this routine differs
|
||||
slightly for local and remote unwinding.
|
||||
.PP
|
||||
For local unwinding, unw_resume()
|
||||
restores the machine state
|
||||
and then directly resumes execution in the target stack frame. Thus
|
||||
unw_resume()
|
||||
does not return in this case. Restoring the
|
||||
machine state normally involves restoring the ``preserved\&''
|
||||
(callee\-saved) registers. However, if execution in any of the stack
|
||||
frames younger (more deeply nested) than the one identified by
|
||||
cp
|
||||
was interrupted by a signal, then unw_resume()
|
||||
will
|
||||
restore all registers as well as the signal mask. Attempting to call
|
||||
unw_resume()
|
||||
on a cursor which identifies the stack frame of
|
||||
another thread results in undefined behavior (e.g., the program may
|
||||
crash).
|
||||
.PP
|
||||
For remote unwinding, unw_resume()
|
||||
installs the machine state
|
||||
identified by the cursor by calling the access_reg
|
||||
and
|
||||
access_fpreg
|
||||
accessor callbacks as needed. Once that is
|
||||
accomplished, the resume
|
||||
accessor callback is invoked. The
|
||||
unw_resume
|
||||
routine then returns normally (that is, unlikely
|
||||
for local unwinding, unw_resume
|
||||
will always return for remote
|
||||
unwinding).
|
||||
.PP
|
||||
Most platforms reserve some registers to pass arguments to exception
|
||||
handlers (e.g., IA\-64 uses r15\-r18
|
||||
for this
|
||||
purpose). These registers are normally treated like ``scratch\&''
|
||||
registers. However, if libunwind
|
||||
is used to set an exception
|
||||
argument register to a particular value (e.g., via
|
||||
unw_set_reg()),
|
||||
then unw_resume()
|
||||
will install this
|
||||
value as the contents of the register. In other words, the exception
|
||||
handling arguments are installed even in cases where normally only the
|
||||
``preserved\&'' registers are restored.
|
||||
.PP
|
||||
Note that unw_resume()
|
||||
does \fInot\fP
|
||||
invoke any unwind
|
||||
handlers (aka, ``personality routines\&''). If a program needs this, it
|
||||
will have to do so on its own by obtaining the unw_proc_info_t
|
||||
of each unwound frame and appropriately processing its unwind handler
|
||||
and language\-specific data area (lsda). These steps are generally
|
||||
dependent on the target\-platform and are regulated by the
|
||||
processor\-specific ABI (application\-binary interface).
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
For local unwinding, unw_resume()
|
||||
does not return on success.
|
||||
For remote unwinding, it returns 0 on success. On failure, the
|
||||
negative value of one of the errors below is returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_resume()
|
||||
is thread\-safe. If cursor cp
|
||||
is in the
|
||||
local address\-space, this routine is also safe to use from a signal
|
||||
handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
A register needed by unw_resume()
|
||||
wasn\&'t
|
||||
accessible.
|
||||
.TP
|
||||
UNW_EINVALIDIP
|
||||
The instruction pointer identified by
|
||||
cp
|
||||
is not valid.
|
||||
.TP
|
||||
UNW_BADFRAME
|
||||
The stack frame identified by
|
||||
cp
|
||||
is not valid.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_set_reg(3),
|
||||
sigprocmask(2)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,99 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_resume}{David Mosberger-Tang}{Programming Library}{unw\_resume}unw\_resume -- resume execution in a particular stack frame
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_resume}(\Type{unw\_cursor\_t~*}\Var{cp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_resume}() routine resumes execution at the stack frame
|
||||
identified by \Var{cp}. The behavior of this routine differs
|
||||
slightly for local and remote unwinding.
|
||||
|
||||
For local unwinding, \Func{unw\_resume}() restores the machine state
|
||||
and then directly resumes execution in the target stack frame. Thus
|
||||
\Func{unw\_resume}() does not return in this case. Restoring the
|
||||
machine state normally involves restoring the ``preserved''
|
||||
(callee-saved) registers. However, if execution in any of the stack
|
||||
frames younger (more deeply nested) than the one identified by
|
||||
\Var{cp} was interrupted by a signal, then \Func{unw\_resume}() will
|
||||
restore all registers as well as the signal mask. Attempting to call
|
||||
\Func{unw\_resume}() on a cursor which identifies the stack frame of
|
||||
another thread results in undefined behavior (e.g., the program may
|
||||
crash).
|
||||
|
||||
For remote unwinding, \Func{unw\_resume}() installs the machine state
|
||||
identified by the cursor by calling the \Func{access\_reg} and
|
||||
\Func{access\_fpreg} accessor callbacks as needed. Once that is
|
||||
accomplished, the \Func{resume} accessor callback is invoked. The
|
||||
\Func{unw\_resume} routine then returns normally (that is, unlikely
|
||||
for local unwinding, \Func{unw\_resume} will always return for remote
|
||||
unwinding).
|
||||
|
||||
Most platforms reserve some registers to pass arguments to exception
|
||||
handlers (e.g., IA-64 uses \texttt{r15}-\texttt{r18} for this
|
||||
purpose). These registers are normally treated like ``scratch''
|
||||
registers. However, if \Prog{libunwind} is used to set an exception
|
||||
argument register to a particular value (e.g., via
|
||||
\Func{unw\_set\_reg}()), then \Func{unw\_resume}() will install this
|
||||
value as the contents of the register. In other words, the exception
|
||||
handling arguments are installed even in cases where normally only the
|
||||
``preserved'' registers are restored.
|
||||
|
||||
Note that \Func{unw\_resume}() does \emph{not} invoke any unwind
|
||||
handlers (aka, ``personality routines''). If a program needs this, it
|
||||
will have to do so on its own by obtaining the \Type{unw\_proc\_info\_t}
|
||||
of each unwound frame and appropriately processing its unwind handler
|
||||
and language-specific data area (lsda). These steps are generally
|
||||
dependent on the target-platform and are regulated by the
|
||||
processor-specific ABI (application-binary interface).
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
For local unwinding, \Func{unw\_resume}() does not return on success.
|
||||
For remote unwinding, it returns 0 on success. On failure, the
|
||||
negative value of one of the errors below is returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_resume}() is thread-safe. If cursor \Var{cp} is in the
|
||||
local address-space, this routine is also safe to use from a signal
|
||||
handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] A register needed by \Func{unw\_resume}() wasn't
|
||||
accessible.
|
||||
\item[\Const{UNW\_EINVALIDIP}] The instruction pointer identified by
|
||||
\Var{cp} is not valid.
|
||||
\item[\Const{UNW\_BADFRAME}] The stack frame identified by
|
||||
\Var{cp} is not valid.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)},
|
||||
sigprocmask(2)
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,118 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_SET\\_CACHING\\_POLICY" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_set_caching_policy
|
||||
\-\- set unwind caching policy
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_set_caching_policy(unw_addr_space_t
|
||||
as,
|
||||
unw_caching_policy_t
|
||||
policy);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_set_caching_policy()
|
||||
routine sets the caching policy
|
||||
of address space as
|
||||
to the policy specified by argument
|
||||
policy\&.
|
||||
The policy
|
||||
argument can take one of three
|
||||
possible values:
|
||||
.TP
|
||||
UNW_CACHE_NONE
|
||||
Turns off caching completely. This
|
||||
also implicitly flushes the contents of all caches as if
|
||||
unw_flush_cache()
|
||||
had been called.
|
||||
.TP
|
||||
UNW_CACHE_GLOBAL
|
||||
Enables caching using a global cache
|
||||
that is shared by all threads. If global caching is unavailable or
|
||||
unsupported, libunwind
|
||||
may fall back on using a per\-thread
|
||||
cache, as if UNW_CACHE_PER_THREAD
|
||||
had been specified.
|
||||
.TP
|
||||
UNW_CACHE_PER_THREAD
|
||||
Enables caching using
|
||||
thread\-local caches. If a thread\-local caching are unavailable or
|
||||
unsupported, libunwind
|
||||
may fall back on using a global cache,
|
||||
as if UNW_CACHE_GLOBAL
|
||||
had been specified.
|
||||
.PP
|
||||
If caching is enabled, an application must be prepared to make
|
||||
appropriate calls to unw_flush_cache()
|
||||
whenever the target
|
||||
changes in a way that could affect the validity of cached information.
|
||||
For example, after unloading (removing) a shared library,
|
||||
unw_flush_cache()
|
||||
would have to be called (at least) for the
|
||||
address\-range that was covered by the shared library.
|
||||
.PP
|
||||
For address spaces created via unw_create_addr_space(3),
|
||||
caching is turned off by default. For the local address space
|
||||
unw_local_addr_space,
|
||||
caching is turned on by default.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_set_caching_policy()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_set_caching_policy()
|
||||
is thread\-safe but \fInot\fP
|
||||
safe
|
||||
to use from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_ENOMEM
|
||||
The desired caching policy could not be
|
||||
established because the application is out of memory.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3),
|
||||
unw_flush_cache(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,80 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_set\_caching\_policy}{David Mosberger-Tang}{Programming Library}{unw\_set\_caching\_policy}unw\_set\_caching\_policy -- set unwind caching policy
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_set\_caching\_policy}(\Type{unw\_addr\_space\_t} \Var{as}, \Type{unw\_caching\_policy\_t} \Var{policy});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_set\_caching\_policy}() routine sets the caching policy
|
||||
of address space \Var{as} to the policy specified by argument
|
||||
\Var{policy}. The \Var{policy} argument can take one of three
|
||||
possible values:
|
||||
\begin{description}
|
||||
\item[\Const{UNW\_CACHE\_NONE}] Turns off caching completely. This
|
||||
also implicitly flushes the contents of all caches as if
|
||||
\Func{unw\_flush\_cache}() had been called.
|
||||
\item[\Const{UNW\_CACHE\_GLOBAL}] Enables caching using a global cache
|
||||
that is shared by all threads. If global caching is unavailable or
|
||||
unsupported, \Prog{libunwind} may fall back on using a per-thread
|
||||
cache, as if \Const{UNW\_CACHE\_PER\_THREAD} had been specified.
|
||||
\item[\Const{UNW\_CACHE\_PER\_THREAD}] Enables caching using
|
||||
thread-local caches. If a thread-local caching are unavailable or
|
||||
unsupported, \Prog{libunwind} may fall back on using a global cache,
|
||||
as if \Const{UNW\_CACHE\_GLOBAL} had been specified.
|
||||
\end{description}
|
||||
|
||||
If caching is enabled, an application must be prepared to make
|
||||
appropriate calls to \Func{unw\_flush\_cache}() whenever the target
|
||||
changes in a way that could affect the validity of cached information.
|
||||
For example, after unloading (removing) a shared library,
|
||||
\Func{unw\_flush\_cache}() would have to be called (at least) for the
|
||||
address-range that was covered by the shared library.
|
||||
|
||||
For address spaces created via \Func{unw\_create\_addr\_space}(3),
|
||||
caching is turned off by default. For the local address space
|
||||
\Func{unw\_local\_addr\_space}, caching is turned on by default.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_set\_caching\_policy}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_set\_caching\_policy}() is thread-safe but \emph{not} safe
|
||||
to use from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_ENOMEM}] The desired caching policy could not be
|
||||
established because the application is out of memory.
|
||||
\end{Description}
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)},
|
||||
\SeeAlso{unw\_flush\_cache(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,117 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_SET\\_FPREG" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_set_fpreg
|
||||
\-\- set contents of floating\-point register
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_set_fpreg(unw_cursor_t *cp,
|
||||
unw_regnum_t
|
||||
reg,
|
||||
unw_fpreg_t
|
||||
val);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_set_fpreg()
|
||||
routine sets the value of register
|
||||
reg
|
||||
in the stack frame identified by cursor cp
|
||||
to the
|
||||
value passed in val\&.
|
||||
.PP
|
||||
The register numbering is target\-dependent and described in separate
|
||||
manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that cp
|
||||
is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee\-saved\&'') registers and frame\-related registers (such as the
|
||||
stack\-pointer). However, for signal frames (see
|
||||
unw_is_signal_frame(3)),
|
||||
it is usually possible to access
|
||||
all registers.
|
||||
.PP
|
||||
Note that unw_set_fpreg()
|
||||
can only write the contents of
|
||||
floating\-point registers. See unw_set_reg(3)
|
||||
for a way to
|
||||
write registers which fit in a single word.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_set_fpreg()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_set_fpreg()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
An attempt was made to write a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
.TP
|
||||
UNW_EREADONLY
|
||||
An attempt was made to write to a
|
||||
read\-only register.
|
||||
.PP
|
||||
In addition, unw_set_fpreg()
|
||||
may return any error returned by
|
||||
the access_mem(),
|
||||
access_reg(),
|
||||
and
|
||||
access_fpreg()
|
||||
call\-backs (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
libunwind\-ia64(3),
|
||||
unw_get_fpreg(3),
|
||||
unw_is_fpreg(3),
|
||||
unw_is_signal_frame(3),
|
||||
unw_set_reg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,79 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_set\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_set\_fpreg}unw\_set\_fpreg -- set contents of floating-point register
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_set\_fpreg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_fpreg\_t} \Var{val});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_set\_fpreg}() routine sets the value of register
|
||||
\Var{reg} in the stack frame identified by cursor \Var{cp} to the
|
||||
value passed in \Var{val}.
|
||||
|
||||
The register numbering is target-dependent and described in separate
|
||||
manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that \Var{cp} is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee-saved'') registers and frame-related registers (such as the
|
||||
stack-pointer). However, for signal frames (see
|
||||
\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
|
||||
all registers.
|
||||
|
||||
Note that \Func{unw\_set\_fpreg}() can only write the contents of
|
||||
floating-point registers. See \Func{unw\_set\_reg}(3) for a way to
|
||||
write registers which fit in a single word.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_set\_fpreg}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_set\_fpreg}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] An attempt was made to write a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
\item[\Const{UNW\_EREADONLY}] An attempt was made to write to a
|
||||
read-only register.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_set\_fpreg}() may return any error returned by
|
||||
the \Func{access\_mem}(), \Func{access\_reg}(), and
|
||||
\Func{access\_fpreg}() call-backs (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{libunwind-ia64(3)},
|
||||
\SeeAlso{unw\_get\_fpreg(3)},
|
||||
\SeeAlso{unw\_is\_fpreg(3)},
|
||||
\SeeAlso{unw\_is\_signal\_frame(3)},
|
||||
\SeeAlso{unw\_set\_reg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,117 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_SET\\_REG" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_set_reg
|
||||
\-\- set register contents
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_set_reg(unw_cursor_t *cp,
|
||||
unw_regnum_t
|
||||
reg,
|
||||
unw_word_t
|
||||
val);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_set_reg()
|
||||
routine sets the value of register
|
||||
reg
|
||||
in the stack frame identified by cursor cp
|
||||
to the
|
||||
value passed in val\&.
|
||||
.PP
|
||||
The register numbering is target\-dependent and described in separate
|
||||
manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that cp
|
||||
is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee\-saved\&'') registers and frame\-related registers (such as the
|
||||
stack\-pointer). However, for signal frames (see
|
||||
unw_is_signal_frame(3)),
|
||||
it is usually possible to access
|
||||
all registers.
|
||||
.PP
|
||||
Note that unw_set_reg()
|
||||
can only write the contents of
|
||||
registers whose values fit in a single word. See
|
||||
unw_set_fpreg(3)
|
||||
for a way to write registers which do not
|
||||
fit this constraint.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_set_reg()
|
||||
returns 0.
|
||||
Otherwise the negative value of one of the error\-codes below is
|
||||
returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_set_reg()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_EBADREG
|
||||
An attempt was made to write a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
.TP
|
||||
UNW_EREADONLY
|
||||
An attempt was made to write to a
|
||||
read\-only register.
|
||||
.PP
|
||||
In addition, unw_set_reg()
|
||||
may return any error returned by
|
||||
the access_mem(),
|
||||
access_reg(),
|
||||
and
|
||||
access_fpreg()
|
||||
call\-backs (see
|
||||
unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
libunwind\-ia64(3),
|
||||
unw_get_reg(3),
|
||||
unw_is_signal_frame(3),
|
||||
unw_set_fpreg(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,79 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_set\_reg}{David Mosberger-Tang}{Programming Library}{unw\_set\_reg}unw\_set\_reg -- set register contents
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_word\_t} \Var{val});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_set\_reg}() routine sets the value of register
|
||||
\Var{reg} in the stack frame identified by cursor \Var{cp} to the
|
||||
value passed in \Var{val}.
|
||||
|
||||
The register numbering is target-dependent and described in separate
|
||||
manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
|
||||
Furthermore, the exact set of accessible registers may depend on the
|
||||
type of frame that \Var{cp} is referring to. For ordinary stack
|
||||
frames, it is normally possible to access only the preserved
|
||||
(``callee-saved'') registers and frame-related registers (such as the
|
||||
stack-pointer). However, for signal frames (see
|
||||
\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
|
||||
all registers.
|
||||
|
||||
Note that \Func{unw\_set\_reg}() can only write the contents of
|
||||
registers whose values fit in a single word. See
|
||||
\Func{unw\_set\_fpreg}(3) for a way to write registers which do not
|
||||
fit this constraint.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_set\_reg}() returns 0.
|
||||
Otherwise the negative value of one of the error-codes below is
|
||||
returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_set\_reg}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_EBADREG}] An attempt was made to write a register
|
||||
that is either invalid or not accessible in the current frame.
|
||||
\item[\Const{UNW\_EREADONLY}] An attempt was made to write to a
|
||||
read-only register.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_set\_reg}() may return any error returned by
|
||||
the \Func{access\_mem}(), \Func{access\_reg}(), and
|
||||
\Func{access\_fpreg}() call-backs (see
|
||||
\Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{libunwind-ia64(3)},
|
||||
\SeeAlso{unw\_get\_reg(3)},
|
||||
\SeeAlso{unw\_is\_signal\_frame(3)},
|
||||
\SeeAlso{unw\_set\_fpreg(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,106 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_STEP" "3" "16 August 2007" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_step
|
||||
\-\- advance to next stack frame
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
int
|
||||
unw_step(unw_cursor_t *cp);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_step()
|
||||
routine advances the unwind cursor cp
|
||||
to
|
||||
the next older, less deeply nested stack frame.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
On successful completion, unw_step()
|
||||
returns a positive value
|
||||
if the updated cursor refers to a valid stack frame, or 0 if the
|
||||
previous stack frame was the last frame in the chain. On error, the
|
||||
negative value of one of the error\-codes below is returned.
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_step()
|
||||
is thread\-safe. If cursor cp
|
||||
is in the local
|
||||
address\-space, this routine is also safe to use from a signal handler.
|
||||
.PP
|
||||
.SH ERRORS
|
||||
|
||||
.PP
|
||||
.TP
|
||||
UNW_EUNSPEC
|
||||
An unspecified error occurred.
|
||||
.TP
|
||||
UNW_ENOINFO
|
||||
Libunwind
|
||||
was unable to locate the
|
||||
unwind\-info needed to complete the operation.
|
||||
.TP
|
||||
UNW_EBADVERSION
|
||||
The unwind\-info needed to complete the
|
||||
operation has a version or a format that is not understood by
|
||||
libunwind\&.
|
||||
.TP
|
||||
UNW_EINVALIDIP
|
||||
The instruction\-pointer
|
||||
(``program\-counter\&'') of the next stack frame is invalid (e.g., not
|
||||
properly aligned).
|
||||
.TP
|
||||
UNW_EBADFRAME
|
||||
The next stack frame is invalid.
|
||||
.TP
|
||||
UNW_ESTOPUNWIND
|
||||
Returned if a call to
|
||||
find_proc_info()
|
||||
returned \-UNW_ESTOPUNWIND\&.
|
||||
.PP
|
||||
In addition, unw_step()
|
||||
may return any error returned by the
|
||||
find_proc_info(),
|
||||
get_dyn_info_list_addr(),
|
||||
access_mem(),
|
||||
access_reg(),
|
||||
or access_fpreg()
|
||||
call\-backs (see unw_create_addr_space(3)).
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
|
||||
.PP
|
||||
libunwind(3),
|
||||
unw_create_addr_space(3)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
David Mosberger\-Tang
|
||||
.br
|
||||
Email: \fBdmosberger@gmail.com\fP
|
||||
.br
|
||||
WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,68 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_step}{David Mosberger-Tang}{Programming Library}{unw\_step}unw\_step -- advance to next stack frame
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{int} \Func{unw\_step}(\Type{unw\_cursor\_t~*}\Var{cp});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_step}() routine advances the unwind cursor \Var{cp} to
|
||||
the next older, less deeply nested stack frame.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
On successful completion, \Func{unw\_step}() returns a positive value
|
||||
if the updated cursor refers to a valid stack frame, or 0 if the
|
||||
previous stack frame was the last frame in the chain. On error, the
|
||||
negative value of one of the error-codes below is returned.
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_step}() is thread-safe. If cursor \Var{cp} is in the local
|
||||
address-space, this routine is also safe to use from a signal handler.
|
||||
|
||||
\section{Errors}
|
||||
|
||||
\begin{Description}
|
||||
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
|
||||
\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate the
|
||||
unwind-info needed to complete the operation.
|
||||
\item[\Const{UNW\_EBADVERSION}] The unwind-info needed to complete the
|
||||
operation has a version or a format that is not understood by
|
||||
\Prog{libunwind}.
|
||||
\item[\Const{UNW\_EINVALIDIP}] The instruction-pointer
|
||||
(``program-counter'') of the next stack frame is invalid (e.g., not
|
||||
properly aligned).
|
||||
\item[\Const{UNW\_EBADFRAME}] The next stack frame is invalid.
|
||||
\item[\Const{UNW\_ESTOPUNWIND}] Returned if a call to
|
||||
\Func{find\_proc\_info}() returned -\Const{UNW\_ESTOPUNWIND}.
|
||||
\end{Description}
|
||||
In addition, \Func{unw\_step}() may return any error returned by the
|
||||
\Func{find\_proc\_info}(), \Func{get\_dyn\_info\_list\_addr}(),
|
||||
\Func{access\_mem}(), \Func{access\_reg}(), or \Func{access\_fpreg}()
|
||||
call-backs (see \Func{unw\_create\_addr\_space}(3)).
|
||||
|
||||
\section{See Also}
|
||||
|
||||
\SeeAlso{libunwind(3)},
|
||||
\SeeAlso{unw\_create\_addr\_space(3)}
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
David Mosberger-Tang\\
|
||||
Email: \Email{dmosberger@gmail.com}\\
|
||||
WWW: \URL{http://www.nongnu.org/libunwind/}.
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
@@ -1,63 +0,0 @@
|
||||
'\" t
|
||||
.\" Manual page created with latex2man on Wed Aug 18 16:51:29 CEST 2004
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
.de Vb
|
||||
.ft CW
|
||||
.nf
|
||||
..
|
||||
.de Ve
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.TH "UNW\\_STRERROR" "3" "18 August 2004" "Programming Library " "Programming Library "
|
||||
.SH NAME
|
||||
unw_strerror
|
||||
\-\- get text corresponding to error code
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
|
||||
.PP
|
||||
#include <libunwind.h>
|
||||
.br
|
||||
.PP
|
||||
const char *
|
||||
unw_strerror(int
|
||||
err_code);
|
||||
.br
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
|
||||
.PP
|
||||
The unw_strerror()
|
||||
routine maps the (negative) err_code
|
||||
to a corresponding text message and returns it.
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
|
||||
.PP
|
||||
The message that corresponds to err_code
|
||||
or, if the
|
||||
err_code
|
||||
has no corresponding message, the text "invalid error
|
||||
code".
|
||||
.PP
|
||||
.SH THREAD AND SIGNAL SAFETY
|
||||
|
||||
.PP
|
||||
unw_strerror()
|
||||
is thread\-safe as well as safe to use
|
||||
from a signal handler.
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
|
||||
.PP
|
||||
Thomas Hallgren
|
||||
.br
|
||||
BEA Systems
|
||||
.br
|
||||
Stockholm, Sweden
|
||||
.br
|
||||
Email: \fBthallgre@bea.com\fP
|
||||
.br
|
||||
.\" NOTE: This file is generated, DO NOT EDIT.
|
||||
@@ -1,42 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[fancyhdr,pdf]{latex2man}
|
||||
|
||||
\input{common.tex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{Name}{3}{unw\_strerror}{Thomas Hallgren}{Programming Library}{unw\_strerror}unw\_strerror -- get text corresponding to error code
|
||||
\end{Name}
|
||||
|
||||
\section{Synopsis}
|
||||
|
||||
\File{\#include $<$libunwind.h$>$}\\
|
||||
|
||||
\Type{const char *} \Func{unw\_strerror}(\Type{int} \Var{err\_code});\\
|
||||
|
||||
\section{Description}
|
||||
|
||||
The \Func{unw\_strerror}() routine maps the (negative) \Var{err\_code}
|
||||
to a corresponding text message and returns it.
|
||||
|
||||
\section{Return Value}
|
||||
|
||||
The message that corresponds to \Var{err\_code} or, if the
|
||||
\Var{err\_code} has no corresponding message, the text "invalid error
|
||||
code".
|
||||
|
||||
\section{Thread and Signal Safety}
|
||||
|
||||
\Func{unw\_strerror}() is thread-safe as well as safe to use
|
||||
from a signal handler.
|
||||
|
||||
\section{Author}
|
||||
|
||||
\noindent
|
||||
Thomas Hallgren\\
|
||||
BEA Systems\\
|
||||
Stockholm, Sweden\\
|
||||
Email: \Email{thallgre@bea.com}\\
|
||||
\LatexManEnd
|
||||
|
||||
\end{document}
|
||||
255
app/src/main/jni/crash_dump/libunwind/include/config.h
Normal file
255
app/src/main/jni/crash_dump/libunwind/include/config.h
Normal file
@@ -0,0 +1,255 @@
|
||||
/* include/config.h. Generated from config.h.in by configure. */
|
||||
/* include/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Block signals before mutex operations */
|
||||
/* #undef CONFIG_BLOCK_SIGNALS */
|
||||
|
||||
/* Enable Debug Frame */
|
||||
#define CONFIG_DEBUG_FRAME 1
|
||||
|
||||
/* Support for Microsoft ABI extensions */
|
||||
/* This is required to understand floating point registers on x86-64 */
|
||||
#define CONFIG_MSABI_SUPPORT 1
|
||||
|
||||
/* Define to 1 if you want every memory access validated */
|
||||
#define CONSERVATIVE_CHECKS 1
|
||||
|
||||
/* Allocate large structures rather than place them on the stack. */
|
||||
#define CONSERVE_STACK /**/
|
||||
|
||||
/* Define to 1 if you have the <asm/ptrace_offsets.h> header file. */
|
||||
/* #undef HAVE_ASM_PTRACE_OFFSETS_H */
|
||||
|
||||
/* Define to 1 if you have the <atomic_ops.h> header file. */
|
||||
/* #undef HAVE_ATOMIC_OPS_H */
|
||||
|
||||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
#define HAVE_BYTESWAP_H 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_CONT', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PTRACE_CONT 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_POKEDATA', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_PTRACE_POKEDATA 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_POKEUSER', and to 0 if
|
||||
you don't. */
|
||||
#if defined(__aarch64__) || defined(__mips__)
|
||||
#define HAVE_DECL_PTRACE_POKEUSER 0
|
||||
#else
|
||||
#define HAVE_DECL_PTRACE_POKEUSER 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_SINGLESTEP', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_PTRACE_SINGLESTEP 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_SYSCALL', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_PTRACE_SYSCALL 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PTRACE_TRACEME', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_PTRACE_TRACEME 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PT_CONTINUE 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PT_GETFPREGS 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you
|
||||
don't. */
|
||||
#if defined(__mips__)
|
||||
#define HAVE_DECL_PT_GETREGS 1
|
||||
#else
|
||||
#define HAVE_DECL_PT_GETREGS 0
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_GETREGSET', and to 0 if you
|
||||
don't. */
|
||||
#if defined(__aarch64__)
|
||||
#define HAVE_DECL_PT_GETREGSET 1
|
||||
#else
|
||||
#define HAVE_DECL_PT_GETREGSET 0
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_PT_IO 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_STEP', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PT_STEP 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_SYSCALL', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PT_SYSCALL 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `PT_TRACE_ME', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_PT_TRACE_ME 0
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `dlmodinfo' function. */
|
||||
#define HAVE_DLMODINFO 1
|
||||
|
||||
/* Define to 1 if you have the `dl_iterate_phdr' function. */
|
||||
#define HAVE_DL_ITERATE_PHDR 1
|
||||
|
||||
/* Define to 1 if you have the `dl_phdr_removals_counter' function. */
|
||||
#define HAVE_DL_PHDR_REMOVALS_COUNTER 1
|
||||
|
||||
/* Define to 1 if you have the <elf.h> header file. */
|
||||
#define HAVE_ELF_H 1
|
||||
|
||||
/* Define to 1 if you have the <endian.h> header file. */
|
||||
#define HAVE_ENDIAN_H 1
|
||||
|
||||
/* Define to 1 if you have the <execinfo.h> header file. */
|
||||
/* #undef HAVE_EXECINFO_H */
|
||||
|
||||
/* Define to 1 if you have the `getunwind' function. */
|
||||
#define HAVE_GETUNWIND 1
|
||||
|
||||
/* Define to 1 if you have the <ia64intrin.h> header file. */
|
||||
/* #undef HAVE_IA64INTRIN_H */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `uca' library (-luca). */
|
||||
/* #undef HAVE_LIBUCA */
|
||||
|
||||
/* Define to 1 if you have the <link.h> header file. */
|
||||
#define HAVE_LINK_H 1
|
||||
|
||||
/* Define if you have liblzma */
|
||||
#define HAVE_LZMA 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `mincore' function. */
|
||||
#define HAVE_MINCORE 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */
|
||||
/* #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS */
|
||||
|
||||
/* Define to 1 if the system has the type `struct elf_prstatus'. */
|
||||
/* #undef HAVE_STRUCT_ELF_PRSTATUS */
|
||||
|
||||
/* Define to 1 if the system has the type `struct prstatus'. */
|
||||
/* #undef HAVE_STRUCT_PRSTATUS */
|
||||
|
||||
/* Defined if __sync atomics are available */
|
||||
#define HAVE_SYNC_ATOMICS 1
|
||||
|
||||
/* Define to 1 if you have the <sys/elf.h> header file. */
|
||||
/* #undef HAVE_SYS_ELF_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/endian.h> header file. */
|
||||
#define HAVE_SYS_ENDIAN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/link.h> header file. */
|
||||
/* #undef HAVE_SYS_LINK_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/procfs.h> header file. */
|
||||
/* #undef HAVE_SYS_PROCFS_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/ptrace.h> header file. */
|
||||
#define HAVE_SYS_PTRACE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/uc_access.h> header file. */
|
||||
/* #undef HAVE_SYS_UC_ACCESS_H */
|
||||
|
||||
/* Define to 1 if you have the `ttrace' function. */
|
||||
/* #undef HAVE_TTRACE */
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Defined if __builtin_unreachable() is available */
|
||||
#define HAVE__BUILTIN_UNREACHABLE 1
|
||||
|
||||
/* Defined if __builtin___clear_cache() is available */
|
||||
#define HAVE__BUILTIN___CLEAR_CACHE 1
|
||||
|
||||
/* Define to 1 if __thread keyword is supported by the C compiler. */
|
||||
#define HAVE___THREAD 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libunwind"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "libunwind-devel@nongnu.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "libunwind"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "libunwind 1.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "libunwind"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.1"
|
||||
|
||||
/* The size of `off_t', as computed by sizeof. */
|
||||
#define SIZEOF_OFF_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.1"
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
308
app/src/main/jni/crash_dump/libunwind/include/libunwind-common.h
Normal file
308
app/src/main/jni/crash_dump/libunwind/include/libunwind-common.h
Normal file
@@ -0,0 +1,308 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2001-2004 Hewlett-Packard Co
|
||||
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
/* ANDROID support update. */
|
||||
#include <sys/types.h>
|
||||
/* End of ANDROID update. */
|
||||
|
||||
#define UNW_VERSION_MAJOR 1
|
||||
#define UNW_VERSION_MINOR 1
|
||||
#define UNW_VERSION_EXTRA
|
||||
|
||||
#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min))
|
||||
#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR)
|
||||
|
||||
#define UNW_PASTE2(x,y) x##y
|
||||
#define UNW_PASTE(x,y) UNW_PASTE2(x,y)
|
||||
#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn)
|
||||
#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
|
||||
|
||||
#ifdef UNW_LOCAL_ONLY
|
||||
# ifdef UNW_ADDITIONAL_PREFIX
|
||||
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UUL,UNW_TARGET),_)
|
||||
# else
|
||||
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
|
||||
# endif
|
||||
#else /* !UNW_LOCAL_ONLY */
|
||||
# ifdef UNW_ADDITIONAL_PREFIX
|
||||
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UU,UNW_TARGET),_)
|
||||
# else
|
||||
# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_)
|
||||
# endif
|
||||
#endif /* !UNW_LOCAL_ONLY */
|
||||
|
||||
/* Error codes. The unwind routines return the *negated* values of
|
||||
these error codes on error and a non-negative value on success. */
|
||||
typedef enum
|
||||
{
|
||||
UNW_ESUCCESS = 0, /* no error */
|
||||
UNW_EUNSPEC, /* unspecified (general) error */
|
||||
UNW_ENOMEM, /* out of memory */
|
||||
UNW_EBADREG, /* bad register number */
|
||||
UNW_EREADONLYREG, /* attempt to write read-only register */
|
||||
UNW_ESTOPUNWIND, /* stop unwinding */
|
||||
UNW_EINVALIDIP, /* invalid IP */
|
||||
UNW_EBADFRAME, /* bad frame */
|
||||
UNW_EINVAL, /* unsupported operation or bad value */
|
||||
UNW_EBADVERSION, /* unwind info has unsupported version */
|
||||
UNW_ENOINFO /* no unwind info found */
|
||||
}
|
||||
unw_error_t;
|
||||
|
||||
/* The following enum defines the indices for a couple of
|
||||
(pseudo-)registers which have the same meaning across all
|
||||
platforms. (RO) means read-only. (RW) means read-write. General
|
||||
registers (aka "integer registers") are expected to start with
|
||||
index 0. The number of such registers is architecture-dependent.
|
||||
The remaining indices can be used as an architecture sees fit. The
|
||||
last valid register index is given by UNW_REG_LAST. */
|
||||
typedef enum
|
||||
{
|
||||
UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */
|
||||
UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */
|
||||
UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */
|
||||
UNW_REG_LAST = UNW_TDEP_LAST_REG
|
||||
}
|
||||
unw_frame_regnum_t;
|
||||
|
||||
/* Number of exception-handler argument registers: */
|
||||
#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UNW_CACHE_NONE, /* no caching */
|
||||
UNW_CACHE_GLOBAL, /* shared global cache */
|
||||
UNW_CACHE_PER_THREAD /* per-thread caching */
|
||||
}
|
||||
unw_caching_policy_t;
|
||||
|
||||
typedef int unw_regnum_t;
|
||||
|
||||
/* The unwind cursor starts at the youngest (most deeply nested) frame
|
||||
and is used to track the frame state as the unwinder steps from
|
||||
frame to frame. It is safe to make (shallow) copies of variables
|
||||
of this type. */
|
||||
typedef struct unw_cursor
|
||||
{
|
||||
unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
|
||||
}
|
||||
unw_cursor_t;
|
||||
|
||||
/* This type encapsulates the entire (preserved) machine-state. */
|
||||
typedef unw_tdep_context_t unw_context_t;
|
||||
|
||||
/* unw_getcontext() fills the unw_context_t pointed to by UC with the
|
||||
machine state as it exists at the call-site. For implementation
|
||||
reasons, this needs to be a target-dependent macro. It's easiest
|
||||
to think of unw_getcontext() as being identical to getcontext(). */
|
||||
#define unw_getcontext(uc) unw_tdep_getcontext(uc)
|
||||
|
||||
/* Return 1 if register number R is a floating-point register, zero
|
||||
otherwise.
|
||||
This routine is signal-safe. */
|
||||
#define unw_is_fpreg(r) unw_tdep_is_fpreg(r)
|
||||
|
||||
typedef unw_tdep_fpreg_t unw_fpreg_t;
|
||||
|
||||
typedef struct unw_addr_space *unw_addr_space_t;
|
||||
|
||||
/* Each target may define it's own set of flags, but bits 0-15 are
|
||||
reserved for general libunwind-use. */
|
||||
#define UNW_PI_FLAG_FIRST_TDEP_BIT 16
|
||||
/* The information comes from a .debug_frame section. */
|
||||
#define UNW_PI_FLAG_DEBUG_FRAME 32
|
||||
|
||||
typedef struct unw_proc_info
|
||||
{
|
||||
unw_word_t start_ip; /* first IP covered by this procedure */
|
||||
unw_word_t end_ip; /* first IP NOT covered by this procedure */
|
||||
unw_word_t lsda; /* address of lang.-spec. data area (if any) */
|
||||
unw_word_t handler; /* optional personality routine */
|
||||
unw_word_t gp; /* global-pointer value for this procedure */
|
||||
unw_word_t flags; /* misc. flags */
|
||||
|
||||
int format; /* unwind-info format (arch-specific) */
|
||||
int unwind_info_size; /* size of the information (if applicable) */
|
||||
void *unwind_info; /* unwind-info (arch-specific) */
|
||||
unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */
|
||||
}
|
||||
unw_proc_info_t;
|
||||
|
||||
/* These are backend callback routines that provide access to the
|
||||
state of a "remote" process. This can be used, for example, to
|
||||
unwind another process through the ptrace() interface. */
|
||||
typedef struct unw_accessors
|
||||
{
|
||||
/* Look up the unwind info associated with instruction-pointer IP.
|
||||
On success, the routine fills in the PROC_INFO structure. */
|
||||
int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *,
|
||||
int, void *);
|
||||
|
||||
/* Release any resources (e.g., memory) that were allocated for
|
||||
the unwind info returned in by a previous call to
|
||||
find_proc_info() with NEED_UNWIND_INFO set to 1. */
|
||||
void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *);
|
||||
|
||||
/* Return the list-head of the dynamically registered unwind
|
||||
info. */
|
||||
int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *);
|
||||
|
||||
/* Access aligned word at address ADDR. The value is returned
|
||||
according to the endianness of the host (e.g., if the host is
|
||||
little-endian and the target is big-endian, access_mem() needs
|
||||
to byte-swap the value before returning it). */
|
||||
int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int,
|
||||
void *);
|
||||
|
||||
/* Access register number REG at address ADDR. */
|
||||
int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int,
|
||||
void *);
|
||||
|
||||
/* Access register number REG at address ADDR. */
|
||||
int (*access_fpreg) (unw_addr_space_t, unw_regnum_t,
|
||||
unw_fpreg_t *, int, void *);
|
||||
|
||||
int (*resume) (unw_addr_space_t, unw_cursor_t *, void *);
|
||||
|
||||
/* Optional call back to obtain the name of a (static) procedure.
|
||||
Dynamically generated procedures are handled automatically by
|
||||
libunwind. This callback is optional and may be set to
|
||||
NULL. */
|
||||
int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t,
|
||||
unw_word_t *, void *);
|
||||
}
|
||||
unw_accessors_t;
|
||||
|
||||
typedef enum unw_save_loc_type
|
||||
{
|
||||
UNW_SLT_NONE, /* register is not saved ("not an l-value") */
|
||||
UNW_SLT_MEMORY, /* register has been saved in memory */
|
||||
UNW_SLT_REG /* register has been saved in (another) register */
|
||||
}
|
||||
unw_save_loc_type_t;
|
||||
|
||||
typedef struct unw_save_loc
|
||||
{
|
||||
unw_save_loc_type_t type;
|
||||
union
|
||||
{
|
||||
unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */
|
||||
unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */
|
||||
}
|
||||
u;
|
||||
unw_tdep_save_loc_t extra; /* target-dependent additional information */
|
||||
}
|
||||
unw_save_loc_t;
|
||||
|
||||
/* ANDROID support update. */
|
||||
typedef struct unw_map_cursor
|
||||
{
|
||||
void *map_list;
|
||||
void *cur_map;
|
||||
}
|
||||
unw_map_cursor_t;
|
||||
|
||||
typedef struct unw_map
|
||||
{
|
||||
unw_word_t start;
|
||||
unw_word_t end;
|
||||
unw_word_t offset;
|
||||
unw_word_t load_base;
|
||||
char *path;
|
||||
int flags;
|
||||
}
|
||||
unw_map_t;
|
||||
/* End of ANDROID update. */
|
||||
|
||||
/* These routines work both for local and remote unwinding. */
|
||||
|
||||
#define unw_local_access_addr_space_init UNW_OBJ(local_access_addr_space_init)
|
||||
#define unw_local_addr_space UNW_OBJ(local_addr_space)
|
||||
#define unw_create_addr_space UNW_OBJ(create_addr_space)
|
||||
#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
|
||||
#define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
|
||||
#define unw_init_local UNW_OBJ(init_local)
|
||||
#define unw_init_remote UNW_OBJ(init_remote)
|
||||
#define unw_step UNW_OBJ(step)
|
||||
#define unw_resume UNW_OBJ(resume)
|
||||
#define unw_get_proc_info UNW_OBJ(get_proc_info)
|
||||
#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip)
|
||||
#define unw_get_reg UNW_OBJ(get_reg)
|
||||
#define unw_set_reg UNW_OBJ(set_reg)
|
||||
#define unw_get_fpreg UNW_OBJ(get_fpreg)
|
||||
#define unw_set_fpreg UNW_OBJ(set_fpreg)
|
||||
#define unw_get_save_loc UNW_OBJ(get_save_loc)
|
||||
#define unw_is_signal_frame UNW_OBJ(is_signal_frame)
|
||||
#define unw_handle_signal_frame UNW_OBJ(handle_signal_frame)
|
||||
#define unw_get_proc_name UNW_OBJ(get_proc_name)
|
||||
#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip)
|
||||
#define unw_set_caching_policy UNW_OBJ(set_caching_policy)
|
||||
#define unw_regname UNW_ARCH_OBJ(regname)
|
||||
#define unw_flush_cache UNW_ARCH_OBJ(flush_cache)
|
||||
#define unw_strerror UNW_ARCH_OBJ(strerror)
|
||||
|
||||
extern void unw_local_access_addr_space_init (unw_addr_space_t);
|
||||
extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
|
||||
extern void unw_destroy_addr_space (unw_addr_space_t);
|
||||
extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
|
||||
extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
|
||||
extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
|
||||
extern const char *unw_regname (unw_regnum_t);
|
||||
|
||||
extern int unw_init_local (unw_cursor_t *, unw_context_t *);
|
||||
extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *);
|
||||
extern int unw_step (unw_cursor_t *);
|
||||
extern int unw_resume (unw_cursor_t *);
|
||||
extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *);
|
||||
extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t,
|
||||
unw_proc_info_t *, void *);
|
||||
extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *);
|
||||
extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
|
||||
extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *);
|
||||
extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t);
|
||||
extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *);
|
||||
extern int unw_is_signal_frame (unw_cursor_t *);
|
||||
extern int unw_handle_signal_frame (unw_cursor_t *);
|
||||
extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *);
|
||||
extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *,
|
||||
size_t, unw_word_t *, void *);
|
||||
extern const char *unw_strerror (int);
|
||||
extern int unw_backtrace (void **, int);
|
||||
|
||||
/* ANDROID support update. */
|
||||
extern int unw_map_local_cursor_valid (unw_map_cursor_t *);
|
||||
extern void unw_map_local_cursor_get (unw_map_cursor_t *);
|
||||
extern int unw_map_local_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
|
||||
extern int unw_map_local_create (void);
|
||||
extern void unw_map_local_destroy (void);
|
||||
extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *);
|
||||
extern void unw_map_cursor_reset (unw_map_cursor_t *);
|
||||
extern void unw_map_cursor_clear (unw_map_cursor_t *);
|
||||
extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t);
|
||||
extern void unw_map_cursor_destroy (unw_map_cursor_t *);
|
||||
extern int unw_map_cursor_get_next (unw_map_cursor_t *, unw_map_t *);
|
||||
/* End of ANDROID update. */
|
||||
|
||||
extern unw_addr_space_t unw_local_addr_space;
|
||||
@@ -1,10 +0,0 @@
|
||||
kdir=${1:-../kernel}
|
||||
scriptdir=$(dirname $0)
|
||||
udir=$(dirname $scriptdir)
|
||||
cat $scriptdir/kernel-files.txt | \
|
||||
(while read l r; do
|
||||
left=$(eval echo $l)
|
||||
right=$(eval echo $r)
|
||||
# echo $left $right
|
||||
diff -up $left $right
|
||||
done)
|
||||
@@ -1,19 +0,0 @@
|
||||
$udir/include/tdep-ia64/rse.h $kdir/arch/ia64/unwind/rse.h
|
||||
$udir/src/ia64/Ginit_local.c $kdir/arch/ia64/unwind/init_local.c
|
||||
$udir/src/ia64/Gis_signal_frame.c $kdir/arch/ia64/unwind/is_signal_frame.c
|
||||
$udir/src/ia64/Gparser.c $kdir/arch/ia64/unwind/parser.c
|
||||
$udir/src/ia64/Grbs.c $kdir/arch/ia64/unwind/rbs.c
|
||||
$udir/src/ia64/Gregs.c $kdir/arch/ia64/unwind/regs.c
|
||||
$udir/src/ia64/Gscript.c $kdir/arch/ia64/unwind/script.c
|
||||
$udir/src/ia64/Gstep.c $kdir/arch/ia64/unwind/step.c
|
||||
$udir/src/ia64/init.h $kdir/arch/ia64/unwind/init.h
|
||||
$udir/src/ia64/offsets.h $kdir/arch/ia64/unwind/offsets.h
|
||||
$udir/src/ia64/regname.c $kdir/arch/ia64/unwind/regname.c
|
||||
$udir/src/ia64/regs.h $kdir/arch/ia64/unwind/regs.h
|
||||
$udir/src/ia64/unwind_decoder.h $kdir/arch/ia64/unwind/unwind_decoder.h
|
||||
$udir/src/mi/Gget_fpreg.c $kdir/unwind/get_fpreg.c
|
||||
$udir/src/mi/Gget_reg.c $kdir/unwind/get_reg.c
|
||||
$udir/src/mi/Gset_fpreg.c $kdir/unwind/set_fpreg.c
|
||||
$udir/src/mi/Gset_reg.c $kdir/unwind/set_reg.c
|
||||
$udir/src/mi/flush_cache.c $kdir/unwind/flush_cache.c
|
||||
$udir/src/mi/mempool.c $kdir/unwind/mempool.c
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
cwd=`pwd`
|
||||
dir=`basename ${cwd}`
|
||||
#
|
||||
# When compiling a file that goes into libunwind, we only
|
||||
# need to compile it when we really do support UNW_LOCAL_ONLY.
|
||||
# In contrast, libunwind-tests should always get compiled.
|
||||
#
|
||||
if test $dir = "tests"; then
|
||||
local_only_test=""
|
||||
else
|
||||
local_only_test="defined(UNW_LOCAL_ONLY) && "
|
||||
fi
|
||||
for gname in `ls G*.c G*.cxx G*.S 2>/dev/null`; do
|
||||
lname="L$(expr $gname : '.\(.*\)')"
|
||||
bk edit $lname >/dev/null 2>&1
|
||||
ext=$(expr $gname : '[^.]*[.]\(.*\)')
|
||||
if [ "$ext" = "S" ]; then
|
||||
include=""
|
||||
else
|
||||
include="#include <libunwind.h>"
|
||||
fi
|
||||
echo -e "\
|
||||
#define UNW_LOCAL_ONLY\n\
|
||||
$include\n\
|
||||
#if ${local_only_test}!defined(UNW_REMOTE_ONLY)\n\
|
||||
#include \"$gname\"\n\
|
||||
#endif" > $lname
|
||||
echo created $lname
|
||||
done
|
||||
@@ -1,250 +0,0 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2014 The Android Open Source Project
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
#include "libunwind_i.h"
|
||||
|
||||
/* Global to hold the map for all local unwinds. */
|
||||
extern struct map_info *local_map_list;
|
||||
extern lock_rdwr_var (local_rdwr_lock);
|
||||
|
||||
static pthread_once_t local_rdwr_lock_init = PTHREAD_ONCE_INIT;
|
||||
|
||||
static void
|
||||
map_local_init_once (void)
|
||||
{
|
||||
lock_rdwr_init (&local_rdwr_lock);
|
||||
}
|
||||
|
||||
HIDDEN void
|
||||
map_local_init (void)
|
||||
{
|
||||
pthread_once (&local_rdwr_lock_init, map_local_init_once);
|
||||
}
|
||||
|
||||
static void
|
||||
move_cached_elf_data (struct map_info *old_list, struct map_info *new_list)
|
||||
{
|
||||
while (old_list)
|
||||
{
|
||||
if (!old_list->ei.valid)
|
||||
{
|
||||
old_list = old_list->next;
|
||||
continue;
|
||||
}
|
||||
/* Both lists are in order, so it's not necessary to scan through
|
||||
from the beginning of new_list each time looking for a match to
|
||||
the current map. As we progress, simply start from the last element
|
||||
in new_list we checked. */
|
||||
while (new_list && old_list->start <= new_list->start)
|
||||
{
|
||||
if (old_list->start == new_list->start
|
||||
&& old_list->end == new_list->end)
|
||||
{
|
||||
/* No need to do any lock, the entire local_map_list is locked
|
||||
at this point. */
|
||||
new_list->ei = old_list->ei;
|
||||
/* If it was mapped before, make sure to mark it unmapped now. */
|
||||
old_list->ei.mapped = false;
|
||||
/* Clear the old mini debug info so we do not try to free it twice */
|
||||
old_list->ei.mini_debug_info_data = NULL;
|
||||
old_list->ei.mini_debug_info_size = 0;
|
||||
/* Don't bother breaking out of the loop, the next while check
|
||||
is guaranteed to fail, causing us to break out of the loop
|
||||
after advancing to the next map element. */
|
||||
}
|
||||
new_list = new_list->next;
|
||||
}
|
||||
old_list = old_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* In order to cache as much as possible while unwinding the local process,
|
||||
we gather a map of the process before starting. If the cache is missing
|
||||
a map, or a map exists but doesn't have the "expected_flags" set, then
|
||||
check if the cache needs to be regenerated.
|
||||
While regenerating the list, grab a write lock to avoid any readers using
|
||||
the list while it's being modified. */
|
||||
static int
|
||||
rebuild_if_necessary (unw_word_t addr, int expected_flags, size_t bytes)
|
||||
{
|
||||
struct map_info *map;
|
||||
struct map_info *new_list;
|
||||
int ret_value = -1;
|
||||
intrmask_t saved_mask;
|
||||
|
||||
new_list = map_create_list (UNW_MAP_CREATE_LOCAL, getpid());
|
||||
map = map_find_from_addr (new_list, addr);
|
||||
if (map && (map->end - addr >= bytes) && (expected_flags == 0 || (map->flags & expected_flags)))
|
||||
{
|
||||
/* Get a write lock on local_map_list since it's going to be modified. */
|
||||
lock_rdwr_wr_acquire (&local_rdwr_lock, saved_mask);
|
||||
|
||||
/* Just in case another thread rebuilt the map, check to see if the
|
||||
ip with expected_flags is in local_map_list. If not, the assumption
|
||||
is that new_list is newer than local_map_list because the map only
|
||||
gets new maps with new permissions. If this is not true, then it
|
||||
would be necessary to regenerate the list one more time. */
|
||||
ret_value = 0;
|
||||
map = map_find_from_addr (local_map_list, addr);
|
||||
if (!map || (map->end - addr < bytes) || (expected_flags != 0 && !(map->flags & expected_flags)))
|
||||
{
|
||||
/* Move any cached items to the new list. */
|
||||
move_cached_elf_data (local_map_list, new_list);
|
||||
map = local_map_list;
|
||||
local_map_list = new_list;
|
||||
new_list = map;
|
||||
}
|
||||
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
}
|
||||
|
||||
map_destroy_list (new_list);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
static int
|
||||
is_flag_set (unw_word_t addr, int flag, size_t bytes)
|
||||
{
|
||||
struct map_info *map;
|
||||
int ret = 0;
|
||||
intrmask_t saved_mask;
|
||||
|
||||
lock_rdwr_rd_acquire (&local_rdwr_lock, saved_mask);
|
||||
map = map_find_from_addr (local_map_list, addr);
|
||||
if (map != NULL)
|
||||
{
|
||||
if (map->flags & MAP_FLAGS_DEVICE_MEM)
|
||||
{
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
return 0;
|
||||
}
|
||||
/* Do not bother checking if the next map is readable and right at
|
||||
* the end of this map. All of the reads/writes are of small values
|
||||
* that should never span a map.
|
||||
*/
|
||||
if (map->end - addr < bytes)
|
||||
ret = 0;
|
||||
else
|
||||
ret = map->flags & flag;
|
||||
}
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
|
||||
if (!ret && rebuild_if_necessary (addr, flag, bytes) == 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
PROTECTED int
|
||||
map_local_is_readable (unw_word_t addr, size_t read_bytes)
|
||||
{
|
||||
return is_flag_set (addr, PROT_READ, read_bytes);
|
||||
}
|
||||
|
||||
PROTECTED int
|
||||
map_local_is_writable (unw_word_t addr, size_t write_bytes)
|
||||
{
|
||||
return is_flag_set (addr, PROT_WRITE, write_bytes);
|
||||
}
|
||||
|
||||
PROTECTED int
|
||||
local_get_elf_image (unw_addr_space_t as, struct elf_image *ei, unw_word_t ip,
|
||||
unsigned long *segbase, unsigned long *mapoff, char **path, void *as_arg)
|
||||
{
|
||||
struct map_info *map;
|
||||
intrmask_t saved_mask;
|
||||
int return_value = -UNW_ENOINFO;
|
||||
|
||||
lock_rdwr_rd_acquire (&local_rdwr_lock, saved_mask);
|
||||
map = map_find_from_addr (local_map_list, ip);
|
||||
if (!map)
|
||||
{
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
if (rebuild_if_necessary (ip, 0, sizeof(unw_word_t)) < 0)
|
||||
return -UNW_ENOINFO;
|
||||
|
||||
lock_rdwr_rd_acquire (&local_rdwr_lock, saved_mask);
|
||||
map = map_find_from_addr (local_map_list, ip);
|
||||
}
|
||||
|
||||
if (map && elf_map_cached_image (as, as_arg, map, ip, true))
|
||||
{
|
||||
/* It is absolutely necessary that the elf structure is a copy of
|
||||
* the map data. The map could be rebuilt and the old ei pointer
|
||||
* will be modified and thrown away.
|
||||
*/
|
||||
*ei = map->ei;
|
||||
*segbase = map->start;
|
||||
if (ei->mapped)
|
||||
*mapoff = map->offset;
|
||||
else
|
||||
/* Always use zero as the map offset for in memory maps. The
|
||||
* dlopen of a shared library from an APK will result in a
|
||||
* non-zero offset so it won't match the elf data and cause
|
||||
* unwinds to fail. Currently, only in memory unwinds of an APK
|
||||
* are possible, so only modify this path.
|
||||
*/
|
||||
*mapoff = 0;
|
||||
if (path != NULL)
|
||||
{
|
||||
if (map->path)
|
||||
*path = strdup(map->path);
|
||||
else
|
||||
*path = NULL;
|
||||
}
|
||||
return_value = 0;
|
||||
}
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PROTECTED char *
|
||||
map_local_get_image_name (unw_word_t ip)
|
||||
{
|
||||
struct map_info *map;
|
||||
intrmask_t saved_mask;
|
||||
char *image_name = NULL;
|
||||
|
||||
lock_rdwr_rd_acquire (&local_rdwr_lock, saved_mask);
|
||||
map = map_find_from_addr (local_map_list, ip);
|
||||
if (!map)
|
||||
{
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
if (rebuild_if_necessary (ip, 0, sizeof(unw_word_t)) < 0)
|
||||
return NULL;
|
||||
|
||||
lock_rdwr_rd_acquire (&local_rdwr_lock, saved_mask);
|
||||
map = map_find_from_addr (local_map_list, ip);
|
||||
}
|
||||
if (map)
|
||||
image_name = strdup (map->path);
|
||||
lock_rdwr_release (&local_rdwr_lock, saved_mask);
|
||||
|
||||
return image_name;
|
||||
}
|
||||
@@ -1,673 +0,0 @@
|
||||
SOVERSION=8:1:0 # See comments at end of file.
|
||||
SETJMP_SO_VERSION=0:0:0
|
||||
COREDUMP_SO_VERSION=0:0:0
|
||||
#
|
||||
# Don't link with start-files since we don't use any constructors/destructors:
|
||||
#
|
||||
COMMON_SO_LDFLAGS = $(LDFLAGS_NOSTARTFILES)
|
||||
|
||||
lib_LIBRARIES =
|
||||
lib_LTLIBRARIES =
|
||||
if !REMOTE_ONLY
|
||||
lib_LTLIBRARIES += libunwind.la
|
||||
if BUILD_PTRACE
|
||||
lib_LTLIBRARIES += libunwind-ptrace.la
|
||||
endif
|
||||
if BUILD_COREDUMP
|
||||
lib_LTLIBRARIES += libunwind-coredump.la
|
||||
endif
|
||||
endif
|
||||
|
||||
noinst_HEADERS =
|
||||
noinst_LTLIBRARIES =
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libunwind-generic.pc
|
||||
|
||||
if !REMOTE_ONLY
|
||||
pkgconfig_DATA += unwind/libunwind.pc
|
||||
endif
|
||||
|
||||
if BUILD_PTRACE
|
||||
pkgconfig_DATA += ptrace/libunwind-ptrace.pc
|
||||
endif
|
||||
|
||||
if BUILD_SETJMP
|
||||
pkgconfig_DATA += setjmp/libunwind-setjmp.pc
|
||||
endif
|
||||
|
||||
if BUILD_COREDUMP
|
||||
pkgconfig_DATA += coredump/libunwind-coredump.pc
|
||||
endif
|
||||
|
||||
### libunwind-ptrace:
|
||||
libunwind_ptrace_la_SOURCES = \
|
||||
ptrace/_UPT_elf.c \
|
||||
ptrace/_UPT_accessors.c ptrace/_UPT_access_fpreg.c \
|
||||
ptrace/_UPT_access_mem.c ptrace/_UPT_access_reg.c \
|
||||
ptrace/_UPT_create.c ptrace/_UPT_destroy.c \
|
||||
ptrace/_UPT_find_proc_info.c ptrace/_UPT_get_dyn_info_list_addr.c \
|
||||
ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c \
|
||||
ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c
|
||||
noinst_HEADERS += ptrace/_UPT_internal.h
|
||||
|
||||
### libunwind-coredump:
|
||||
libunwind_coredump_la_SOURCES = \
|
||||
coredump/_UCD_accessors.c \
|
||||
coredump/_UCD_create.c \
|
||||
coredump/_UCD_destroy.c \
|
||||
coredump/_UCD_access_mem.c \
|
||||
coredump/_UCD_elf_map_image.c \
|
||||
coredump/_UCD_find_proc_info.c \
|
||||
coredump/_UCD_get_proc_name.c \
|
||||
\
|
||||
coredump/_UPT_elf.c \
|
||||
coredump/_UPT_access_fpreg.c \
|
||||
coredump/_UPT_get_dyn_info_list_addr.c \
|
||||
coredump/_UPT_put_unwind_info.c \
|
||||
coredump/_UPT_resume.c
|
||||
libunwind_coredump_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \
|
||||
-version-info $(COREDUMP_SO_VERSION)
|
||||
noinst_HEADERS += coredump/_UCD_internal.h
|
||||
|
||||
### libunwind-setjmp:
|
||||
libunwind_setjmp_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \
|
||||
-version-info $(SETJMP_SO_VERSION)
|
||||
|
||||
if USE_ELF32
|
||||
LIBUNWIND_ELF = libunwind-elf32.la
|
||||
endif
|
||||
if USE_ELF64
|
||||
LIBUNWIND_ELF = libunwind-elf64.la
|
||||
endif
|
||||
if USE_ELFXX
|
||||
LIBUNWIND_ELF = libunwind-elfxx.la
|
||||
endif
|
||||
|
||||
libunwind_setjmp_la_LIBADD = $(LIBUNWIND_ELF) \
|
||||
libunwind-$(arch).la \
|
||||
libunwind.la -lc
|
||||
libunwind_setjmp_la_SOURCES = setjmp/longjmp.c \
|
||||
setjmp/siglongjmp.c
|
||||
noinst_HEADERS += setjmp/setjmp_i.h
|
||||
|
||||
### libunwind:
|
||||
libunwind_la_LIBADD =
|
||||
|
||||
# List of arch-independent files needed by both local-only and generic
|
||||
# libraries:
|
||||
libunwind_la_SOURCES_common = \
|
||||
$(libunwind_la_SOURCES_os) \
|
||||
mi/init.c mi/flush_cache.c mi/mempool.c mi/strerror.c
|
||||
|
||||
# List of arch-independent files needed by generic library (libunwind-$ARCH):
|
||||
libunwind_la_SOURCES_generic = \
|
||||
mi/Gdyn-extract.c mi/Gdyn-remote.c mi/Gfind_dynamic_proc_info.c \
|
||||
mi/Gget_accessors.c \
|
||||
mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \
|
||||
mi/Gput_dynamic_unwind_info.c mi/Gdestroy_addr_space.c \
|
||||
mi/Gget_reg.c mi/Gset_reg.c \
|
||||
mi/Gget_fpreg.c mi/Gset_fpreg.c \
|
||||
mi/Gset_caching_policy.c
|
||||
|
||||
if SUPPORT_CXX_EXCEPTIONS
|
||||
libunwind_la_SOURCES_local_unwind = \
|
||||
unwind/Backtrace.c unwind/DeleteException.c \
|
||||
unwind/FindEnclosingFunction.c unwind/ForcedUnwind.c \
|
||||
unwind/GetBSP.c unwind/GetCFA.c unwind/GetDataRelBase.c \
|
||||
unwind/GetGR.c unwind/GetIP.c unwind/GetLanguageSpecificData.c \
|
||||
unwind/GetRegionStart.c unwind/GetTextRelBase.c \
|
||||
unwind/RaiseException.c unwind/Resume.c \
|
||||
unwind/Resume_or_Rethrow.c unwind/SetGR.c unwind/SetIP.c \
|
||||
unwind/GetIPInfo.c
|
||||
|
||||
# _ReadULEB()/_ReadSLEB() are needed for Intel C++ 8.0 compatibility
|
||||
libunwind_la_SOURCES_os_linux_local = mi/_ReadULEB.c mi/_ReadSLEB.c
|
||||
endif
|
||||
|
||||
# List of arch-independent files needed by local-only library (libunwind):
|
||||
libunwind_la_SOURCES_local_nounwind = \
|
||||
$(libunwind_la_SOURCES_os_local) \
|
||||
mi/backtrace.c \
|
||||
mi/dyn-cancel.c mi/dyn-info-list.c mi/dyn-register.c \
|
||||
mi/Ldyn-extract.c mi/Lfind_dynamic_proc_info.c \
|
||||
mi/Lget_accessors.c \
|
||||
mi/Lget_proc_info_by_ip.c mi/Lget_proc_name.c \
|
||||
mi/Lput_dynamic_unwind_info.c mi/Ldestroy_addr_space.c \
|
||||
mi/Lget_reg.c mi/Lset_reg.c \
|
||||
mi/Lget_fpreg.c mi/Lset_fpreg.c \
|
||||
mi/Lset_caching_policy.c
|
||||
|
||||
libunwind_la_SOURCES_local = \
|
||||
$(libunwind_la_SOURCES_local_nounwind) \
|
||||
$(libunwind_la_SOURCES_local_unwind)
|
||||
|
||||
noinst_HEADERS += os-linux.h
|
||||
libunwind_la_SOURCES_os_linux = os-linux.c
|
||||
|
||||
libunwind_la_SOURCES_os_hpux = os-hpux.c
|
||||
|
||||
libunwind_la_SOURCES_os_freebsd = os-freebsd.c
|
||||
|
||||
libunwind_la_SOURCES_os_qnx = os-qnx.c
|
||||
|
||||
libunwind_dwarf_common_la_SOURCES = dwarf/global.c
|
||||
|
||||
libunwind_dwarf_local_la_SOURCES = \
|
||||
dwarf/Lexpr.c dwarf/Lfde.c dwarf/Lparser.c dwarf/Lpe.c dwarf/Lstep.c \
|
||||
dwarf/Lfind_proc_info-lsb.c \
|
||||
dwarf/Lfind_unwind_table.c
|
||||
libunwind_dwarf_local_la_LIBADD = libunwind-dwarf-common.la
|
||||
|
||||
libunwind_dwarf_generic_la_SOURCES = \
|
||||
dwarf/Gexpr.c dwarf/Gfde.c dwarf/Gparser.c dwarf/Gpe.c dwarf/Gstep.c \
|
||||
dwarf/Gfind_proc_info-lsb.c \
|
||||
dwarf/Gfind_unwind_table.c
|
||||
libunwind_dwarf_generic_la_LIBADD = libunwind-dwarf-common.la
|
||||
|
||||
if USE_DWARF
|
||||
noinst_LTLIBRARIES += libunwind-dwarf-common.la libunwind-dwarf-generic.la
|
||||
if !REMOTE_ONLY
|
||||
noinst_LTLIBRARIES += libunwind-dwarf-local.la
|
||||
endif
|
||||
libunwind_la_LIBADD += libunwind-dwarf-local.la
|
||||
endif
|
||||
|
||||
noinst_HEADERS += elf32.h elf64.h elfxx.h
|
||||
|
||||
libunwind_elf32_la_SOURCES = elf32.c
|
||||
libunwind_elf64_la_SOURCES = elf64.c
|
||||
libunwind_elfxx_la_SOURCES = elfxx.c
|
||||
|
||||
noinst_LTLIBRARIES += $(LIBUNWIND_ELF)
|
||||
libunwind_la_LIBADD += $(LIBUNWIND_ELF)
|
||||
|
||||
# The list of files that go into libunwind and libunwind-aarch64:
|
||||
noinst_HEADERS += aarch64/init.h aarch64/offsets.h aarch64/unwind_i.h
|
||||
libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common) \
|
||||
aarch64/is_fpreg.c aarch64/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c \
|
||||
aarch64/Lget_save_loc.c aarch64/Lglobal.c aarch64/Linit.c \
|
||||
aarch64/Linit_local.c aarch64/Linit_remote.c \
|
||||
aarch64/Lis_signal_frame.c aarch64/Lregs.c aarch64/Lresume.c \
|
||||
aarch64/Lstep.c
|
||||
|
||||
libunwind_aarch64_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c \
|
||||
aarch64/Gget_save_loc.c aarch64/Gglobal.c aarch64/Ginit.c \
|
||||
aarch64/Ginit_local.c aarch64/Ginit_remote.c \
|
||||
aarch64/Gis_signal_frame.c aarch64/Gregs.c aarch64/Gresume.c \
|
||||
aarch64/Gstep.c
|
||||
|
||||
# The list of files that go into libunwind and libunwind-arm:
|
||||
noinst_HEADERS += arm/init.h arm/offsets.h arm/unwind_i.h
|
||||
libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common) \
|
||||
arm/is_fpreg.c arm/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
arm/getcontext.S \
|
||||
arm/Lcreate_addr_space.c arm/Lget_proc_info.c arm/Lget_save_loc.c \
|
||||
arm/Lglobal.c arm/Linit.c arm/Linit_local.c arm/Linit_remote.c \
|
||||
arm/Lis_signal_frame.c arm/Lregs.c arm/Lresume.c arm/Lstep.c \
|
||||
arm/Lex_tables.c
|
||||
|
||||
libunwind_arm_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
arm/Gcreate_addr_space.c arm/Gget_proc_info.c arm/Gget_save_loc.c \
|
||||
arm/Gglobal.c arm/Ginit.c arm/Ginit_local.c arm/Ginit_remote.c \
|
||||
arm/Gis_signal_frame.c arm/Gregs.c arm/Gresume.c arm/Gstep.c \
|
||||
arm/Gex_tables.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-ia64:
|
||||
noinst_HEADERS += ia64/init.h ia64/offsets.h ia64/regs.h \
|
||||
ia64/ucontext_i.h ia64/unwind_decoder.h ia64/unwind_i.h
|
||||
libunwind_la_SOURCES_ia64_common = $(libunwind_la_SOURCES_common) \
|
||||
ia64/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
\
|
||||
ia64/dyn_info_list.S ia64/getcontext.S \
|
||||
\
|
||||
ia64/Lcreate_addr_space.c ia64/Lget_proc_info.c ia64/Lget_save_loc.c \
|
||||
ia64/Lglobal.c ia64/Linit.c ia64/Linit_local.c ia64/Linit_remote.c \
|
||||
ia64/Linstall_cursor.S ia64/Lis_signal_frame.c ia64/Lparser.c \
|
||||
ia64/Lrbs.c ia64/Lregs.c ia64/Lresume.c ia64/Lscript.c ia64/Lstep.c \
|
||||
ia64/Ltables.c ia64/Lfind_unwind_table.c
|
||||
|
||||
# The list of files that go into libunwind-ia64:
|
||||
libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
ia64/Gcreate_addr_space.c ia64/Gget_proc_info.c ia64/Gget_save_loc.c \
|
||||
ia64/Gglobal.c ia64/Ginit.c ia64/Ginit_local.c ia64/Ginit_remote.c \
|
||||
ia64/Ginstall_cursor.S ia64/Gis_signal_frame.c ia64/Gparser.c \
|
||||
ia64/Grbs.c ia64/Gregs.c ia64/Gresume.c ia64/Gscript.c ia64/Gstep.c \
|
||||
ia64/Gtables.c ia64/Gfind_unwind_table.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-hppa:
|
||||
noinst_HEADERS += hppa/init.h hppa/offsets.h hppa/unwind_i.h
|
||||
libunwind_la_SOURCES_hppa_common = $(libunwind_la_SOURCES_common) \
|
||||
hppa/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
hppa/getcontext.S hppa/setcontext.S \
|
||||
hppa/Lcreate_addr_space.c hppa/Lget_save_loc.c hppa/Lglobal.c \
|
||||
hppa/Linit.c hppa/Linit_local.c hppa/Linit_remote.c \
|
||||
hppa/Lis_signal_frame.c hppa/Lget_proc_info.c hppa/Lregs.c \
|
||||
hppa/Lresume.c hppa/Lstep.c
|
||||
|
||||
# The list of files that go into libunwind-hppa:
|
||||
libunwind_hppa_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
hppa/Gcreate_addr_space.c hppa/Gget_save_loc.c hppa/Gglobal.c \
|
||||
hppa/Ginit.c hppa/Ginit_local.c hppa/Ginit_remote.c \
|
||||
hppa/Gis_signal_frame.c hppa/Gget_proc_info.c hppa/Gregs.c \
|
||||
hppa/Gresume.c hppa/Gstep.c
|
||||
|
||||
# The list of files that go info libunwind and libunwind-mips:
|
||||
noinst_HEADERS += mips/init.h mips/offsets.h
|
||||
libunwind_la_SOURCES_mips_common = $(libunwind_la_SOURCES_common) \
|
||||
mips/is_fpreg.c mips/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_mips = $(libunwind_la_SOURCES_mips_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
mips/getcontext.S \
|
||||
mips/Lcreate_addr_space.c mips/Lget_proc_info.c mips/Lget_save_loc.c \
|
||||
mips/Lglobal.c mips/Linit.c mips/Linit_local.c mips/Linit_remote.c \
|
||||
mips/Lis_signal_frame.c mips/Lregs.c mips/Lresume.c mips/Lstep.c
|
||||
|
||||
libunwind_mips_la_SOURCES_mips = $(libunwind_la_SOURCES_mips_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
mips/Gcreate_addr_space.c mips/Gget_proc_info.c mips/Gget_save_loc.c \
|
||||
mips/Gglobal.c mips/Ginit.c mips/Ginit_local.c mips/Ginit_remote.c \
|
||||
mips/Gis_signal_frame.c mips/Gregs.c mips/Gresume.c mips/Gstep.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-x86:
|
||||
noinst_HEADERS += x86/init.h x86/offsets.h x86/unwind_i.h
|
||||
libunwind_la_SOURCES_x86_common = $(libunwind_la_SOURCES_common) \
|
||||
x86/is_fpreg.c x86/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common) \
|
||||
$(libunwind_la_SOURCES_x86_os_local) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
x86/Lcreate_addr_space.c x86/Lget_save_loc.c x86/Lglobal.c \
|
||||
x86/Linit.c x86/Linit_local.c x86/Linit_remote.c \
|
||||
x86/Lget_proc_info.c x86/Lregs.c \
|
||||
x86/Lresume.c x86/Lstep.c
|
||||
|
||||
# The list of files that go into libunwind-x86:
|
||||
libunwind_x86_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common) \
|
||||
$(libunwind_la_SOURCES_x86_os) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
x86/Gcreate_addr_space.c x86/Gget_save_loc.c x86/Gglobal.c \
|
||||
x86/Ginit.c x86/Ginit_local.c x86/Ginit_remote.c \
|
||||
x86/Gget_proc_info.c x86/Gregs.c \
|
||||
x86/Gresume.c x86/Gstep.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-x86_64:
|
||||
noinst_HEADERS += x86_64/offsets.h \
|
||||
x86_64/init.h x86_64/unwind_i.h x86_64/ucontext_i.h
|
||||
libunwind_la_SOURCES_x86_64_common = $(libunwind_la_SOURCES_common) \
|
||||
x86_64/is_fpreg.c x86_64/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common) \
|
||||
$(libunwind_la_SOURCES_x86_64_os_local) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
x86_64/setcontext.S \
|
||||
x86_64/Lcreate_addr_space.c x86_64/Lget_save_loc.c x86_64/Lglobal.c \
|
||||
x86_64/Linit.c x86_64/Linit_local.c x86_64/Linit_remote.c \
|
||||
x86_64/Lget_proc_info.c x86_64/Lregs.c x86_64/Lresume.c \
|
||||
x86_64/Lstash_frame.c x86_64/Lstep.c x86_64/Ltrace.c x86_64/getcontext.S
|
||||
|
||||
# The list of files that go into libunwind-x86_64:
|
||||
libunwind_x86_64_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common) \
|
||||
$(libunwind_la_SOURCES_x86_64_os) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
x86_64/Gcreate_addr_space.c x86_64/Gget_save_loc.c x86_64/Gglobal.c \
|
||||
x86_64/Ginit.c x86_64/Ginit_local.c x86_64/Ginit_remote.c \
|
||||
x86_64/Gget_proc_info.c x86_64/Gregs.c x86_64/Gresume.c \
|
||||
x86_64/Gstash_frame.c x86_64/Gstep.c x86_64/Gtrace.c
|
||||
|
||||
# The list of local files that go to Power 64 and 32:
|
||||
libunwind_la_SOURCES_ppc = ppc/Lcreate_addr_space.c \
|
||||
ppc/Lget_proc_info.c ppc/Lget_save_loc.c ppc/Linit_local.c \
|
||||
ppc/Linit_remote.c ppc/Lis_signal_frame.c
|
||||
|
||||
# The list of generic files that go to Power 64 and 32:
|
||||
libunwind_ppc_la_SOURCES_ppc_generic = ppc/Gcreate_addr_space.c \
|
||||
ppc/Gget_proc_info.c ppc/Gget_save_loc.c ppc/Ginit_local.c \
|
||||
ppc/Ginit_remote.c ppc/Gis_signal_frame.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-ppc32:
|
||||
noinst_HEADERS += ppc32/init.h ppc32/unwind_i.h ppc32/ucontext_i.h
|
||||
libunwind_la_SOURCES_ppc32_common = $(libunwind_la_SOURCES_common) \
|
||||
ppc32/is_fpreg.c ppc32/regname.c ppc32/get_func_addr.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
$(libunwind_la_SOURCES_ppc) \
|
||||
ppc32/Lglobal.c ppc32/Linit.c \
|
||||
ppc32/Lregs.c ppc32/Lresume.c ppc32/Lstep.c
|
||||
|
||||
# The list of files that go into libunwind-ppc32:
|
||||
libunwind_ppc32_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
$(libunwind_ppc_la_SOURCES_ppc_generic) \
|
||||
ppc32/Gglobal.c ppc32/Ginit.c \
|
||||
ppc32/Gregs.c ppc32/Gresume.c ppc32/Gstep.c
|
||||
|
||||
# The list of files that go both into libunwind and libunwind-ppc64:
|
||||
noinst_HEADERS += ppc64/init.h ppc64/unwind_i.h ppc64/ucontext_i.h
|
||||
libunwind_la_SOURCES_ppc64_common = $(libunwind_la_SOURCES_common) \
|
||||
ppc64/is_fpreg.c ppc64/regname.c ppc64/get_func_addr.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
$(libunwind_la_SOURCES_ppc) \
|
||||
ppc64/Lglobal.c ppc64/Linit.c \
|
||||
ppc64/Lregs.c ppc64/Lresume.c ppc64/Lstep.c
|
||||
|
||||
# The list of files that go into libunwind-ppc64:
|
||||
libunwind_ppc64_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
$(libunwind_ppc_la_SOURCES_ppc_generic) \
|
||||
ppc64/Gglobal.c ppc64/Ginit.c \
|
||||
ppc64/Gregs.c ppc64/Gresume.c ppc64/Gstep.c
|
||||
|
||||
# The list of files that go into libunwind and libunwind-sh:
|
||||
noinst_HEADERS += sh/init.h sh/offsets.h sh/unwind_i.h
|
||||
libunwind_la_SOURCES_sh_common = $(libunwind_la_SOURCES_common) \
|
||||
sh/is_fpreg.c sh/regname.c
|
||||
|
||||
# The list of files that go into libunwind:
|
||||
libunwind_la_SOURCES_sh = $(libunwind_la_SOURCES_sh_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
sh/Lcreate_addr_space.c sh/Lget_proc_info.c sh/Lget_save_loc.c \
|
||||
sh/Lglobal.c sh/Linit.c sh/Linit_local.c sh/Linit_remote.c \
|
||||
sh/Lis_signal_frame.c sh/Lregs.c sh/Lresume.c sh/Lstep.c
|
||||
|
||||
libunwind_sh_la_SOURCES_sh = $(libunwind_la_SOURCES_sh_common) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
sh/Gcreate_addr_space.c sh/Gget_proc_info.c sh/Gget_save_loc.c \
|
||||
sh/Gglobal.c sh/Ginit.c sh/Ginit_local.c sh/Ginit_remote.c \
|
||||
sh/Gis_signal_frame.c sh/Gregs.c sh/Gresume.c sh/Gstep.c
|
||||
|
||||
if REMOTE_ONLY
|
||||
install-exec-hook:
|
||||
# Nothing to do here....
|
||||
else
|
||||
#
|
||||
# This is not ideal, but I know of no other way to install an
|
||||
# alias for a library. For the shared version, we have to do
|
||||
# a file check before creating the link, because it isn't going
|
||||
# to be there if the user configured with --disable-shared.
|
||||
#
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).a libunwind-generic.a
|
||||
if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \
|
||||
cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).so \
|
||||
libunwind-generic.so; \
|
||||
fi
|
||||
endif
|
||||
|
||||
if OS_LINUX
|
||||
libunwind_la_SOURCES_os = $(libunwind_la_SOURCES_os_linux)
|
||||
libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_linux_local)
|
||||
libunwind_la_SOURCES_x86_os = x86/Gos-linux.c
|
||||
libunwind_x86_la_SOURCES_os = x86/getcontext-linux.S
|
||||
libunwind_la_SOURCES_x86_os_local = x86/Los-linux.c
|
||||
libunwind_la_SOURCES_x86_64_os = x86_64/Gos-linux.c
|
||||
libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-linux.c
|
||||
libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_linux.c
|
||||
endif
|
||||
|
||||
if OS_HPUX
|
||||
libunwind_la_SOURCES_os = $(libunwind_la_SOURCES_os_hpux)
|
||||
libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_hpux_local)
|
||||
endif
|
||||
|
||||
if OS_FREEBSD
|
||||
libunwind_la_SOURCES_os = $(libunwind_la_SOURCES_os_freebsd)
|
||||
libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_freebsd_local)
|
||||
libunwind_la_SOURCES_x86_os = x86/Gos-freebsd.c
|
||||
libunwind_x86_la_SOURCES_os = x86/getcontext-freebsd.S
|
||||
libunwind_la_SOURCES_x86_os_local = x86/Los-freebsd.c
|
||||
libunwind_la_SOURCES_x86_64_os = x86_64/Gos-freebsd.c
|
||||
libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-freebsd.c
|
||||
libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c
|
||||
endif
|
||||
|
||||
if OS_QNX
|
||||
libunwind_la_SOURCES_os = $(libunwind_la_SOURCES_os_qnx)
|
||||
libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_qnx_local)
|
||||
endif
|
||||
|
||||
if ARCH_AARCH64
|
||||
lib_LTLIBRARIES += libunwind-aarch64.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_aarch64)
|
||||
libunwind_aarch64_la_SOURCES = $(libunwind_aarch64_la_SOURCES_aarch64)
|
||||
libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_aarch64_la_LIBADD += libunwind-elf64.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_aarch64_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += aarch64/siglongjmp.S
|
||||
else
|
||||
if ARCH_ARM
|
||||
lib_LTLIBRARIES += libunwind-arm.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm)
|
||||
libunwind_arm_la_SOURCES = $(libunwind_arm_la_SOURCES_arm)
|
||||
libunwind_arm_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_arm_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_arm_la_LIBADD += libunwind-elf32.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_arm_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += arm/siglongjmp.S
|
||||
else
|
||||
if ARCH_IA64
|
||||
BUILT_SOURCES = Gcursor_i.h Lcursor_i.h
|
||||
mk_Gcursor_i.s: $(srcdir)/ia64/mk_Gcursor_i.c
|
||||
$(COMPILE) -S "$(srcdir)/ia64/mk_Gcursor_i.c" -o mk_Gcursor_i.s
|
||||
mk_Lcursor_i.s: $(srcdir)/ia64/mk_Lcursor_i.c
|
||||
$(COMPILE) -S "$(srcdir)/ia64/mk_Lcursor_i.c" -o mk_Lcursor_i.s
|
||||
Gcursor_i.h: mk_Gcursor_i.s
|
||||
"$(srcdir)/ia64/mk_cursor_i" mk_Gcursor_i.s > Gcursor_i.h
|
||||
Lcursor_i.h: mk_Lcursor_i.s
|
||||
"$(srcdir)/ia64/mk_cursor_i" mk_Lcursor_i.s > Lcursor_i.h
|
||||
|
||||
lib_LTLIBRARIES += libunwind-ia64.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_ia64)
|
||||
libunwind_ia64_la_SOURCES = $(libunwind_ia64_la_SOURCES_ia64)
|
||||
libunwind_ia64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_ia64_la_LIBADD = libunwind-elf64.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_ia64_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += ia64/setjmp.S ia64/sigsetjmp.S \
|
||||
ia64/longjmp.S ia64/siglongjmp.S
|
||||
else
|
||||
if ARCH_HPPA
|
||||
lib_LTLIBRARIES += libunwind-hppa.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_hppa)
|
||||
libunwind_hppa_la_SOURCES = $(libunwind_hppa_la_SOURCES_hppa)
|
||||
libunwind_hppa_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_hppa_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_hppa_la_LIBADD += libunwind-elf32.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_hppa_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += hppa/siglongjmp.S
|
||||
else
|
||||
if ARCH_MIPS
|
||||
lib_LTLIBRARIES += libunwind-mips.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_mips)
|
||||
libunwind_mips_la_SOURCES = $(libunwind_mips_la_SOURCES_mips)
|
||||
libunwind_mips_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_mips_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_mips_la_LIBADD += libunwind-elfxx.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_mips_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += mips/siglongjmp.S
|
||||
else
|
||||
if ARCH_X86
|
||||
lib_LTLIBRARIES += libunwind-x86.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86) $(libunwind_x86_la_SOURCES_os)
|
||||
libunwind_x86_la_SOURCES = $(libunwind_x86_la_SOURCES_x86)
|
||||
libunwind_x86_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_x86_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_x86_la_LIBADD += libunwind-elf32.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_x86_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += x86/longjmp.S x86/siglongjmp.S
|
||||
else
|
||||
if ARCH_X86_64
|
||||
lib_LTLIBRARIES += libunwind-x86_64.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86_64)
|
||||
libunwind_x86_64_la_SOURCES = $(libunwind_x86_64_la_SOURCES_x86_64)
|
||||
libunwind_x86_64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_x86_64_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_x86_64_la_LIBADD += libunwind-elf64.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_x86_64_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += x86_64/longjmp.S x86_64/siglongjmp.S
|
||||
else
|
||||
if ARCH_PPC32
|
||||
lib_LTLIBRARIES += libunwind-ppc32.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_ppc32)
|
||||
libunwind_ppc32_la_SOURCES = $(libunwind_ppc32_la_SOURCES_ppc32)
|
||||
libunwind_ppc32_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_ppc32_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_ppc32_la_LIBADD += libunwind-elf32.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_ppc32_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += ppc/longjmp.S ppc/siglongjmp.S
|
||||
else
|
||||
if ARCH_PPC64
|
||||
lib_LTLIBRARIES += libunwind-ppc64.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_ppc64)
|
||||
libunwind_ppc64_la_SOURCES = $(libunwind_ppc64_la_SOURCES_ppc64)
|
||||
libunwind_ppc64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_ppc64_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_ppc64_la_LIBADD += libunwind-elf64.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_ppc64_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += ppc/longjmp.S ppc/siglongjmp.S
|
||||
else
|
||||
if ARCH_SH
|
||||
lib_LTLIBRARIES += libunwind-sh.la
|
||||
libunwind_la_SOURCES = $(libunwind_la_SOURCES_sh)
|
||||
libunwind_sh_la_SOURCES = $(libunwind_sh_la_SOURCES_sh)
|
||||
libunwind_sh_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
|
||||
libunwind_sh_la_LIBADD = libunwind-dwarf-generic.la
|
||||
libunwind_sh_la_LIBADD += libunwind-elf32.la
|
||||
if !REMOTE_ONLY
|
||||
libunwind_sh_la_LIBADD += libunwind.la -lc
|
||||
endif
|
||||
libunwind_setjmp_la_SOURCES += sh/siglongjmp.S
|
||||
|
||||
endif # ARCH_SH
|
||||
endif # ARCH_PPC64
|
||||
endif # ARCH_PPC32
|
||||
endif # ARCH_X86_64
|
||||
endif # ARCH_X86
|
||||
endif # ARCH_MIPS
|
||||
endif # ARCH_HPPA
|
||||
endif # ARCH_IA64
|
||||
endif # ARCH_ARM
|
||||
endif # ARCH_AARCH64
|
||||
|
||||
# libunwind-setjmp depends on libunwind-$(arch). Therefore must be added
|
||||
# at the end.
|
||||
if BUILD_SETJMP
|
||||
lib_LTLIBRARIES += libunwind-setjmp.la
|
||||
endif
|
||||
|
||||
#
|
||||
# Don't link with standard libraries, because those may mention
|
||||
# libunwind already.
|
||||
#
|
||||
libunwind_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
|
||||
$(LDFLAGS_STATIC_LIBCXA) -version-info $(SOVERSION)
|
||||
libunwind_la_LIBADD += -lc $(LIBCRTS)
|
||||
libunwind_la_LIBADD += $(LIBLZMA)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
|
||||
AM_CCASFLAGS = $(AM_CPPFLAGS)
|
||||
noinst_HEADERS += unwind/unwind-internal.h
|
||||
|
||||
EXTRA_DIST = $(libunwind_la_SOURCES_aarch64) \
|
||||
$(libunwind_la_SOURCES_arm) \
|
||||
$(libunwind_la_SOURCES_hppa) \
|
||||
$(libunwind_la_SOURCES_ia64) \
|
||||
$(libunwind_la_SOURCES_mips) \
|
||||
$(libunwind_la_SOURCES_sh) \
|
||||
$(libunwind_la_SOURCES_x86) \
|
||||
$(libunwind_la_SOURCES_os_freebsd) \
|
||||
$(libunwind_la_SOURCES_os_linux) \
|
||||
$(libunwind_la_SOURCES_os_hpux) \
|
||||
$(libunwind_la_SOURCES_os_qnx) \
|
||||
$(libunwind_la_SOURCES_common) \
|
||||
$(libunwind_la_SOURCES_local) \
|
||||
$(libunwind_la_SOURCES_generic) \
|
||||
$(libunwind_aarch64_la_SOURCES_aarch64) \
|
||||
$(libunwind_arm_la_SOURCES_arm) \
|
||||
$(libunwind_hppa_la_SOURCES_hppa) \
|
||||
$(libunwind_ia64_la_SOURCES_ia64) \
|
||||
$(libunwind_mips_la_SOURCES_mips) \
|
||||
$(libunwind_sh_la_SOURCES_sh) \
|
||||
$(libunwind_x86_la_SOURCES_x86) \
|
||||
$(libunwind_x86_64_la_SOURCES_x86_64)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
# The -version-info flag accepts an argument of the form
|
||||
# `current[:revision[:age]]'. So, passing `-version-info 3:12:1' sets
|
||||
# current to 3, revision to 12, and age to 1.
|
||||
|
||||
# If either revision or age are omitted, they default to 0. Also note
|
||||
# that age must be less than or equal to the current interface number.
|
||||
|
||||
# Here are a set of rules to help you update your library version
|
||||
# information:
|
||||
|
||||
# 1. Start with version information of `0:0:0' for each libtool
|
||||
# library.
|
||||
|
||||
# 2. Update the version information only immediately before a public
|
||||
# release of your software. More frequent updates are unnecessary,
|
||||
# and only guarantee that the current interface number gets larger
|
||||
# faster.
|
||||
|
||||
# 3. If the library source code has changed at all since the last
|
||||
# update, then increment revision (`c:r:a' becomes `c:r+1:a').
|
||||
|
||||
# 4. If any interfaces have been added, removed, or changed since the
|
||||
# last update, increment current, and set revision to 0.
|
||||
|
||||
# 5. If any interfaces have been added since the last public release,
|
||||
# then increment age.
|
||||
|
||||
# 6. If any interfaces have been removed since the last public
|
||||
# release, then set age to 0.
|
||||
@@ -1,60 +0,0 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
|
||||
Copyright (C) 2013 Linaro Limited
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unwind_i.h"
|
||||
|
||||
PROTECTED unw_addr_space_t
|
||||
unw_create_addr_space (unw_accessors_t *a, int byte_order)
|
||||
{
|
||||
#ifdef UNW_LOCAL_ONLY
|
||||
return NULL;
|
||||
#else
|
||||
unw_addr_space_t as;
|
||||
|
||||
/* AArch64 supports little-endian and big-endian. */
|
||||
if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
|
||||
&& byte_order != __BIG_ENDIAN)
|
||||
return NULL;
|
||||
|
||||
as = malloc (sizeof (*as));
|
||||
if (!as)
|
||||
return NULL;
|
||||
|
||||
memset (as, 0, sizeof (*as));
|
||||
|
||||
as->acc = *a;
|
||||
|
||||
/* Default to little-endian for AArch64. */
|
||||
if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
|
||||
as->big_endian = 0;
|
||||
else
|
||||
as->big_endian = 1;
|
||||
|
||||
return as;
|
||||
#endif
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2008 CodeSourcery
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#include "unwind_i.h"
|
||||
|
||||
PROTECTED int
|
||||
unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi)
|
||||
{
|
||||
struct cursor *c = (struct cursor *) cursor;
|
||||
int ret;
|
||||
|
||||
ret = dwarf_make_proc_info (&c->dwarf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
*pi = c->dwarf.pi;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2008 CodeSourcery
|
||||
Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
|
||||
Copyright (C) 2013 Linaro Limited
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#include "unwind_i.h"
|
||||
|
||||
PROTECTED int
|
||||
unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc)
|
||||
{
|
||||
struct cursor *c = (struct cursor *) cursor;
|
||||
dwarf_loc_t loc;
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
case UNW_AARCH64_X0:
|
||||
case UNW_AARCH64_X1:
|
||||
case UNW_AARCH64_X2:
|
||||
case UNW_AARCH64_X3:
|
||||
case UNW_AARCH64_X4:
|
||||
case UNW_AARCH64_X5:
|
||||
case UNW_AARCH64_X6:
|
||||
case UNW_AARCH64_X7:
|
||||
case UNW_AARCH64_X8:
|
||||
case UNW_AARCH64_X9:
|
||||
case UNW_AARCH64_X10:
|
||||
case UNW_AARCH64_X11:
|
||||
case UNW_AARCH64_X12:
|
||||
case UNW_AARCH64_X13:
|
||||
case UNW_AARCH64_X14:
|
||||
case UNW_AARCH64_X15:
|
||||
case UNW_AARCH64_X16:
|
||||
case UNW_AARCH64_X17:
|
||||
case UNW_AARCH64_X18:
|
||||
case UNW_AARCH64_X19:
|
||||
case UNW_AARCH64_X20:
|
||||
case UNW_AARCH64_X21:
|
||||
case UNW_AARCH64_X22:
|
||||
case UNW_AARCH64_X23:
|
||||
case UNW_AARCH64_X24:
|
||||
case UNW_AARCH64_X25:
|
||||
case UNW_AARCH64_X26:
|
||||
case UNW_AARCH64_X27:
|
||||
case UNW_AARCH64_X28:
|
||||
case UNW_AARCH64_X29:
|
||||
case UNW_AARCH64_X30:
|
||||
case UNW_AARCH64_SP:
|
||||
case UNW_AARCH64_PC:
|
||||
case UNW_AARCH64_PSTATE:
|
||||
loc = c->dwarf.loc[reg];
|
||||
break;
|
||||
|
||||
default:
|
||||
loc = DWARF_NULL_LOC; /* default to "not saved" */
|
||||
break;
|
||||
}
|
||||
|
||||
memset (sloc, 0, sizeof (*sloc));
|
||||
|
||||
if (DWARF_IS_NULL_LOC (loc))
|
||||
{
|
||||
sloc->type = UNW_SLT_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(UNW_LOCAL_ONLY)
|
||||
if (DWARF_IS_REG_LOC (loc))
|
||||
{
|
||||
sloc->type = UNW_SLT_REG;
|
||||
sloc->u.regnum = DWARF_GET_LOC (loc);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sloc->type = UNW_SLT_MEMORY;
|
||||
sloc->u.addr = DWARF_GET_LOC (loc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2008 CodeSourcery
|
||||
Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
|
||||
Copyright (C) 2013 Linaro Limited
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#include "unwind_i.h"
|
||||
#include "dwarf_i.h"
|
||||
|
||||
HIDDEN define_lock (aarch64_lock);
|
||||
HIDDEN int tdep_init_done;
|
||||
|
||||
HIDDEN void
|
||||
tdep_init (void)
|
||||
{
|
||||
intrmask_t saved_mask;
|
||||
|
||||
sigfillset (&unwi_full_mask);
|
||||
|
||||
lock_acquire (&aarch64_lock, saved_mask);
|
||||
{
|
||||
if (tdep_init_done)
|
||||
/* another thread else beat us to it... */
|
||||
goto out;
|
||||
|
||||
mi_init ();
|
||||
|
||||
dwarf_init ();
|
||||
|
||||
#ifndef UNW_REMOTE_ONLY
|
||||
aarch64_local_addr_space_init ();
|
||||
#endif
|
||||
tdep_init_done = 1; /* signal that we're initialized... */
|
||||
}
|
||||
out:
|
||||
lock_release (&aarch64_lock, saved_mask);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user