Commit Graph

3029 Commits

Author SHA1 Message Date
Daniel Jacobowitz 6387b45f80 * gdb.dwarf2/dw2-compressed.S: Also define __start. 2008-07-27 21:01:45 +00:00
Daniel Jacobowitz 62f64ff2d6 * lib/mi-support.exp (default_mi_gdb_start): Remove check for
non-MI prompt.
2008-07-27 20:57:43 +00:00
Tom Tromey fa8de41e93 gdb:
PR gdb/1158:
	* valops.c (value_struct_elt): Treat function-valued field as a
	static method.
gdb/testsuite:
	* gdb.base/callfuncs.c (struct struct_with_fnptr): New struct.
	(function_struct, function_struct_ptr): New globals.
	* gdb.base/callfuncs.exp (do_function_calls): Test calling via a
	function pointer in a struct.
2008-07-27 02:00:04 +00:00
Tom Tromey ccb3ac8a12 gdb:
PR gdb/1136:
	* macroexp.c (get_punctuator) <punctuators>: Rearrange to put
	longer tokens first.
gdb/testsuite:
	* gdb.base/macscp.exp: Add test for macro lexing bug.
2008-07-27 01:58:01 +00:00
Tom Tromey d7d9f01ea1 gdb
PR gdb/855:
	* NEWS: Add entry for macro commands.
	* Makefile.in (macrocmd.o): Add gdb_string.h.
	* macroscope.h (user_macro_scope): Declare.
	(default_macro_scope): Update documentation.
	(macro_user_macros): Declare.
	* c-lang.c (c_preprocess_and_parse): Always attempt macro lookup.
	Use user_macro_scope.
	(null_macro_lookup): Remove.
	* macrotab.h (macro_callback_fn): Declare.
	(macro_for_each): Likewise.
	(macro_allow_redefinitions): Likewise.
	* macrotab.c (foreach_macro): New function
	(macro_for_each): Likewise.
	(struct macro_table) <redef_ok>: New field.
	(macro_allow_redefinitions): New function.
	(new_macro_table): Update.
	(macro_define_function): Likewise.
	(macro_define_object): Likewise.
	* macroscope.c (user_macro_scope): New function.
	(default_macro_scope): Use it.
	(macro_user_macros): New global.
	(standard_macro_lookup): Look in macro_user_macros.
	(_initialize_macroscope): New function.
	* macroexp.h (macro_is_whitespace, macro_is_digit,
	macro_is_identifier_nondigit): Declare.
	* macroexp.c (macro_is_whitespace): Rename.  No longer static.
	(macro_is_digit): Likewise.
	(macro_is_identifier_nondigit): Likewise.
	(get_identifier): Update.
	(get_pp_number): Likewise.
	(get_token): Likewise.
	* macrocmd.c (skip_ws): New function.
	(extract_identifier): Likewise.
	(free_macro_definition_ptr): Likewise.
	(user_macros): Remove.
	(macro_define_command): Implement.
	(_initialize_macrocmd): Update.
	(macro_undef_command): Implement.
	(print_one_macro): New function.
	(macro_list_command): Implement.
gdb/doc
	* gdb.texinfo (Macros): Update.  Use @code rather than @command.
gdb/testsuite
	* gdb.base/macscp.exp: Add macro tests.
2008-07-18 20:55:33 +00:00
Paul Pluzhnikov 9bf07184c9 Fix for Linux/VDSO failure. 2008-07-17 20:57:26 +00:00
Paul Pluzhnikov becf64774c Fix for gdb.base/corefile.exp failure on Linux 2008-07-17 19:01:44 +00:00
Paul Pluzhnikov 0709f7d3ac Fix for 'FAIL: gdb.cp/class2.exp: p acp->c2' on spu-elf 2008-07-15 19:15:28 +00:00
Paul Pluzhnikov 7093c834d7 Fix for PR gdb/2477 2008-07-14 18:28:57 +00:00
Jan Kratochvil b432ffe3e2 * gdb.base/randomize.exp: Catch non-Linux targets as untested. 2008-07-13 14:56:02 +00:00
Vladimir Prus b1a268e5b4 * infrun.c (normal_stop): For MI, report which threads
were stopped.
2008-07-12 12:41:56 +00:00
Kevin Buettner e2995f8ea0 * gdb.arch/e500-regs.exp (decimal_vector): Adjust "v8_int8" portion
of regexp to account for changes made to GDB in the printing of
	byte vectors.
2008-07-11 21:57:24 +00:00
Tom Tromey 14032a66f1 gdb
* completer.c (complete_line_internal): New function, from
	complete_line.  Add 'for_help' parameter.
	(complete_line): Use it.
	(command_completer): Move later.  Rewrite.
gdb/testsuite
	* gdb.base/completion.exp: Add 'help' completion test.
2008-07-11 15:07:52 +00:00
Jan Kratochvil 981505ef9a * gdb.base/randomize.exp: Remove dependency on tcl-8.4+. 2008-07-10 20:16:27 +00:00
Jan Kratochvil 10568435e1 gdb/
* NEWS (New commands): Mention "set disable-randomization".
	* configure.ac: Add check for HAVE_PERSONALITY and
	HAVE_DECL_ADDR_NO_RANDOMIZE.
	* configure, config.in: Regenerate.
	* linux-nat.c [HAVE_PERSONALITY]: New include <sys/personality.h>.
	[HAVE_PERSONALITY] [!HAVE_DECL_ADDR_NO_RANDOMIZE]: Set
	ADDR_NO_RANDOMIZE.
	(disable_randomization, show_disable_randomization)
	(set_disable_randomization): New.
	(linux_nat_create_inferior) [HAVE_PERSONALITY]: New variables
	PERSONALITY_ORIG and PERSONALITY_SET.  Disable randomization upon the
	variable DISABLE_RANDOMIZATION.
	(_initialize_linux_nat): Call ADD_SETSHOW_BOOLEAN_CMD for the variable
	DISABLE_RANDOMIZATION.

gdb/doc/
	* gdb.texinfo (Starting): Document "set disable-randomization".

gdb/testsuite/
	* gdb.base/randomize.exp, gdb.base/randomize.c: New files.
2008-07-10 09:31:00 +00:00
Pedro Alves 4487aabf2e gdb/
2008-07-09  Pedro Alves  <pedro@codesourcery.com>

	* symfile.c (load_command): Reopen the exec file and reread
	symbols before anything else.

gdb/testsuite/
2008-07-09  Pedro Alves  <pedro@codesourcery.com>

	* gdb.base/chng-syms.exp: Don't expect "No symbol ...".
2008-07-09 11:16:49 +00:00
Pedro Alves a4a9b1c4f2 * gdb.base/fullname.exp: Restore pwd if compiling failed. 2008-07-09 10:50:52 +00:00
Jan Kratochvil 3c3185ac88 gdb/
* breakpoint.c (bpstat_copy): Call RELEASE_VALUE on the new OLD_VAL.

gdb/testsuite/
	* gdb.base/value-double-free.exp, gdb.base/value-double-free.c: New.
2008-07-07 22:39:59 +00:00
Daniel Jacobowitz ed5e946612 Add missed changelog entry. 2008-07-05 13:48:21 +00:00
Vladimir Prus 7ebd49dca3 * lib/mi-support.exp (mi_send_resuming_command_raw): Revert
previous commit.  Add a comment.
2008-06-28 11:31:02 +00:00
Pedro Alves 84e46146f7 gdb/
2008-06-28  Pedro Alves  <pedro@codesourcery.com>

	* linux-nat.c (enum sigchld_state): New.
	(linux_nat_async_events_state): Renamed from
	linux_nat_async_events_enabled.
	(linux_nat_event_pipe_push, my_waitpid): Adjust.
	(sigchld_default_action): New.
	(lin_lwp_attach_lwp): Adjust.  Call linux_nat_async_events
	unconditionally.
	(linux_nat_create_inferior): Set events state to sigchld_default
	state.
	(linux_nat_resume): Adjust.
	(linux_nat_wait): Call linux_nat_async_events unconditionally.
	(sigchld_handler): Adjust.
	(linux_nat_async_mask): Don't set SIGCHLD actions here.
	(get_pending_events): Adjust.
	(linux_nat_async_events): Rewrite to handle enum sigchld_state
	instead of a boolean.
	(linux_nat_async): Adjust.
	(_initialize_linux_nat): Capture default SIGCHLD action into
	sigchld_default_action.

gdb/testsuite/
2008-06-28  Pedro Alves  <pedro@codesourcery.com>

	* gdb.base/sigchld.c, gdb.base/sigchld.exp: New test.
2008-06-28 11:15:34 +00:00
Vladimir Prus 0f8d4a2f6e * lib/mi-support.exp (mi_send_resuming_command_raw): Report pass. 2008-06-28 10:14:34 +00:00
Vladimir Prus 53c2f6a972 Revert accidental commit 2008-06-28 10:03:42 +00:00
Pedro Alves f747e0ce0a * lib/gdb.exp (gdb_saved_set_unbuffered_mode_obj): New global.
(gdb_compile): If target is *-*-cygwin* or *-*-mingw*, and we're
	compiling an executable, link in an object that forces unbuffered
	output.
	* lib/set_unbuffered_mode.c: New file.
2008-06-27 16:42:19 +00:00
Vladimir Prus d50867903f * target.c (target_read_until_error): New.
* target.h (target_read_until_error): Declare.
        * mi/mi-main.c (mi_cmd_data_read_memory): Use
        target_read_until_error.
2008-06-26 15:10:48 +00:00
Jan Kratochvil 734a5c3612 * lib/gdb.exp (prepare_for_testing): Do not drop the OPTIONS argument. 2008-06-25 15:52:15 +00:00
Daniel Jacobowitz 2c40eaebf8 Revert accidental commit. 2008-06-25 15:21:21 +00:00
Vladimir Prus a2840c3559 Emit ^running via observer.
* mi/mi-interp.c (mi_cmd_interpreter_exec): Do no print
        ^running here.
        (mi_on_resume): Print ^running if not previously output.
        * mi/mi-main.c (running_result_record_printed): New.
        (captured_mi_execute_command): Reset
        running_result_record_printed.  Use running_result_record_printed
        to decide if we should skip ^done.
        (mi_execute_async_cli_command): Don't print ^running here.
        * mi/mi-main.h (current_token, running_result_record_printed):
        Declare.
2008-06-25 14:32:34 +00:00
Daniel Jacobowitz 7413f23fb4 * elf32-arm.c (STUB_ENTRY_NAME): Define.
(arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
	(arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
	R_ARM_ABS32.
	(struct elf32_arm_stub_hash_entry): Add output_name.
	(arm_build_one_stub): Move offsets into the offset argument
	of _bfd_final_link_relocate.  Correct offset for
	arm_thumb_arm_v4t_stub_long_branch.
	(elf32_arm_size_stubs): Set stub_entry->output_name.
	(elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
	Update all callers.
	(elf32_arm_output_stub_sym): New.
	(arm_map_one_stub): Correct formatting.  Use elf32_arm_output_stub_sym.

	* ld-arm/farcall-arm-arm-be8.d, ld-arm/farcall-arm-arm-pic-veneer.d,
	ld-arm/farcall-arm-arm.d, ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
	ld-arm/farcall-arm-thumb-blx.d, ld-arm/farcall-arm-thumb-pic-veneer.d,
	ld-arm/farcall-arm-thumb.d, ld-arm/farcall-group-size2.d,
	ld-arm/farcall-group.d, ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d,
	ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
	ld-arm/farcall-thumb-arm-blx.d, ld-arm/farcall-thumb-arm.d,
	ld-arm/farcall-thumb-thumb-blx-pic-veneer.d,
	ld-arm/farcall-thumb-thumb-blx.d, ld-arm/farcall-thumb-thumb-m.d,
	ld-arm/thumb2-bl-as-thumb1-bad.d, ld-arm/thumb2-bl-bad.d: Update for
	stub symbols and stub corrections.
2008-06-25 14:28:48 +00:00
Vladimir Prus 6ae37fefeb Robustify mi-simplerun.
* gdb.mi/basics.c (main): Add a call to sleep.
        * gdb.mi/mi-cli.exp: Adjust for change in line numbers.
        * gdb.mi/mi2-cli.exp: Likewise.
        * gdb.mi/mi-break.exp: Likewise.
2008-06-13 19:53:42 +00:00
Vladimir Prus b4aa76f032 Fix date in changelog entry 2008-06-11 13:50:55 +00:00
Vladimir Prus 83408de733 * gdb.mi/mi-break.exp (test_ignore_count): Use mi_expect_stop. 2008-06-11 13:35:58 +00:00
Vladimir Prus e1ac332873 Implement *running.
* Makefile.in: Update dependencies.
        * gdbthread.h (struct thread_info): New field
        running_.
        (set_running, is_running): New.
        * thread.c (set_running, is_running): New.
        * inferior.h (suppress_normal_stop_observer): Rename to...
        (suppress_run_stop_observers): ..this.
        * infcmd.c (suppress_normal_stop_observer): Rename to...
        (suppress_run_stop_observers): ..this.
        (finish_command_continuation, finish_command): Adjust.
        * infcall.c (call_function_by_hand): Adjust.
        * infrun.c (normal_stop): Call set_running.
        * target.c (target_resume): New.  Call set_running.
        * target.h (target_resume): Convert from macro to
        a function.

        * mi/mi-interp.c (mi_on_resume): New.
        (mi_interpreter_init): Register mi_on_resume.
2008-06-10 10:23:54 +00:00
Vladimir Prus f7f9a841a3 Use observers to report stop events in MI.
* mi/mi-interp.c (mi_on_normal_stop): New.
        (mi_interpreter_init): Register mi_on_normal_stop.
        (mi_interpreter_exec_continuation): Remove.
        (mi_cmd_interpreter_exec): Don't register the above.
        * mi/mi-main.c (captured_mi_execute_command): Don't care
        about sync_execution.
        (mi_execute_async_cli_command): Don't install continuation.  Don't
        print *stopped.
        (mi_exec_async_cli_cmd_continuation): Remove.
2008-06-10 09:35:09 +00:00
Tom Tromey 37cd5d19fe gdb
* completer.c (complete_line): Don't special-case
	expression_completer.
	(expression_completer): Only pass last word to
	location_completer.
	* c-exp.y (yylex): Check 'token', not 'operator'.
gdb/testsuite
	* gdb.base/completion.exp: New tests for field name completion
	with spaces, and field name completion with '->'.
2008-06-09 19:25:15 +00:00
Tom Tromey 65d12d83a5 gdb
* value.h (evaluate_subexpression_type, extract_field_op):
	Declare.
	* printcmd.c (_initialize_printcmd): Use expression_completer for
	'p', 'inspect', 'call'.
	* parser-defs.h (parse_field_expression): Declare.
	* parse.c: Include exceptions.h.
	(in_parse_field, expout_last_struct): New globals.
	(mark_struct_expression): New function.
	(prefixify_expression): Return int.
	(prefixify_subexp): Return int.  Use expout_last_struct.
	(parse_exp_1): Update.
	(parse_exp_in_context): Add 'out_subexp' argument.  Handle
	in_parse_field.
	(parse_field_expression): New function.
	* expression.h (parse_field_expression): Declare.
	(in_parse_field): Likewise.
	* eval.c (evaluate_subexpression_type): New function.
	(extract_field_op): Likewise.
	* completer.h (expression_completer): Declare.
	* completer.c (expression_completer): New function.
	(count_struct_fields, add_struct_fields): New functions.
	* c-exp.y (yyparse): Redefine.
	(COMPLETE): New token.
	(exp): New productions.
	(saw_name_at_eof, last_was_structop): New globals.
	(yylex): Return COMPLETE when needed.  Recognize in_parse_field.
	(c_parse): New function.
	* breakpoint.c (_initialize_breakpoint): Use expression_completer
	for watch, awatch, and rwatch.
	* Makefile.in (parse.o): Depend on exceptions_h.
gdb/testsuite
	* gdb.base/break1.c (struct some_struct): New struct.
	(values): New global.
	* gdb.base/completion.exp: Add field name completion test.
gdb/doc
	* gdb.texinfo (Completion): Add field name example.
2008-06-06 20:58:08 +00:00
Paul Pluzhnikov ebfe2e3fb6 2008-06-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/call-c.exp: Test for incorrect handling of reference
	to pointer.
	* gdb.cp/call-c.cc: Likewise.
2008-06-06 18:29:52 +00:00
Nick Roberts bcf6fc3ae4 *** empty log message *** 2008-06-06 00:41:22 +00:00
Nick Roberts 47741aa56c (thread_switch): Test for thread-changed annotation. 2008-06-06 00:40:21 +00:00
Pedro Alves 49fd4a422b gdb/
* linux-thread-db.c (thread_db_wait): Don't trim event ptid.

testsuite/
	* gdb.threads/execl.c, gdb.threads/execl1.c,
	gdb.threads/execl.exp: New tests.
2008-06-05 21:03:59 +00:00
Aleksandar Ristovski 8a34ac3f58 * gdb.cp/exception.exp: Activate test, make it work with pending
catchpoints.
2008-06-05 18:45:37 +00:00
Jan Kratochvil 86ae69ef81 * dw2-ref-missing-frame.S, dw2-ref-missing-frame.exp: New files. 2008-06-05 18:37:17 +00:00
Vladimir Prus f7f9ae2c16 Refactor varobj_update interface.
* varobj.c (varobj_update): Report changes as vector.  Also
        return not just a list of varobj, but a list of special structures
        that tell what exactly has changed.
        * varobj.h (enum varobj_update_error): Rename to
        varobj_scope_status.
        (struct varobj_update_result_t): New.
        (varobj_update): Adjust prototype.
        * mi/mi-cmd-var.c: Adjust for changes.
2008-05-28 12:06:36 +00:00
Andreas Schwab 2a2d4dc301 * symtab.h (enum address_class): Remove LOC_REGPARM and
LOC_COMPUTED_ARG.
	(struct symbol): Add is_argument.
	(SYMBOL_IS_ARGUMENT): Define.

	* ada-lang.c (ada_add_block_symbols): Use SYMBOL_IS_ARGUMENT.
	* buildsym.c (finish_block): Likewise.
	* stack.c (print_frame_args, print_block_frame_locals)
	(print_frame_arg_vars): Likewise.
	* symtab.c (lookup_block_symbol): Likewise.
	* tracepoint.c (add_local_symbols): Likewise.
	* mi/mi-cmd-stack.c (list_args_or_locals): Likewise.

	* coffread.c (process_coff_symbol): Set SYMBOL_IS_ARGUMENT.
	* dwarf2read.c (new_symbol): Likewise.
	* mdebugread.c (parse_symbol): Likewise.
	* stabsread.c (define_symbol): Likewise.

	* ada-exp.y (select_possible_type_sym): Don't handle LOC_REGPARM
	and LOC_COMPUTED_ARG.
	* ada-lang.c (resolve_subexp, symtab_for_sym): Likewise.
	* ax-gdb.c (gen_var_ref): Likewise.
	* eval.c (evaluate_subexp_for_address): Likewise.
	* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
	* m2-exp.y (yylex): Likewise.
	* printcmd.c (address_info): Likewise.
	* symmisc.c (print_symbol, print_partial_symbols): Likewise.
	* tracepoint.c (collect_symbol, scope_info): Likewise.

testsuite/:
	* gdb.base/frame-args.exp: Handle arguments that are optimized
	out.
2008-05-27 19:29:52 +00:00
Luis Machado 5099e4d90d * gdb.arch/ppc64-atomic-inst.exp: Make the expected compile failure
quiet for ppc32 and group options into a single variable.
2008-05-26 15:46:55 +00:00
Joel Brobecker d9c36a9152 * gdb.ada/null_array/foo.adb: Add multi-dimensional array
of zero-size elements.
        * gdb.ada/null_array.exp: Test printing this new array.
2008-05-23 18:15:23 +00:00
Jan Kratochvil 103a867135 * gdb.base/longjmp.exp: Fix GDB_TEST_MULTIPLE missing GDB_PROMPT races. 2008-05-22 14:33:12 +00:00
Joel Brobecker 07a4cc1acc Fix the date of the entry that I just added. 2008-05-21 17:58:21 +00:00
Joel Brobecker 5943254b56 * gdb.base/finish.exp: Test that "fin" works as an abbreviation
of the "finish" command.
2008-05-21 17:55:22 +00:00
Nick Roberts 79afeace62 Test for new annotation. 2008-05-20 21:11:04 +00:00
Nick Roberts 55f996a733 *** empty log message *** 2008-05-20 21:10:31 +00:00
Ulrich Weigand 907fc20268 gdb/
2008-05-15  Pedro Alves  <pedro@codesourcery.com>
	    Ulrich Weigand  <uweigand@de.ibm.com>

	* minsyms.c (lookup_minimal_symbol_by_pc_name): New function.
	* symtab.h (lookup_minimal_symbol_by_pc_name): Add prototype.

	* symtab.c (fixup_section): Remove prototype.  Add ADDR parameter;
	use it instead of ginfo->value.address.  Look up minimal symbol by
	address and name.  Assume OBJFILE is non-NULL.
	(fixup_symbol_section): Ensure we always have an objfile to look
	into.  Extract and pass to fixup_section the symbol's address that
	will match the minimal symbol's address.
	(fixup_psymbol_section): Likewise.

	(find_pc_sect_psymtab): Fall back to non-addrmap case when debugging
	overlays and the addrmap returned the wrong section.

	* dwarf2read.c (var_decode_location): Set SYMBOL_CLASS before
	calling fixup_symbol_section.


gdb/testsuite/

2008-05-15  Pedro Alves  <pedro@codesourcery.com>

	* gdb.base/fixsection.exp: New file.
	* gdb.base/fixsection0.c: New file.
	* gdb.base/fixsection1.c: New file.
2008-05-16 12:58:49 +00:00
Ulrich Weigand e8f972703a * gdb.base/annota1.exp: Accept printf@... in place of printf.
* gdb.base/annota3.exp: Likewise.
2008-05-16 12:48:08 +00:00
Nathan Froyd ac0bb574ab * gdb.base/watch_thread_num.exp: Don't run tests that require
watchpoints if the target doesn't support them.
2008-05-13 21:17:18 +00:00
Doug Evans 6fadd07a48 * lib/gdbserver-support.exp (find_gdbserver): Use $GDBSERVER if set. 2008-05-12 17:25:28 +00:00
Joel Brobecker 6e9a4a305b * gdb.ada/assign_1.exp: New testcase. 2008-05-09 23:51:40 +00:00
Doug Evans de90ada150 update for capitalization changes 2008-05-09 18:51:07 +00:00
Doug Evans a3c83fae41 remove cruft from previous checkin 2008-05-09 18:08:56 +00:00
Doug Evans 08388c79d5 New "find" command.
* NEWS: Document find command and qSearch:memory packet.
	* Makefile.in (SFILES): Add findcmd.c.
	(COMMON_OBJS): Add findcmd.o.
	(findcmd.o): New rule.
	* findcmd.c: New file.
	* target.h (target_ops): New member to_search_memory.
	(simple_search_memory): Declare.
	(target_search_memory): Declare.
	* target.c (simple_search_memory): New fn.
	(target_search_memory): New fn.
	* remote.c (PACKET_qSearch_memory): New packet kind.
	(remote_search_memory): New fn.
	(init_remote_ops): Init to_search_memory.
	(init_extended_remote_ops): Ditto.
	(_initialize_remote): Add qSearch:memory packet config command.

	* gdbserver/server.h (decode_search_memory_packet): Declare.
	* gdbserver/remote-utils.c (decode_search_memory_packet): New fn.
	* gdbserver/server.c (handle_search_memory_1): New fn.
	(handle_search_memory): New fn.
	(handle_query): Process qSearch:memory packets.

	* doc/gdb.texinfo: Document "find" command, qSearch:memory packet.

	* testsuite/gdb.base/find.exp: New file.
	* testsuite/gdb.base/find.c: New file.
2008-05-09 17:02:03 +00:00
Daniel Jacobowitz bd5ddfe865 * gdb.base/commands.exp (watchpoint_command_test): Handle
gdb,no_hardware_watchpoints.
	* gdb.base/float.exp: Allow ARM targets without floating point.
	* gdb.base/step-test.exp: Allow callee@plt when stepping in.
2008-05-08 16:30:53 +00:00
Joel Brobecker b5dd68e231 * gdb.ada/lang_switch: New test program.
* gdb.ada/lang_switch.exp: New testcase.
2008-05-06 21:37:32 +00:00
Doug Evans 382d13d1ca * gdb.base/help.exp (disassemble): Update expected help text. 2008-05-05 22:54:49 +00:00
Pedro Alves 9dd789d040 * gdb.base/longjmp.c, gdb.base/longjmp.exp: New files. 2008-05-04 19:43:31 +00:00
Pedro Alves 611c83ae47 gdb/
* breakpoint.c (update_breakpoints_after_exec): Delete bp_longjmp
	and bp_longjmp_resume breakpoints.
	(breakpoint_address_is_meaningful): Claim bp_longjmp_resume as
	meaningful.
	(create_longjmp_breakpoint): Don't create bp_longjmp_resume
	breakpoints.  Create bp_longjmp breakpoints as momentary
	breakpoints.
	(enable_longjmp_breakpoint): Delete.
	(set_longjmp_breakpoint): New.
	(disable_longjmp_breakpoint): Delete.
	(delete_longjmp_breakpoint): New.
	(set_longjmp_resume_breakpoint): Delete.
	(set_momentary_breakpoint_at_pc): New.
	(breakpoint_re_set_one): Don't delete bp_longjmp and
	bp_longjmp_resume breakpoints.
	(breakpoint_re_set): Don't create longjmp and longjmp-resume
	breakpoints.

	* infrun.c (step_resume_breakpoint): Add comment.
	(struct execution_control_state): Delete handling_longjmp member.
	(init_execution_control_state). Don't clear handling_longjmp.
	(context_switch): Don't context switch handling_longjmp.
	(handle_inferior_event): If handling a bp_longjmp breakpoint,
	create a bp_longjmp_resume breakpoint, and set it as current
	step_resume_breakpoint, then step over the longjmp breakpoint.  If
	handling a bp_longjmp_resume breakpoint, don't delete the longjmp
	breakpoint, delete the longjmp-resume breakpoint, and stop
	stepping.
	(currently_stepping): Remove handling_longjmp from expression.
	(insert_step_resume_breakpoint_at_sal): Update comment.
	(insert_longjmp_resume_breakpoint): New.

	* breakpoint.h (set_momentary_breakpoint_at_pc): Declare.
	(enable_longjmp_breakpoint, disable_longjmp_breakpoint): Delete
	declarations.
	(set_longjmp_breakpoint, delete_longjmp_breakpoint): Declare.
	(set_longjmp_resume_breakpoint): Delete declaration.

	* gdbthread.h (save_infrun_state): Remove handling_longjmp
	parameter.
	(load_infrun_state): Delete *handling_longjmp parameter.
	* thread.c (save_infrun_state): Remove handling_longjmp parameter.
	Update body.
	(load_infrun_state): Delete *handling_longjmp parameter.  Update
	body.

	* infcmd.c (disable_longjmp_breakpoint_cleanup): Delete.
	(delete_longjmp_breakpoint_cleanup): New.
	(step_1): Call set_longjmp_breakpoint instead of
	enable_longjmp_breakpoint.  Use delete_longjmp_breakpoint_cleanup
	instead of disable_longjmp_breakpoint_cleanup when making cleanup.
	(step_1_continuation): Pass thread id in the continuation args to
	step_once.
	(step_once): Add thread parameter.  Pass thread id the the
	continuation.

gdb/testsuite/
	* gdb.cp/annota2.exp: Adjust to breakpoints invalidations at
	different times.
2008-05-04 19:39:00 +00:00
Jan Kratochvil ff013f42f4 gdb/
* Makefile.in: Update dependencies.
	* dwarf2read.c: Include "addrmap.h"
	(struct dwarf2_cu): New fields RANGES_OFFSET and HAS_RANGES_OFFSET.
	(dwarf2_ranges_read): New prototype.
	(dwarf2_build_psymtabs_hard): Initialize and prepare PSYMTABS_ADDRMAP.
	Add discontiguous range to PSYMTABS_ADDRMAP by DWARF2_RANGES_READ on
	HAS_RANGES_OFFSET, otherwise add there the contiguous range.
	(dwarf2_ranges_read): New parameter RANGES_PST, update the function
	comment for it.  Add the found ranges to RANGES_PST.  New variable
	BASEADDR, initialize it the common way.
	(dwarf2_get_pc_bounds): Update the caller for the new parameter.
	(read_partial_die): `DW_AT_ranges' now only sets RANGES_OFFSET and
	HAS_RANGES_OFFSET for the later processing.
	* objfiles.h (struct objfile): New field PSYMTABS_ADDRMAP.
	* symtab.c: Include "addrmap.h"
	(find_pc_sect_psymtab): Support reading the field PSYMTABS_ADDRMAP.
	Move the psymtab locator into ...
	(find_pc_sect_psymtab_closer): ... a new function.

	gdb/testsuite/
	* gdb.dwarf2/dw2-ranges.S: Merge the secondary section with `.fini'.
	* gdb.dwarf2/dw2-ranges.exp: Compile also `dw2-ranges2.S' and
	`dw2-ranges3.S' and test also their MAIN2, FUNC2 and MAIN3 symbols.
	* gdb.dwarf2/dw2-ranges2.S, gdb.dwarf2/dw2-ranges3.S: New files.
2008-05-04 17:27:01 +00:00
Vladimir Prus 96dff6a2f4 * lib/mi-support.exp (mi_run_cmd): Allow for =thread-created
notification to appear.
2008-05-04 12:15:54 +00:00
Daniel Jacobowitz 55cd6f92dc * gdb.base/fullname.c: New file.
* gdb.base/fullname.exp: New file.
	* lib/gdb.exp (gdb_breakpoint): Support no-message option.
2008-05-04 04:04:11 +00:00
Pedro Alves d705c43c5a gdb/
* parse.c (parse_exp_in_context): Don't override
	expression_context_pc if get_selected_block returned a valid
	block.

	gdb/testsuite/
	* gdb.base/macscp.exp, gdb.base/macscp1.c: Add test for printing
	expressions with macros.
2008-05-03 22:30:51 +00:00
Jan Kratochvil 333222e127 * gdb.base/dfp-test.exp: Fix random FAIL risk on calling functions. 2008-05-03 21:56:38 +00:00
Daniel Jacobowitz 5ac016828d * gdb.base/completion.exp: Handle lack of other symbols beginning
with "a".

	* gdb.base/varargs.exp: Correct quoting for options to gdb_compile.
2008-05-02 20:30:49 +00:00
Pedro Alves 237fc4c9cd Implement displaced stepping.
gdb/
	* gdbarch.sh (max_insn_length): New 'variable'.
	(displaced_step_copy, displaced_step_fixup)
	(displaced_step_free_closure, displaced_step_location): New
	functions.
	(struct displaced_step_closure): Add forward declaration.
	* gdbarch.c, gdbarch.h: Regenerated.

	* arch-utils.c: #include "objfiles.h".
	(simple_displaced_step_copy_insn)
	(simple_displaced_step_free_closure)
	(displaced_step_at_entry_point): New functions.
	* arch-utils.h (simple_displaced_step_copy_insn)
	(simple_displaced_step_free_closure)
	(displaced_step_at_entry_point): New prototypes.

	* i386-tdep.c (I386_MAX_INSN_LEN): Rename to...
	(I386_MAX_MATCHED_INSN_LEN): ... this.
	(i386_absolute_jmp_p, i386_absolute_call_p)
	(i386_ret_p, i386_call_p, i386_breakpoint_p, i386_syscall_p)
	(i386_displaced_step_fixup): New functions.
	(struct i386_insn, i386_match_insn): Update.
	(i386_gdbarch_init): Set gdbarch_max_insn_length.
	* i386-tdep.h (I386_MAX_INSN_LEN): New.
	(i386_displaced_step_fixup): New prototype.
	* i386-linux-tdep.c (i386_linux_init_abi): Include "arch-utils.h".
	Register gdbarch_displaced_step_copy,
	gdbarch_displaced_step_fixup, gdbarch_displaced_step_free_closure,
	and gdbarch_displaced_step_location functions.

	* infrun.c (debug_displaced): New variable.
	(show_debug_displaced): New function.
	(struct displaced_step_request): New struct.
	(displaced_step_request_queue, displaced_step_ptid)
	(displaced_step_gdbarch, displaced_step_closure)
	(displaced_step_original, displaced_step_copy)
	(displaced_step_saved_copy, can_use_displaced_stepping): New
	variables.
	(show_can_use_displaced_stepping, use_displaced_stepping)
	(displaced_step_clear, cleanup_displaced_step_closure)
	(displaced_step_dump_bytes, displaced_step_prepare)
	(displaced_step_clear_cleanup, write_memory_ptid)
	(displaced_step_fixup): New functions.
	(resume): Call displaced_step_prepare.
	(proceed): Call read_pc once, and remember the value.  If using
	displaced stepping, don't remove breakpoints.
	(handle_inferior_event): Call displaced_step_fixup.  Add some
	debugging output.  When we try to step over a breakpoint, but get
	a signal to deliver to the thread instead, ensure the step-resume
	breakpoint is actually inserted.  If a thread hop is needed, and
	displaced stepping is enabled, don't remove breakpoints.
	(init_wait_for_inferior): Call displaced_step_clear.
	(_initialize_infrun): Add "set debug displaced" command.  Add
	"maint set can-use-displaced-stepping" command.  Clear
	displaced_step_ptid.
	* inferior.h (debug_displaced): Declare variable.
	(displaced_step_dump_bytes): Declare function.

	* Makefile.in (arch-utils.o, i386-linux-tdep.o): Update
	dependencies.

	gdb/testsuite/
	* gdb.asm/asmsrc1.s: Add scratch space.

	gdb/doc/
	* gdb.texinfo (Debugging Output): Document "set/show debug
	displaced".
	(Maintenance Commands): Document "maint set/show
	can-use-displaced-stepping".
2008-05-02 16:49:54 +00:00
Daniel Jacobowitz a0ef42744d 2008-05-01 Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	Based on work by Jan Kratochvil <jan.kratochvil@redhat.com> and Jeff
 	Johnston <jjohnstn@redhat.com>.

	* NEWS: Mention attach to stopped process fix.
	* infcmd.c (detach_command, disconnect_command): Discard the thread
	list.
	* infrun.c (handle_inferior_event): Do not ignore non-SIGSTOP while
	attaching.  Use signal_stop_state.
	(signal_stop_state): Check stop_soon.
	* linux-nat.c (kill_lwp): Declare earlier.
	(pid_is_stopped, linux_nat_post_attach_wait): New.
	(lin_lwp_attach_lwp): Use linux_nat_post_attach_wait.  Update
	comments.
	(linux_nat_attach): Use linux_nat_post_attach_wait.
	(detach_callback, linux_nat_detach): Improve handling for signalled
	processes.
	(linux_nat_pid_to_str): Always print out the LWP ID if it differs
	from the process ID.
	* Makefile.in (infcmd.o): Update.

2008-05-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.threads/attach-into-signal.c, gdb.threads/attach-into-signal.exp,
	gdb.threads/attach-stopped.c, gdb.threads/attach-stopped.exp,
	gdb.threads/attachstop-mt.c, gdb.threads/attachstop-mt.exp: New.
2008-05-01 18:50:14 +00:00
Daniel Jacobowitz b39cc96258 * arm-linux-tdep.h (ARM_CPSR_REGNUM): Delete definition.
* arm-tdep.c (arm_frame_is_thumb): New.
	(arm_pc_is_thumb): Clarify comment.
	(thumb_analyze_prologue): Remove PC special case.
	(thumb_scan_prologue): Take a block_addr argument.  Use it for
	find_pc_partial_function.  Remove unused variables.
	(arm_scan_prologue): Use arm_frame_is_thumb.  Use the block address
	for find_pc_partial_function.  Remove PC special case.
	(arm_prologue_prev_register): Add special handling for PC and CPSR.
	(arm_dwarf2_prev_register, arm_dwarf2_frame_init_reg): New.
	(arm_get_next_pc): Use arm_frame_is_thumb.
	(arm_write_pc): Use CPSR_T instead of 0x20.
	(arm_gdbarch_init): Call dwarf2_frame_set_init_reg.
	* arm-tdep.h (enum gdb_regnum): Add ARM_CPSR_REGNUM.
	(CPSR_T): Define.
	* dwarf2-frame.c (dwarf2_frame_prev_register): Handle
	DWARF2_FRAME_REG_FN.
	* dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
	DWARF2_FRAME_REG_FN.
	(struct dwarf2_frame_state_reg): Add FN to loc union.

	* gdb.arch/thumb-prologue.exp: Do not expect a saved PC.
2008-05-01 18:30:51 +00:00
Joel Brobecker 36d520f5f6 * gdb.base/info-target.exp: New testcase. 2008-05-01 17:48:23 +00:00
Daniel Jacobowitz 8d4e307105 * gdb.cp/hang.exp: Use .cc instead of .C.
* gdb.cp/hang1.cc, gdb.cp/hang2.cc, gdb.cp/hang3.cc: Renamed from ...
	* gdb.cp/hang1.C, gdb.cp/hang2.C, gdb.cp/hang3.C: ... here.
2008-04-30 18:28:23 +00:00
Daniel Jacobowitz 6f3f3097b9 * gdb.base/gdb1250.exp: Remove perror.
* lib/mi-support.exp (mi_delete_breakpoints): Match the prompt.
2008-04-30 18:25:53 +00:00
Pedro Alves 5550a9142a * gdb.dwarf2/dw2-strp.S: Replace .long by .4byte and .value by
.2byte.
2008-04-30 13:54:10 +00:00
Daniel Jacobowitz d848e6871e * gdb.base/macscp.exp: Enable kfails. Compile with -g3 for GCC.
(maybe_kfail): New.
2008-04-25 21:47:11 +00:00
Pedro Alves 93b5768bfd gdb/
* dwarf2read.c (dwarf2_const_value): Handle DW_FORM_strp.

gdb/testsuite/
	* gdb.dwarf2/dw2-strp.S, gdb.dwarf2/dw2-strp.exp: New files.
2008-04-25 18:45:24 +00:00
Vladimir Prus 721c02def4 * mi/mi-main.c (last_async_command): Rename to current_token.
(previous_async_command): Remove.
        (mi_cmd_gdb_exit): Adjust.
        (mi_cmd_exec_interrupt): Don't dance with previous_async_command.
        (mi_cmd_target_select): Adjust.
        (mi_cmd_execute): Don't set previous_async_command.  Free token
        here even in async mode.
        (mi_execute_async_cli_command): Adjust.
        (mi_exec_async_cli_cmd_continuation): Adjust.  Do not free the
        token.
        (mi_load_progress): Adjust.
2008-04-24 12:09:49 +00:00
Vladimir Prus 74960c6002 * breakpoint.h (bp_location_p): New typedef.
Register a vector of bp_location_p.
	* breakpoint.c (always_inserted_mode)
	(show_always_inserted_mode): New.
	(unlink_locations_from_global_list): Remove.
	(update_global_location_list)
	(update_global_location_list_nothrow): New.
	(update_watchpoint): Don't free locations.
	(should_insert_location): New.
	(insert_bp_location): Use should_insert_location.
	(insert_breakpoint_locations): Copied from
	insert_breakpoints.
	(insert_breakpoint): Use insert_breakpoint_locations.
	(bpstat_stop_status): Call update_global_location_list
	when disabling breakpoint.
	(allocate_bp_location): Don't add to bp_location_chain.
	(set_raw_breakpoint)
	(create_longjmp_breakpoint, enable_longjmp_breakpoint)
	(disable_longjmp_breakpoint, create_overlay_event_breakpoint)
	(enable_overlay_breakpoints, disable_overlay_breakpoints)
	(set_longjmp_resume_breakpoint)
	(enable_watchpoints_after_interactive_call_stop)
	(disable_watchpoints_before_interactive_call_start)
	(create_internal_breakpoint)
	(create_fork_vfork_event_catchpoint)
	(create_exec_event_catchpoint, set_momentary_breakpoint)
	(create_breakpoints, break_command_1, watch_command_1)
	(create_exception_catchpoint)
	(handle_gnu_v3_exceptions)
	(disable_breakpoint, breakpoint_re_set_one)
	(create_thread_event_breakpoint, create_solib_event_breakpoint)
	(create_ada_exception_breakpoint): : Don't call check_duplicates.
	Call update_global_location_list.
	(delete_breakpoint): Don't remove locations and don't
	try to reinsert them. Call update_global_location_list.
	(update_breakpoint_locations): Likewise.
	(restore_always_inserted_mode): New.
	(update_breakpoints_after_exec): Temporary disable
	always inserted mode.
	* Makefile.in: Update dependencies.

	* infrun.c (proceed): Remove breakpoints while stepping
	over breakpoint.
	(handle_inferior_event): Don't remove or insert
	breakpoints.
	* linux-fork.c (checkpoint_command): Remove breakpoints
	before fork and insert after.
	(linux_fork_context): Remove breakpoints before switch
	and insert after.
	* target.c (target_disconnect, target_detach): Remove
	breakpoints from target.
2008-04-24 10:21:45 +00:00
Vladimir Prus d24317b480 * breakpoint.c (print_one_breakpoint_location): In MI
mode, report the location string the breakpoint was
	originally created with.
2008-04-24 08:46:19 +00:00
Paolo Bonzini fdc5970995 gdb:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * acinclude.m4: Add override.m4.
        * configure: Regenerate.

gdb/gdbserver:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * acinclude.m4: Add override.m4.
        * configure: Regenerate.

gdb/testsuite:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

        * aclocal.m4: Add override.m4.
        * configure: Regenerate.
2008-04-23 12:21:50 +00:00
Vladimir Prus 8e91f0232c * mi/mi-cmd-var.c (varobj_update_one): Print new
value for variable objects that changed type.
2008-04-19 17:03:20 +00:00
Craig Silverstein 233a11ab1c * configure.ac (AC_SEARCH_LIBS): Add check for zlib.
* config.in, configure: Regenerate.
	* dwarf2read.c: Include zlib.h if present.
	Modified *_SECTION macros.
	(section_is_p): New.
	(dwarf2_locate_sections): Use section_is_p instead of strcmp
	(dwarf2_resize_section): New.
	to determine whether a given section has a given name.
	(zlib_decompress_section): New.
	(dwarf2_read_section): Read the compressed section if present
	in the binary.
	* testsuite/gdb.dwarf2/dw2-compressed.S: New file.
	* testsuite/gdb.dwarf2/dw2-compressed.exp: New file.
	* MAINTAINERS: Added myself to section Write After Approval.
2008-04-19 05:06:54 +00:00
Joel Brobecker 9c1137add5 * gdb.ada/atomic_enum: New test program.
* gdb.ada/atomic_enum.exp: New testcase.
2008-04-19 01:35:49 +00:00
Doug Evans 66d0bbc7b8 * gdb.opt/Makefile.in: Fix whitespace. 2008-04-17 23:06:54 +00:00
Ulrich Weigand 100906b03a 2008-04-17 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.threads/linux-dp.exp: Continue after unrecognized lines.
2008-04-17 21:36:23 +00:00
Doug Evans 4584e32ea4 * buildsym.c (watch_main_source_file_lossage): New fn.
(end_symtab): Call it.

	* gdb.base/hashline1.exp: New testcase.
	* gdb.base/hashline2.exp: New testcase.
	* gdb.base/hashline2.exp: New testcase.
2008-04-17 17:54:05 +00:00
Pedro Alves 0a320680e8 gdb/
* inf-loop.c (inferior_event_handler): Also run the intermediate
	continuations in the INF_EXEC_COMPLETE case.

	gdb/testsuite/
	* gdb.base/step-break.exp, gdb.base/step-break.c: New files.
2008-04-17 11:49:56 +00:00
Aleksandar Ristovski 18ac113bcc * gdb.base/attach.exp (do_attach_tests): Matching pattern for
temporary breakpoint to match "Temporary breakpoint".
	* gdb.base/break.exp (delete_breakpoints): Likewise.
	* gdb.base/call-ar-st.exp (get_debug_format): Likewise.
	* gdb.base/commands.exp (temporary_breakpoint_commands): Likewise.
	* gdb.base/display.exp: Likewise.
	* gdb.base/foll-exec.exp (do_exec_tests): Likewise.
	* gdb.base/foll-fork.exp (catch_fork_child_follow): Likewise.
	* gdb.base/restore.exp (restore_tests): Likewise.
	* gdb.base/sepdebug.exp: Likewise.
	* gdb.base/watchpoint.exp: Likewise.
	* gdb.mi/mi-cli.exp: Added argument for new "disp" field.
	* gdb.mi/mi-pending.exp: Likewise.
	* gdb.mi/mi-simplerun.exp (test_running_the_program): Likewise.
	* gdb.mi/mi-until.exp (test_runnint_to_foo): Likewise.
	* gdb.mi/mi-var-cmd.exp: Likewise.
	* gdb.mi/mi-var-display.exp: Likewise.
	* gdb.mi/mi2-cli.exp: Likewise.
	* gdb.mi/mi2-simplerun.exp (test_running_the_program): Likewise.
	* gdb.mi/mi2-until.exp (test_running_to_foo): Likewise.
	* gdb.mi/mi2-var-display.exp: Likewise.
	* lib/gdb.exp (gdb_breakpoint): Pattern for temporary breakpoint.
	* lib/mi-support.exp (mi_runto_helper): Use "after_reason" argument for
	new "disp" field.
	(mi_expect_stop): Move after_reason argument to be really after
	reason. This is to support fix for PR2424.
2008-04-15 14:33:55 +00:00
Jan Kratochvil add386939d * gdb.dwarf2/dw2-ranges.S: New stub `.file' directive. 2008-04-15 09:00:32 +00:00
Vladimir Prus fcacd99f87 Fix @-varobjs.
* varobj.c (value_of_root): Update the expression for
        floating varobjs.
        * mi/mi-cmd-var.c (varobj_update_one): If type has changed,
        report that.
2008-04-13 09:33:49 +00:00
Marc Khouzam de051565df gdb/ChangeLog
2008-04-09  Marc Khouzam  <marc.khouzam@ericsson.com>

        * mi/mi-cmd-var.c: Include "mi-getopt.h".
        (mi_parse_format): New.  Factored out from mi_cmd_var_set_format.
        (mi_cmd_var_set_format): Use new mi_parse_format.
        (mi_cmd_var_evaluate_expression): Support for -f option to specify
        format.
        * Makefile.in (mi-cmd-var.o): Update dependencies.

        * varobj.h (varobj_get_formatted_value): Declare.
        * varobj.c (my_value_of_variable): Added format parameter.
        (cplus_value_of_variable): Likewise.
        (java_value_of_variable): Likewise.
        (c_value_of_variable): Likewise.  Evaluate expression based
        on format parameter.
        (struct language_specific): Add format parameter to function member
        *value_of_variable.
        (varobj_get_formatted_value): New.
        (varobj_get_value): Added format parameter to method call.

gdb/doc/ChangeLog
2008-04-09  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.texinfo (GDB/MI Variable Objects): Add anchor to
        -var-set-format.  Add -f option to -var-evaluate-expression.

gdb/testsuite/ChangeLog
2008-04-09  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.mi/mi2-var-display.exp: Added tests for the new -f
        option of -var-evaluate-expression.
        * gdb.mi/mi2-var-display.exp: Likewise.
2008-04-09 13:29:55 +00:00
Vladimir Prus dbc5282291 Introduce test setup helpers.
* lib/gdb.exp (build_executable, clean_restart)
        (prepare_for_testing): New.
        * gdb.base/break.exp: Use prepare_for_testing, and clean_restart.
        * gdb.base/return.exp: Likewise.
        * gdb.base/ending-run.exp: Likewise.
2008-04-07 16:32:44 +00:00
Nick Roberts 473591da7a *** empty log message *** 2008-04-06 22:44:47 +00:00
Nick Roberts fd0e64da87 New test for asynchronous Machine Interface (MI) responses. 2008-04-06 22:41:19 +00:00
Vladimir Prus 2b2d9e11a0 Fix breakpoint condition that use member variables.
* valops.c (check_field): Remove.
        (check_field_in): Rename to check_field.
        (value_of_this): Use la_name_of_this.
        * value.h (check_field): Adjust prototype.

        * language.h (la_value_of_this): Rename to la_name_of_this.
        * language.c (unknown_language_defn): Specify "this" for
        name_of_this.
        (auto_language_defn): Likewise.
        (local_language_defn): Likewise.
        * ada-lang.c (ada_language_defn): Adjust comment.
        * c-lang.c (c_language_defn): Adjust comment.
        (cplus_language_defn): Specify "this" for name_of_this.
        (asm_language_defn): Adjust comment.
        (minimal_language_defn): Adjust comment.
        * f-lang.c (f_language_defn): Specify NULL for name_of_this.
        * jv-lang.c (java_language_defn): Specify "this" for name_of_this.
        * m2-lang.c (m2_language_defn): Specify "this" for name_of_this.
        * objc-lang.c (objc_language_defn): Specify "self" for
        name_of_this.
        * p-lang.c (pascal_language_defn): Specify "this" for
        name_of_this.
        * scm-lang.c (scm_language_defn): Specify NULL for name_of_this.

        * symtab.c (lookup_symbol_aux): Lookup "this" in the
        proper scope, and check for field in type of "this", without
        trying to create a value.
2008-04-06 08:56:37 +00:00
Vladimir Prus bb3784283e * lib/mi-support.exp (mi_expect_stop): New.
(mi_run_cmd): Change the
	token.  Use mi_send_resuming_command, use
	mi_expect_stop.
	(mi_execute_to_helper): Rename to mi_execute_to.
	(mi_send_resuming_command): Add more error patterns.
	(mi_wait_for_stop): Renamed to...
	(mi_get_stop_line): ...this.
	(mi_run_inline_test): Adjust.

	* gdb.mi/mi-cli.exp: Use mi_execute_to/mi_expect_stop.
	* gdb.mi/mi-console.exp: Likewise.
	* gdb.mi/mi-pending.exp: Likewise.
	* gdb.mi/mi-simplerun.exp: Likewise.
	* gdb.mi/mi-stack.exp: Likewise.
	* gdb.mi/mi-stepi.exp: Likewise.
	* gdb.mi/mi-syn-frame.exp: Add comment.
	* gdb.mi/mi-until.exp: Likewise.
	* gdb.mi/mi-var-display.exp: Likewise.
	* gdb.mi/mi-watch.exp: Likewise.
	* gdb.mi/mi2-cli.exp: Likewise.
	* gdb.mi/mi2-console.exp: Likewise.
	* gdb.mi/mi2-simplerun.exp: Likewise.
	* gdb.mi/mi2-stack.exp: Likewise.
	* gdb.mi/mi2-stepi.exp: Likewise.
	* gdb.mi/mi2-until.exp: Likewise.
	* gdb.mi/mi2-var-display.exp: Likewise.
	* gdb.mi/mi2-watch.exp: Likewise.
2008-04-05 17:12:46 +00:00
Ulrich Weigand 62172bb981 * gdb.base/watch_thread_num.exp: Use gdb_compile_pthreads.
* gdb.cp/mb-templates.exp: Skip test on spu*-*-* targets.
2008-04-04 22:59:28 +00:00
Pedro Alves a13e061a1b gdb/
2008-04-04  Pedro Alves  <pedro@codesourcery.com>

	* mi/mi-cmds.h (enum mi_cmd_result): Delete MI_CMD_ERROR.
	(mi_error_message): Delete declaration.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Call error instead of
	returning MI_CMD_ERROR.
	* mi/mi-main.c (mi_error_message): Delete.
	(mi_cmd_exec_interrupt):
	(mi_cmd_thread_select, mi_cmd_thread_list_ids)
	(mi_cmd_thread_info): Call error instead of returning
	MI_CMD_ERROR.
	(mi_cmd_data_list_register_values): Call error instead of
	returning MI_CMD_ERROR.  Adapt to new get_register interface.
	(get_register): Change return typo to void.  Call error instead of
	returning MI_CMD_ERROR.
	(mi_cmd_data_write_register_values): Call error instead of
	returning MI_CMD_ERROR.
	(mi_cmd_list_features): Return MI_CMD_DONE.
	(captured_mi_execute_command): Remove MI_CMD_ERROR handling.
	(mi_execute_command): Always print exceptions with -error.

gdb/testsuite/
2008-04-04  Pedro Alves  <pedro@codesourcery.com>

	* gdb.mi/mi-disassemble.exp, gdb.mi/mi-stack.exp,
	gdb.mi/mi-syn-frame.exp, gdb.mi/mi-var-block.exp,
	gdb.mi/mi-var-cmd.exp, gdb.mi/mi-var-display.exp,
	gdb.mi/mi2-disassemble.exp, gdb.mi/mi2-stack.exp,
	gdb.mi/mi2-syn-frame.exp, gdb.mi/mi2-var-block.exp,
	gdb.mi/mi2-var-cmd.exp, gdb.mi/mi2-var-display.exp: Update to not
	expect an mi error duplicated in stderr.
2008-04-04 21:59:25 +00:00
Joel Brobecker eae06beb6d * gdb.cp/ovldbreak.cc: Add missing bodies for methods foo::foofunc.
* gdb.cp/ovldbreak.exp: Set multiple-symbols to "ask".
        Add a couple of tests that verify the behavior when the new setting
        is set to "cancel" and "all".
        * gdb.cp/method2.exp, gdb.cp/templates.exp: Set multiple-symbols to
        "ask" before we start the testing.
2008-04-03 21:42:33 +00:00
Aleksandar Ristovski 79c6ced6ea * gdb.cp/casts.cc: Add class reference variables.
* gdb.cp/casts.exp: New test cases for up/down casting references.
2008-04-01 18:05:13 +00:00
Aleksandar Ristovski f0050c2089 * gdb.cp/casts.cc: Add class reference variables.
* gdb.cp/casts.exp: New test cases for up/down casting references.
2008-04-01 16:16:43 +00:00
Marc Khouzam 6c2d1a6bc9 2008-04-01 Marc Khouzam <marc.khouzam@ericsson.com>
* gdb.mi/mi-var-display.exp: Stop at end of do_special_tests
	instead of beginning to make an extra test pass.
	* gdb.mi/mi2-var-display.exp: Likewise.
2008-04-01 15:18:30 +00:00
Maciej W. Rozycki 55b411d998 * gdb.base/break.exp: Mark failures as such. Fix formatting. 2008-03-31 10:46:17 +00:00
Markus Deuling c6140da2ff 2008-03-31 Markus Deuling <deuling@de.ibm.com>
Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>

	* gdb.arch/spu-info.exp (info spu mailbox): Check for correct initial
	value.  Add xfail for older kernels.
2008-03-31 08:34:42 +00:00
Aleksandar Ristovski 79732189ea 2008-03-28 Aleksandar Ristovski <aristovski@qnx.com>
Bring mi-support in line with gdb.exp.
	* lib/mi-support.exp (default_mi_gdb_start): Rename from mi_gdb_start.
	(mi_gdb_start): New function.
2008-03-28 16:32:11 +00:00
Maciej W. Rozycki 33c3676e65 * gdb.mi/mi-var-cmd.exp: Fix a typo. 2008-03-28 14:01:36 +00:00
Vladimir Prus 92e28119da * gdb.mi/mi-var-display.exp: Remove obsolete xfail.
* gdb.mi/mi2-var-display.exp: Likewise.
2008-03-26 13:36:51 +00:00
Vladimir Prus 9e8e3afe37 * lib/mi-support.exp (mi_create_varobj_checked): New.
(mi_list_varobj_children): Allow to check for a
	value.
	(mi_list_array_varobj_children): New.

	* gdb.mi/mi-var-child.exp: Use mi_create_varobj
	and mi_list_varobj_children, as opposed to hardcoding
	expected strings.
	* gdb.mi/gdb701.exp: Likewise.
	* gdb.mi/gdb792.exp: Likewise.
	* gdb.mi/mi-var-block.exp: Likewise.
	* gdb.mi/mi-var-cmd.exp: Likewise.
	* gdb.mi/mi-var-invalidate.exp: Likewise.
	* gdb.mi/mi2-var-block.exp: Likewise.
	* gdb.mi/mi2-var-child.exp: Likewise.
	* gdb.mi/mi2-var-cmd.exp: Likewise.
	* gdb.mi/mi2-var-display.exp: Likewise.
2008-03-26 13:24:22 +00:00
Jan Kratochvil 9df503519c Fix random false FAILs on i386.
* gdb.base/prelink.exp: Use `--no-exec-shield' for prelink.
2008-03-24 15:16:12 +00:00
Daniel Jacobowitz 31e5d73a44 PR gdb/544
* gdb.cp/annota2.exp, gdb.cp/annota3.exp: Reapply 2008-03-21 changes.
2008-03-24 13:27:07 +00:00
Daniel Jacobowitz 12f4afab79 Revert 2008-03-21 changes. 2008-03-23 17:29:34 +00:00
Daniel Jacobowitz b562a0cb2a PR gdb/544
Suggested by Jan Kratochvil:
	* top.c (gdb_rl_operate_and_get_next_completion): Call
	rl_redisplay_function.
	(gdb_rl_redisplay): New.
	(init_main): Set rl_redisplay_function.

	* gdb.cp/annota2.exp, gdb.cp/annota3.exp: Remove KFAIL for
	fixed PR gdb/544.
2008-03-21 21:44:30 +00:00
Daniel Jacobowitz 17faa917e0 2008-03-21 Daniel Jacobowitz <dan@codesourcery.com>
* gdbthread.h (add_thread_with_info): New.
	* linux-thread-db.c: Add some documentation.
	(GET_LWP, GET_PID, GET_THREAD, is_lwp, is_thread, BUILD_LWP): Delete.
	(struct private_thread_info): Remove th_valid and ti_valid.
	Replace ti with tid.
	(thread_get_info_callback): Do not add TID to the new ptid.  Do
	not cache th or ti.
	(thread_db_map_id2thr, lwp_from_thread): Delete functions.
	(thread_from_lwp): Assert that the LWP is set.  Do not add TID to the
	new PTID.
	(attach_thread): Handle an already-existing thread.  Use
	add_thread_with_info.  Cache the th and tid.
	(detach_thread): Verify that private was set.  Remove verbose
	argument and printing.  Update caller.
	(thread_db_detach): Do not adjust inferior_ptid.
	(clear_lwpid_callback, thread_db_resume, thread_db_kill): Delete.
	(check_event, find_new_threads_callback): Do not add TID to the new PTID.
	(thread_db_wait): Do not use lwp_from_thread.
	(thread_db_pid_to_str): Use the cached TID.
	(thread_db_extra_thread_info): Check that private is set.
	(same_ptid_callback): Delete.
	(thread_db_get_thread_local_address): Do not use it or check
	is_thread.  Check that private is set.  Assume that the thread
	handle is already cached.
	(init_thread_db_ops): Remove to_resume and to_kill.
	* thread.c (add_thread_with_info): New.
	(add_thread): Use it.
	* linux-nat.c (find_thread_from_lwp): Delete.
	(exit_lwp): Do not use it.  Check print_thread_events.  Print before
	deleting the thread.
	(GET_PID, GET_LWP, BUILD_LWP, is_lwp): Move to...
	* linux-nat.h (GET_PID, GET_LWP, BUILD_LWP, is_lwp): ...here.
	* inf-ttrace.c (inf_ttrace_wait): Use print_thread_events and
	printf_unfiltered for thread exits.
	* procfs.c (procfs_wait): Likewise.

2008-03-21  Pedro Alves  <pedro@codesourcery.com>

	* gdb.threads/fork-child-threads.exp: Test next over fork.
2008-03-21 15:44:53 +00:00
Daniel Jacobowitz 6214f497d3 2008-03-21 Chris Demetriou <cgd@google.com>
* symtab.c (rbreak_command): Quote symbol name before passing
	it to break_command.

	* gdb.base/break.exp (rbreak junk): New test for rbreak
	"Junk at end of arguments" issue.
2008-03-21 15:33:11 +00:00
Daniel Jacobowitz 6309237547 * eval.c (evaluate_subexp_for_address): Clarify error message.
Use value_must_coerce_to_target.
	* infcall.c (value_arg_coerce): Call value_coerce_to_target.
	* valops.c (value_assign): Call value_coerce_to_target when
	assigning to anything but internalvars.  Leave GDB-side arrays
	as arrays when assigning to internalvars.
	(value_must_coerce_to_target, value_coerce_to_target): New.
	(value_coerce_array, value_addr): Call value_coerce_to_target.
	(value_array): Create the array in GDB's memory instead of
	the inferior's.
	* value.h (value_must_coerce_to_target, value_coerce_to_target):
	Declare.

	* gdb.texinfo (Expressions): Update description of malloced arrays.

	* gdb.base/printcmds.exp (test_print_array_constants): Do not expect
	*& to work on created array elements.
	(Top level): Test print $pc with a file.  Test string operations
	without a target.
	* gdb.base/ptype.exp: Do not expect *& to work on created array
	elements.
2008-03-21 15:02:38 +00:00
Daniel Jacobowitz b21991b00c * top.c (quit_confirm): Warn that we will kill the program.
* gdb.threads/killed.exp, gdb.threads/manythreads.exp,
	gdb.threads/staticthreads.exp: Update exit query.
2008-03-21 14:39:23 +00:00
Sandra Loosemore c4b347c7ca 2008-03-07 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
	* lib/gdb.exp (gdb_load_cmd): Fix $args typo in timeout error message.
2008-03-07 16:23:41 +00:00
Daniel Jacobowitz fa4727a64f * breakpoint.c (fetch_watchpoint_value): New function.
(update_watchpoint): Set and clear val_valid.  Use
	fetch_watchpoint_value.  Handle unreadable values on the
	value chain.  Correct check for user-requested array watchpoints.
	(breakpoint_init_inferior): Clear val_valid.
	(watchpoint_value_print): New function.
	(print_it_typical): Use it.  Do not free or clear old_val.  Print
	watchpoints even if old_val == NULL.
	(watchpoint_check): Use fetch_watchpoint_value.  Check for values
	becoming readable or unreadable.
	(watch_command_1): Use fetch_watchpoint_value.  Set val_valid.
	(do_enable_watchpoint): Likewise.
	* breakpoint.h (struct breakpoint): Update comment for val.  Add
	val_valid.
	* NEWS: Mention watchpoints on inaccessible memory.

	* gdb.base/watchpoint.c (global_ptr, func4): New.
	(main): Call func4.
	* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint.
	(test_inaccessible_watchpoint): New.

	* gdb.texinfo (Set Watchpoints): Mention watchpoints on
	unreadable memory.  Delete obsolete SPARClite reference.
2008-03-03 13:24:12 +00:00
Maciej W. Rozycki 2f34202fde * lib/gdb.exp (gdb_expect): Of all the timeouts provided always
select the largest.
2008-02-29 15:40:20 +00:00
Daniel Jacobowitz 0d6ba1b16e * frame.c (reinit_frame_cache): Only annotate if frames were
previously valid.

	* gdb.base/annota1.exp, gdb.cp/annota2.exp: Update for fewer
	frames-invalid annotations.
2008-02-28 16:24:25 +00:00
Pierre Muller e691325a9c 2008-02-28 Pierre Muller <muller@ics.u-strasbg.fr>
* gdb.base/assign.exp: avoid same output for different tests.
2008-02-28 10:32:50 +00:00
Doug Evans f85b5eccfe * gdb.base/sigstep.exp (breakpoint_to_handler): Remove setup_kfail
for bug 1738.
	(breakpoint_to_handler_entry): Ditto.
2008-02-27 23:42:20 +00:00
Joel Brobecker b40e7bf371 * gdb.base/ending-run.exp: Use the first line of code inside
function body to test breakpoints.
        * gdb.mi/mi-break.exp, gdb.mi/mi2-break.exp: Adjust the actual
        location where the breakpoint is inserted when using the line
        where a function is declared. Fix typo in the description of
        one of the tests.
        * gdb.mi/mi-simplerun.exp, gdb.mi/mi2-simplerun.exp: Likewise.
2008-02-27 20:29:31 +00:00
Pierre Muller 2faca73a4e 2008-02-27 Pierre Muller <muller@ics.u-strasbg.fr>
* gdb.arch/i386-sse.exp: avoid same output for two breakpoint setting
	tests.
2008-02-27 15:52:33 +00:00
Pierre Muller 6f439c366a 2008-02-27 Pierre Muller <muller@ics.u-strasbg.fr>
* gdb.base/args.exp: avoid same output for tests
	with single quotes.
2008-02-27 15:46:46 +00:00
Vladimir Prus 54e52265e2 * breakpoint.c (print_one_breakpoint_location): Revert Enb field
to old format.  Discard breakpoint address if shared library is
	unloaded.
	(breakpoint_1): Adjust formatting of table header accordingly.
2008-02-26 08:14:11 +00:00
Doug Evans 897b09ca9f * gdb.cp/mb-inline.exp: New.
* gdb.cp/mb-inline.h: New.
	* gdb.cp/mb-inline1.cc: New.
	* gdb.cp/mb-inline2.cc: New.
2008-02-08 00:42:26 +00:00
Doug Evans 776592bf17 * breakpoint.c: #include "hashtab.h".
(ambiguous_names_p): New fn.
	(update_breakpoint_locations): When restoring bp enable status, don't
	compare function names if any functions have same name.
	* Makefile.in (breakpoint.o): Add hashtab.h dependency.

	* gdb.cp/mb-inline.exp: New.
	* gdb.cp/mb-inline.h: New.
	* gdb.cp/mb-inline1.cc: New.
	* gdb.cp/mb-inline2.cc: New.
2008-02-08 00:42:07 +00:00
Pierre Muller b1c32d3564 * gdb.pascal/floats.pas: New test program.
* gdb.pascal/floats.exp: New testcase.
2008-02-06 22:24:43 +00:00
Thiago Jung Bauermann 1a4ca44aeb * gdb.base/callfuncs.c (t_float_many_args): New function.
(t_double_many_args): New function.
	* gdb.base/callfuncs.exp: Add tests for exceeding float
	and double parameters passed through the stack.
2008-02-06 03:54:12 +00:00
Joel Brobecker 439048e8fe * gdb.ada/complete/pck.ads, gdb.ada/complete/pck.adb,
gdb.ada/complete/foo.adb: New files.
        * gdb.ada/complete.exp: New testcase.
2008-02-05 22:20:51 +00:00
Doug Evans 301f0ecf99 * eval.c (evaluate_subexp_standard): Fix type of result of mixed
integer/float division operations when EVAL_AVOID_SIDE_EFFECTS.
	* valops.c (value_one): New function.
	* value.h (value_one): Declare.

	Fix argument promotion for binary arithmetic ops for C.
	* valarith.c (unop_result_type): New fn.
	(binop_result_type): New fn.
	(value_binop): Move result type computation to binop_result_type.
	(value_pos, value_neg, value_complement): Move result type
	computation to unop_result_type.

	* gdb.base/whatis-exp.exp: Fix expected result of whatis x+y, x-y, x*y.
2008-02-04 00:23:05 +00:00
Doug Evans dccca035f0 add copyright 2008-02-03 22:17:05 +00:00
Doug Evans 81fe80802c PR 2384
* gdbtypes.c (get_vptr_fieldno): Renamed from fill_in_vptr_fieldno.
	Return basetype, fieldno if found.  All callers updated.
	Don't cache TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE if from different
	objfile.
	* gdbtypes.h (get_vptr_fieldno): Renamed from fill_in_vptr_fieldno.
	* symfile.h (fill_in_vptr_fieldno): Delete.

	* gdb.cp/gdb2384.exp: New file.
	* gdb.cp/gdb2384.cc: New file.
	* gdb.cp/gdb2384-base.h: New file.
	* gdb.cp/gdb2384-base.cc: New file.
2008-02-03 22:13:30 +00:00
Doug Evans 4b071aec13 * gdb.base/sigall.c (main): Ensure all signals aren't blocked. 2008-02-03 00:42:55 +00:00
Joel Brobecker 61137ba64b * gdb.ada/sym_print_name: New test program.
* gdb.ada/sym_print_name.exp: New testcase.
2008-02-01 23:15:36 +00:00
Joel Brobecker 51ba8a62ab * gdb.ada/nested/hello.adb: New file.
* gdb.ada/nested.exp: New testcase.
        * gdb.ada/Makefile.in (EXECUTABLES): Update list.
2008-02-01 22:48:16 +00:00
Vladimir Prus 98deb0daae * breakpoint.c (break_command_1): Return void.
(break_command_really): Return void.  Rethrow
        exceptions instead of returning.
        (gdb_breakpoint): Remove the error_message parameter.
        Return void.  Rename to set_breakpoint.
        * gdb.h (gdb_breakpoint): Rename and move to...
	* breakpoint.h (set_breakpoint): ...here.
        * mi/mi-cmb-break.c (mi_cmd_break_insert): Restore
        event hooks even if exception is thrown.  Adjust to
        gdb_breakpoint interface changes.
2008-02-01 16:24:47 +00:00
Vladimir Prus 723a227560 Properly rethrow exception. This fixes errors
about non-existent functions for -break-insert.
        * breakpoint.c (break_command_really): Use throw_exception
        for rethrowing.  If rethrowing, don't print the exception.
2008-02-01 06:47:20 +00:00
Luis Machado fb546a2f2e * gdb.arch/ppc64-atomic-inst.c: New testcase source file.
* gdb.arch/ppc64-atomic-inst.exp: New testcase expect file.
2008-01-31 16:00:25 +00:00
Pierre Muller 2d8fd90a9c * gdb.pascal/integers.pas: New test program.
* gdb.pascal/integers.exp: New testcase.
2008-01-31 14:49:23 +00:00
Pierre Muller a7fa0dedad * gdb.pascal/hello.exp (binfile): Add ${EXEEXT}. 2008-01-31 14:46:21 +00:00
Thiago Jung Bauermann 5e1a19265c 2008-01-30 Luis Machado <luisgpm@br.ibm.com>
* gdb.arch/powerpc-d128-regs.exp: New testcase expect file.
	* gdb.arch/powerpc-d128-regs.c: New testcase source file.
2008-01-31 13:41:38 +00:00
Joel Brobecker 8d04f9f0c8 * gdb.ada/formatted_ref: New test program.
* gdb.ada/formatted_ref.exp: New testcase.

        * gdb.cp/formatted-ref.cc: New file.
        * gdb.cp/formatted-ref.exp: New testcase.
2008-01-30 19:23:26 +00:00
Joel Brobecker ce75a98f14 * gdb.base/ptype.exp: Add testing of "ptype $pc". 2008-01-30 18:48:07 +00:00
Nick Roberts f43691e395 (test_file_list_exec_source_file): Update to new macro-info field. 2008-01-30 08:50:10 +00:00
Nick Roberts e835f6bf0c *** empty log message *** 2008-01-30 08:49:27 +00:00