diff options
author | Doug Moore <dougm@rice.edu> | 2017-05-08 22:16:37 -0500 |
---|---|---|
committer | Doug Moore <dougm@rice.edu> | 2017-05-12 22:24:00 -0500 |
commit | 502ba27753e4bb45b6180e4d9059fbd06b4991d2 (patch) | |
tree | 92106f93368523f8c73df4229be12c0611e551c3 /src | |
parent | bbdc4b12da26510e3b7f1d50c2c9888d672fa3bd (diff) | |
download | libunwind-502ba27753e4bb45b6180e4d9059fbd06b4991d2.tar.gz |
Add a function to capture the dwarf_reg_states that occur in processing
the dwarf code for a procedure, and a function to apply a captured
dwarf_reg_state later.
Diffstat (limited to 'src')
42 files changed, 927 insertions, 3 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 53a4bfa9..2ba59105 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -196,6 +196,7 @@ libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common) \ # The list of files that go into libunwind: libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \ $(libunwind_la_SOURCES_local) \ + aarch64/Lapply_reg_state.c aarch64/Lreg_states_iterate.c \ 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 \ @@ -205,6 +206,7 @@ libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \ libunwind_aarch64_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \ $(libunwind_la_SOURCES_generic) \ + aarch64/Gapply_reg_state.c aarch64/Greg_states_iterate.c \ 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 \ @@ -220,6 +222,7 @@ libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common) \ $(libunwind_la_SOURCES_local) \ arm/getcontext.S \ + arm/Lapply_reg_state.c arm/Lreg_states_iterate.c \ 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 \ @@ -227,6 +230,7 @@ libunwind_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common) \ libunwind_arm_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common) \ $(libunwind_la_SOURCES_generic) \ + arm/Gapply_reg_state.c arm/Greg_states_iterate.c \ 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 \ @@ -244,6 +248,7 @@ libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ \ ia64/dyn_info_list.S ia64/getcontext.S \ \ + ia64/Lapply_reg_state.c ia64/Lreg_states_iterate.c \ 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 \ @@ -253,6 +258,7 @@ libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ # The list of files that go into libunwind-ia64: libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ $(libunwind_la_SOURCES_generic) \ + ia64/Gapply_reg_state.c ia64/Greg_states_iterate.c \ 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 \ @@ -268,6 +274,7 @@ libunwind_la_SOURCES_hppa_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common) \ $(libunwind_la_SOURCES_local) \ hppa/getcontext.S hppa/setcontext.S \ + hppa/Lapply_reg_state.c hppa/Lreg_states_iterate.c \ 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 \ @@ -276,6 +283,7 @@ libunwind_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common) \ # The list of files that go into libunwind-hppa: libunwind_hppa_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common) \ $(libunwind_la_SOURCES_generic) \ + hppa/Gapply_reg_state.c hppa/Greg_states_iterate.c \ 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 \ @@ -290,12 +298,14 @@ libunwind_la_SOURCES_mips_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_mips = $(libunwind_la_SOURCES_mips_common) \ $(libunwind_la_SOURCES_local) \ mips/getcontext.S \ + mips/Lapply_reg_state.c mips/Lreg_states_iterate.c \ 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/Gapply_reg_state.c mips/Greg_states_iterate.c \ 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 @@ -309,12 +319,14 @@ libunwind_la_SOURCES_tilegx_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_tilegx = $(libunwind_la_SOURCES_tilegx_common) \ $(libunwind_la_SOURCES_local) \ tilegx/getcontext.S \ + tilegx/Lapply_reg_state.c tilegx/Lreg_states_iterate.c \ tilegx/Lcreate_addr_space.c tilegx/Lget_proc_info.c tilegx/Lget_save_loc.c \ tilegx/Lglobal.c tilegx/Linit.c tilegx/Linit_local.c tilegx/Linit_remote.c \ tilegx/Lis_signal_frame.c tilegx/Lregs.c tilegx/Lresume.c tilegx/Lstep.c libunwind_tilegx_la_SOURCES_tilegx = $(libunwind_la_SOURCES_tilegx_common) \ $(libunwind_la_SOURCES_generic) \ + tilegx/Gapply_reg_state.c tilegx/Greg_states_iterate.c \ tilegx/Gcreate_addr_space.c tilegx/Gget_proc_info.c tilegx/Gget_save_loc.c \ tilegx/Gglobal.c tilegx/Ginit.c tilegx/Ginit_local.c tilegx/Ginit_remote.c \ tilegx/Gis_signal_frame.c tilegx/Gregs.c tilegx/Gresume.c tilegx/Gstep.c @@ -329,6 +341,7 @@ libunwind_la_SOURCES_x86_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common) \ $(libunwind_la_SOURCES_x86_os_local) \ $(libunwind_la_SOURCES_local) \ + x86/Lapply_reg_state.c x86/Lreg_states_iterate.c \ 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 \ @@ -338,6 +351,7 @@ libunwind_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common) \ libunwind_x86_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common) \ $(libunwind_la_SOURCES_x86_os) \ $(libunwind_la_SOURCES_generic) \ + x86/Gapply_reg_state.c x86/Greg_states_iterate.c \ 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 \ @@ -354,6 +368,7 @@ 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/Lapply_reg_state.c x86_64/Lreg_states_iterate.c \ 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 \ @@ -363,6 +378,7 @@ libunwind_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common) \ 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/Gapply_reg_state.c x86_64/Greg_states_iterate.c \ 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 \ @@ -387,6 +403,7 @@ libunwind_la_SOURCES_ppc32_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \ $(libunwind_la_SOURCES_local) \ $(libunwind_la_SOURCES_ppc) \ + ppc32/Lapply_reg_state.c ppc32/Lreg_states_iterate.c \ ppc32/Lcreate_addr_space.c \ ppc32/Lglobal.c ppc32/Linit.c \ ppc32/Lregs.c ppc32/Lresume.c ppc32/Lstep.c @@ -395,6 +412,7 @@ libunwind_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \ libunwind_ppc32_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \ $(libunwind_la_SOURCES_generic) \ $(libunwind_ppc_la_SOURCES_ppc_generic) \ + ppc32/Gapply_reg_state.c ppc32/Greg_states_iterate.c \ ppc32/Gcreate_addr_space.c \ ppc32/Gglobal.c ppc32/Ginit.c \ ppc32/Gregs.c ppc32/Gresume.c ppc32/Gstep.c @@ -408,6 +426,7 @@ libunwind_la_SOURCES_ppc64_common = $(libunwind_la_SOURCES_common) \ libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \ $(libunwind_la_SOURCES_local) \ $(libunwind_la_SOURCES_ppc) \ + ppc64/Lapply_reg_state.c ppc64/Lreg_states_iterate.c \ ppc64/Lcreate_addr_space.c \ ppc64/Lglobal.c ppc64/Linit.c \ ppc64/Lregs.c ppc64/Lresume.c ppc64/Lstep.c @@ -416,6 +435,7 @@ libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \ libunwind_ppc64_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \ $(libunwind_la_SOURCES_generic) \ $(libunwind_ppc_la_SOURCES_ppc_generic) \ + ppc64/Gapply_reg_state.c ppc64/Greg_states_iterate.c \ ppc64/Gcreate_addr_space.c \ ppc64/Gglobal.c ppc64/Ginit.c \ ppc64/Gregs.c ppc64/Gresume.c ppc64/Gstep.c @@ -428,12 +448,14 @@ libunwind_la_SOURCES_sh_common = $(libunwind_la_SOURCES_common) \ # The list of files that go into libunwind: libunwind_la_SOURCES_sh = $(libunwind_la_SOURCES_sh_common) \ $(libunwind_la_SOURCES_local) \ + sh/Lapply_reg_state.c sh/Lreg_states_iterate.c \ 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/Gapply_reg_state.c sh/Greg_states_iterate.c \ 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 diff --git a/src/aarch64/Gapply_reg_state.c b/src/aarch64/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/aarch64/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/aarch64/Greg_states_iterate.c b/src/aarch64/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/aarch64/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/aarch64/Lapply_reg_state.c b/src/aarch64/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/aarch64/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/aarch64/Lreg_states_iterate.c b/src/aarch64/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/aarch64/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/arm/Gapply_reg_state.c b/src/arm/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/arm/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/arm/Greg_states_iterate.c b/src/arm/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/arm/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/arm/Lapply_reg_state.c b/src/arm/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/arm/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/arm/Lreg_states_iterate.c b/src/arm/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/arm/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index ab7ea50b..264bd35e 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -759,8 +759,8 @@ eval_location_expr (struct dwarf_cursor *c, unw_addr_space_t as, return 0; } -static int -apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) +HIDDEN int +dwarf_apply_reg_state (struct dwarf_cursor *c, dwarf_reg_state_t *rs) { unw_word_t regnum, addr, cfa, ip; unw_word_t prev_ip, prev_cfa; @@ -933,7 +933,7 @@ dwarf_step (struct dwarf_cursor *c) dwarf_state_record_t sr; if ((ret = find_reg_state (c, &sr)) < 0) return ret; - if ((ret = apply_reg_state (c, &sr.rs_current)) < 0) + if ((ret = dwarf_apply_reg_state (c, &sr.rs_current)) < 0) return ret; return 1; @@ -963,3 +963,65 @@ dwarf_make_proc_info (struct dwarf_cursor *c) return 0; } + +static int +dwarf_reg_states_dynamic_iterate(struct dwarf_cursor *c, + unw_reg_states_callback cb, + void *token) +{ + Debug (1, "Not yet implemented\n"); +#if 0 + /* Don't forget to set the ret_addr_column! */ + c->ret_addr_column = XXX; +#endif + return -UNW_ENOINFO; +} + +static int +dwarf_reg_states_table_iterate(struct dwarf_cursor *c, + unw_reg_states_callback cb, + void *token) +{ + dwarf_state_record_t sr; + int ret = setup_fde(c, &sr); + struct dwarf_cie_info *dci = c->pi.unwind_info; + unw_word_t addr = dci->fde_instr_start; + unw_word_t curr_ip = c->pi.start_ip; + while (ret >= 0 && curr_ip < c->pi.end_ip && addr < dci->fde_instr_end) + { + unw_word_t prev_ip = curr_ip; + ret = run_cfi_program (c, &sr, &curr_ip, prev_ip, &addr, dci->fde_instr_end, dci); + if (ret >= 0 && prev_ip < curr_ip) + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), prev_ip, curr_ip); + } + if (ret >= 0 && curr_ip < c->pi.last_ip) + /* report the dead zone after the procedure ends */ + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), curr_ip, c->pi.last_ip); + return ret; +} + +HIDDEN int +dwarf_reg_states_iterate(struct dwarf_cursor *c, + unw_reg_states_callback cb, + void *token) +{ + int ret = fetch_proc_info (c, c->ip, 1); + if (ret >= 0) + switch (c->pi.format) + { + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: + ret = dwarf_reg_states_table_iterate(c, cb, token); + break; + + case UNW_INFO_FORMAT_DYNAMIC: + ret = dwarf_reg_states_dynamic_iterate (c, cb, token); + break; + + default: + Debug (1, "Unexpected unwind-info format %d\n", c->pi.format); + ret = -UNW_EINVAL; + } + put_unwind_info (c, &c->pi); + return ret; +} diff --git a/src/hppa/Gapply_reg_state.c b/src/hppa/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/hppa/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/hppa/Greg_states_iterate.c b/src/hppa/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/hppa/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/hppa/Lapply_reg_state.c b/src/hppa/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/hppa/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/hppa/Lreg_states_iterate.c b/src/hppa/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/hppa/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/ia64/Gapply_reg_state.c b/src/ia64/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/ia64/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/ia64/Greg_states_iterate.c b/src/ia64/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/ia64/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/ia64/Lapply_reg_state.c b/src/ia64/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/ia64/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/ia64/Lreg_states_iterate.c b/src/ia64/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/ia64/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/mips/Gapply_reg_state.c b/src/mips/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/mips/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/mips/Greg_states_iterate.c b/src/mips/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/mips/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/mips/Lapply_reg_state.c b/src/mips/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/mips/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/mips/Lreg_states_iterate.c b/src/mips/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/mips/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/ppc/Gapply_reg_state.c b/src/ppc/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/ppc/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/ppc/Greg_states_iterate.c b/src/ppc/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/ppc/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/ppc/Lapply_reg_state.c b/src/ppc/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/ppc/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/ppc/Lreg_states_iterate.c b/src/ppc/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/ppc/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/sh/Gapply_reg_state.c b/src/sh/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/sh/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/sh/Greg_states_iterate.c b/src/sh/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/sh/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/sh/Lapply_reg_state.c b/src/sh/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/sh/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/sh/Lreg_states_iterate.c b/src/sh/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/sh/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/tilegx/Gapply_reg_state.c b/src/tilegx/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/tilegx/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/tilegx/Greg_states_iterate.c b/src/tilegx/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/tilegx/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/tilegx/Lapply_reg_state.c b/src/tilegx/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/tilegx/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/tilegx/Lreg_states_iterate.c b/src/tilegx/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/tilegx/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/x86/Gapply_reg_state.c b/src/x86/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/x86/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/x86/Greg_states_iterate.c b/src/x86/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/x86/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/x86/Lapply_reg_state.c b/src/x86/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/x86/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/x86/Lreg_states_iterate.c b/src/x86/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/x86/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/src/x86_64/Gapply_reg_state.c b/src/x86_64/Gapply_reg_state.c new file mode 100644 index 00000000..eec93046 --- /dev/null +++ b/src/x86_64/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/src/x86_64/Greg_states_iterate.c b/src/x86_64/Greg_states_iterate.c new file mode 100644 index 00000000..a39837a1 --- /dev/null +++ b/src/x86_64/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + Modified for x86_64 by Max Asbock <masbock@us.ibm.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. */ + +#include "unwind_i.h" + +PROTECTED int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/src/x86_64/Lapply_reg_state.c b/src/x86_64/Lapply_reg_state.c new file mode 100644 index 00000000..7ebada48 --- /dev/null +++ b/src/x86_64/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/src/x86_64/Lreg_states_iterate.c b/src/x86_64/Lreg_states_iterate.c new file mode 100644 index 00000000..f1eb1e79 --- /dev/null +++ b/src/x86_64/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include <libunwind.h> +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif |