diff options
author | Roland McGrath <roland@redhat.com> | 2009-07-22 13:55:50 -0700 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2009-07-22 13:56:32 -0700 |
commit | af80014e49796185298dfb261ddf1e51d98f25c0 (patch) | |
tree | a6bc2fc9bbf16990c953ff83a7533c9654f3ce01 /libdw/dwarf_getlocation.c | |
parent | fa1d4447b16f16ff9056a24163b175fcbc3a57cf (diff) |
Rejigger calling conventions for dwarf_frame_{cfa,register}.
Diffstat (limited to 'libdw/dwarf_getlocation.c')
-rw-r--r-- | libdw/dwarf_getlocation.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c index 0ce10837..1488203b 100644 --- a/libdw/dwarf_getlocation.c +++ b/libdw/dwarf_getlocation.c @@ -167,7 +167,7 @@ int internal_function __libdw_intern_expression (Dwarf *dbg, bool other_byte_order, unsigned int address_size, - void **cache, const Dwarf_Block *block, + void **cache, const Dwarf_Block *block, bool valuep, Dwarf_Op **llbuf, size_t *listlen, int sec_index) { /* Check whether we already looked at this list. */ @@ -179,6 +179,12 @@ __libdw_intern_expression (Dwarf *dbg, *llbuf = (*found)->loc; *listlen = (*found)->nloc; + if (valuep) + { + assert (*listlen > 1); + assert ((*llbuf)[*listlen - 1].atom == DW_OP_stack_value); + } + return 0; } @@ -358,6 +364,19 @@ __libdw_intern_expression (Dwarf *dbg, goto invalid; } + if (valuep) + { + struct loclist *newloc; + newloc = (struct loclist *) alloca (sizeof (struct loclist)); + newloc->atom = DW_OP_stack_value; + newloc->number = 0; + newloc->number2 = 0; + newloc->offset = data - block->data; + newloc->next = loclist; + loclist = newloc; + ++n; + } + /* Allocate the array. */ Dwarf_Op *result; if (dbg != NULL) @@ -420,8 +439,8 @@ getlocation (struct Dwarf_CU *cu, const Dwarf_Block *block, Dwarf_Op **llbuf, size_t *listlen, int sec_index) { return __libdw_intern_expression (cu->dbg, cu->dbg->other_byte_order, - cu->address_size, &cu->locs, - block, llbuf, listlen, sec_index); + cu->address_size, &cu->locs, block, false, + llbuf, listlen, sec_index); } int |