From bb61e0bc2bf0d9887da1826a1a460886ea59fa5b Mon Sep 17 00:00:00 2001 From: Doug Moore Date: Fri, 12 May 2017 23:45:56 -0500 Subject: [PATCH] Bury the last_ip field until it can reappear in version 2.0. --- doc/unw_get_proc_info.tex | 6 ------ include/libunwind-common.h.in | 2 ++ src/dwarf/Gfind_proc_info-lsb.c | 4 ++++ src/dwarf/Gparser.c | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/unw_get_proc_info.tex b/doc/unw_get_proc_info.tex index 89c25193..72621f1a 100644 --- a/doc/unw_get_proc_info.tex +++ b/doc/unw_get_proc_info.tex @@ -31,12 +31,6 @@ following members: 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{last\_ip}] The address of the first - instruction that could begin another procedure. Addresses from - end\_ip up to last\_ip are addresses where there are no - instructions. 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 diff --git a/include/libunwind-common.h.in b/include/libunwind-common.h.in index 01e11888..0a9537eb 100644 --- a/include/libunwind-common.h.in +++ b/include/libunwind-common.h.in @@ -126,7 +126,9 @@ 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 */ +#if defined(NEED_LAST_IP) unw_word_t last_ip; /* first IP that could begin another procedure */ +#endif 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 */ diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c index 2757fdb8..4eb80461 100644 --- a/src/dwarf/Gfind_proc_info-lsb.c +++ b/src/dwarf/Gfind_proc_info-lsb.c @@ -898,7 +898,11 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip, pi->flags = UNW_PI_FLAG_DEBUG_FRAME; } +#if defined(NEED_LAST_IP) pi->last_ip = last_ip; +#else + (void)last_ip; +#endif if (ip < pi->start_ip || ip >= pi->end_ip) return -UNW_ENOINFO; diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index 72547902..f7cdbcee 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -992,9 +992,15 @@ dwarf_reg_states_table_iterate(struct dwarf_cursor *c, if (ret >= 0 && prev_ip < curr_ip) ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), prev_ip, curr_ip); } +#if defined(NEED_LAST_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); +#else + if (ret >= 0 && curr_ip < c->pi.end_ip) + /* report for whatever is left before procedure end */ + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), curr_ip, c->pi.end_ip); +#endif return ret; }