mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-02-17 02:31:41 +01:00
(common_init): Use rbs_get_base() to determine size of register-backing store.
(Logical change 1.297)
This commit is contained in:
parent
8236491807
commit
9724ac492c
1 changed files with 10 additions and 9 deletions
|
@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
static ALWAYS_INLINE int
|
static ALWAYS_INLINE int
|
||||||
common_init (struct cursor *c, unw_word_t sp, unw_word_t bsp)
|
common_init (struct cursor *c, unw_word_t sp, unw_word_t bsp)
|
||||||
{
|
{
|
||||||
unw_word_t bspstore;
|
unw_word_t bspstore, rbs_base;
|
||||||
uint8_t *natp;
|
uint8_t *natp;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -107,16 +107,17 @@ common_init (struct cursor *c, unw_word_t sp, unw_word_t bsp)
|
||||||
|
|
||||||
c->rbs_curr = c->rbs_left_edge = 0;
|
c->rbs_curr = c->rbs_left_edge = 0;
|
||||||
|
|
||||||
/* There is no way to know the real size of the most recent
|
/* Try to find a base of the register backing-store. We may default
|
||||||
(right-most) RBS so we'll just assume it to occupy a quarter of
|
to a reasonable value (e.g., half the address-space down from
|
||||||
the address space (so we have a notion of "above" and "below" and
|
bspstore). If the BSPSTORE looks corrupt, we fail. */
|
||||||
one bit to indicate whether the backing store needs to be
|
if ((ret = rbs_get_base (c, bspstore, &rbs_base)) < 0)
|
||||||
accessed via uc_access(3)). */
|
return ret;
|
||||||
|
|
||||||
c->rbs_area[0].end = bspstore;
|
c->rbs_area[0].end = bspstore;
|
||||||
c->rbs_area[0].size = ((unw_word_t) 1) << 63; /* initial guess... */
|
c->rbs_area[0].size = bspstore - rbs_base;
|
||||||
c->rbs_area[0].rnat_loc = IA64_REG_LOC (c, UNW_IA64_AR_RNAT);
|
c->rbs_area[0].rnat_loc = IA64_REG_LOC (c, UNW_IA64_AR_RNAT);
|
||||||
Debug (10, "initial rbs-area: [?-0x%llx), rnat@%s\n",
|
Debug (10, "initial rbs-area: [0x%llx-0x%llx), rnat@%s\n",
|
||||||
(long long) c->rbs_area[0].end,
|
(long long) rbs_base, (long long) c->rbs_area[0].end,
|
||||||
ia64_strloc (c->rbs_area[0].rnat_loc));
|
ia64_strloc (c->rbs_area[0].rnat_loc));
|
||||||
|
|
||||||
c->pi.flags = 0;
|
c->pi.flags = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue