* blockframe.c (find_frame_addr_in_frame_chain): Move function
from here ...
* varobj.c (find_frame_addr_in_frame_chain): ... to here.
(varobj_create): Note that frame ID should be used.
* frame.h (find_frame_addr_in_frame_chain): Delete declaration.
* varobj.c (child_exists, cplus_number_of_children): Change
STREQ macro references to strcmp.
(cplus_name_of_child): Change code to handle the fact that
fields are not necessarily contiguous with regards to their
access control. This is a fix for PR gdb/792.
* NEWS: add recent mi fixes.
* varobj.c (struct varobj): Add new "updated" flag.
(new_variable): Default "updated" flag to 0.
(varobj_set_value): Set "updated" flag to 1 if value
changes.
(varobj_update): Check varobj "updated" flag before
comparing old and refreshed values. Fix for
PR gdb/702.
* varobj.c (struct varobj_root): Change frame from CORE_ADDR to
struct frame_id.
(varobj_create): Store frame_id for root.
(varobj_gen_name): Use xasprintf.
(varobj_update): Save and restore frame using get_frame_id() and
frame_find_by_id().
(create_child): Use xasprintf.
(new_root_variable): Initialize frame_id.
(c_name_of_child): Use xasprintf. Call find_frame_by_id().
(c_value_of_variable): Use xasprintf. Move mem_fileopen call
to prevent memory leak.
* stack.c (get_selected_block): Add new argument `addr_in_block',
used to return the exact code address we used to select the block,
not just the block.
* blockframe.c (get_frame_block, get_current_block): Same.
* frame.h (get_frame_block, get_current_block,
get_selected_block): Update declarations.
* linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c,
linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed.
gdb/mi/ChangeLog:
* mi-cmd-stack.c (list_args_or_locals): Pass new arg to
get_frame_block. (See entry in gdb/ChangeLog.)
errors evaluating the object before attempting to set its
value.
value_cast now properly adjusts VALUE_ADDRESS for baseclasses,
so this offset adjustment is no longer necessary.
(create_child): Don't set the error flag if the child is
a CPLUS_FAKE_CHILD.
(value_of_child): If value_fetch_lazy fails, return NULL
so that callers will be notified that an error occurred.
(c_value_of_variable): Delay check of variable's validity
until later. We actually want all structs and unions to have
the value "{...}".
Do not return "???" for variables which could not be evaluated.
This error condition must be returned to the caller so that it
can get the error condition from gdb.
(cplus_name_of_child): Adjust index for vptr before figuring
out the name of the child.
(cplus_value_of_child): If a child's (real) parent is not valid,
don't even bother trying to give a value for it. Just return
an error. Change all instances in this function.
(cplus_type_of_child): If our parent is one of the "fake"
parents, we need to get at the type of the real parent, and
derive the child's true type using this information.
finshed using it.
(c_type_of_child): Likewise.
(cplus_value_of_child): Isolate the use of name_of_child to
one case that needs it.
Release memory for "name" when finished using it.
pointer to struct varobj*. This function can delete
varobjs, so we need to give callers the new varobj
when this happens.
(value_of_root): Update "var", too, if "var_handle"
changes.
* varobj.h (varobj_update): Likewise.
* wrapper.c (gdb_value_assign): New function. Longjump-free
version of value_assign.
(wrap_value_assign): New function. Wrapper for value_assign.
* wrapper.h: Add declaration for the above.
* varobj.c (varobj_set_value): Use gdb_value_assign, not
value_assign which can longjump. Do not change varobj value if
assign fails.
* varobj.c (type_changeable): Arrays are not changeable.
Trying to check for updates was causing an error if the array lived
in a register as gdb value_equal() cannot handle that case yet.
* varobj.c (varobj_update): Prevent uninitialized error code to be
returned on type_changed. Also, prevent value_equal() to be called
for the types we do not want to test for updates.
* wrapper.c (gdb_value_subscript, wrap_value_subscript): New functions.
Safe version of value_subscript.
* varobj.c (): Use gdb_value_subscript() to get an array element value.
Add support for a variable object that tries to evaluate itself in
the currently selected frame, rather than in a fixed frame.
* wrapper.c,h (gdb_parse_exp_1): Added a wrapper for
gdb_parse_exp_1.
* varobj.h: Added USE_CURRENT_FRAME to varobj_type & changed def'n
of varobj_create.
* varobj.c (varobj_list): Return type indicates whether the
variable's type has changed (for current frame variables).
(varobj_update): Handle the case where the variable's type has
changed.
(delete_variable_1): Allow for deletion of variables that have not
been installed yet.
(new_root_variable): Initialize use_selected_frame variable.
(value_of_root): This is where most of the work to handle "current
frame" variables was added. Most of the complexity involves
handling the case where the type of the variable has changed.
(varobj_create): Add a "type" argument, to tell if the
variable is one of these "current frame" variables. Also protect
call to parse_exp_1 from long jumping.
* mi-var-block.exp: The error report from varobj_create changed
since I am now trapping parse_exp_1 errors. Change the tests to
match the new error message.
* mi-var-child.exp: Ditto.
* mi-var-cmd.exp: Ditto.
* lib/gdb.exp: Fix the gdbtk_start routine to correctly find all
the library directories.
* gdbtk-varobj.c (variable_create): Pass the correct
"how_specified" flag to the varobj_create routine.