summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLassi Tuura <lat@cern.ch>2011-05-06 20:19:36 -0700
committerArun Sharma <asharma@fb.com>2011-05-06 20:19:36 -0700
commit5c2cade264010c9855c4ea5effc5b4789739e7ca (patch)
treec641c636d2681535ade28f872073e930cd8e98e0
parent36511d3d1f040bbf778094e907725ad0617326c8 (diff)
downloadlibunwind-5c2cade264010c9855c4ea5effc5b4789739e7ca.tar.gz
Inline access to initial register values as it's known to be safe.
-rw-r--r--src/x86_64/Gtrace.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/x86_64/Gtrace.c b/src/x86_64/Gtrace.c
index 5b23f7c0..f24ed1c1 100644
--- a/src/x86_64/Gtrace.c
+++ b/src/x86_64/Gtrace.c
@@ -412,16 +412,12 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
/* Tell core dwarf routines to call back to us. */
d->stash_frames = 1;
- /* Determine initial register values. */
+ /* Determine initial register values. These are direct access safe
+ because we know they come from the initial machine context. */
rip = d->ip;
rsp = cfa = d->cfa;
- if (unlikely((ret = dwarf_get (d, d->loc[UNW_X86_64_RBP], &rbp)) < 0))
- {
- Debug (1, "returning %d, rbp value not found\n", ret);
- *size = 0;
- d->stash_frames = 0;
- return ret;
- }
+ ACCESS_MEM_FAST(ret, 0, d, DWARF_GET_LOC(d->loc[UNW_X86_64_RBP]), rbp);
+ assert(ret == 0);
/* Get frame cache. */
if (unlikely(! (cache = trace_cache_get())))