Commit Graph

356 Commits

Author SHA1 Message Date
Joel Brobecker a7b75dfda1 lib/gdb.exp: New gdb_test_no_output function.
This new testsuite routine allows us to test commands that are not
expected to generate any output.

2010-05-20  Pedro Alves  <pedro@codesourcery.com>
            Joel Brobecker  <brobecker@adacore.com>

        * lib/gdb.exp (gdb_test_no_output): New function.
        * lib/gdb.ada/arrayidx.exp: Use gdb_test_no_output instead of gdb_test
        when testing commands that should produce no output.

Tested on x86_64-linux.
2010-05-20 19:18:58 +00:00
Joel Brobecker 47050449b9 testsuite: Prevent writes to prms_id and bug_id.
gdb/testsuite/ChangeLog:

        * lib/gdb.exp (banned_variables): New variable/constant.
        (gdb_init): Add write trace on variables listed in banned_variables.
        (gdb_finish): Remove write traces on variables listed in
        banned_variables.
2010-05-17 17:11:28 +00:00
Jan Kratochvil 8e1d0c49c1 gdb/testsuite/
* gdb.base/break-interp.exp: Remove $exec.debug safety removal.
	* gdb.base/sepdebug.exp: Remove .debug subdirectory handling.  New
	variable different_dir. Move debugfile into a full directory pathname
	under DIFFERENT_DIR.
	* lib/gdb.exp (separate_debug_filename): Remove.
	(gdb_gnu_strip_debug): No longer call separate_debug_filename.  Remove
	variable debug_dir and mkdir of it.  Update function comments.
2010-05-02 09:08:59 +00:00
Jan Kratochvil c0201579c8 gdb/
Fix crashes on dangling display expressions.
	* ada-lang.c (ada_operator_check): New function.
	(ada_exp_descriptor): Fill-in the field operator_check.
	* c-lang.c (exp_descriptor_c): Fill-in the field operator_check.
	* jv-lang.c (exp_descriptor_java): Likewise.
	* m2-lang.c (exp_descriptor_modula2): Likewise.
	* scm-lang.c (exp_descriptor_scm): Likewise.
	* parse.c (exp_descriptor_standard): Likewise.
	(operator_check_standard): New function.
	(exp_iterate, exp_uses_objfile_iter, exp_uses_objfile): New functions.
	* parser-defs.h (struct exp_descriptor): New field operator_check.
	(operator_check_standard, exp_uses_objfile): New declarations.
	* printcmd.c: Remove the inclusion of solib.h.
	(display_uses_solib_p): Remove the function.
	(clear_dangling_display_expressions): Call lookup_objfile_from_block
	and exp_uses_objfile instead of display_uses_solib_p.
	* solist.h (struct so_list) <objfile>: New comment.
	* symtab.c (lookup_objfile_from_block): Remove the static qualifier.
	* symtab.h (lookup_objfile_from_block): New declaration.
	(struct general_symbol_info) <obj_section>: Extend the comment.

gdb/testsuite/
	Fix crashes on dangling display expressions.
	* gdb.base/solib-display.exp: Call gdb_gnu_strip_debug if LIBSEPDEBUG
	is SEP.
	(lib_flags): Remove the "debug" keyword.
	(libsepdebug): New variable for iterating new loop.
	(save_pf_prefix): New variable wrapping the loop.
	(sep_lib_flags): New variable derived from LIB_FLAGS.  Use it.
	* lib/gdb.exp (gdb_gnu_strip_debug): Document the return code.
2010-04-22 23:15:43 +00:00
Daniel Jacobowitz 2390201f4b * gdb.base/call-signal-resume.exp, gdb.base/unwindonsignal.exp: Skip
if gdb,nosignals.
	* gdb.base/watchpoints.c: Do not include unnecessary headers.
	* lib/gdb.exp (gdb_test_multiple): Relax pattern for "the program
	exited".
2010-03-24 21:20:39 +00:00
Vladimir Prus a7bdde9e63 Unify actions and commands
* defs.h (read_command_lines, read_command_lines_1): New
	parameters validator and closure.
	* tracepoint.h (struct action_line): Remove.
	* breakpoint.h (struct breakpoint): Remove the 'actions'
	field.
	* defs.h (enum command_control_type): New value
	while_stepping_control.
	(struct command_line): Add comments.
	* breakpoint.c (breakoint_is_tracepoint): New.
	(breakpoint_set_commands): For tracepoints,
	verify the commands are permissible.
	(check_tracepoint_commands): New.
	(commands_command): Require that each new line is validated using
	check_tracepoint_command, if we set commands for a tracepoint.
	(create_tracepoint_from_upload): Likewise.
	(print_one_breakpoint_location): Remove the code to print
	actions specifically.
	(tracepoint_save_command): Relay to print_command_lines.
	* cli/cli-script.c (process_next_line): New parameters validator
	and closure. Handle 'while-stepping'. Call validator if not null.
	(read_command_lines, read_command_lines1): Likewise.
	(recurse_read_control_structure): New parameters validator and
	closure. Handle while_stepping_control.
	(print_command_lines): Handle while-stepping.
	(get_command_line, define_command, document_command): Adjust.
	* remote.c (remote_download_tracepoint): Adjust.
	* tracepoint.c (make_cleanup_free_actions, read_actions)
	(free_actions, do_free_actions_cleanup): Remove.
	(trace_actions_command): Use read_command_lines.
	(validate_actionline): Use error in one place.
	(encode_actions_1): New, extracted from...
	(encode_actions): ...this. Also use cleanups for exception
	safety.
	(trace_dump_command): Adjust.
	* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
	it's tracepoint.
2010-03-23 21:32:28 +00:00
Doug Evans 6bb85cd171 * lib/gdb.exp (gdb_compile_test): Watch for "compiler not installed"
output from gcc.
2010-03-19 17:59:37 +00:00
Jie Zhang e2d69cb505 * lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var.
Declare and use new loadtimeout variable.
2010-03-15 03:43:13 +00:00
Pedro Alves 21e24d2119 gdb/testsuite/
* lib/gdb.exp (gdb_test_multiple): Handle -timeout.
2010-03-12 21:07:51 +00:00
Pedro Alves 759f0f0b7b gdb/testsuite/
* lib/gdb.exp (skip_stl_tests): New.
	(gdb_compile): Symbian needs -ldl.
	(shlib_target_file): New.
	(shlib_symbol_file): New.
	(gdb_load_shlibs): Use shlib_target_file.
	* lib/mi-support.exp (mi_load_shlibs): Use shlib_target_file.
	* gdb.cp/exception.exp: Use skip_stl_tests.
	* gdb.cp/bs15503.exp: Use skip_stl_tests.  Use untested.
	* gdb.cp/try_catch.exp: Use skip_stl_tests.
	* gdb.cp/mb-templates.exp: Ditto.
	* gdb.base/commands.exp: Relax regexes.
	* gdb.base/watchpoint-solib.exp: Don't skip on symbian.  Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/maint.exp: Allow lowercase t.  Allow .rodata in
	sections.
	* gdb.base/ending-run.exp: Accept E32Main for symbian.
	* gdb.base/solib-disc.exp: Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/unload.exp: Don't skip on symbian.  Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/list.exp: Check use_gdb_stub instead of is_remote.
2010-03-12 19:17:01 +00:00
Doug Evans 24486cb784 * lib/gdb.exp (gdb_compile_pthreads): Handle case where
libc contains libpthread.
2010-03-03 22:19:05 +00:00
Phil Muldoon f6bbabf054 2010-02-24 Phil Muldoon <pmuldoon@redhat.com>
PR python/11314
	* lib/gdb.exp (skip_python_tests): New function.
	* gdb.python/py-cmd.exp: Use skip_python_tests.
	* gdb.python/py-frame.exp: Likewise.
	* gdb.python/py-function.exp: Likewise.
	* gdb.python/py-prettyprint.exp: Likewise.
	* gdb.python/py-template.exp: Likewise.
	* gdb.python/py-type.exp: Likewise.
	* gdb.python/py-value.exp: Likewise.
2010-02-24 11:11:17 +00:00
Pedro Alves 061b528517 * lib/gdb.exp (build_id_debug_filename_get): Don't assume new
`regsub' syntax available.
2010-02-17 23:07:24 +00:00
Joel Brobecker 7b356089ca * lib/gdb.exp (gdb_test_timeout): New global variable.
Set it to timeout if not already set.
        (gdb_init): Reset the value of timeout to gdb_test_timeout.
2010-02-08 11:33:54 +00:00
Doug Evans 1be008824d testsuite/
* lib/gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by
	user.
	doc/
	* gdbint.texinfo (Testsuite): Document INTERNAL_GDBFLAGS.
2010-02-05 21:51:38 +00:00
Daniel Jacobowitz 4ea95be9cd * gdb.mi/mi-nonstop.exp (mi_nonstop_resume): New function.
(Top level): Use it to resume.
	* lib/mi-support.exp (mi_send_resuming_command_raw): Recognize
	the Thumb mode displaced stepping error as unsupported.
2010-01-28 22:14:12 +00:00
Jan Kratochvil bbfba9ed15 gdb/testsuite/
* gdb.base/break-interp-lib.c: Include unistd.h, assert.h and stdio.h.
	(libfunc): New parameter action.  Implement also selectable "sleep".
	* gdb.base/break-interp-main.c: Include assert.h.
	(libfunc): New parameter action.
	(main): New parameters argc and argv.  Assert argc.  Pass argv.
	* gdb.base/break-interp.exp (test_core): Pass the "segv" argument.
	(test_attach): New proc.
	(test_ld): Pass new "segv" exec parameter.  Call also test_attach.
	* lib/gdb.exp (core_find): New parameter arg.  Pass it to $binfile.
2010-01-14 21:12:00 +00:00
Vladimir Prus dc146f7c09 Implement core awareness.
* bcache.c (compare_ints): Remove
	(print_percentage): Use compare_positive_ints.
	* defs.h (compare_positive_ints): Declare.
	* linux-nat.h (struct lin_lwp): New field core.
	(linux_nat_core_of_thread_1): Declare.
	* linux-nat.c (add_lwp): Init the 'core' field.
	(linux_nat_wait_1): Record the core.
	(linux_nat_core_of_thread_1, linux_nat_core_of_thread): New.
	(linux_nat_add_target): Register the above.
	* linux-thread-db.c (update_thread_core): New.
	(thread_db_find_new_threads): Update core information for
	every thread.
	* remote.c (struct private_thread_info): New.
	(free_private_thread_info, demand_private_info): New.
	(PACKET_qXfer_threads, use_osdata_threads): New.
	(struct thread_item, threads_parsing_context
	(start_thread, end_thread, thread_attributes)
	(thread_children, threads_children, threads_elements): New.
	(remote_threads_info): Try qXfer:threads before anything
	else.
	(remote_protocol_packets): Register qXfer:threads.
	(remote_open_1): Init use_osdata_threads.
	(struct stop_reply): New field 'core'.
	(remote_parse_stop_reply): Parse core number.
	(process_stop_reply): Record core number.
	(remote_xfer_partial): Handle qXfer:threads.
	(remote_core_of_thread): New.
	(init_remote_ops): Register remote_core_of_thread.
	(_initialize_remote): Register qXfer:read.
	* target.c (target_core_of_thread): New
	* target.h (enum target_object): New value TARGET_OBJECT_THREADS.
	(struct target_ops): New field to_core_of_threads.
	(target_core_of_thread): Declare.
	* gdbthread.h (struct thread_info): New field private_dtor.
	* thread.c (print_thread_info): Report the core.
	* ui-out.c (MAX_UI_OUT_LEVELS): Increase.
	* utils.c (compare_positive_ints): New.
	* features/threads.dtd: New.
	* mi/mi-interp.c (mi_on_normal_stop): Report the core.
	* mi/mi-main.c (struct collect_cores_data, collect_cores)
	(do_nothing, free_vector_of_osdata_items)
	(splay_tree_int_comparator, free_splay_tree): New.
	(print_one_inferior_data): Implemented printing of selected
	inferiors.  Collect and print cores.
	(output_cores): New.
	(mi_cmd_list_thread_groups): Support --recurse.  Permit specifying
	thread groups together with --available.
2010-01-12 21:40:25 +00:00
Doug Evans 6496a6093d * lib/gdbserver-support.exp (gdbserver_download_current_prog): Rename
from gdbserver_download.  All callers updated.
2010-01-12 00:50:26 +00:00
Jan Kratochvil 37aeb5df6e gdb/testsuite/
* gdb.base/corefile.exp: Move the core finding block out and call it as
	core_find, new variable $corefile, replace corefile by $corefile and
	[file tail $corefile] for usage vs. test names resp.
	* lib/gdb.exp (core_find): Move it as a new function here.  New
	parameter binfile and deletefiles.  New variable $destcore.  Pre-delete
	$destcore.  Return "" on error.
2010-01-09 00:14:11 +00:00
Jan Kratochvil d521f56333 gdb/testsuite/
Workaround PR binutils/10802.
	* lib/gdb.exp (gdb_gnu_strip_debug): Preserve the file attributes
	(twice).
2010-01-08 22:59:47 +00:00
Joel Brobecker 2de75e717c * lib/gdb.exp (gdb_start_cmd): Move comment outside of gdb_expect
call, to avoid interruption.
2010-01-08 12:03:36 +00:00
Doug Evans d0ef5df828 * lib/gdb.exp (gdb_skip_xml_test): Add comment. 2010-01-07 23:26:39 +00:00
Jan Kratochvil 8997583e21 gdb/testsuite/
* lib/mi-support.exp (mi_expect_stop <stopped at wrong place>): Insert
	missing $after_stopped and comma (,) expectation.
2010-01-01 07:57:56 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Daniel Jacobowitz f6838f8147 * lib/gdb.exp (current_target_name): New procedure.
(gdb_wrapper_target): New variable.
	(gdb_wrapper_init): Set gdb_wrapper_target.
	(default_gdb_init): Check gdb_wrapper_target before rebuilding the
	wrapper.
2009-11-13 22:51:59 +00:00
Daniel Jacobowitz a69b7d9d96 testsuite/
* lib/cell.exp (skip_cell_tests): Clean up test files before
	returning.
2009-11-12 19:59:28 +00:00
Daniel Jacobowitz b598bfda9b testsuite/
* lib/gdb.exp (gdb_test_multiple): Handle "y or [n]", "[y] or n",
	and the breakpoint menu.  Do not call perror if a prompt is seen.
	Consume the following GDB prompt.
	* gdb.cp/method2.exp (test_break): Use gdb_test_multiple.
	* gdb.cp/namespace.exp: Use gdb_test.
	* gdb.cp/templates.exp: Use gdb_test.
	(test_template_breakpoints): Use gdb_test_multiple.
2009-11-12 19:54:39 +00:00
Nathan Froyd bdf7534a4d * lib/gdb.exp (gdb_compile): Also set rpath for shlib=, on a
remote host.
2009-11-12 17:35:54 +00:00
Daniel Jacobowitz fa33544892 * lib/gdb.exp (default_gdb_version): Use --version instead of
--command.
2009-11-10 20:54:55 +00:00
Nathan Sidwell ec3c07fc0f * lib/gdb.exp (gdb_compile_test): New.
(skip_ada_tests, skip_java_tests): New.
	(gdb_compile): Use gdb_compile_test for f77.
	* lib/ada.exp (gdb_compile_ada): Use gdb_compile_test to record result.
	* lib/java.exp (compile_java_from_source): Remove runtests check,
	use gdb_compile_test to record result.
	* gdb.ada/packed_array.exp, gdb.ada/fixed_points.exp,
	gdb.ada/exec_changed.exp, gdb.ada/start.exp,
	gdb.ada/watch_arg.exp, gdb.ada/null_record.exp,
	gdb.ada/array_return.exp, gdb.ada/arrayidx.exp,
	gdb.mi/mi-var-child-f.exp, gdb.fortran/types.exp,
	gdb.fortran/array-element.exp, gdb.fortran/subarray.exp,
	gdb.fortran/derived-type.exp, gdb.fortran/exprs.exp,
	gdb.java/jmisc.exp, gdb.java/jmisc1.exp, gdb.java/jprint.exp,
	gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
	adjust gdb_compile invocations.
2009-11-10 10:16:10 +00:00
Daniel Jacobowitz f8b7eaf30a * config/m68k-emc.exp, lib/emc-support.exp,
gdb.trace/gdb_c_test.c: Delete.
	* gdb.trace/actions.exp, gdb.trace/backtrace.exp, gdb.trace/circ.exp,
	gdb.trace/collection.exp, gdb.trace/deltrace.exp,
	gdb.trace/infotrace.exp, gdb.trace/limits.exp, gdb.trace/packetlen.exp,
	gdb.trace/passc-dyn.exp, gdb.trace/passcount.exp, gdb.trace/report.exp,
	gdb.trace/save-trace.exp, gdb.trace/tfind.exp, gdb.trace/tracecmd.exp,
	gdb.trace/while-dyn.exp, gdb.trace/while-stepping.exp: Remove special
	casing for m68k-*-elf.
2009-11-05 20:06:03 +00:00
Daniel Jacobowitz db16b77203 * lib/gdb.exp (gdb_expect): Fix timeout typo. 2009-11-02 17:28:16 +00:00
Pedro Alves 0413d7389a gdb/testsuite/
* lib/gdb.exp (gdb_compile): Remove dead aix and irix related
	bits.
2009-10-08 22:42:53 +00:00
Pierre Muller 8d417781d6 * lib/gdb.exp (default_gdb_init): Set current value of match_max
to default.
2009-10-05 06:27:46 +00:00
Pierre Muller bb61102ddc * lib/gdb.exp (gdb_compile): Add --enable-auto-import option for
mingw and cygwin targets.
2009-10-02 22:25:26 +00:00
Pierre Muller ace5c364a5 * lib/gdb.exp (gdb_compile): Avoid adding
gdb_saved_unbuffered_mode_obj if -nostdlib option is used.
2009-10-02 21:28:34 +00:00
Tom Tromey 0cc7d26fe4 gdb
* varobj.h (varobj_update_result_t) <new>: New field.
	(varobj_get_child_range, varobj_set_child_range): Declare.
	(varobj_list_children): Update.
	(varobj_enable_pretty_printing, varobj_has_more)
	(varobj_pretty_printed_p): Declare.
	* varobj.c (pretty_printing): New global.
	(varobj_enable_pretty_printing): New function.
	(struct varobj_root) <from, to, constructor, child_iter,
	saved_item>: New fields.
	(varobj_create): Don't call install_default_visualizer.
	(instantiate_pretty_printer): Don't use value_copy.
	(varobj_has_more): New function.
	(restrict_range): New function.
	(install_dynamic_child): Likewise.
	(dynamic_varobj_has_child_method): Likewise.
	(update_dynamic_varobj_children): Remove 'new_and_unchanged'
	argument; add 'new', 'unchanged', 'from', and 'to' arguments.
	Rewrite.
	(varobj_get_num_children): Call update_dynamic_varobj_children.
	(varobj_list_children): Add 'from' and 'to' arguments.  Ignore
	result of update_dynamic_varobj_children.  Don't call
	install_default_visualizer.  Restrict result range.
	(varobj_add_child): Don't call install_default_visualizer.
	(varobj_pretty_printed_p): New function.
	(install_visualizer): Rewrite.  Move earlier in file.
	(install_default_visualizer): Likewise.
	(construct_visualizer): New function.
	(install_new_value_visualizer): Likewise.
	(install_new_value): Don't call release_value.  Special case
	pretty-printed objects.  Use value_incref.  Rearrange "changed"
	logic.
	(varobj_get_child_range): New function.
	(varobj_set_child_range): Likewise.
	(varobj_set_visualizer): Rewrite.
	(varobj_update): Rewrite pretty-printing logic.
	(new_variable): Initialize new fields.
	(free_variable): Destroy new fields.
	(value_of_root): Copy 'from' and 'to'.
	(my_value_of_variable): Handle pretty-printers.
	(value_get_print_value): Rework pretty-printing logic.
	(cplus_describe_child): Don't use release_value.
	* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
	(mi_cmd_var_set_update_range): Declare.
	* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
	var-set-update-range.
	* mi/mi-cmd-var.c (print_varobj): Update.  Emit "dynamic"
	attribute.
	(mi_cmd_var_create): Emit "has_more" attribute.
	(mi_cmd_var_set_format): Plug memory leak.
	(mi_print_value_p): Replace 'type' argument with 'var'.  Handle
	pretty-printed varobjs.
	(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
	Emit "has_more" attribute.
	(mi_cmd_var_evaluate_expression): Plug memory leak.
	(mi_cmd_var_assign): Likewise.
	(varobj_update_one): Likewise.  Emit "dynamic", "has_more", and
	"new_children" attributes.
	(mi_cmd_enable_pretty_printing): New function.
	(mi_cmd_var_set_update_range): Likewise.
gdb/doc
	* gdb.texinfo (GDB/MI Variable Objects): Document
	-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
	Expand -var-update documentation.
gdb/testsuite
	* lib/mi-support.exp (mi_create_varobj): Update.
	(mi_create_floating_varobj): Likewise.
	(mi_create_dynamic_varobj): New proc.
	(mi_varobj_update): Update.
	(mi_varobj_update_with_type_change): Likewise.
	(mi_varobj_update_kv_helper): New proc.
	(mi_varobj_update_dynamic_helper): Rewrite.
	(mi_varobj_update_dynamic): New proc.
	(mi_list_varobj_children): Update.
	(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
	* gdb.python/python-prettyprint.py (pp_outer): New class.
	(pp_nullstr): Likewise.
	(lookup_function): Register new printers.
	* gdb.python/python-prettyprint.c (struct substruct): New type.
	(struct outerstruct): Likewise.
	(substruct_test): New function.
	(struct nullstr): New type.
	(string_1, string_2): New globals.
	(main): Add new tests.
	* gdb.python/python-mi.exp: Added regression tests.
	* gdb.mi/mi2-var-display.exp: Update.
	* gdb.mi/mi2-var-cmd.exp: Update.
	* gdb.mi/mi2-var-child.exp: Update.
	* gdb.mi/mi2-var-block.exp: Update.
	* gdb.mi/mi-var-invalidate.exp: Update.
	* gdb.mi/mi-var-display.exp: Update.
	* gdb.mi/mi-var-cmd.exp: Update.
	* gdb.mi/mi-var-child.exp: Update.
	* gdb.mi/mi-var-block.exp: Update.
	* gdb.mi/mi-break.exp: Update.
	* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
Vladimir Prus 48cb2d8581 Implement -break-commands
* breakpoint.c (get_breakpoint, breakpoint_set_commands): New.
	(commands_command): Use breakpoint_set_commands.
	* breakpoint.h (get_breakpoint, breakpoint_set_commands): Declare.

	* mi/mi-cmds.h (mi_cmd_break_commands): New.
	* mi/mi-cmds.c: Register -break-commands.
	* mi/mi-cmd-break.c (mi_cmd_break_commands, mi_read_next_line)
	(mi_command_line_array, mi_command_line_array_cnt)
	(mi_command_line_array_ptr): New.
2009-08-03 12:39:01 +00:00
Ulrich Weigand 79d0a52d5d Fix previous check-in. 2009-07-31 15:39:24 +00:00
Jan Kratochvil 4662c76e91 gdb/testsuite/
Fix gdb.base/macscp.exp when using custom inputrc.
	* gdb.base/completion.exp: Remove env(INPUTRC) set and restore.
	* gdb.base/readline.exp: Remove env(INPUTRC) set and restore.  Remove
	env(TERM) set.
	* gdb.cp/cpcompletion.exp: Remove env(INPUTRC) set.
	* lib/gdb.exp (default_gdb_start): Add env(INPUTRC) and env(TERM) set.
2009-07-13 19:24:18 +00:00
Tom Tromey 812f734247 gdb/doc
* gdbint.texinfo (Testsuite): Document test transcripts.
gdb/testsuite
	* lib/gdb.exp: Handle TRANSCRIPT.
	(remote_spawn, remote_close, send_gdb): New procs.
2009-07-10 18:48:41 +00:00
Daniel Jacobowitz d80a43f961 * lib/java.exp (java_init): Ignore $GCJ if it is empty. 2009-07-06 19:14:01 +00:00
Jan Kratochvil 047427a8a8 gdb/testsuite/
* lib/gdbserver-support.exp (gdbserver_start): Loop spawning
	gdbserver increasing $portnum if "Can't bind address" has been seen.
2009-07-06 18:51:10 +00:00
Jan Kratochvil f4e164aac4 gdb/testsuite/
* lib/mi-support.exp (mi_check_thread_states): Permit any output before
	the expected result record.
2009-06-30 20:23:05 +00:00
Daniel Jacobowitz edb3359dff gdb/
* NEWS: Document inlined function support.
	* Makefile.in (SFILES): Add inline-frame.c.
	(COMMON_OBS): Add inline-frame.o.
	* block.c (contained_in): Rewrite to use lexical nesting.
	(block_linkage_function): Skip inlined function blocks.
	(block_inlined_p): New.
	* block.h (struct block): Update comment.
	(block_inlined_p): New prototype.
	* blockframe.c (get_frame_block): Handle inlined functions.
	(get_frame_function): Do not use block_linkage_function.
	(block_innermost_frame): Use get_frame_block and contained_in.
	* breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache.
	Skip over inlined functions.  Simplify epilogue check.
	(bpstat_check_breakpoint_conditions): Use get_stack_frame_id.
	Update comments.
	(set_momentary_breakpoint): Only accept non-inlined frames.
	(watch_command_1): Use frame_unwind_caller_pc and
	frame_unwind_caller_id instead of get_prev_frame.
	(until_break_command): Likewise.  Use get_stack_frame_id.
	* buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions.
	* dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function.
	* dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine.
	(read_func_scope, new_symbol): Likewise.  Handle arguments specially
	for inlined functions without call site information.
	(inherit_abstract_dies): Allow tag mismatch for inlined subroutines.
	(die_specification): Treat DW_AT_abstract_origin as a specification.
	(read_type_die): Handle DW_TAG_inlined_subroutine.
	* frame-unwind.c (frame_unwind_init): Add inline_frame_unwind.
	* frame.c (fprint_frame_id): Print inline depth.
	(fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME.
	(skip_inlined_frames, get_stack_frame_id): New.
	(frame_unwind_caller_id): Use skip_inlined_frames.
	(frame_id_inlined_p): New.
	(frame_id_eq): Make the logic match the comments.  Add inline_depth
	check.
	(frame_id_inner): Handle inlined functions.
	(frame_unwind_pc): New function, copied from frame_unwind_caller_pc.
	(frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc.
	(get_prev_frame_1): Check for inline frames.  Split out frame
	allocation to get_prev_frame_raw.
	(get_prev_frame_raw): New function.
	(get_prev_frame): Handle inline frames.
	(get_frame_pc): Use frame_unwind_pc.
	(get_frame_address_in_block): Skip inlined frames on both sides.
	(pc_notcurrent): Delete.
	(find_frame_sal): Rewrite to handle inline call sites.  Use
	get_frame_address_in_block.
	(deprecated_update_frame_pc_hack): Make static.
	* frame.h: Update comments.
	(struct frame_id): Add inline_depth.
	(enum frame_type): Add INLINE_FRAME.
	(frame_id_inlined_p, get_stack_frame_id): New prototypes.
	* gdbthread.h (struct thread_info): Add step_stack_frame_id field.
	* infcmd.c (set_step_frame): New function.
	(step_once): Use set_step_frame.  Handle inlined functions.
	(until_next_command): Use set_step_frame.
	(finish_backward), finish_forward): Use get_stack_frame_id.
	(finish_command): Support inlined functions.
	* inferior.h (set_step_info): New prototype.
	* infrun.c (RESUME_ALL): Use minus_one_ptid.
	(clear_proceed_status): Clear step_stack_frame_id.
	(init_wait_for_inferior): Call clear_inline_frame_state.
	(init_execution_control_state): Make static.
	(set_step_info): New function.
	(init_thread_stepping_state): Do not set the symtab or line here.
	(stepped_in_from): New function.
	(handle_inferior_event): Handle inlined functions.  Use set_step_info.
	(insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id.
	(struct inferior_status): Add step_stack_frame_id.
	(save_inferior_status, restore_inferior_status): Save and restore
	step_stack_frame_id.
	* inline-frame.c, inline-frame.h: New files.
	* minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC.
	* regcache.c (regcache_write_pc): Call reinit_frame_cache.
	* s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME.
	* stack.c (frame_show_address): New.
	(print_frame_info, print_frame): Use it.
	(find_frame_funname): Use get_frame_function.  Handle inlined blocks.
	(frame_info): Mark inlined functions.
	(backtrace_command_1): Use get_current_user_frame.
	(print_frame_local_vars, print_frame_label_vars): Update comments.
	(return_command): Refuse inlined functions.
	* symtab.c (lookup_symbol_aux_local): Stop at inlined function
	boundaries.
	(find_function_start_sal): Avoid inlined functions.
	(completion_list_add_fields): New function.
	(default_make_symbol_completion_list): Use it.  Use block_static_block
	and block_global_block.  Check for inlined functions.
	(skip_prologue_using_sal): Avoid line number comparison across
	inlining.
	* symtab.h (struct symbol): Add is_inlined.
	(SYMBOL_INLINED): New.
	* target.c (target_resume): Call clear_inline_frame_state.
	* valops.c (value_of_variable): Check block_inlined_p.

	gdb/doc/
	* gdb.texinfo (Debugging Optimized Code): New chapter.
	(Compiling for Debugging): Reference it.  Move some
	text to the new section.

	gdb/testsuite/
	* gdb.base/break.exp: Add an XFAIL for gcc/36748.
	* gdb.cp/annota2.exp: Accept frames-invalid in more places.
	* gdb.opt/Makefile.in (EXECUTABLES): Update.
	* gdb.opt/clobbered-registers-O2.exp: Update to GPL v3.
	* gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp,
	gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp,
	gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp,
	gdb.opt/inline-markers.c: New files.
	* lib/gdb.exp (skip_inline_frame_tests): New function.
	(skip_inline_var_tests): New function.
2009-06-28 00:20:24 +00:00
Pierre Muller 56643c5e72 * lib/gdb.exp (gdb_compile): Also force unbuffered mode for DJGPP
target.
2009-06-17 22:46:09 +00:00
Jan Kratochvil 72c6339519 gdb/testsuite/
Report error on GDB crash during runto.
	* lib/gdb.exp (runto <eof>): New.
2009-06-12 21:28:34 +00:00
Tom Tromey b631324398 gdb
2009-05-27  Vladimir Prus  <vladimir@codesourcery.com>
	    Tom Tromey  <tromey@redhat.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* mi/mi-main.c (mi_cmd_list_features): List "python" feature.
	* varobj.h (varobj_set_visualizer): Declare.
	(varobj_get_display_hint): Likewise.
	(varobj_update_result_t) <children_changed, value_installed>: New
	fields.
	* mi/mi-cmds.c (mi_cmds): Add var-set-visualizer.
	* mi/mi-cmds.h (mi_cmd_var_set_visualizer,
	mi_cmd_var_set_child_range): Declare.
	* mi/mi-cmd-var.c (mi_cmd_var_set_visualizer): New function.
	(mi_cmd_var_list_children): Emit display hint.
	(varobj_update_one): Emit display hint.  Handle dynamic children.
	* python/python.c (GdbMethods): Add "default_visualizer".
	* python/python-internal.h (apply_varobj_pretty_printer,
	gdbpy_get_varobj_pretty_printer, gdbpy_get_display_hint):
	Declare.
	(gdbpy_default_visualizer): Likewise.
	* varobj.c: Include python.h, python-internal.h.
	(PyObject): New typedef.
	(struct varobj) <children_requested, pretty_printer>: New fields.
	(varobj_create): Call install_default_visualizer.
	(instantiate_pretty_printer): New function.
	(varobj_set_display_format): Update.
	(varobj_get_display_hint): New function.
	(update_dynamic_varobj_children): New function.
	(varobj_get_num_children): Handle dynamic children.
	(varobj_list_children): Likewise.
	(install_new_value): Likewise.
	(varobj_add_child): New function.
	(install_visualizer): Likewise.
	(install_default_visualizer): Likewise.
	(varobj_set_visualizer): Likewise.
	(varobj_update): Handle dynamic children.
	(create_child): Use create_child_with_value.
	(create_child_with_value): New function.
	(value_get_print_value): Call pretty printer.  Add value_formatter
	argument.
	(c_value_of_variable): Update.
	(varobj_invalidate): Always free all_rootvarobj.
	* python/python-prettyprint.c (apply_varobj_pretty_printer): New
	function.
	(gdbpy_get_varobj_pretty_printer): Likewise.
	(gdbpy_default_visualizer): Likewise.

gdb/doc

2009-05-27  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (GDB/MI Miscellaneous Commands): Document "python"
	feature.
	(GDB/MI Variable Objects): Document -var-set-visualizer.

gdb/testsuite

2009-05-27  Tom Tromey  <tromey@redhat.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* lib/mi-support.exp (mi_varobj_update_dynamic): New proc.
	(mi_child_regexp): Likewise.
	(mi_list_varobj_children_range): Likewise.
	(mi_get_features): Likewise.
	(mi_list_varobj_children): Rewrite.
	* gdb.python/python-mi.exp: New file.
2009-05-28 01:09:20 +00:00
Joseph Myers e7f86de9ac * lib/gdb.exp (get_compiler_info): Use -E -o in remote-host case. 2009-04-22 19:46:19 +00:00