{
const struct btrace_frame_cache *cache;
const struct btrace_function *bfun;
+ struct btrace_call_iterator it;
CORE_ADDR code, special;
cache = (const struct btrace_frame_cache *) *this_cache;
bfun = cache->bfun;
gdb_assert (bfun != NULL);
- while (bfun->segment.prev != NULL)
- bfun = bfun->segment.prev;
+ while (btrace_find_call_by_number (&it, &cache->tp->btrace, bfun->prev) != 0)
+ bfun = btrace_call_get (&it);
code = get_frame_func (this_frame);
special = bfun->number;