aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
AgeCommit message (Collapse)AuthorFilesLines
2008-03-24 * varobj.c (struct varobj_root): New component thread_id.Vladimir Prus1-13/+59
(varobj_get_thread_id, check_scope): New functions. (c_value_of_root): Use check_scope. Switch to the proper thread if necessary. * varobj.h (varobj_get_thread_id): New extern. * mi/mi-cmd-var.c (print_varobj): Add thread-id field.
2008-03-23 * thread.c (make_cleanup_restore_current_thread): Make itVladimir Prus1-11/+8
globally visible. * gdbthread.h (make_cleanup_restore_current_thread): Declare. * varobj.c (varobj_update): Don't save/restore frame. (c_value_of_root): Save/restore thread and frame here, using make_cleanup_restore_current_thread. * Makefile.in: Update dependecies.
2008-03-23 * varobj.c (struct varobj_root): ClarifyVladimir Prus1-2/+3
comment on the frame field. (varobj_create): Don't set frame if we have no block.
2008-02-04 * varobj.c (c_value_of_variable): Use xstrdup.Vladimir Prus1-1/+1
2008-02-04 Update stored rendition of varobj value when format changes.Vladimir Prus1-1/+8
* varobj.c (varobj_set_display_format): Recomputed print_value. (c_value_of_variable): Return print_value.
2008-01-30 Use vector for varobj_list_children interface.Vladimir Prus1-28/+5
* gdb/varobj.c (varobj_list_children): Return vector of varobjs. * gdb/varobj.h (varobj_list_children): Adjust prototype. (varobj_p): Declare. Declare vector thereof. * mi/mi-cmd-var.c (mi_cmd_var_list_children): Adjust for varobj_list_children change. * Makefile.in (varobj_h): Update dependencies.
2008-01-292008-01-29 Aleksandar Ristovski <aristovski@qnx.com>Daniel Jacobowitz1-3/+11
* varobj (adjust_value_for_child_access): Added checking for returned value from gdb_value_ind. (c_describe_child): Likewise. (cplus_describe_child): Fixed a typo.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-11-20(c_variable_editable, cplus_variable_editable)Nick Roberts1-104/+70
(java_variable_editable, variable_editable): Delete. (varobj_editable_p): Replace above functions with one language independent function. Check for an lvalue. (varobj_get_attributes, varobj_set_value): Use varobj_editable_p. (struct language_specific): Delete variable_editable field.
2007-11-07 Fix crash when a variable object being deletedVladimir Prus1-0/+2
has any of its children deleted previously. * varobj.c (delete_variable_1): Don't recurse into deleted children.
2007-09-27 * varobj.c (install_new_value): Don'tVladimir Prus1-16/+13
call value_get_print_value when a value is lazy. Update the print_value member in a single place.
2007-08-31 * varobj.c (struct varobj): Fix commentVladimir Prus1-1/+3
for the type member not to lie when it can be NULL.
2007-08-31 Implement -var-info-path-expression.Vladimir Prus1-20/+150
* mi/mi-cmds.h (mi_cmd_var_info_path_expression): Declare. * mi/mi-cmds.c (mi_cmds): Register var-info-path-expression. * mi/mi-cmd-var.c (mi_cmd_var_info_path_expression): New. * varobj.c (struct varobj): New field 'path_expr'. (c_path_expr_of_child, cplus_path_expr_of_child) (java_path_expr_of_child): New. (struct language_specific): New field path_expr_of_child. (varobj_create): Initialize the path_expr field. (varobj_get_path_expr): New. (new_variable): Initialize the path_expr field. (free_variable): Free the path_expr field. (adjust_value_for_children_access): New parameter WAS_TYPE. (c_number_of_children): Adjust. (c_describe_child): New parameter CFULL_EXPRESSION. Compute full expression. (c_value_of_child, c_type_of_child): Adjust. (cplus_number_of_children): Adjust. (cplus_describe_child): New parameter CFULL_EXPRESSION. Compute full expression. (cplus_name_of_child, cplus_value_of_child) (cplus_type_of_child): Adjust. * varobj.h (varobj_get_path_expr): Declare.
2007-08-23 Switch the license of all .c files to GPLv3.Joel Brobecker1-4/+2
Switch the license of all .h files to GPLv3. Switch the license of all .cc files to GPLv3.
2007-08-172007-08-17 Michael Snyder <msnyder@access-company.com>Michael Snyder1-0/+2
* varobj.c (value_of_root): Memory leak.
2007-08-142007-08-14 Michael Snyder <msnyder@access-company.com>Michael Snyder1-3/+4
* varobj.c (cplus_describe_child): Guard against null. Use "NULL" instead of "0" to initialize pointers.
2007-08-082007-08-08 Michael Snyder <msnyder@access-company.com>Michael Snyder1-1/+2
* varobj.c (value_of_root): Move alloc after return to avoid leak.
2007-04-14 * varobj.h (varobj_set_frozen): NewVladimir Prus1-46/+121
(varobj_get_frozen): New. (varobj_update): New parameter explicit. * varobj.c (struct varobj): New fields frozen and not_fetched. (varobj_set_frozen, varobj_get_frozen): New. (install_new_value): Don't fetch values for frozen variable object, or children thereof. Allow a frozen variable object to have non-fetched value. (varobj_update): Allow updating child variables. Don't traverse frozen children. (new_variable): Initialize the frozen field. (c_value_of_variable): Return NULL for frozen variable without any value yet. * mi/mi-cmd-var.c (varobj_update_one): New parameter 'explicit'. (mi_cmd_var_create): Output the 'frozen' field, as soon as testsuite is adjusted to expect that field. (mi_cmd_var_set_frozen): New. (mi_cmd_var_update): Pass the 'explicit' parameter to varobj_update_one. * mi/mi-cmds.c (mi_cmds): Register '-var-set-frozen'. * mi/mi-cmds.h (mi_cmd_var_set_frozen): Declare.
2007-04-01 * varobj.c (varobj_create): Keep varobj valueVladimir Prus1-5/+9
NULL when evaluating the type.
2007-02-27(varobj_update): Free temporary vectors.Nick Roberts1-0/+3
2007-02-27(varobj_update): Remove unused local. Use gdb_assertNick Roberts1-6/+2
to check changelist is non-NULL. Call error if the frontend tries to update a non-root variable.
2007-02-27 * frame.c (deprecated_selected_frame): Rename to...Daniel Jacobowitz1-3/+3
(selected_frame): ...this. Make static. (get_selected_frame, select_frame): Update. * frame.h (deprected_select_frame): Delete. (deprecated_safe_get_selected_frame): Update comments. * breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c, infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c, tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c, parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c, tui/tui.c: Replace references to deprecated_selected_frame.
2007-02-132007-02-13 Denis Pilat <denis.pilat@st.com>Denis Pilat1-23/+75
* varobj.h (enum varobj_update_error): New enum. * varobj.c (struct varobj_root): Add is_valid member. (varobj_get_type): Check for invalid varobj. (varobj_get_attributes): Likewise. (variable_editable):Likewise. (varobj_update): Likewise. Use varobj_update_error. (new_root_variable): Set root varobj as valid by default. (varobj_invalidate): New function. * symfile.c (clear_symtab_users): Use varobj_invalidate. * mi/mi-cmd-var.c (varobj_update_one): Change return type to void. Use varobj_update_error.
2007-02-08 * varobj.c (install_new_value): Only call value_get_print_valueDaniel Jacobowitz1-1/+1
if changeable.
2007-01-24 * varobj.c (c_value_of_root, c_value_of_child)Vladimir Prus1-10/+2
(cplus_describe_child): Don't call release_value.
2007-01-24 Refactor getting children name, value and type accessVladimir Prus1-233/+167
for varobjs in C++. * varobj.c (get_type_deref): Remove. (adjust_value_for_child_access): New. (c_number_of_children): Use the above. (c_describe_child): Likewise. (enum accessibility): New. (match_accessibility): New function. (cplus_describe_child): New function. (cplus_name_of_child, cplus_value_of_child) (cplus_type_of_child): Reimplement in terms of cplus_describe_child. (cplus_number_of_children): Use adjust_value_for_child_access.
2007-01-24 Fix computation of the 'editable' attribute andVladimir Prus1-2/+35
value changeability for for references. * varobj.c (get_value_type): New function. (c_variable_editable): Use get_value_type. (varobj_value_is_changeable): Likewise.
2007-01-16Fix 'selected frame' varobjs.Vladimir Prus1-24/+12
* varobj.c (struct varobj): Remove the error field. (varobj_set_value): Don't check var->error. (install_new_value): Don't set var->error. (varobj_update): Always pass the new value of the root via install_new_value. (create_child): Don't set error field. (new_variable): Likewise. (c_value_of_root): Always reevaluate the value of selected frame varobjs in the selected frame. Don't call reinit_frame_cache.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2007-01-08 * varobj.c (install_new_value): Always update print_value.Daniel Jacobowitz1-6/+22
(value_get_print_value): Immediately return NULL for missing values. * gdb.mi/mi-var-cmd.exp: Expect lpcharacter to update when lcharacter or linteger change. Correct duplicated test name. * gdb.mi/mi2-var-cmd.exp: Likewise.
2007-01-05(c_value_of_root): Don't select frame if variableNick Roberts1-1/+2
object is out of scope.
2007-01-05(struct varobj): New member print_value.Nick Roberts1-18/+40
(install_new_value): Compare last printed value with current one instead of contents. (new_variable): Initialize var->print_value to NULL. (free_variable): Free var->print_value. (value_get_print_value): New function derived from c_value_of_variable. (c_value_of_variable): Use value_get_print_value.
2007-01-04(get_type_deref): Fix variable objects for references toNick Roberts1-6/+11
pointers.
2007-01-04 * Makefile.in (eval.o): Update dependencies.Daniel Jacobowitz1-1/+1
* eval.c: Include "ui-out.h" and "exceptions.h". (evaluate_subexp_standard): Use TRY_CATCH around value_of_variable. Use value_zero if an error occurs when avoiding side effects. * varobj.c (c_value_of_root): Initialize new_val. * gdb.mi/mi-var-cmd.exp: Add tests for unreadable varobjs.
2007-01-04 * varobj.c (varobj_list_children): Stop if the number of children isDaniel Jacobowitz1-1/+7
unknown. (c_number_of_children): Report no children for zero sized arrays. * lib/mi-support.exp (mi_runto_helper): Expect two prompts when continuing.
2007-01-04 Simplify access to variours properties of childVladimir Prus1-118/+120
variable objects in C. * varobj.c (value_struct_element_index): New function. (c_describe_child): New function. (c_name_of_child, c_value_of_child) (c_type_of_child): Rewrite to use c_describe_child.
2007-01-04 gdb/Vladimir Prus1-204/+69
* varobj.c: Include "vec.h". (varobj_p): New typedef, declare vector of those. (struct varobj): Use vector for the 'children' member. (child_exists): Remove. (save_child_in_parent): Remove. (remove_child_from_parent): Remove. (struct varobj_child): Remove. (struct vstack): Remove. (vpush, vpop): Remove. (varobj_list_children): Adjust to work work vector. (varobj_update): Likewise. Use vectors for working stack and result. (delete_variable_1): Likewise. * Makefile.in (varobj.o): Update dependencies.
2007-01-04 Port from Apple's version.Vladimir Prus1-13/+20
gdb/ * varobj.c (type_changeable): Rename to... (varobj_value_is_changeable_p): ...this. Adjust all callers. (is_root_p): New function. Use it everywhere.
2007-01-03 Warning fixes.Daniel Jacobowitz1-3/+2
* ada-lang.c (find_struct_field): Initialize *byte_offset_p. * breakpoint.c (do_enable_breakpoint): Ignore both mem_cnt and i. * c-typeprint.c (c_type_print_varspec_suffix): Don't test length greater than or equal to zero. * m2-typeprint.c (m2_array): Likewise. * p-typeprint.c (pascal_type_print_varspec_prefix): Likewise. * gdbtypes.c (copy_type_recursive): Correct == typo. * i386-tdep.c (i386_skip_prologue): Remove stray semicolon. * linux-nat.c (linux_nat_info_proc_cmd): Don't compare a pointer greater than zero. * macroscope.c (sal_macro_scope): Don't name a local variable "main". (default_macro_scope): Remove unused variable. * prologue-value.h (pv_area_find_reg): Don't name an argument "register". * remote-fileio.c (remote_fio_func_map): Add missing braces. * remote.c (sigint_remote_twice_token, sigint_remote_token): Change type. (cleanup_sigint_signal_handler): Remove casts. * valprint.c (val_print): Use a volatile local for the modified argument. * varobj.c (languages): Remove extra array dimension. (varobj_create): Correct access to languages array. * mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Add missing braces. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_path, mi_cmd_env_dir): Likewise. * mi/mi-getopt.c (mi_valid_noargs): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_write_memory): Likewise. * signals/signals.c (target_signal_to_string): Cast to int before comparing. * tui/tui-layout.c (init_and_make_win): Take and return a void *. Update all callers.
2007-01-03 * NEWS: Mention pointer to member improvements.Daniel Jacobowitz1-1/+0
* Makefile.in (gnu-v3-abi.o): Delete special rule. (eval.o, gnu-v3-abi.o, ia64-tdep.o): Update. * ada-valprint.c (ada_print_scalar): Update for new type codes. * c-typeprint.c (c_print_type): Update for new type codes. (c_type_print_varspec_prefix, c_type_print_varspec_suffix) (c_type_print_base): Likewise. (c_type_print_args): Rewrite. * c-valprint.c (c_val_print): Update for new type codes. Remove support for references to members. Treat methods like functions. * cp-abi.c (cplus_print_method_ptr, cplus_method_ptr_size) (cplus_make_method_ptr, cplus_method_ptr_to_value): New. * cp-abi.h (cplus_print_method_ptr, cplus_method_ptr_size) (cplus_make_method_ptr, cplus_method_ptr_to_value): New prototypes. (struct cp_abi_ops): Add corresponding members. * cp-valprint.c (cp_print_class_method): Delete. (cp_find_class_member): New function. (cp_print_class_member): Use it. Simplify support for bogus member pointers. * dwarf2read.c (quirk_gcc_member_function_pointer): Use lookup_methodptr_type. (read_tag_ptr_to_member_type): Likewise, and lookup_memberptr_type. * eval.c (evaluate_subexp_standard): Implement EVAL_SKIP for OP_SCOPE. Update call to value_aggregate_elt. Rewrite member pointer support. (evaluate_subexp_for_address): Handle OP_SCOPE explicitly. Handle references returned by user defined operators. * f-typeprint.c (f_print_type, f_type_print_varspec_prefix) (f_type_print_varspec_suffix): Remove support for member pointers. * gdbtypes.c (lookup_memberptr_type): Renamed from lookup_member_type and adjusted. (smash_to_memberptr_type): Likewise, from smash_to_member_type. (lookup_methodptr_type): New. (rank_one_type): Adjust for TYPE_CODE_MEMBERPTR. (recursive_dump_type): Update for new types. * gdbtypes.h (enum type_code): Replace TYPE_CODE_MEMBER with TYPE_CODE_MEMBERPTR and TYPE_CODE_METHODPTR. (lookup_memberptr_type, lookup_methodptr_type) (smash_to_memberptr_type): New prototypes. (smash_to_method_type): Formatting fix. (lookup_member_type, smash_to_member_type): Delete prototypes. * gnu-v3-abi.c (gnuv3_get_vtable, gnuv3_get_virtual_fn): New. Do not rely on debug information for the vptr or the method's enclosing type. Handle function descriptors for IA64. (gnuv3_virtual_fn_field): Rewrite using the new functions. (gnuv3_find_method_in, gnuv3_print_method_ptr) (gnuv3_method_ptr_size, gnuv3_make_method_ptr) (gnuv3_method_ptr_to_value): New. (init_gnuv3_ops): Set new members of gnu_v3_abi_ops. * hpread.c (hpread_type_lookup): Update for new types. * infcall.c (value_arg_coerce): Likewise. * m2-typeprint.c (m2_print_type): Remove explicit support for member pointers. * m2-valprint.c (m2_val_print): Likewise. * p-typeprint.c (pascal_type_print_varspec_prefix) (pascal_type_print_varspec_suffix, pascal_type_print_base): Likewise. * p-valprint.c (pascal_val_print): Likewise. (pascal_object_print_class_method, pascal_object_print_class_member): Delete. * p-lang.h (pascal_object_print_class_method) (pascal_object_print_class_member): Delete prototypes. * stabsread.c (read_type): Update for new types. * typeprint.c (print_type_scalar): Likewise. * valops.c (value_struct_elt_for_reference, value_namespace_elt) (value_maybe_namespace_elt, value_aggregate_elt): Add want_address argument. Construct a pointer to member if the address of a function or data member is requested. (value_cast_pointers): Don't modify the input value. (value_cast): Adjust pointer to member handling for new types. Allow null pointer to member constants. Don't modify the input value. (value_ind): Remove pointer to member check. Handle function descriptors for function pointers. (value_struct_elt, value_find_oload_method_list, check_field): Remove pointer to member checks. * value.c (unpack_long): Allow pointers to data members. (value_from_longest): Allow member pointers. * value.h (value_aggregate_elt): Add want_address. * varobj.c (c_variable_editable): Remove check for members. * gdbarch.sh: Add vtable_function_descriptors and vbit_in_delta. * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Handle descriptors in virtual tables. (ia64_gdbarch_init): Call set_gdbarch_vtable_function_descriptors. * c-lang.h (cp_print_class_method): Delete prototype. * arm-tdep.c (arm_gdbarch_init): Call set_gdbarch_vbit_in_delta. * mips-tdep.c (mips_gdbarch_init): Likewise. * gdbarch.c, gdbarch.h: Regenerated. * gdb.cp/classes.exp (test_pointers_to_class_members): Update expected output. Test the types of members and member pointers. * gdb.cp/inherit.exp (test_print_mi_member_types): Remove KFAILs for gdb/2092. * gdb.cp/member-ptr.exp: Search for a comment instead of a statement. Enable for GCC. Update expected output for some tests and add new tests. Remove obsolete GCC KFAILs. Allow GCC's class layout. * gdb.cp/member-ptr.cc (Padding, Padding::vspacer, Base, Base::get_x) (Base::vget_base, Left, Left::vget, Right, Right::vget, Diamond) (Diamond::vget_base): New. (main): Add new tests. * gdb.cp/printmethod.exp: Update expected output for member functions. * gdb.cp/virtfunc.exp (test_virtual_calls): Add a KFAIL for print pEe->D::vg().
2007-01-01Include block.h.Nick Roberts1-2/+9
(c_value_of_root): Check scope within nested statements.
2006-12-08(varobj_update): Ensure frame is restored whenNick Roberts1-5/+6
variable object is out of scope.
2006-12-082006-12-08 Vladimir Prus <vladimir@codesourcery.com>Vladimir Prus1-7/+16
* varobj.c (varobj_create): Don't call release_value. (varobj_set_value): Likewise. (install_new_value): Call coerce_ref and release_value on the value. Add asserts.
2006-12-062006-12-06 Vladimir Prus <vladimir@codesourcery.com>Vladimir Prus1-2/+3
* varobj.c (cplus_value_of_child): When accessing base suboject, don't specially process references.
2006-11-292006-11-29 Vladimir Prus <vladimir@codesourcery.com>Vladimir Prus1-5/+9
* varobj.c (varobj_set_value): Don't compare the old and the new value here. Don't assign new value here. Instead, call install_new_value.
2006-11-282006-11-28 Vladimir Prus <vladimir@codesourcery.com>Vladimir Prus1-124/+169
Fetch varobj values from memory in a single place, and only fetch the values that are really needed. * varobj.c (struct varobj): Clarify comment. (my_value_equal): Remove. (install_new_value): New function. (type_of_child): Remove. (varobj_create): Use install_new_value. (varobj_set_value): Use value_contents_equal, not my_value_equal. (varobj_update): Use install_new_value. (create_child): Likewise. Inline type_of_child here. (value_of_child): Don't fetch the value. (c_value_of_root): Likewise. (c_value_of_variable): Likewise. (type_changeable): Improve comments.
2006-05-03gdb/ChangeLog:Jim Blandy1-3/+9
2006-05-03 Vladimir Prus <ghost@cs.msu.su> * varobj.c (c_value_of_variable): Ignore top-level references. (Committed by Jim Blandy.)
2006-03-27(c_name_of_child, c_value_of_child): Allow non-zeroNick Roberts1-6/+7
offsets for languages like Fortran.
2006-02-14Update copyright noticeAlexandre Oliva1-1/+1
2006-02-14* doublest.h (DOUBLEST): Use long double only if we can scanAlexandre Oliva1-1/+1
it in. Undefine HAVE_LONG_DOUBLE otherwise. (DOUBLEST_FORMAT): New. * c-exp.y (parse_number): Use it. * jv-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * varobj.c (free_variable): Silence type-punning warnings. * tui/tui-data.h (struct tui_list): Change type of list member. * tui/tui-data.c: Remove no-longer-needed type casts. (source_windows): Silence type-punning warnings. * tui/tui-stack.c, tui/tui-win.c, tui/tui-winsource.c: Likewise.