Commit Graph

4441 Commits

Author SHA1 Message Date
Joel Brobecker ba2419699a New Ada testcase (bp_enum_homonym).
gdb/testsuite/ChangeLog:

        * gdb.ada/bp_enum_homonym: New testcase.
2012-03-06 17:04:59 +00:00
Yao Qi abe49676e9 gdb/testsuite/
* gdb.trace/ftrace.exp (test_fast_tracepoints): Run test on target
	x86_64-*-* and i?86-*-*.
	Set up KFAIL for gdb/13808.
2012-03-06 01:30:18 +00:00
Tom Tromey d8df103b50 * gdb.ada/operator_bp.exp: Clear debug-file-directory.
* gdb.ada/mi_task_arg.exp: Clear debug-file-directory.
2012-03-05 21:21:13 +00:00
Tom Tromey b7b189f3cf * jv-valprint.c (java_value_print): Correctly compute 'obj_addr'.
gdb/testsuite
	* gdb.java/jprint.java (jprint.main): Keep 'x' live.
2012-03-05 19:38:17 +00:00
Yao Qi 69dc1c4dd3 gdb/testsuite/
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Catch error
	messages for KFAIL.
2012-03-04 02:36:38 +00:00
Jan Kratochvil 3f20c47f9e gdb/testsuite/
* gdb.ada/arrayidx.exp: Call get_compiler_info.  New variable old_gcc.
	(print one_two_three, indexes off, print few_reps, indexes off)
	(print many_reps, indexes off, print empty, indexes off)
	(print one_two_three, print few_reps, print many_reps, print empty):
	Call setup_xfail if $gcc_old.
2012-03-03 18:03:31 +00:00
Jan Kratochvil abf1152ad7 gdb/
* breakpoint.c (set_condition_evaluation_mode): Set
	CONDITION_EVALUATION_MODE unconditionally.

gdb/testsuite/
	Implement testsuite workaround for PR breakpoints/13781.
	* gdb.cp/mb-templates.exp: New loop with variable $workaround.
	(set breakpoint condition-evaluation host): New conditional command.
2012-03-03 14:21:04 +00:00
Jan Kratochvil a06715f8dd gdb/testsuite/
Code cleanup.
	* gdb.cp/mb-templates.exp: New variables executable.  Use it for
	binfile.  use clean_restart.  Replace gdb_expect by gdb_test_multiple.
	Replace GDB restart by kill and delete_breakpoints.  Replace breakpoint
	number 1 by $bpnum.  Four times.
2012-03-03 14:19:19 +00:00
Yao Qi 5808517f9a gdb:
* common/agent.c (agent_look_up_symbols): Add one parameter 'arg'.
	* common/agent.h: Update declaration.
	* inf-child.c (inf_child_use_agent): New.
	(inf_child_can_use_agent): New.
	(inf_child_target): Initialize fields `to_use_agent'
	and `to_can_use_agent'.
	* agent.c (agent_new_objfile): New.
        (_initialize_agent): Add agent_new_objfile to new_objfile
	observer.

	* linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
	New.
        (linux_target_install_ops): Initialize field
	`to_static_tracepoint_markers_by_strid'.
	* remote.c (free_current_marker): Move it to ...
	* tracepoint.c (free_current_marker): ... here.  New.
	(cleanup_target_stop): New.
	* tracepoint.h: Declare free_current_marker.
	* NEWS: Add one entry about `info static-tracepoint-marker'.

gdb/gdbserver:
	* tracepoint.c (tracepoint_look_up_symbols): Update call to
	agent_look_up_symbols.

gdb/testsuite:
	* gdb.trace/strace.exp: run strace_info_marker in linux native gdb.
2012-03-03 09:51:29 +00:00
Jan Kratochvil dfe2ac1496 gdb/testsuite/
Setup KFAIL for PR server/13796.
	* gdb.base/disp-step-syscall.exp (single step over vfork): Setup KFAIL.
2012-03-03 06:58:16 +00:00
Joel Brobecker 8bbc467ad4 New Ada testcase for breakpoints on operators.
gdb/testsuite/ChangeLog:

        * gdb.ada/operator_bp: New testcase.
2012-03-02 20:36:41 +00:00
Joel Brobecker c0eac87f84 Testcase: "info locals" with Ada renamings.
gdb/testsuite/ChangeLog:

        * gdb.ada/info_locals_renaming: New testcase.
2012-03-02 19:31:53 +00:00
Tom Tromey 4f42c881de * gdb.base/nextoverexit.c: New file.
* gdb.base/nextoverexit.exp: New file.
2012-03-02 19:29:57 +00:00
Edjunior Barbosa Machado 7380c0c93f gdb/testsuite/
2012-03-02  Edjunior Machado  <emachado@linux.vnet.ibm.com>

	* gdb.arch/altivec-abi.exp (altivec_abi_tests): Remove obsolete
	parameter.
2012-03-02 18:43:46 +00:00
Maciej W. Rozycki 1faeff088b gdb/
* features/mips-dsp.xml: New file.
	* features/mips64-dsp.xml: New file.
	* features/mips-dsp-linux.xml: New file.
	* features/mips64-dsp-linux.xml: New file.
	* features/Makefile (WHICH): Add mips-dsp-linux and
	mips64-dsp-linux.
	(mips-dsp-expedite, mips64-dsp-expedite): New variables.
	* features/mips-dsp-linux.c: New file.
	* features/mips64-dsp-linux.c: New file.
	* regformats/mips-dsp-linux.dat: New file.
	* regformats/mips64-dsp-linux.dat: New file.
	* mips-linux-nat.c (mips_linux_register_addr): Handle DSP
	registers.
	(mips64_linux_register_addr): Likewise.
	(mips64_linux_regsets_fetch_registers): Likewise.
	(mips64_linux_regsets_store_registers): Likewise.
	(mips64_linux_fetch_registers): Update call to
	mips64_linux_regsets_fetch_registers.
	(mips64_linux_store_registers): Update call to
	mips64_linux_regsets_store_registers.
	(mips_linux_read_description): Probe for DSP registers.
	(_initialize_mips_linux_nat): Call initialize_tdesc_mips_dsp_linux
	and initialize_tdesc_mips64_dsp_linux.
	* mips-linux-tdep.c (supply_gregset, mips64_supply_gregset):
	Remove padding of no longer used embedded register slots.
	* mips-linux-tdep.h (DSP_BASE, DSP_CONTROL): New macros.
	(MIPS_RESTART_REGNUM): Redefine enum value.
	* mips-tdep.c (mips_generic_reg_names): Remove trailing null
	strings.
	(mips_tx39_reg_names): Likewise.
	(mips_linux_reg_names): New array of register names for Linux
	targets.
	(mips_register_name): Check for a null pointer in
	mips_processor_reg_names and return an empty string.
	(mips_register_type): Exclude embedded registers for the IRIX
	and Linux ABIs.
	(mips_pseudo_register_type): Likewise.  Use dynamic numbers to
	refer to FP registers, LO, HI, BadVAddr, Cause and PC.  Handle
	DSP registers.
	(mips_stab_reg_to_regnum): Handle DSP accumulators.
	(mips_dwarf_dwarf2_ecoff_reg_to_regnum): Likewise.
	(mips_gdbarch_init): Likewise.  Initialize internal register
	indices for the Linux ABI.  Use dynamic numbers to refer to
	registers, as applicable, while parsing the target description.
	* mips-tdep.h (struct mips_regnum): Add dspacc/dspctl offsets.

	gdb/doc/
	* gdb.texinfo (MIPS Features): Add org.gnu.gdb.mips.dsp.

	gdb/gdbserver/
	* linux-low.h (linux_target_ops): Add regset_bitmap member.
	* linux-low.c (use_linux_regsets): New macro.
	[!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
	[!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
	(linux_register_in_regsets): New function.
	(usr_fetch_inferior_registers): Skip registers covered by
	regsets.
	(usr_store_inferior_registers): Likewise.
	(usr_fetch_inferior_registers): New macro.
	(usr_store_inferior_registers): Likewise.
	(linux_fetch_registers): Handle mixed regset/non-regset targets.
	(linux_store_registers): Likewise.
	* linux-mips-low.c (init_registers_mips_dsp_linux): New
	prototype.
	(init_registers_mips64_dsp_linux): Likewise.
	(init_registers_mips_linux): New macro.
	(init_registers_mips_dsp_linux): Likewise.
	(mips_dsp_num_regs): Likewise.
	(DSP_BASE, DSP_CONTROL): New fallback macros.
	(mips_base_regs): New macro.
	(mips_regmap): Use it.  Fix the size.
	(mips_dsp_regmap): New variable.
	(mips_dsp_regset_bitmap): Likewise.
	(mips_arch_setup): New function.
	(mips_cannot_fetch_register): Use the_low_target.regmap rather
	than mips_regmap.
	(mips_cannot_store_register): Likewise.
	(the_low_target): Update .arch_setup, .num_regs and .regmap
	initializers.  Add .regset_bitmap initializer.
	* linux-arm-low.c (the_low_target): Add .regset_bitmap
	initializer.
	* linux-bfin-low.c (the_low_target): Likewise.
	* linux-cris-low.c (the_low_target): Likewise.
	* linux-crisv32-low.c (the_low_target): Likewise.
	* linux-ia64-low.c (the_low_target): Likewise.
	* linux-m32r-low.c (the_low_target): Likewise.
	* linux-m68k-low.c (the_low_target): Likewise.
	* linux-ppc-low.c (the_low_target): Likewise.
	* linux-s390-low.c (the_low_target): Likewise.
	* linux-sh-low.c (the_low_target): Likewise.
	* linux-sparc-low.c (the_low_target): Likewise.
	* linux-tic6x-low.c (the_low_target): Likewise.
	* linux-x86-low.c (the_low_target): Likewise.
	* linux-xtensa-low.c (the_low_target): Likewise.
	* configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
	mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
	mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
	srv_xmlfiles.
	* Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
	(mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.

	gdb/testsuite/
	* gdb.xml/tdesc-regs.exp: Add "mips-dsp.xml" to the list of MIPS
	core registers.
2012-03-01 22:19:48 +00:00
Maciej W. Rozycki 320b6f49d3 * gdb.base/hbreak2.exp: New test for "hbreak" and "thbreak". 2012-03-01 21:01:11 +00:00
Pedro Alves ad5f7d6ef7 2012-03-01 Pedro Alves <palves@redhat.com>
PR gdb/13767

	gdb/
	* frame.c (read_frame_register_unsigned): New.
	* frame.h (read_frame_register_unsigned): Declare.
	* i387-tdep.c (print_i387_status_word): New parameter `status_p'.
	Handle it.
	(print_i387_control_word): New parameter `control_p'.  Handle it.
	(i387_print_float_info): Handle unavailable float registers.

	gdb/testsuite/
	* gdb.trace/unavailable.exp (gdb_unavailable_floats): New.
	(gdb_collect_globals_test): Call it.
2012-03-01 20:49:02 +00:00
Keith Seitz d3dc44a619 * gdb.cp/method2.exp: Output of overload menu is now
alphabetized.  Update tests for "break A::method".
	* gdb.cp/ovldbreak.exp: Use gdb_get_line_number instead
	of hard-coding them.
	Overload menu is alphabetized: rewrite to accommodate.
	Unset variables LINE and TYPES which are used in other tests.
	Compute the output of "info break".
	Update the breakpoint table after all breakpoints are deleted.
	(continue_to_bp_overloaded): Rename ACTUALS to ARGUMENT and
	compute ACTUALS and the method body based on parameters.
	Update expected output accordingly.
	* gdb.cp/ovldbreak.cc (foo::overload1arg): Reformat and add
	unique comments to allow the use of gdb_get_line_number.

	* gdb.cp/method2.exp: Use prepare_for_testing and cleanup
	some Tcl syntax.
	* gdb.cp/ovldbreak.exp: Likewise.
2012-03-01 20:34:13 +00:00
Keith Seitz 7949c2a0b4 * gdb.base/help.exp (help show user): Update expected result
for new doc string changes (add "non-python").
2012-03-01 20:25:50 +00:00
Doug Evans 7d74f2446c * NEWS: Mention new python command class gdb.COMMAND_USER.
* cli/cli-cmds.c (show_user): Print error when used on a python
	command.
	(init_cli_cmds): Update documentation strings for "show user" and
	"set/show max-user-call-depth" to clarify that it does not apply to
	python commands.
	* python/py-cmd.c (cmdpy_init): Treat class_user as a valid class in
	error check.
	(gdbpy_initialize_commands): Add COMMAND_USER as a constant in
	gdb python api.
	* top.c (execute_command): Only execute a user-defined command as a
	legacy macro if c->user_commands is set.

	doc/
	* gdb.texinfo (Commands In Python): Put example python macro in
	COMMAND_USER category rather than COMMAND_OBSCURE.
	Document gdb.COMMAND_USER.
	(User-defined Commands): Update documentation to clarify
	"set/show max-user-call-depth" and "show user" don't apply to python
	commands.  Update documentation to clarify "help user-defined" may
	also include python commands defined as COMMAND_USER.

	testsuite/
	* gdb.python/py-cmd.exp: Add test to verify that python commands can
	be put in the user-defined category and that the commands appear in
	"help user-defined".
2012-03-01 19:30:25 +00:00
Joel Brobecker 1b61134393 [Ada] avoid error message pollution with uninitialized tagged variable
Consider the following function...

  3 procedure Foo is
  4    I : Integer := Ident (10);
  5    Obj : Base;
  6 begin
  7    Obj.X := I;
  8    Do_Nothing (Obj.X'Address);
  9 end Foo;

... where type "Base" is defined as a plain tagged record. If the user
stops execution before "Obj" gets initialized (for example, by inserting
a breakpoint "on" the function - or in other words, by inserting a
breakpoint using the function name as the location), one might get
the following of output if you try printing the value of obj:

    (gdb) p obj
    object size is larger than varsize-limit
    object size is larger than varsize-limit
    object size is larger than varsize-limit
    $1 = object size is larger than varsize-limit
    (x => 4204154)

Same thing with "info locals":

   (gdb) info locals
    i = 0
    obj = object size is larger than varsize-limit
    (x => 4204154)

We have also seen different error messages such as "Cannot read
memory at 0x...".

The error happens because we are trying to read the dispatch table
of a tagged type variable before it gets initialized.  So the errors
might legitimately occur, and are supposed to be be contained.
However, the way things are written in ada-lang.c:ada_tag_name,
although the exception is in fact contained, the error message still
gets to be printed out.

This patch prevents this from happening by eliminating the use of
catch_errors, and using a TRY_CATCH block instead.  Doing this removed
the need to use functions specifically fitted for catch_errors, and
thus some other simplifications could me made.  In the end, the code
got reorganized a bit to better show the logic behind it, as well as
the common patterns.

gdb/ChangeLog:

        * ada-lang.c (struct tag_args): Delete.
        (ada_get_tsd_type): Function body moved up in source file.
        (ada_tag_name_1, ada_tag_name_2): Delete.
        (ada_get_tsd_from_tag): New function.
        (ada_tag_name_from_tsd): New function.
        (ada_tag_name): Use a TRY_CATCH block instead of catch_errors
        to determine the tag name.

gdb/testsuite/ChangeLog:

        * gdb.ada/tagged_not_init: New testcase.
2012-02-29 19:46:48 +00:00
Joel Brobecker 99b1c762c9 [Ada] print packed arrays indexed by enumerated type
Consider the following declarations (a packed array indexed by an
enumerated type):

    type Color is (Black, Red, Green, Blue, White);
    type Full_Table is array (Color) of Boolean;
    pragma Pack (Full_Table);
    Full : Full_Table := (False, True, False, True, False);

GDB is unable to print the index values correctly. It prints the
enumeration's underlying value instead of the enumeration name:

    (gdb) p full
    $1 = (0 => false, true, false, true, false)
    (gdb) p full'first
    $2 = 0

And yet, it is capable of printing the correct type description:

    (gdb) ptype full
    type = array (black .. white) of boolean <packed: 1-bit elements>

To get to the real index type, one has to follow the parallel XA type.
We already do this for normal arrays. We can do it for this packed
array as well.

gdb/ChangeLog:

        * ada-lang.c (constrained_packed_array_type): If there is a
        parallel XA type, use it to determine the array index type.

gdb/testsuite/ChangeLog:

        * gdb.ada/arrayidx.exp: Adjust expected output for p_one_two_three.
        * gdb.ada/enum_idx_packed: New testcase.
2012-02-29 19:34:40 +00:00
Joel Brobecker 2d4a02ee95 [Ada] Handle reference to array descriptors
This patch is to help handle aliased array variables, such as:

   type Bounded is array (Integer range <>) of Integer;
   function New_Bounded (Low, High : Integer) return Bounded;
   BT : aliased Bounded := New_Bounded (Low => 1, High => 3);

In that case, the compiler describes variable "BT" as a reference
to a thin pointer, and GDB is unable to print its value:

    (gdb) p bt
    $1 =

The problems starts when ada_value_print deconstructs the struct
value into contents and address in order to call val_print. It
turns out in this case that "bt" is not an lval. In the debug
information, this variable's location is described as:

        .uleb128 0xd    # (DIE (0xe0) DW_TAG_variable)
        .ascii "bt\0"   # DW_AT_name
        [...]
        .byte   0x6     # DW_AT_location
        .byte   0x91    # DW_OP_fbreg
        .sleb128 -56
        .byte   0x6     # DW_OP_deref
        .byte   0x23    # DW_OP_plus_uconst
        .uleb128 0x8
        .byte   0x9f    # DW_OP_stack_value

So, when ada_value_print passes the bt's (value) address, it passes
in effect a meaningless address. The problem continues shortly after
when ada_val_print_1 re-creates the value from the contents and address.
The value has become an lval_memory, with a null address.

As a result, we trigger a memory error later on, while trying to
read the array bounds in order to transform our value into a simple
array.

To avoid the problem entirely, the fix is to coerce references before
transforming array descriptors into simple arrays.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_1): If our value is a reference
        to an array descriptor, dereference it before converting it
        to a simple array.

gdb/testsuite/ChangeLog:

        * gdb.ada/aliased_array: New testcase.
2012-02-29 19:33:02 +00:00
Joel Brobecker 2e6fda7d06 [Ada] whatis not printing array type name for value from history
Consider the following declaration:

   type Full_Table is array (Color) of Integer;
   Full : Full_Table := (144, 233, 377, 610, 987);

The debugger correctly prints the type name of variable "full":

        (gdb) whatis full
        type = pck.full_table

But is unable to do so when using the value history:

        (gdb) print full
        $1 = (144, 233, 377, 610, 987)
        (gdb) whatis $
 !!! -> type = array (black .. white) of integer

This is because the evaluation creates a "fixed" version of
the array type, and that "fixed" version is missing a type name.
As a result, whatis falls back to describing the type (a la ptype)
instead of printing the type name.

gdb/ChangeLog:

        * ada-lang.c (to_fixed_array_type): Set result's type name.

gdb/testsuite/ChangeLog:

        * gdb.ada/whatis_array_val: New testcase.
2012-02-29 19:29:12 +00:00
Jan Kratochvil 9a7f938f93 gdb/
Fix disp-step-syscall.exp: fork: single step over fork.
	* i386-linux-tdep.c (-i386_linux_get_syscall_number): Rename to ...
	(i386_linux_get_syscall_number_from_regcache): ... here, new function
	comment, change parameters gdbarch and ptid to regcache.  Remove
	parameter regcache, initialize gdbarch from regcache here.
	(i386_linux_get_syscall_number, i386_linux_displaced_step_copy_insn):
	New functions.
	(i386_linux_init_abi): Install i386_linux_displaced_step_copy_insn
	instead.
	* i386-tdep.c (i386_syscall_p): Check also for 'sysenter' and
	'syscall'.  Make the 'int' check more strict.

gdb/testsuite/
	Fix disp-step-syscall.exp: fork: single step over fork.
	* gdb.base/disp-step-syscall.exp (syscall_insn): Anchor it by
	whitespaces.
	(single step over $syscall): Remove its check.
	(single step over $syscall final pc): New check.
2012-02-29 14:59:41 +00:00
Jan Kratochvil 8703a944b0 gdb/testsuite/
Support processors without SSSE3.
	* gdb.reverse/i386-sse-reverse.c (sse_test): Move pabsb, pabsw and
	pabsd into ...
	(ssse3_test): ... a new function.
	(main): Call ssse3_test.
	* gdb.reverse/i386-sse-reverse.exp: New variable end_ssse3_test.
	Update expected values everywhere.
	(reverse-step to pabsd, verify xmm0 after reverse pabsd)
	(verify xmm1 after reverse pabsd, verify xmm2 after reverse pabsd)
	(reverse-step to pabsw, verify xmm0 after reverse pabsw)
	(verify xmm1 after reverse pabsw, verify xmm2 after reverse pabsw)
	(reverse-step to pabsb, verify xmm0 after reverse pabsb)
	(verify xmm1 after reverse pabsb, verify xmm2 after reverse pabsb):
	Move these tests lower.
	(set breakpoint at end of ssse3_test, continue to end of ssse3_test)
	(verify xmm0 at end of ssse3_test, verify xmm1 at end of ssse3_test)
	(verify xmm2 at end of ssse3_test, continue to end of ssse3_test #2):
	New tests.
2012-02-29 14:55:46 +00:00
Yao Qi c03e6ccce2 gdb/gdbserver:
2012-02-29  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* linux-low.c (linux_wait_1): Call unsuspend_all_lwps when
	`step_over_finished' is true.

gdb/testsuite:

2012-02-29  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.trace/trace-mt.c: New
	* gdb.trace/trace-mt.exp: New.
2012-02-29 13:59:41 +00:00
Thomas Schwinge 2c8910ba4a gdb/testsuite/
* gdb.base/annota1.exp: Use gdb_get_line_number for retrieving line
	numbers instead of hardcoding them.
	* gdb.base/annota1.c: Provide suitable markers.
	* gdb.base/annota3.exp: Use gdb_get_line_number for retrieving line
	numbers instead of hardcoding them.
	* gdb.base/annota3.c: Provide suitable markers.
2012-02-28 22:40:48 +00:00
Thomas Schwinge 7964b62a37 gdb/testsuite/
* gdb.base/annota1.c [__sh__]: Remove any special-casing.
        * gdb.base/annota3.c: Likewise.
        * gdb.base/sigall.c: Likewise.
        * gdb.base/signals.c: Likewise.
        * gdb.reverse/sigall-reverse.c: Likewise.
2012-02-28 10:24:15 +00:00
Maciej W. Rozycki 5a41c0b791 * gdb.cp/breakpoint.exp (test_breakpoint): Fix the runto_main
failure return path.
2012-02-27 20:48:25 +00:00
Luis Machado ebbbe5c5ed 2012-02-27 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/save-bp.exp: Account for new condition evaluator output.
2012-02-27 13:22:59 +00:00
Luis Machado 8d126d8a7a 2012-02-24 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/cond-eval-mode.exp: New file.
2012-02-24 15:17:41 +00:00
Pedro Alves 11337c2fed 2012-02-24 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_ld): Use with_test_prefix.
	(top level): Use with_test_prefix.
2012-02-24 14:09:08 +00:00
Pedro Alves 13fc3e3cf9 2012-02-24 Pedro Alves <palves@redhat.com>
* gdb.threads/attach-into-signal.exp (corefunc): Use
	with_test_prefix.
2012-02-24 14:06:29 +00:00
Jan Kratochvil 07c1b62689 gdb/testsuite/
Fix false FAILs on old CPUs without SSE.
	* gdb.reverse/i386-sse-reverse.exp (continue to end of sse_test):
	Return untested for Illegal instruction.
2012-02-24 00:40:01 +00:00
Jan Kratochvil 596ba13831 gdb/testsuite/
Fix false FAILs with glibc debug infos installed.
	* gdb.reverse/solib-precsave.exp (set debug-file-directory): New test.
	* gdb.reverse/solib-reverse.exp (set debug-file-directory): New test.
2012-02-24 00:05:56 +00:00
Sterling Augustine aeaa24743c ChangeLog
2012-02-22  Sterling Augustine  <saugustine@google.com>

	PR 13689:
	* breakpoint.c (watchpoint_exp_is_constant): Add UNOP_CAST to switch.

testsuite/ChangeLog
2012-02-22  Sterling Augustine  <saugustine@google.com>

	* gdb.base/watchpoint.exp (test_constant_watchpoint): Add test for
	constant with cast.
2012-02-22 18:20:38 +00:00
Pedro Alves aed555c941 2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.threads/watchpoint-fork.exp (test): Use with_test_prefix.
2012-02-22 00:07:43 +00:00
Pedro Alves 78afebb483 2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.base/return-nodebug.exp (do_test): Use with_test_prefix.
2012-02-22 00:04:58 +00:00
Pedro Alves fdcfef12c3 2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.trace/unavailable.exp (gdb_collect_globals_test): Use
	with_test_prefix.
2012-02-21 22:58:39 +00:00
Pedro Alves 0f4d39d53d 2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.arch/altivec-abi.exp (altivec_abi_tests): Don't do
	with_test_prefix here.
	(top level): Do it here instead.  Remove `:' from the
	with_test_prefix string.
	* gdb.base/attach-pie-misread.exp: Remove the leading space the
	the suffix `:' from the with_test_prefix prefix string.
	* gdb.base/break-interp.exp: Ditto.
	* gdb.base/catch-load.exp: Ditto.
	* gdb.base/disp-step-syscall.exp: Ditto.
	* gdb.base/jit-so.exp: Ditto.
	* gdb.base/jit.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/solib-display.exp: Ditto.
	* gdb.base/solib-overlap.exp: Ditto.
	* gdb.base/watch-cond-infcall.exp: Ditto.
	* gdb.base/watchpoint.exp: Ditto.
	* gdb.dwarf2/dw2-noloc.exp: Ditto.
	* gdb.mi/mi-watch.exp: Ditto.
	* gdb.mi/mi2-watch.exp: Ditto.
	* gdb.threads/non-ldr-exc-1.exp: Ditto.
	* gdb.threads/non-ldr-exc-2.exp: Ditto.
	* gdb.threads/non-ldr-exc-3.exp: Ditto.
	* gdb.threads/non-ldr-exc-4.exp: Ditto.
	* gdb.threads/watchpoint-fork.exp: Ditto.
	* gdb.threads/watchthreads-reorder.exp: Ditto.
	* gdb.trace/change-loc.exp: Ditto.
	* gdb.trace/pending.exp: Ditto.
	* gdb.trace/status-stop.exp: Ditto.
	* gdb.trace/strace.exp: Ditto.
	* gdb.trace/trace-break.exp: Ditto.
	* gdb.trace/unavailable.exp: Ditto.
	* lib/gdb.exp (with_test_prefix): Always prefix with space and
	suffix with colon.  Adjust leading comments.
2012-02-21 22:01:10 +00:00
Pedro Alves 6a5870cea1 2012-02-21 Pedro Alves <palves@redhat.com>
Tom Tromey  <tromey@redhat.com>

	* lib/gdb.exp: Add description of test prefixes.
	(with_test_prefix): New procedure.
	* gdb.arch/altivec-abi.exp: Use with_test_prefix.
	* gdb.base/attach-pie-misread.exp: Use with_test_prefix.
	* gdb.base/break-interp.exp: Use with_test_prefix.  Use append
	instead of lappend to append to pf_prefix.
	* gdb.base/catch-load.exp: Use with_test_prefix.
	* gdb.base/disp-step-syscall.exp: Use with_test_prefix.
	* gdb.base/jit-so.exp: Use with_test_prefix.
	* gdb.base/jit.exp: Use with_test_prefix.
	* gdb.base/return-nodebug.exp (do_test): Use append instead of
	lappend to append to pf_prefix.
	* gdb.base/sepdebug.exp: Use with_test_prefix.
	* gdb.base/solib-display.exp: Use with_test_prefix.
	* gdb.base/solib-overlap.exp: Use with_test_prefix.
	* gdb.base/watch-cond-infcall.exp: Use with_test_prefix.
	* gdb.base/watchpoint.exp: Use with_test_prefix.
	* gdb.dwarf2/dw2-noloc.exp: Use with_test_prefix.
	* gdb.mi/mi-watch.exp: Use with_test_prefix.
	* gdb.mi/mi2-watch.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-1.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-2.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-3.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-4.exp: Use with_test_prefix.
	* gdb.threads/watchpoint-fork.exp: Use with_test_prefix.  Use
	append instead of lappend to append to pf_prefix.
	* gdb.threads/watchthreads-reorder.exp: Use with_test_prefix.
	* gdb.trace/change-loc.exp: Use with_test_prefix.
	* gdb.trace/pending.exp: Use with_test_prefix.
	* gdb.trace/status-stop.exp: Use with_test_prefix.
	* gdb.trace/strace.exp: Use with_test_prefix.
	* gdb.trace/trace-break.exp: Use with_test_prefix.
	* gdb.trace/unavailable.exp: Use with_test_prefix.  Use append
	instead of lappend to append to pf_prefix.
2012-02-21 21:55:39 +00:00
Jan Kratochvil 35dc4a6b96 gdb/testsuite/
Fix racy FAILs.
	* gdb.base/inferior-died.c (main): Add return of 0.
	* gdb.base/inferior-died.exp (continue): Fix expectation of
	asynchronous events.
	(p 1): New test.
2012-02-20 21:03:05 +00:00
Pedro Alves c5a006e6e8 2012-02-20 Pedro Alves <palves@redhat.com>
* gdb.threads/attach-into-signal.exp (corefunc): Don't enable
	lin-lwp output.  Set SIGALRM to stop.  Adjust tests to not rely on
	gdb's internal debug output.  For the non-threaded case, look for
	"Program received signal SIGLARM", for the threaded case, peek at
	the thread's siginfo.
2012-02-20 13:20:38 +00:00
Pedro Alves cc51a17021 2012-02-20 Pedro Alves <palves@redhat.com>
General cleanup, make output test messages unique, and build
	different executable files for the non-threaded and threaded
	cases.

	* gdb.threads/attach-into-signal.exp (binfile, escapedbinfile):
	Delete.
	(executable_nothr, executable_thr): New globals.
	(top level): Adjust to delete both executables.
	(corefunc): New parameter $executable.  Set $pf_prefix instead of
	hand writing a prefix in tests.  Issue a clean_restart and enable
	lin-lwp debug output here.
	(top level): Adjust.  Use build_executable.  Don't start gdb here,
	and don't enable lin-lwp debug output here.
	* gdb.threads/Makefile.in (EXECUTABLES): Adjust.
2012-02-20 13:18:36 +00:00
Jan Kratochvil c755f03d06 gdb/testsuite/
Fix racy FAILs.
	* gdb.base/catch-load.exp (one_catch_load_test): Remove duplicate
	"continue" command.
2012-02-20 06:20:28 +00:00
Jan Kratochvil 6bec5e0a45 gdb/testsuite/
Fix for gdbserver non-extended mode.
	* gdb.base/break-inline.exp (start): Replace "start" by gdb_breakpoint
	and gdb_run_cmd.
2012-02-19 13:05:28 +00:00
Tom Tromey 2e8265fd8b PR python/12070:
* python/py-event.c (event_object_getset): New global.
	(event_object_type): Reference it.
	* python/py-type.c (field_object_getset): New global.
	(field_object_type): Reference it.
	* python/python-internal.h (gdb_py_generic_dict): Declare.
	* python/py-utils.c (gdb_py_generic_dict): New function.
testsuite/gdb
	* gdb.python/py-events.py (exit_handler): Add test for 'dir'.
	* gdb.python/py-events.exp: Check 'dir' output.
	* gdb.python/py-type.exp (test_fields): Add test for 'dir'.
2012-02-17 19:24:27 +00:00
Yao Qi 9e50707687 gdb/testsuite/
* gdb.trace/strace.exp (strace_info_marker): Test `info threads'.
2012-02-17 13:22:58 +00:00
Tom Tromey 32d22ab151 * gdb.base/inferior-died.c: Don't include stdio.h. 2012-02-16 14:42:51 +00:00
Tom Tromey 9addecb9fb PR c++/13653:
* thread.c (struct current_thread_cleanup) <was_removable>: New
	field.
	(do_restore_current_thread_cleanup): Restore 'removable' field.
	(restore_current_thread_cleanup_dtor): Likewise.
	(make_cleanup_restore_current_thread): Initialize new field.
testsuite/gdb
	* gdb.base/inferior-died.c: New file.
	* gdb.base/inferior-died.exp: New file.
2012-02-16 14:35:00 +00:00
Aleksandar Ristovski 4cb6da1cdd * frame.c (find_frame_sal): Initialize sal->pspace field from frame
data.
	* stack.c (set_last_displayed_sal): Validate that PSPACE is not NULL.

testuite:
	* gdb.base/break-inline.exp: New file.
	* gdb.base/break-inline.c: New file.
2012-02-15 19:27:59 +00:00
Tom Tromey 3af2590d3e PR gdb/12659:
* infcmd.c (registers_info): Print just the current register's
	name.
gdb/testsuite
	* gdb.base/pc-fp.exp: Add "info register" tests.
2012-02-15 19:13:14 +00:00
Tom Tromey 29988831db * gdb.base/regs.exp: Remove. 2012-02-15 18:49:27 +00:00
Pedro Alves 10010058f2 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.trace/backtrace.exp: Issue UNSUPPORTED instead of PASS when
	the target doesn't support tracepoints.
	* gdb.trace/circ.exp: Ditto.
	* gdb.trace/collection.exp: Ditto.
	* gdb.trace/packetlen.exp: Ditto.
	* gdb.trace/passc-dyn.exp: Ditto.
	* gdb.trace/report.exp: Ditto.
	* gdb.trace/tfind.exp: Ditto.
	* gdb.trace/tspeed.exp: Ditto.
	* gdb.trace/tsv.exp: Ditto.
	* gdb.trace/unavailable.exp: Ditto.
	* gdb.trace/while-dyn.exp: Ditto.
2012-02-15 18:09:20 +00:00
Pedro Alves a2e0062d4b 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.trace/circ.exp (trace_buffer_normal): Rewrite using
	gdb_test_multiple, and call unsupported instead of fail, if the
	remote side does not support the request.
2012-02-15 17:20:07 +00:00
Pedro Alves a1999d4022 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.server/ext-attach.exp: Make sure gdb is disconnected.
	* gdb.server/ext-run.exp: Make sure gdb is disconnected.
	* gdb.server/file-transfer.exp: Make sure gdb is disconnected.
	* gdb.server/server-mon.exp: Make sure gdb is disconnected.
	* gdb.server/server-run.exp: Make sure gdb is disconnected.
	* lib/gdbserver-support.exp (gdbserver_start_extended): Only
	prepend "extended-" to $gdbserver_protocol if $gdbserver_protocol
	doesn't start with "extended-" already.
2012-02-15 12:51:17 +00:00
Pedro Alves 7cee1e5405 gdb/
2012-02-15  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_detach_1, extended_remote_attach_1): Tweak
	output to be like native targets'.
	(remote_pid_to_str): Special case the null ptid.

gdb/testsuite/
2012-02-15  Pedro Alves  <palves@redhat.com>

	Support extended-remote.  Avoid cascading timeouts.

	* gdb.base/attach.exp (do_attach_tests): Add expected output for
	the extended-remote target.  If attaching with no file fails, load
	the file manually.
	* gdb.server/ext-attach.exp: Adjust expected attach/detach output.
2012-02-15 12:48:55 +00:00
Stan Shebs 816338b563 2012-02-14 Stan Shebs <stan@codesourcery.com>
* NEWS: Mention enable count command.
	* breakpoint.h (struct breakpoint): New field enable_count.
	* breakpoint.c (enable_breakpoint_disp): Add count argument.
	(enable_breakpoint): Add arg to call.
	(struct disp_data): New struct.
	(do_enable_breakpoint_disp): Interp arg as disp_data and unpack.
	(do_map_enable_once_breakpoint): Create a struct and pass it.
	(do_map_enable_delete_breakpoint): Ditto.
	(do_map_enable_count_breakpoint): New function.
	(enable_count_command): New function.
	(bpstat_stop_status): Decrement enable_count.
	(print_one_breakpoint_location): Report enable count.
	(_initialize_breakpoint): Add enable count command.

	* gdb.texinfo (Disabling Breakpoints): Document enable count.

	* gdb.base/ena-dis-br.exp: Add enable count test.
2012-02-14 23:28:15 +00:00
Pedro Alves cc30c4bd19 gdb/doc/
2012-02-13  Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (MIPS boards): Refer to mips-elf instead of
	mips-idt-ecoff.

gdb/testsuite/
2012-02-13  Pedro Alves  <palves@redhat.com>

	* config/mips-idt.exp: Delete.
	* gdb.base/a2-run.exp: Remove mips-idt xfails.
	* gdb.base/bitfields.exp: Remove mips-idt restarts.
	* gdb.base/break.exp: Remove mips-idt references.
	* gdb.base/chng-syms.exp: Ditto.
	* gdb.base/default.exp: Ditto.
	* gdb.base/funcargs.exp (funcargs_reload): Delete.
	(top level): Don't call it.
	* gdb.base/opaque.exp: Remove mips-idt restarts.
	* gdb.base/ptype.exp: Remove mips-idt xfails.
	* gdb.base/scope.exp: Remove mips-idt restarts.
	* gdb.base/sepdebug.exp: Remove mips-idt references.
	* gdb.base/watchpoint.exp (maybe_clean_restart)
	(maybe_reinitialize): Delete.
	(test_disabling_watchpoints, test_disabling_watchpoints)
	(test_watchpoint_triggered_in_syscall)
	(test_watchpoint_and_breakpoint, test_inaccessible_watchpoint):
	Don't call them.
2012-02-13 18:09:59 +00:00
Jan Kratochvil 570083757c gdb/
Fix crash on loaded shlibs without loaded exec_bfd.
	* exec.c (exec_files_info): Do not crash on NULL EXEC_BFD.
	(set_section_command): Replace exec_bfd by p->bfd.

gdb/testsuite/
	* gdb.server/server-exec-info.exp: New file.
2012-02-12 19:15:01 +00:00
Pedro Alves 4a2d9c0801 2012-02-10 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_attach_gdb): Assume $file is
	always non-empty.
	(test_attach): Always pass $exec to test_attach_gdb.
2012-02-10 16:06:50 +00:00
Tom Tromey 09fa21bd6f * gdb.python/py-symbol.exp: Use lookup_global_symbol for tests
before inferior is started.
2012-02-08 19:58:25 +00:00
Tom Tromey f0823d2ce8 PR python/12027:
* python/python-internal.h (frame_object_type): Declare.
	* python/py-symbol.c (sympy_needs_frame): New function.
	(sympy_value): New function.
	(symbol_object_getset): Add "needs_frame".
	(symbol_object_methods): Add "value".
	* python/py-frame.c (frame_object_type): No longer static.
gdb/doc
	* gdb.texinfo (Symbols In Python): Document Symbol.needs_frame and
	Symbol.value.
gdb/testsuite
	* gdb.python/py-symbol.exp: Test Symbol.needs_frame and
	Symbol.value.
	* gdb.python/py-symbol.c (qq): Set default value.
2012-02-07 19:47:16 +00:00
Tom Tromey 64e7d9dddc PR python/13599:
* python/py-symbol.c (sympy_line): New function.
	(symbol_object_getset): Add "line".
gdb/doc
	* gdb.texinfo (Symbols In Python): Document Symbol.line.
gdb/testsuite
	* gdb.python/py-symbol.c (qq): New global.
	* gdb.python/py-symbol.exp: Add test for frame-less
	lookup_symbol.
	* gdb.python/py-symtab.exp: Fix line number.
2012-02-07 19:42:27 +00:00
Joel Brobecker f7e44f6574 GDB/MI: crash printing "_task" (Ada) argument
In GDB/MI mode, trying to print the arguments of the frame corresponding
to the body of a task ("-stack-list-arguments 1") causes the debugger to
crash.

This is because the compiler adds an implicit argument to that task body
called "_task". mi/mi-cmd-stack.c:list_args_or_locals, which is
responsible for printing the value of our arguments, finds that our
"_task" symbol is an argument, and thus tries to fing the non-argument
equivalent:

              if (SYMBOL_IS_ARGUMENT (sym))
                sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
                                      block, VAR_DOMAIN,
                                      (int *) NULL);

Unfortunately, it tries using the natural name, which doesn't always
work for Ada parameters, in particular those who are internally-
generated. In our case, The "_task" parameter's natural name is
"<_task>", and that symbol does not exist.  So sym2 is NULL, thus
causing the crash a little later on when trying to dereference it.
We should be using the symbol linkage name in this case, the same
way iterate_over_block_arg_vars already does.

gdb/ChangeLog:

        * mi/mi-cmd-stack.c (list_args_or_locals): For argument symbols,
        use SYMBOL_LINKAGE_NAME to find the corresponding non-argument
        symbol.  Add assertion that sym2 is never NULL.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_task_arg: New testcase.
2012-02-03 07:32:40 +00:00
Pedro Alves 4c9ed63c1f 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.reverse/until-precsave.exp: Also put "record save" under the
	extended timeout.
2012-02-02 18:10:07 +00:00
Pedro Alves c0b9f2c6e8 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.gdb/complaints.exp: Skip if gdb,noinferiorio is set.
	* gdb.gdb/selftest.exp (test_with_self): Handle gdb,noinferiorio.
2012-02-02 18:09:07 +00:00
Pedro Alves 5f8cefd757 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.base/term.exp: Rewrite.
	* gdb.base/term.c: New.
2012-02-02 18:07:58 +00:00
Pedro Alves 2f3a2569b8 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp (run "r" abbreviation, run): Add
	extended-remote expected output.
2012-02-02 18:05:35 +00:00
Tom Tromey f149aabd96 PR gdb/9307:
* symtab.c (lookup_language_this): Set block_found.
gdb/testsuite
	* gdb.cp/dispcxx.exp: New file.
	* gdb.cp/dispcxx.cc: New file.
2012-02-02 14:58:33 +00:00
Tom Tromey 03bef283c2 PR gdb/13431:
* jit.c (struct jit_inferior_data): Rewrite.
	(struct jit_objfile_data): New.
	(get_jit_objfile_data): New function.
	(add_objfile_entry): Update.
	(jit_read_descriptor): Return int.  Replace descriptor_addr
	argument with inf_data.  Update.  Don't call error.
	(jit_breakpoint_re_set_internal): Reorder logic.  Update.  Look up
	descriptor here.
	(jit_inferior_init): Don't look up descriptor.  Don't call error.
	(jit_reset_inferior_data_and_breakpoints)
	(jit_inferior_created_observer): Remove.
	(jit_inferior_exit_hook): Update.
	(jit_executable_changed_observer): Remove.
	(jit_event_handler): Update.
	(free_objfile_data): Reset inferior data if needed.
	(_initialize_jit): Update.
gdb/testsuite
	* gdb.base/jit-simple.exp: New file.
	* gdb.base/jit-simple.c: New file.
2012-02-01 20:21:22 +00:00
Yao Qi a79b18b537 gdb/testsuite/
* gdb.base/skip.exp: Make test result unique.
2012-01-31 00:10:58 +00:00
Jan Kratochvil f0d1a53ee3 gdb/testsuite/
* gdb.base/valgrind-db-attach.exp (attach to debugger): Fix
	compatibility with valgrind-3.7.0.
2012-01-30 06:48:08 +00:00
Pedro Alves 4b3c9f41b6 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (no_hw): New global.
	(maybe_clean_restart, maybe_reinitialize): If no_hw is set,
	disable hw watchpoints.
	(test_wide_location_1, test_wide_location_2): If no_hw is set,
	don't expect hw watchpoints.
	(no_hw_watchpoints): Always clean restart.
	(do_tests): New procedure, factored out from the top level.
	(top level): Run tests twice.  Once with hw watchpoints enabled,
	another time with hw watchpoints disabled.
2012-01-27 14:01:23 +00:00
Pedro Alves a13491c8b5 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_no_hw_watchpoints): New, factored
	out from the top level.
	(top level): Call it instead.
2012-01-27 14:00:41 +00:00
Pedro Alves f2c8a05131 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (top level): Re-enable hardware
	watchpoints sooner.
2012-01-27 13:59:57 +00:00
Pedro Alves 654d7a9e20 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (top level): Delete watch ival3.
2012-01-27 13:59:21 +00:00
Pedro Alves 274f47f34a 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): Expect
	"You may have requested too many hardware
	breakpoints/watchpoints".
2012-01-27 13:58:46 +00:00
Pedro Alves e4d63ba2ed 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (maybe_clean_restart)
	(maybe_reinitialize): New.
	(test_disabling_watchpoints): Call maybe_reinitialize.  Don't
	expect "hit N times".
	(test_disabling_watchpoints, test_complex_watchpoint)
	(test_watchpoint_and_breakpoint, test_inaccessible_watchpoint):
	Call maybe_clean_restart.
	(top level): Use clean_restart.  Remove "mips-idt-*"
	reinitialization.
2012-01-27 13:58:11 +00:00
Pedro Alves dbd95dafec 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Always run test_complex_watchpoint.
2012-01-27 13:56:56 +00:00
Pedro Alves f3ad2025d7 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Clean restart after tests that don't
	require `initialize' anymore.  Remove unnecessary `initialize'
	calls.
2012-01-27 13:55:58 +00:00
Pedro Alves 100aa3aee0 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (wp_set): Delete.
	(initialize, test_simple_watchpoint, top level): Remove dead code.
2012-01-27 13:54:52 +00:00
Pedro Alves c79a8e1135 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_inaccessible_watchpoint): Fix
	typo.
2012-01-27 13:54:03 +00:00
Pedro Alves 048fe15a05 2012-01-27 Pedro Alves <palves@redhat.com>
* config/extended-gdbserver.exp: New file.
	* lib/gdbserver-support.exp (gdbserver_start_extended): Extend
	comment.
	(gdbserver_start_multi, mi_gdbserver_start_multi): New.
	* boards/native-extended-gdbserver.exp: New file.
2012-01-27 13:02:22 +00:00
Pedro Alves 4033a6bf64 2012-01-26 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Replace send_gdb/gdb_expect by gdb_test
	and gdb_test_multiple.
2012-01-26 10:50:59 +00:00
Pedro Alves 3d7f4b8126 2012-01-26 Pedro Alves <palves@redhat.com>
Make test messages unique, and more identifiable.
	* gdb.multi/watchpoint-multi.exp: Change test messages.
2012-01-26 10:09:43 +00:00
Tom Tromey 484abf42a0 * gdb.base/solib-disc.exp: Fix regexps. 2012-01-25 16:20:31 +00:00
Tom Tromey edcc512082 PR symtab/12406:
* solib.c (update_solib_list): Update the program space's
	added_solibs and deleted_solibs fields.
	* progspace.h (struct program_space) <added_solibs,
	deleted_solibs>: New fields.
	(clear_program_space_solib_cache): Declare.
	* progspace.c (release_program_space): Call
	clear_program_space_solib_cache.
	(clear_program_space_solib_cache): New function.
	* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call
	bpstat_stop_status.  Use handle_solib_event.
	* breakpoint.c: Include gdb_regex.h.
	(print_solib_event): New function.
	(bpstat_print): Use print_solib_event.
	(bpstat_stop_status): Add special case for bp_shlib_event.
	(handle_solib_event): New function.
	(bpstat_what): Use handle_solib_event.
	(struct solib_catchpoint): New.
	(dtor_catch_solib, insert_catch_solib, remove_catch_solib)
	(breakpoint_hit_catch_solib, check_status_catch_solib)
	(print_it_catch_solib, print_one_catch_solib)
	(print_mention_catch_solib, print_recreate_catch_solib): New
	functions.
	(catch_solib_breakpoint_ops): New global.
	(catch_load_or_unload, catch_load_command_1)
	(catch_unload_command_1): New functions.
	(internal_bkpt_check_status): Add special case for
	bp_shlib_event.
	(internal_bkpt_print_it): Use print_solib_event.
	(initialize_breakpoint_ops): Initialize
	catch_solib_breakpoint_ops.
	(_initialize_breakpoint): Register "catch load" and "catch
	unload".
	* breakpoint.h (handle_solib_event): Declare.
	* NEWS: Add entry for "catch load" and "catch unload".
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document "catch load" and "catch
	unload".
	(Files): Mention new catch commands.
	(GDB/MI Async Records): Likewise.
gdb/testsuite
	* lib/mi-support.exp (mi_expect_stop): Add special case for
	solib-event.
	* gdb.base/catch-load-so.c: New file.
	* gdb.base/catch-load.exp: New file.
	* gdb.base/catch-load.c: New file.
	* gdb.base/break-interp.exp (reach_1): Update regexp.
2012-01-24 21:39:18 +00:00
Jan Kratochvil 30b91c9079 gdb/testsuite/
Fix fuzzy results.
	* gdb.mi/var-cmd.c (do_locals_tests): Initialize variables lsimple,
	lpsimple and func.
2012-01-24 20:35:35 +00:00
Gary Benson 53fe178334 ChangeLog:
Delete #if 0'd out code.
	* stack.c (print_frame_label_vars): Remove.
	(catch_info): Likewise.
	(_initialize_stack): Remove "info catch" command.
	* NEWS: Mention the above.

doc/ChangeLog:
	Delete #if 0'd out code.
	* gdb.texinfo (Frame Info): Remove "info catch".

testsuite/ChangeLog:
	Delete #if 0'd out code.
	* gdb.base/default.exp (info catch): Remove.
	* gdb.base/gdb_history (info catch): Likewise.
	* gdb.base/help.exp (info catch): Likewise.
2012-01-24 15:13:30 +00:00
Jan Kratochvil d0d8b0c667 gdb/
Fix watchpoints to be specific for each inferior.
	* breakpoint.c (watchpoint_in_thread_scope): Verify also
	current_program_space.
	* i386-nat.c (i386_inferior_data_cleanup): New.
	(i386_inferior_data_get): Replace variable inf_data_local by an
	inferior_data call.
	(i386_use_watchpoints): Initialize i386_inferior_data.
	* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Use INFERIOR_PTID
	specific iterate_over_lwps.

gdb/testsuite/
	Fix watchpoints to be specific for each inferior.
	* gdb.multi/watchpoint-multi.c: New file.
	* gdb.multi/watchpoint-multi.exp: New file.
2012-01-24 13:49:58 +00:00
Jan Kratochvil 4403d8e9b3 gdb/
Fix watchpoints across inferior fork.
	* amd64-linux-nat.c (update_debug_registers_callback): Update the
	comment for linux_nat_iterate_watchpoint_lwps.
	(amd64_linux_dr_set_control, amd64_linux_dr_set_addr): Use
	linux_nat_iterate_watchpoint_lwps.
	(amd64_linux_prepare_to_resume): New comment on Linux kernel.
	* i386-linux-nat.c (update_debug_registers_callback): Update the
	comment for linux_nat_iterate_watchpoint_lwps.
	(i386_linux_dr_set_control, i386_linux_dr_set_addr): Use
	linux_nat_iterate_watchpoint_lwps.
	(i386_linux_prepare_to_resume): New comment on Linux kernel.
	* i386-nat.c: Include inferior.h.
	(dr_mirror): Remove.
	(i386_inferior_data, struct i386_inferior_data)
	(i386_inferior_data_get): New.
	(i386_debug_reg_state): Use i386_inferior_data_get.
	(i386_cleanup_dregs, i386_update_inferior_debug_regs)
	(i386_insert_watchpoint, i386_remove_watchpoint)
	(i386_stopped_data_address, i386_insert_hw_breakpoint)
	(i386_remove_hw_breakpoint): New variable state, use
	i386_debug_reg_state instead of DR_MIRROR.
	* linux-nat.c (delete_lwp): New declaration.
	(num_lwps): Move here from downwards.
	(delete_lwp_cleanup): New.
	(linux_child_follow_fork): Create new child_lp, call
	linux_nat_new_thread and linux_nat_prepare_to_resume before calling
	PTRACE_DETACH.
	(num_lwps): Move upwards.
	(linux_nat_iterate_watchpoint_lwps): New.
	* linux-nat.h (linux_nat_iterate_watchpoint_lwps_ftype): New.
	(linux_nat_iterate_watchpoint_lwps_ftype): New declaration.

gdb/testsuite/
	Fix watchpoints across inferior fork.
	* gdb.threads/watchpoint-fork-child.c: New file.
	* gdb.threads/watchpoint-fork-mt.c: New file.
	* gdb.threads/watchpoint-fork-parent.c: New file.
	* gdb.threads/watchpoint-fork-st.c: New file.
	* gdb.threads/watchpoint-fork.exp: New file.
	* gdb.threads/watchpoint-fork.h: New file.
2012-01-24 13:46:55 +00:00
Pedro Alves 050a2e1dab gdb/
2012-01-23  Pedro Alves  <palves@redhat.com>

	* top.c (caution): Update comment.
	(execute_command): Don't consider the current value of `caution'.

gdb/testsuite/
2012-01-23  Pedro Alves  <palves@redhat.com>

	* gdb.base/call-signal-resume.exp: Allow output after "return".
2012-01-23 17:11:50 +00:00
Pedro Alves 6a52fb620c 2012-01-20 Pedro Alves <palves@redhat.com>
* gdb.python/py-finish-breakpoint.py: Fix typo.
2012-01-20 20:00:14 +00:00
Ulrich Weigand 145b16a97a ChangeLog:
* defs.h (enum info_proc_what): Moved here from linux-nat.c
	* infcmd.c: (info_proc_cmd_1): New function.
	(info_proc_cmd): New function, moved here from equivalent routine
	orignally in linux-nat.c.
	(info_proc_cmd_mappings): Likewise.
	(info_proc_cmd_stat): Likewise.
	(info_proc_cmd_status): Likewise.
	(info_proc_cmd_cwd): Likewise.
	(info_proc_cmd_cmdline): Likewise.
	(info_proc_cmd_exe): Likewise.
	(info_proc_cmd_all): Likewise.
	(_initialize_infcmd): Install "info proc" command and subcommands.

	* target.h (struct target_ops): Add to_info_proc.
	(target_info_proc): Add prototype.
	* target.c (target_info_proc): New function.

	* procfs.c (procfs_info_proc): Add prototype.
	(info_proc_cmd): Rename into ...
	(procfs_info_proc): ... this.  Update argument types as appropriate
	for a to_info_proc implementation.  Handle "what" argument.
	(procfs_target): Install procfs_info_proc.
	(_initialize_procfs): No longer install "info proc" command.

	* linux-nat.c: (enum info_proc_what): Remove.
	(linux_nat_info_proc_cmd_1): Rename into ...
	(linux_nat_info_proc): ... this.  Update argument types as appropriate
	for a to_info_proc implementation.
	(linux_nat_info_proc_cmd): Remove.
	(linux_nat_info_proc_cmd_mappings): Likewise.
	(linux_nat_info_proc_cmd_stat): Likewise.
	(linux_nat_info_proc_cmd_status): Likewise.
	(linux_nat_info_proc_cmd_cwd): Likewise.
	(linux_nat_info_proc_cmd_cmdline): Likewise.
	(linux_nat_info_proc_cmd_exe): Likewise.
	(linux_nat_info_proc_cmd_all): Likewise.
	(linux_target_install_ops): Install linux_nat_info_proc.
	(_initialize_linux_nat): No longer install "info proc" command
	and subcommands.

testsuite/ChangeLog:

	* gdb.base/info-proc.exp: Also run on remote targets.  Main
	"info proc" command is now always present; whether target supports
	actual info proc operation is detected when attempting to issue
	the command.
2012-01-20 09:49:01 +00:00
Jan Kratochvil 26f6125ebd gdb/testsuite/
* .gdbinit: Remove.
2012-01-19 12:44:01 +00:00
Pedro Alves eb5227ce35 2012-01-19 Pedro Alves <palves@redhat.com>
* gdb.java/jprint.exp: Don't rely on inferior output, but instead
	look at the funtions' returns.
	* gdb.java/jprint.java (jvclass.addprint, jprint.print(int))
	(jprint.print(int, int)): Change return type to int.  Adjust.
2012-01-19 12:37:28 +00:00
Paul Pluzhnikov 1db333787d 2012-01-18 Paul Pluzhnikov <ppluzhnikov@google.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/9538
	* symfile.c (find_separate_debug_file): New function.
	(terminate_after_last_dir_separator): Likewise.
	(find_separate_debug_file_by_debuglink): Also try realpath.
	* configure.ac (AC_CHECK_FUNCS): Add lstat.
	* configure: Regenerate.
	* config.in: Regenerate.

testsuite/ChangeLog:

2012-01-18  Paul Pluzhnikov  <ppluzhnikov@google.com>

	PR gdb/9538
	* gdb.base/sepdebug.exp: New test.
2012-01-18 18:58:43 +00:00
Pedro Alves b9736cf836 2012-01-18 Pedro Alves <palves@redhat.com>
* gdb.ada/mi_task_info.exp (-ada-task-info with no argument):
	Allow output before ^done.
2012-01-18 17:00:17 +00:00