diff options
author | Yao Qi <yao@codesourcery.com> | 2013-08-08 05:10:10 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-08-08 05:10:10 +0000 |
commit | 82a0a75ff005db5ff174768120dddb13a6392c5c (patch) | |
tree | 0abc1f3c7c5b7b1e221d4ba1a545749153f79fa2 /gdb/stack.c | |
parent | 5c4aa40b937c4cb7eeafdc88b7f11e16b3caf503 (diff) | |
download | gdb-82a0a75ff005db5ff174768120dddb13a6392c5c.zip gdb-82a0a75ff005db5ff174768120dddb13a6392c5c.tar.gz gdb-82a0a75ff005db5ff174768120dddb13a6392c5c.tar.bz2 |
gdb/
* frame.h (read_frame_local): Declare.
* mi/mi-cmd-stack.c (list_args_or_locals): Call
read_frame_local.
* stack.c (read_frame_local): New.
gdb/testsuite/
* gdb.trace/mi-trace-unavailable.exp: Don't set
"print entry-values" to "no".
(test_trace_unavailable): Set various values to
"print entry-values" to test that the output of
'-stack-list-locals' is not affected, and then set
set "print entry-values" to "no".
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index d89ff89..7d97dc8 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -301,6 +301,27 @@ print_frame_arg (const struct frame_arg *arg) annotate_arg_end (); } +/* Read in inferior function local SYM at FRAME into ARGP. Caller is + responsible for xfree of ARGP->ERROR. This function never throws an + exception. */ + +void +read_frame_local (struct symbol *sym, struct frame_info *frame, + struct frame_arg *argp) +{ + volatile struct gdb_exception except; + struct value *val = NULL; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + val = read_var_value (sym, frame); + } + + argp->error = (val == NULL) ? xstrdup (except.message) : NULL; + argp->sym = sym; + argp->val = val; +} + /* Read in inferior function parameter SYM at FRAME into ARGP. Caller is responsible for xfree of ARGP->ERROR. This function never throws an exception. */ |