This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How the gdb function throw_error works?
- From: Yao Qi <yao at codesourcery dot com>
- To: Terry Guo <flameroc at gmail dot com>
- Cc: <gdb at sourceware dot org>
- Date: Fri, 28 Jun 2013 16:03:42 +0800
- Subject: Re: How the gdb function throw_error works?
- References: <CAGbRaL5O_9AXtOk_Ur_c0yNj5ZawJG8AJ186u=uinLgDFdcdVQ at mail dot gmail dot com>
On 06/27/2013 11:19 AM, Terry Guo wrote:
Hi there,
Function value_of_dwarf_block_entry in file dwarf2loc.c has a call to
function throw_error which seems will print out some error messages to
gdb user. I am pretty sure that the throw_error will be called in the
Function 'error' prints error messages, but throw_error may not.
NO_ENTRY_VALUE_ERROR is caught by the callers of
value_of_dwarf_block_entry, IIUC. For example, see stack.c:read_frame_arg:
TRY_CATCH (except, RETURN_MASK_ERROR)
{
const struct symbol_computed_ops *ops;
ops = SYMBOL_COMPUTED_OPS (sym);
entryval = ops->read_variable_at_entry (sym, frame);
}
if (!entryval)
{
entryval_error = alloca (strlen (except.message) + 1);
strcpy (entryval_error, except.message);
}
if (except.error == NO_ENTRY_VALUE_ERROR
|| (entryval && value_optimized_out (entryval)))
{
entryval = NULL;
entryval_error = NULL;
}
Function pointer 'read_variable_at_entry' calls value_of_dwarf_block_entry.
--
Yao (éå)