Commit Graph

30212 Commits

Author SHA1 Message Date
Tom Tromey 5ff5c7b436 * gnu-v3-abi.c (gnuv3_print_vtable): Initialize 'result_vec'. 2012-03-19 18:13:43 +00:00
Pedro Alves 122f36efc1 2012-03-19 Pedro Alves <palves@redhat.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>

	* server.c (cont_thread, general_thread): Add describing comments.
	(start_inferior): Clear `cont_thread'.
	(handle_v_cont): Don't set `cont_thread' if resuming all threads
	of a process.
2012-03-19 14:33:35 +00:00
Jan Kratochvil 3a69ffb280 gdb/testsuite/
* gdb.base/cond-eval-mode.exp: Fix the anticipated warning string.
2012-03-19 09:34:13 +00:00
Doug Evans d4ba18a2ac Fix spellings of filenames. 2012-03-19 00:27:39 +00:00
gdbadmin 3843129f42 *** empty log message *** 2012-03-19 00:00:02 +00:00
Doug Evans 8fabffee08 * dg-extract-results.sh: Handle KFAILs. 2012-03-18 04:17:16 +00:00
gdbadmin e52eb7ce3e *** empty log message *** 2012-03-18 00:00:33 +00:00
gdbadmin fabe978264 *** empty log message *** 2012-03-17 00:00:03 +00:00
Jan Kratochvil ab260dad39 gdb/
PR symtab/13777
	* dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for
	GCC >=4.5.

gdb/testsuite/
	PR symtab/13777
	* gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0.
2012-03-16 18:26:02 +00:00
Tom Tromey c366c1f032 2012-03-16 Chris January <chris.january@allinea.com>
* tui-tui.win.c (tui_resize_all): Use erase and clearok instead
	of clear.
2012-03-16 18:22:24 +00:00
Tom Tromey e16edb4530 2012-03-16 Chris January <chris.january@allinea.com>
* source.c (add_path): Use memmove instead of strcpy because the
	strings overlap.
2012-03-16 18:20:34 +00:00
Joel Brobecker 53ba833325 [Ada] Crash when trying to set value of packed array element
Consider the following declaration:

   type Small is new Integer range 0 .. 2 ** 4 - 1;
   type Simple_Array is array (1 .. 4) of Small;
   pragma Pack (Simple_Array);

   SA : Simple_Array := (1, 2, 3, 4);

Trying to change the value of one of the elements in the packed array
causes the debugger to crash:

    (gdb) set sa(3) := 9
    [1]    4880 segmentation fault  gdb -q foo

The circumstances leading to the crash are as follow:

   . ada_evaluate_subexp creates a value corresponding to "sa(3)".

   . ada_evaluate_subexp then tries to assign 9 to this value, and
     for this calls value_assign (via ada_value_assign).

   . Because the array is packed, the destination value is 3 bits long,
     and as a result, value_assign uses the parent to determine that
     element byte address and offset:

      | if (value_bitsize (toval))
      |   {
      |     struct value *parent = value_parent (toval);
      |
      |     changed_addr = value_address (parent) + value_offset (toval);

The destination value (corresponding to "sa(3)") was incorrectly created
by ada-lang.c:ada_value_primitive_packed_val, because the "parent" was
left as NULL. So, when we try to dereference it to get the parent address,
GDB crashed.

The first part of the fix therefore consists in setting that field.
This required the addition of a new "setter" in value.[hc].  It fixes
the crash, but is still not sufficient for the assignment to actually
work.

The second part of the problem came from the fact that value_assign
seems to expect the "child"'s address to be equal to the parent's address,
with the difference being the offset. Unfortunately, this requirement was
not followed by ada_value_primitive_packed_val, so the second part of
the fix consisted in fixing that.

Still, this was not sufficient, because it caused a regression when
trying to perform an aggregate assignment of a packed array of packed
record.  The key element here is the nesting of packed entities.
Looking at the way ada_value_primitive_packed_val creates the value
of each sub-component, one can see that the value's offset is set
to the offset compared to the start of the parent. This was meant to
match what value_primitive_field does as well.

So, with our array of records, if the record offset was 2, and if
the field we're interested in that record is at offset 1, the record
value's offset would be set to 2, and the field value's offset would
be set to 1. But the address for both values would be left to the
array's address. This is where things start breaking down, because
the value_address function for our field value would return the
address of the array + 1, instead of + 3.

This is what causes the final issue, here, because ada-lang.c's
value_assign_to_component needs to compute the offset of the
subcomponent compared to the top-level aggregate's start address
(the array in our case). And it does so by subtracting the array's
address from the sub-component's address.  When you have two levels
of packed components, and the mid-level component is at an offset of
the top-level component, things didn't work, because the component's
address was miscomputed (the parent's offset is missing).

The fix consists is fixing value_address to match the work done by
value_primitive_field (where we ignore the parent's offset).

gdb/ChangeLog:

        * value.h (set_value_parent): Add declaration.
        * value.c (set_value_parent): New function.
        (value_address): If VALUE->PARENT is not NULL, then use it as
        the base address instead of VALUE->LOCATION.address.
        * ada-lang.c (ada_value_primitive_packed_val): Keep V's address
        the same as OBJ's address.  Adjust V's offset accordingly.
        Set V's parent.

gdb/testsuite/ChangeLog:

        * gdb.ada/set_pckd_arr_elt: New testcase.
2012-03-16 17:55:45 +00:00
Gary Benson 481860b396 gdb:
PR breakpoints/10738
	* dwarf2read.c (use_deprecated_index_sections): New global.
	(struct partial_die_info): New member may_be_inlined.
	(read_partial_die): Set may_be_inlined where appropriate.
	(add_partial_subprogram): Add partial symbols for partial
	DIEs that may be inlined.
	(new_symbol_full): Add inlined subroutines to the current
	scope.
	(write_psymtabs_to_index): Bump version number.
	(dwarf2_read_index): Read only version 6 indices unless
	use_deprecated_index_sections is set.
	* linespec.c (symbol_and_data_callback): New structure.
	(iterate_inline_only): New function.
	(iterate_over_all_matching_symtabs): New argument
	"include_inline".  If nonzero, also call the callback for
	symbols representing inlined subroutines.
	(lookup_prefix_sym): Pass extra argument to the above.
	(find_function_symbols): Likewise.
	(add_matching_symbols_to_info): Likewise.
	* NEWS: Mention that GDB can now set breakpoints on inlined
	functions.

gdb/doc:
	PR breakpoints/10738
	* gdb.texinfo (Inline Functions): Remove the now-unnecessary @item
	stating that GDB cannot set breakpoints on inlined functions.
	(Mode Options): Document --use-deprecated-index-sections.
	(Index Section Format): Document new index section version format.

gdb/testsuite:
	PR breakpoints/10738
	* gdb.opt/inline-break.exp: New file.
	* gdb.opt/inline-break.c: Likewise.
	* gdb.dwarf2/inline-break.exp: Likewise.
	* gdb.dwarf2/inline-break.S: Likewise.
	* gdb.base/annota1.exp: Cope with old .gdb_index warnings.
	* gdb.base/async-shell.exp: Likewise.
	* lib/mi-support.exp (library_loaded_re): Likewise.
2012-03-16 16:47:34 +00:00
Pierre Muller d0e7e15ad6 * p-typeprint.c (pascal_type_print_method_args):
Fix display of parameter of methods.
2012-03-16 11:10:04 +00:00
Pierre Muller 3d3546540f * amd64-windows-nat.c (_initialize_amd64_windows_nat):
Add missing prototype.
2012-03-16 10:54:39 +00:00
Jan Kratochvil cafe75b06b gdb/
Fix false compilation warning.
	* gnu-v3-abi.c (print_one_vtable): Initialize ADDR.
2012-03-16 08:18:09 +00:00
gdbadmin ef6a40d627 *** empty log message *** 2012-03-16 00:00:33 +00:00
Jonathan Larmour 25f8c69270 * arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c".
(arm_register_g_packet_guesses): New function.
	(arm_gdbarch_init): Don't force a target description with
	registers when the executable is detected as M-profile.  Instead
	set gdbarch->tdep->is_m.  Register `g' packet guesses.
	(_initialize_arm_tdep): Initialize the new target description.
	* features/arm-with-m-fpa-layout.xml: New description.
	* features/arm-with-m-fpa-layout.c: New, generated.
2012-03-15 18:53:43 +00:00
Joel Brobecker 35c63cd8ce Problem after hitting breakpoint on Windows (with GDBserver)
When debugging on Windows with GDBserver, the debugger starts
failing after hitting a breakpoint.  For instance:

    (gdb) b foo
    Breakpoint 1 at 0x40177e: file foo.adb, line 5.
    (gdb) cont
    Continuing.

    Breakpoint 1, foo () at foo.adb:5
    5          Put_Line ("Hello World.");  -- STOP
    (gdb) n

    Program received signal SIGSEGV, Segmentation fault.
    0x00401782 in foo () at foo.adb:5
    5          Put_Line ("Hello World.");  -- STOP

There are two issues:

  1. While trying to re-insert a breakpoint that is still inserted
     in memory, insert_bp_location wipes out the breakpoint location's
     shadow_contents.  As a consequence, we cannot restore the proper
     instruction when removing the breakpoint anymore.  That's why
     the inferior's behavior changes when trying to resume after
     the breakpoint was hit.

  2. mem-break.c:default_memory_insert_breakpoint passes a breakpoint
     location's shadow_contents as the buffer for a memory read.
     This reveals a limitation of the various memory-read target
     functions.  This patch documents this limitation and adjust
     the two calls that seem to hit that limitation.

gdb/ChangeLog:

        * breakpoint.c (breakpoint_xfer_memory): Add assertion.
        Update function description.
        (insert_bp_location): Do not wipe bl->target_info out.
        * mem-break.c: #include "gdb_string.h".
        (default_memory_insert_breakpoint): Do not call target_read_memory
        with a pointer to the breakpoint's shadow_contents buffer.  Use
        a local buffer instead.
        * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto.
2012-03-15 18:33:45 +00:00
Tom Tromey 57651221de * NEWS: Mention "info vtbl", not "info vtable".
* cp-support.c (info_vtbl_command): Fix comment.
	(_initialize_cp_support): Fix text.
2012-03-15 16:32:16 +00:00
Tom Tromey 410528f093 * cp-valprint.c (cp_print_value_fields): Use
print_function_pointer_address for vtable slot.
gdb/testsuite
	* gdb.cp/virtfunc2.exp: Update expected output.
	* gdb.cp/pr9631.exp: Update expected output.
	* gdb.cp/member-ptr.exp: Update expected output.
	* gdb.cp/inherit.exp (test_print_mvi_classes): Update expected
	output.
	* gdb.cp/casts.exp: Update expected output.
2012-03-15 15:49:42 +00:00
Tom Tromey c4aeac856a * gnu-v3-abi.c (struct value_and_voffset): New.
(hash_value_and_voffset, eq_value_and_voffset)
	(compare_value_and_voffset, compute_vtable_size)
	(print_one_vtable, gnuv3_print_vtable): New functions.
	(init_gnuv3_ops): Initialize 'print_vtable' field.
	* cp-support.c (info_vtbl_command): New function.
	(_initialize_cp_support): Add "info vtbl".
	* cp-abi.h (cplus_print_vtable): Declare.
	(struct cp_abi_ops) <print_vtable>: New field.
	* cp-abi.c (cplus_print_vtable): New function.
	* NEWS: Update.
gdb/testsuite
	* gdb.cp/virtfunc.exp (make_one_vtable_result): New proc.
	(test_info_vtbl): Likewise.
	(do_tests): Call test_info_vtbl.
	* gdb.cp/virtfunc.cc (va): New global.
gdb/doc
	* gdb.texinfo (Debugging C Plus Plus): Document "info vtbl".
2012-03-15 15:43:18 +00:00
Tom Tromey 95cbceff99 * d-lang.c (d_language_defn) <la_iterate_over_symbols>: Set to
iterate_over_symbols.
2012-03-15 14:06:20 +00:00
Yao Qi fc3e51758a gdb/gdbserver/
* tracepoint.c (install_tracepoint): Move duplicated tracepoint
	handling to ...
	(cmd_qtdp): ... here.
2012-03-15 12:57:13 +00:00
Yao Qi 8d0d92cd22 gdb/gdbserver/
* tracepoint.c (struct tracepoint_action_ops): New.
	(struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
	(m_tracepoint_action_download): New.
	(r_tracepoint_action_download): New.
	(x_tracepoint_action_download): New.
	(l_tracepoint_action_download): New.
	(add_tracepoint_action): Install `action->ops' according type.
	(download_tracepoint_1): Move code `download' function pointer
	of various tracepoint_action_ops.
2012-03-15 10:42:38 +00:00
Thomas Schwinge 856d06f972 gdb/testsuite/
* gdb.dwarf2/dw2-ada-ffffffff.S: Use .4byte instead of .long for
	describing DWARF data structures.
	* gdb.dwarf2/dw2-bad-parameter-type.S: Likewise.
	* gdb.dwarf2/dw2-double-set-die-type.S: Likewise.
	* gdb.dwarf2/dw2-empty-pc-range.S: Likewise.
	* gdb.dwarf2/dw2-entry-value.S: Likewise.
	* gdb.dwarf2/dw2-modula2-self-type.S: Likewise.
	* gdb.dwarf2/dw2-param-error.S: Likewise.
	* gdb.dwarf2/dw2-skip-prologue.S: Likewise.
	* gdb.dwarf2/dw2-stack-boundary.S: Likewise.
	* gdb.dwarf2/dw4-sig-type-unused.S: Likewise.
	* gdb.dwarf2/implptr-optimized-out.S: Likewise.
	* gdb.dwarf2/member-ptr-forwardref.S: Likewise.
	* gdb.dwarf2/pr11465.S: Likewise.
2012-03-15 09:08:10 +00:00
Doug Evans 589b4a3225 * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_encoded_addr,
DW_OP_GNU_parameter_ref.
2012-03-15 02:34:49 +00:00
gdbadmin 0a8af9c64c *** empty log message *** 2012-03-15 00:00:32 +00:00
Jan Kratochvil e837f12a8d gdb/
Fix double prompt of 'interpreter-exec mi'.
	* mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
	(mi_interpreter_resume): use it.
	(mi_execute_command_input_handler): New function.
	* mi/mi-main.c (mi_execute_command): Move prompt printing to
	mi_execute_command_input_handler.

gdb/testsuite/
	* gdb.mi/mi2-prompt.exp: New file.
2012-03-14 07:58:06 +00:00
Joel Brobecker ff1e452654 Mark latest entry in ChangeLog as "tiny change". 2012-03-14 01:47:45 +00:00
Joel Brobecker c381a3f69a Fix -Wmissing-prototypes build warnings on Darwin.
gdb/
2012-03-13  Josh Matthews  <josh@joshmatthews.net>

	* darwin-nat-info.c (_initialize_darwin_info_commands): Add
	prototype.
	(darwin_debug_port_info): Make static.
	* darwin-nat.c (_initialize_darwin_inferior): Add prototype.
	* machoread.c (_initialize_machoread): Add prototype.
	* i386-darwin-nat.c (i386_darwin_dr_set, i386_darwin_dr_get)
	(i386_darwin_set_control, i386_darwin_get_control)
	i386_darwin_dr_set_addr, i386_darwin_get_addr)
	i386_darwin_get_status, i386_darwin_get_control):
	Comment out with HW_WATCHPOINT_NOT_YET_ENABLED macro.
2012-03-14 01:46:59 +00:00
Joel Brobecker ccbb4f28f0 Testcase for: "ax-gdb: Do not treat enums and bools as integers".
gdb/testsuite/ChangeLog:

        * gdb.base/enum_cond.c, gdb.base/enum_cond.exp: New testcase.
2012-03-14 01:39:12 +00:00
Joel Brobecker d8a5d6ee2f ax-gdb: Do not treat enums and bools as integers.
This patch fixes a problem when using gdb + gdbserver, and trying
to break on a function when one of the (enum) parameters is equal
to a certain value, and the size of that enum is 1 byte.

    (gdb) break mixed.adb:15 if light = green
    Breakpoint 2 at 0x402d5a: file mixed.adb, line 15.
    (gdb) cont
    Continuing.
    [Inferior 1 (process 9742) exited normally]

The debugger should have stopped once when our function was call
with light set to green.

Here is what happens: Because we're using a recent GDBserver,
GDB hands off the evaluation of the condition to GDBserver, by
providing it in the Z0 packet. This is what GDB sends:

    $Z0,402d5a,1;X13,26000622100223ff1c16100219162022011327#cf

I decoded the condition as follow:

    260006    reg 6 -> push
    2210      const8 0x10 -> push
    02        add (stack now has 1 element equal to reg6 + 16)
    23ff1c    const16 0xff1c
    1610      ext 16 (sign extend 16 bits)
    02        add (stack now has 1 element equal to reg6 + 16 - 228)
    19        ref32: Pop as addr, push 32bit value at addr.
    1620      ext 32 (sign extend 32 bits)
    2201      const8 0x01
    13        equal
    27        end

The beginning of the agent expression can be explained by the address
of symbol "light":

    (gdb) info addr light
    Symbol "light" is a variable at frame base reg $rbp offset 16+-228.

However, the mistake is the "ext 32" operation (extend 32 bits),
because our variable is *not* 32bits, only 8:

    (gdb) print light'size
    $5 = 8

But the reason why GDB decides to use a 32bit extension is because
it overrides the symbol's type with a plain integer type in
ax-gdb.c:gen_usual_unary...

      /* If the value is an enum or a bool, call it an integer.  */
    case TYPE_CODE_ENUM:
    case TYPE_CODE_BOOL:
      value->type = builtin_type (exp->gdbarch)->builtin_int;
      break;

... before calling require_rvalue. And of course, that causes the
generator to generate a sizeof(int) extension of the result.

One way to fix this would be to use an integer type of the correct
size, but I do not understand why this is necessary. The two routines
that use that information to generate the opcode down the line are
gen_fetch (for a memory value), or gen_extend (for a register value).
And they both have handling of enums and bools.

So the fix we elected to implement was simply to remove that code.

gdb/ChangeLog:

        * ax-gdb.c (gen_usual_unary): Remove special handling of
        enum and bool types.
2012-03-14 01:38:58 +00:00
Joel Brobecker 32039130c8 testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types"
gdb/testsuite/ChangeLog:

        * gdb.ada/bp_range_type: New testcase.
2012-03-14 01:38:51 +00:00
Joel Brobecker af381b8cf9 ax-gdb.c: Add handling of TYPE_CODE_RANGE types.
This patch fixes an error that occurs with GDB + GDBserver when
trying to insert a breakpoint with a condition that involves
a range type. For instance:

    type INT_T  is range 0 .. 1000;
    INT_VAR : INT_T := 12;

And then trying to insert the breakpoint:

    (gdb) break foo.adb:18 if int_var > 15
    Breakpoint 1 at 0x4021eb: file foo.adb, line 18.
    (gdb) cont
    Continuing.
    /[...]/ax-gdb.c:560: internal-error: gen_fetch: bad type code
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

This patch fixes the problem by adding handling for range types
in gen_fetch.

gdb/ChangeLog:

        * ax-gdb.c (gen_fetch): Add handling for TYPE_CODE_RANGE types.
2012-03-14 01:38:30 +00:00
gdbadmin a776f595bf *** empty log message *** 2012-03-14 00:00:32 +00:00
Joel Brobecker 786c562f1a Minor cleanup in aix-thread.c:supply_fprs.
This is a minor cleanup that makes supply_fprs more consistent with
how fill_fprs was written.

gdb/ChangeLog:

        * aix-thread.c (supply_fprs): Make more consistent with fill_fprs.
2012-03-13 22:29:45 +00:00
Joel Brobecker e3ebf1bb41 Fix buffer overflow in aix-thread.c:fill_fprs
gdb/
2012-03-08  Chris January  <chris.january@allinea.com>

	* aix-thread.c (fill_sprs): Store the floating point registers
	at the correct offsets into vals.
2012-03-13 22:27:12 +00:00
Doug Evans 168997566e * NEWS: Mention symbol-reloading has been deleted.
* symfile.c (symbol_reloading): Delete.
	(show_symbol_reloading): Delete.
	(_initialize_symfile): Delete set/show symbol-reloading.

	doc/
	* gdb.texinfo (Help): Change apropos example to use "alias" instead
	of "reload".
	(Symbols): Delete docs for set/show symbol-reloading.
	* gdbint.texinfo (Defining Other Architecture Features): Delete
	SYMBOL_RELOADING_DEFAULT.
	* refcard.tex: Delete reference to symbol-reloading.

	testsuite/
	* gdb.base/default.exp: Delete tests for symbol-reloading.
	* gdb.base/help.exp: Ditto.
	* gdb.base/setshow.exp: Ditto.
	* gdb.base/gdb_history: Delete references to symbol-reloading.
2012-03-13 21:02:40 +00:00
Doug Evans c5b7e1cbc5 * dwarf2read.c (load_partial_comp_unit): Defer adding cu to
read_in_chain until we have successfully read it in.
	(load_full_comp_unit): Ditto.
	(read_signatured_type): Add comment.
2012-03-13 17:16:18 +00:00
Joel Brobecker 46cb6474c3 [stabs] The address of Fortran common blocks may be > INT_MAX.
gdb/
2012-03-08  Chris January  <chris.january@allinea.com>

        * stabsread.c (fix_common_block): Change type of valu argument
        to CORE_ADDR.
2012-03-13 16:29:16 +00:00
Joel Brobecker 76219d77db [ppc/prologue] Support the "oril r29, r1, 0x0" insn.
gdb/
2012-03-13  Chris January  <chris.january@allinea.com>

	* rs6000-tdep.c (skip_prologue): Support the oril r29, r1, 0x0
	instruction.
2012-03-13 16:15:35 +00:00
Jan Kratochvil 87b0bb13cb gdb/
* common/linux-procfs.c (linux_proc_get_int): New, from
	linux_proc_get_tgid, change its LWPID type to pid_t, add parameter
	field.
	(linux_proc_get_tgid): Only call linux_proc_get_int.
	(linux_proc_get_tracerpid): New.
	(linux_proc_pid_has_state): New, from linux_proc_pid_is_zombie.
	(linux_proc_pid_is_stopped, linux_proc_pid_is_zombie): Only call
	linux_proc_pid_has_state.
	* common/linux-procfs.h (linux_proc_get_tracerpid): New declaration.
	* common/linux-ptrace.c: Include linux-procfs.h and buffer.h.
	(linux_ptrace_attach_warnings): New.
	* common/linux-ptrace.h (struct buffer, linux_ptrace_attach_warnings):
	New declaration.
	* linux-nat.c: Include exceptions.h, linux-ptrace.h and buffer.h.
	(linux_nat_attach): New variables ex, buffer, message and message_s.
	Wrap to_attach by TRY_CATCH and call linux_ptrace_attach_warnings.

gdb/gdbserver/
	* linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
	linux_ptrace_attach_warnings.

gdb/testsuite/
	* gdb.base/attach-twice.c: New files.
	* gdb.base/attach-twice.exp: New files.
2012-03-13 15:02:25 +00:00
Jan Kratochvil 5f572decf9 gdb/
* Makefile.in (linux-ptrace.o): New.
	* common/linux-procfs.c (linux_proc_pid_is_zombie): New,
	from linux-nat.c.
	* common/linux-procfs.h (linux_proc_pid_is_zombie): New declaration.
	* common/linux-ptrace.c: New file.
	* config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-ptrace.o.
	* config/arm/linux.mh: Likewise.
	* config/i386/linux.mh: Likewise.
	* config/i386/linux64.mh: Likewise.
	* config/ia64/linux.mh: Likewise.
	* config/m32r/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/mips/linux.mh: Likewise.
	* config/pa/linux.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/powerpc/ppc64-linux.mh: Likewise.
	* config/powerpc/spu-linux.mh: Likewise.
	* config/s390/s390.mh: Likewise.
	* config/sparc/linux.mh: Likewise.
	* config/sparc/linux64.mh: Likewise.
	* config/xtensa/linux.mh: Likewise.
	* linux-nat.c (linux_lwp_is_zombie): Remove, move it to
	common/linux-procfs.c.
	(wait_lwp): Rename linux_lwp_is_zombie to linux_proc_pid_is_zombie.

gdb/gdbserver/
	* Makefile.in (linux-ptrace.o): New.
	* configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
	(cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
	(m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
	(s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
	(x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
	of these targets.
	* linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
2012-03-13 15:00:37 +00:00
Pedro Alves 44f238bb63 2012-03-13 Hui Zhu <teawater@gmail.com>
Pedro Alves  <palves@redhat.com>

	* breakpoint.c (init_breakpoint_sal): New flags parameter.  Handle
	CREATE_BREAKPOINT_FLAGS_INSERTED.
	(create_breakpoint_sal, create_breakpoints_sal)
	(base_breakpoint_create_breakpoints_sal)
	(tracepoint_create_breakpoints_sal)
	(strace_marker_create_breakpoints_sal): New flags parameter.  Pass
	down.
	(break_command_1, handle_gnu_v3_exceptions, trace_command)
	(ftrace_command, strace_command): Adjust.
	(create_tracepoint_from_upload): Pass
	CREATE_BREAKPOINT_FLAGS_INSERTED.
	* breakpoint.h (enum breakpoint_create_flags): New.
	(create_breakpoint): New flags parameter.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust.
	* python/py-breakpoint.c (bppy_init): Adjust.
	* python/py-finishbreakpoint.c (bpfinishpy_init): Adjust.
	* spu-tdep.c (spu_catch_start): Adjust.
2012-03-13 13:30:42 +00:00
Pedro Alves 1e51243a97 2012-03-13 Pedro Alves <palves@redhat.com>
Hui Zhu  <teawater@gmail.com>
	    Yao Qi  <yao@codesourcery.com>

	* remote.c (struct remote_state): New field `starting_up'.
	(remote_start_remote): Set and clear it.
	(remote_can_download_tracepoint): If starting up, return false.
2012-03-13 13:25:50 +00:00
Yao Qi fa3064dd8a gdb:
* inferior.h (struct inferior): Remove fields any_syscall_count,
	syscalls_counts and total_syscalls_count.  Move them to new
	struct catch_syscall_inferior_data in breakpoint.c.
	* breakpoint.c: Call DEF_VEC_I(int).
	(struct catch_syscall_inferior_data): New.
	(get_catch_syscall_inferior_data): New.
	(catch_syscall_inferior_data_cleanup): New.
	(insert_catch_syscall): Update to access data in
	struct catch_syscall_inferior_data.
	(insert_catch_syscall): Likewise.
	(remove_catch_syscall): Likewise.
	(remove_catch_syscall): Likewise.
	(is_syscall_catchpoint_enabled): Likewise.
	(add_catch_command): Likewise.
	(_initialize_breakpoint): Register cleanup.
	* breakpoint.h: Removed DEF_VEC_I(int).
	* dwarf2loc.c: Call DEF_VEC_I(int).
	* mi/mi-main.c: Likewise.
2012-03-13 01:16:07 +00:00
gdbadmin 799f5b9672 *** empty log message *** 2012-03-13 00:00:33 +00:00
Mark Kettenis 460fac3cfa * inf-ptrace.c (inf_ptrace_post_attach): Make static. 2012-03-12 21:08:44 +00:00
Joel Brobecker e1aca11ede Add missing prototypes for build in ppx-aix.
gdb/ChangeLog:
2012-03-12  Chris January  <chris.january@allinea.com>

        * aix-thread.c (_initialize_aix_thread): Add prototype.
        * rs6000-nat.c (_initialize_rs6000_nat): Ditto.
        * xcoffsolib.c (_initialize_xcoffsolib): Ditto.
2012-03-12 15:57:19 +00:00
Joel Brobecker 649c7061d4 amd64bsd-nat.c: Move "amd64bsd-nat.h" include...
... after include of "amd64-nat.h".

gdb/ChangeLog:

        * amd64bsd-nat.c: Move #include of "amd64bsd-nat.h" after
        include of "amd64-nat.h".
2012-03-12 15:21:19 +00:00
Tom Tromey 0b49e518cd * buildsym.c (record_pending_block): Now static.
* buildsym.h: (record_pending_block): Remove.
2012-03-12 14:15:22 +00:00
Andreas Tobler fd24fa9434 2012-03-12 Andreas Tobler <andreast@fgznet.ch>
* amd64bsd-nat.c: Include amd64bsd-nat.h.
2012-03-12 05:27:21 +00:00
gdbadmin d4e7cf4522 *** empty log message *** 2012-03-12 00:00:33 +00:00
gdbadmin 25037ec96d *** empty log message *** 2012-03-11 00:00:32 +00:00
gdbadmin 40048c48ff *** empty log message *** 2012-03-10 00:00:33 +00:00
Tom Tromey ba919b5861 * dwarf2read.c (struct dwarf2_cu) <checked_producer,
producer_is_gxx_lt_4_6>: New fields.
	(producer_is_gxx_lt_4_6): Use and update producer cache fields.
2012-03-09 20:17:32 +00:00
Tom Tromey a48e046c37 * dwarf2read.c (dwarf2_attr): Avoid tail-recursive call. 2012-03-09 20:06:18 +00:00
Joel Brobecker 05b8a7895a Fix a couple of ChangeLog entries. 2012-03-09 13:44:51 +00:00
Keith Seitz 0d7941a9be * lib/gdb.exp (gdb_get_line_number): Throw an
error instead of returning -1.
	* gdb.base/break.exp: Remove unused variable
	bp_location5.
	* gdb.base/hbreak2.exp: Likewise.
	* gdb.base/sepdebug.exp: Likewise.
2012-03-09 04:38:53 +00:00
Yao Qi f4647387fe 2012-03-08 Yao Qi <yao@codesourcery.com>
Pedro Alves  <palves@redhat.com>

	Fix PR server/13392.
	* linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
	offset of JMP insn.
	* tracepoint.c (remove_tracepoint): New.
	(cmd_qtdp): Call remove_tracepoint when failed to install.

2012-03-08  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	Fix PR server/13392.
	* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Remove kfail.
	(tracepoint_change_loc_2): Remove kfail.  Return if failed to
	download tracepoints.
	* gdb.trace/pending.exp (pending_tracepoint_works): Likewise.
	(pending_tracepoint_resolved_during_trace): Likewise.
	(pending_tracepoint_installed_during_trace): Likewise.
	(pending_tracepoint_with_action_resolved): Likewise.
2012-03-09 03:47:15 +00:00
Joel Brobecker 6f5e936221 Add missing _initialize_ravenscar_sparc prototype.
This is required now that we compile GDB with -Wmissing-prototype.

gdb/ChangeLog:

        * ravenscar-sparc-thread.c (_initialize_ravenscar_sparc): Add
        prototype.
2012-03-09 00:31:15 +00:00
Joel Brobecker 8d037db936 Add missing _initialize_ravenscar prototype.
gdb/ChangeLog:

        * ravenscar-thread.c (_initialize_ravenscar): Add prototype.
2012-03-09 00:31:07 +00:00
gdbadmin 987c5a110d *** empty log message *** 2012-03-09 00:00:02 +00:00
Jan Kratochvil 4e841acf4e gdb/
Fix -Wmissing-prototypes build.
	* arm-linux-nat.c (get_thread_id): Make it static.
	* xtensa-linux-nat.c (get_thread_id): Likewise.
2012-03-08 22:54:30 +00:00
Joel Brobecker c6030312dc Make breakpoint condition detection trace conditional on remote_debug.
gdb/gdbserver/ChangeLog:

        * server.c (process_point_options): If a conditional expression
        is found, only print a message if remote_debug is nonzero.
2012-03-08 22:19:56 +00:00
Keith Seitz 83c532cb59 * gdb.ada/array_bounds.exp: Get breakpoint for line
with "START", not "STOP".
	* gdb.python/py-infthread.exp: Do not continue to
	line marked "Break here.", which is undefined.
2012-03-08 22:19:48 +00:00
Joel Brobecker 735be1a2c1 Revert "ax-gdb: Do not treat enums and bools as integers."
This patch was checked hasn't been reviewed and has been checked in
by mistake (wrong patch applied).
2012-03-08 22:19:09 +00:00
Luis Machado d6b6bbb744 2012-03-08 Luis Machado <lgustavo@codesourcery.com>
Revert:

	2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	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-08 21:09:17 +00:00
Luis Machado 52323be946 2012-03-08 Luis Machado <lgustavo@codesourcery.com>
* ax-gdb.c (gen_fetch): Fail gracefully and use error instead
	of internal error for unknown/unsupported types.
2012-03-08 21:07:25 +00:00
Joel Brobecker 4bb99ac688 ax-gdb: Do not treat enums and bools as integers.
This patch fixes a problem when using gdb + gdbserver, and trying
to break on a function when one of the (enum) parameters is equal
to a certain value, and the size of that enum is 1 byte.

    (gdb) break mixed.adb:15 if light = green
    Breakpoint 2 at 0x402d5a: file mixed.adb, line 15.
    (gdb) cont
    Continuing.
    [Inferior 1 (process 9742) exited normally]

The debugger should have stopped once when our function was call
with light set to green.

Here is what happens: Because we're using a recent GDBserver,
GDB hands off the evaluation of the condition to GDBserver, by
providing it in the Z0 packet. This is what GDB sends:

    $Z0,402d5a,1;X13,26000622100223ff1c16100219162022011327#cf

I decoded the condition as follow:

    260006    reg 6 -> push
    2210      const8 0x10 -> push
    02        add (stack now has 1 element equal to reg6 + 16)
    23ff1c    const16 0xff1c
    1610      ext 16 (sign extend 16 bits)
    02        add (stack now has 1 element equal to reg6 + 16 - 228)
    19        ref32: Pop as addr, push 32bit value at addr.
    1620      ext 32 (sign extend 32 bits)
    2201      const8 0x01
    13        equal
    27        end

The beginning of the agent expression can be explained by the address
of symbol "light":

    (gdb) info addr light
    Symbol "light" is a variable at frame base reg $rbp offset 16+-228.

However, the mistake is the "ext 32" operation (extend 32 bits),
because our variable is *not* 32bits, only 8:

    (gdb) print light'size
    $5 = 8

But the reason why GDB decides to use a 32bit extension is because
it overrides the symbol's type with a plain integer type in
ax-gdb.c:gen_usual_unary...

      /* If the value is an enum or a bool, call it an integer.  */
    case TYPE_CODE_ENUM:
    case TYPE_CODE_BOOL:
      value->type = builtin_type (exp->gdbarch)->builtin_int;
      break;

... before calling require_rvalue. And of course, that causes the
generator to generate a sizeof(int) extension of the result.

One way to fix this would be to use an integer type of the correct
size, but I do not understand why this is necessary. The two routines
that use that information to generate the opcode down the line are
gen_fetch (for a memory value), or gen_extend (for a register value).
And they both have handling of enums and bools.

So the fix we elected to implement was simply to remove that code.

gdb/ChangeLog:

        * ax-gdb.c (gen_usual_unary): Remove special handling of
        enum and bool types.
2012-03-08 20:54:36 +00:00
Jan Kratochvil 7fe25d9bd2 gdb/
Fix CU relative vs. absolute DIE offsets.
	* dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter
	offset to offset_in_cu.
	* dwarf2read.c (process_enumeration_scope): Add CU offset to
	TYPE_OFFSET.
	(dwarf2_fetch_die_location_block): Rename parameter offset to
	offset_in_cu.  New variable offset, add CU offset to OFFSET_IN_CU.

gdb/testsuite/
	Fix CU relative vs. absolute DIE offsets.
	* gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing
	one.
2012-03-08 19:37:08 +00:00
Jan Kratochvil 05e7c24434 gdb/
* libunwind-frame.c: Rename to ...
	* ia64-libunwind-tdep.c: ... here.
	* libunwind-frame.h: Rename to ...
	* ia64-libunwind-tdep.h: ... here.
	* Makefile.in (HFILES_NO_SRCDIR): Rename libunwind-frame.h to
	ia64-libunwind-tdep.h.
	(ALLDEPFILES): Rename libunwind-frame.c to ia64-libunwind-tdep.c.
	* README (--with-libunwind): Rename to ...
	(--with-libunwind-ia64): ... here, note it is ia64 specific now.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: New option --with-libunwind-ia64, make the
	AS_HELP_STRING ia64 specific.  Deprecate option --with-libunwind.
	Remove AC_DEFINE for HAVE_LIBUNWIND.
	* ia64-libunwind-tdep.c: Make the file top comment ia64 specific.
	Rename libunwind-frame.h #include to ia64-libunwind-tdep.h.
	Rename libunwind-frame in the general comment.
	* ia64-libunwind-tdep.h: Make the file top comment ia64 specific.
	Rename symbol LIBUNWIND_FRAME_H to IA64_TDEP_LIBUNWIND_FRAME_H.
	Move forward declarations inside #ifndef.  Rename libunwind-frame in
	the general comment.
	* ia64-tdep.c: Rename libunwind-frame.h #include to
	ia64-libunwind-tdep.h.
	(ia64_gdb2uw_regnum, ia64_uw2gdb_regnum, ia64_is_fpreg)
	(ia64_libunwind_descr): Rename libunwind-frame to
	ia64-libunwind-tdep in these function comments.
	* ia64-tdep.h: Rename libunwind-frame.h #include to
	ia64-libunwind-tdep.h.
	* ia64-vms-tdep.c (ia64_vms_libunwind_descr): Rename libunwind-frame to
	ia64-libunwind-tdep in that data comment.
2012-03-08 19:08:11 +00:00
Jan Kratochvil 3755cbfddc gdb/
* libunwind-frame.h (struct frame_unwind): New declaration.
2012-03-08 18:13:37 +00:00
Joel Brobecker d1cda5d939 Fix thinko in help of "set breakpoint condition-evaluation".
The 3 valid values for this setting are "auto", "host" and "target".
The help was advertising one of them to be "gdb" instead of "host".

gdb/ChangeLog:

        * breakpoint.c (_initialize_breakpoint): Fix error in help of
        "set breakpoint condition-evaluation" command.
2012-03-08 16:50:21 +00:00
Tristan Gingold a0ba0aa22f gdb/
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* sparc-stub.c: Move to stubs/
	* sh-stub.c: Likewise.
	* m68k-stub.c: Likewise.
	* m32r-stub.c: Likewise.
	* i386-stub.c: Likewise.

gdb/stubs/
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* sparc-stub.c: Move from ..
	* sh-stub.c: Likewise.
	* m68k-stub.c: Likewise.
	* m32r-stub.c: Likewise.
	* i386-stub.c: Likewise.
2012-03-08 14:43:24 +00:00
Andreas Schwab 007cafee35 * m68klinux-tdep.c (m68k_linux_init_abi): Register
linux_get_siginfo_type.
2012-03-08 13:37:26 +00:00
Andreas Schwab 7b8b6d6d0d * m68klinux-nat.c: Include "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
2012-03-08 13:35:41 +00:00
Yao Qi bba74b36f0 gdb/
* remote.c (remote_get_noisy_reply): Replace `sprintf' with
	`xsnprintf'.
	(remote_query_attached): Likewise.
	(remote_static_tracepoint_marker_at): Likewise.
	(remote_set_permissions): Likewise.
	(remote_detach_1, extended_remote_attach_1): Likewise.
	(send_g_packet, remote_vkill): Likewise.
	(extended_remote_disable_randomization): Likewise.
	(remote_add_target_side_condition): Likewise.
	(remote_insert_breakpoint): Likewise.
	(remote_remove_breakpoint): Likewise.
	(remote_insert_watchpoint): Likewise.
	(remote_remove_watchpoint): Likewise.
	(remote_insert_hw_breakpoint): Likewise.
	(remote_insert_hw_breakpoint): Likewise.
	(remote_remove_hw_breakpoint): Likewise.
	(remote_download_command_source): Likewise.
	(remote_download_tracepoint): Likewise.
	(remote_download_trace_state_variable): Likewise.
	(remote_disable_tracepoint): Likewise.
	(remote_trace_set_readonly_regions): Likewise.
	(remote_get_tracepoint_status): Likewise.
	(remote_trace_find): Likewise.
	(remote_get_trace_state_variable_value): Likewise.
	(remote_set_disconnected_tracing): Likewise.
	(remote_set_circular_trace_buffer): Likewise.
	(remote_get_min_fast_tracepoint_insn_len): Likewise.
	(remote_use_agent): Likewise.
	(remote_add_target_side_condition): Add one parameter BUF_SIZE.
	Update callers.
2012-03-08 12:49:15 +00:00
Jan Kratochvil 51898c1516 gdb/testsuite/
Fix false FAIL on distros with relro linkage as default.
	* gdb.reverse/solib-precsave.exp: Try to compile the test using
	-Wl,-z,norelro first.
2012-03-08 07:42:51 +00:00
gdbadmin af112affbd *** empty log message *** 2012-03-08 00:00:03 +00:00
Pedro Alves 9b224c5e1a 2012-03-07 Pedro Alves <palves@redhat.com>
gdb/doc/
	* gdb.texinfo (General Query Packets): Document new
	QProgramSignals packet.
	* gdb.texinfo (Remote configuration): Mention
	"program-signals-packet".

	gdb/gdbserver/
	* linux-low.c (get_detach_signal): New.
	(linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
	Pass on pending signals to PTRACE_DETACH.  Check the result of the
	ptrace call.
	* server.c (program_signals, program_signals_p): New.
	(handle_general_set): Handle QProgramSignals.
	* server.h (program_signals, program_signals_p): Declare.

	gdb/
	* NEWS: Mention QProgramSignals.
	* inferior.h (update_signals_program_target): Declare.
	* infrun.c: (update_signals_program_target): New.
	(handle_command): Update the target of the new program signals
	array changes.
	* remote.c (PACKET_QProgramSignals): New enum.
	(last_program_signals_packet): New global.
	(remote_program_signals): New.
	(remote_start_remote): Update the target with the program signals
	list.
	(remote_protocol_features): Add entry for QPassSignals.
	(remote_open_1): Free anc clear last_program_signals_packet.
	(init_remote_ops): Install remote_program_signals.
	* target.c (update_current_target): Adjust.
	(target_program_signals): New.
	* target.h (struct target_ops) <to_program_signals>: New field.
	(target_program_signals): Declare.
2012-03-07 19:25:39 +00:00
Pedro Alves 74c48cbbff 2012-03-07 Pedro Alves <palves@redhat.com>
* NEWS: Add subtitle for new z0/z1 conditional breakpoint
	extensions.
2012-03-07 19:17:36 +00:00
Andreas Schwab 0c13fc49f4 * m68klinux-nat.c (getregs_supplies): Make static.
(getfpregs_supplies): Likewise.
(have_ptrace_getregs): Likewise.
2012-03-07 16:34:39 +00:00
gdbadmin 519429e1d6 *** empty log message *** 2012-03-07 00:00:03 +00:00
Joel Brobecker 1281d2a30a Pass absolute die offset in call to get_die_type_at_offset
gdb/ChangeLog:

        * dwarf2read.c (dwarf2_get_die_type): Pass absolute offset
        in call to get_die_type_at_offset.
2012-03-06 23:41:50 +00:00
Stan Shebs 2b03b41d6a * mi/mi-cmd-break.c: Enforce coding standards, fix comments.
* mi/mi-cmd-disas.c: Ditto.
	* mi/mi-cmd-env.c: Ditto.
	* mi/mi-cmd-file.c: Ditto.
	* mi/mi-cmd-stack.c: Ditto.
	* mi/mi-cmd-target.c: Ditto.
	* mi/mi-cmd-var.c: Ditto.
	* mi/mi-cmds.c: Ditto.
	* mi/mi-cmds.h: Ditto.
	* mi/mi-console.c: Ditto.
	* mi/mi-getopt.c: Ditto.
	* mi/mi-getopt.h: Ditto.
	* mi/mi-interp.c: Ditto.
	* mi/mi-main.c: Ditto.
	* mi/mi-out.c: Ditto.
	* mi/mi-parse.c: Ditto.
	* mi/mi-parse.h: Ditto.
	* mi/mi-symbol-cmds.c: Ditto.

	* mi/mi-getopt.h: Move mi_opt struct up.
	* mi/mi-main.c (captured_mi_execute_command): Remove redundant
	return.
	* mi/mi-out.c (_initialize_mi_out): Remove empty initialize.
2012-03-06 22:48:53 +00:00
Tom Tromey c988ad8730 * proc-service.c (ps_pglobal_lookup): Set the current program
space.
2012-03-06 19:51:10 +00:00
Joel Brobecker 8131799e80 New Ada testcase (bp_on_var.exp).
gdb/testsuite/ChangeLog:

	* gdb.ada/bp_on_var: New testcase.
2012-03-06 17:33:32 +00:00
Pedro Alves 1b7c1b10aa 2012-03-06 Pedro Alves <palves@redhat.com>
* gregset.h [HAVE_SYS_PROCFS_H]: Include <sys/procfs.h>.
2012-03-06 17:17:16 +00:00
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
gdbadmin 39aaa5247b *** empty log message *** 2012-03-06 00:00:02 +00:00
Joel Brobecker 3c1820694f Add Maciej W. Rozycki as mips maintainer.
gdb/ChangeLog:

        * MAINTAINERS: List Maciej W. Rozycki as the mips maintainer.
2012-03-05 23:21:36 +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
Jan Kratochvil 2e7941949d gdb/
Code cleanup.
	* common/linux-osdata.c (linux_common_core_of_thread): New function
	comment.
	* linux-nat.c (linux_nat_wait_1): Replace linux_nat_core_of_thread_1
	call by linux_common_core_of_thread.
	(linux_nat_core_of_thread_1): Remove.
	* linux-nat.h (linux_nat_core_of_thread_1): Remove declaration.
	* linux-thread-db.c: Include linux-osdata.h.
	(update_thread_core): Replace linux_nat_core_of_thread_1 call by
	linux_common_core_of_thread.
2012-03-05 21:07:46 +00:00
Tom Tromey 9f9f1f31e7 * value.c (value_primitive_field): Don't fetch contents for
non-virtual bases.
2012-03-05 20:53:15 +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
Joel Brobecker 5538f557d1 Include "gregset.h" in s390-nat.c (-Wmissing-prototypes).
gdb/ChangeLog:

        * s390-nat.c: Include "gregset.h".
2012-03-05 19:05:09 +00:00
Jan Kratochvil 75528772a7 gdb/
* libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
	[!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
	(libunwind_load): New variable so_error, use it for dlerror.  Try to
	load also LIBUNWIND_SO_7.
2012-03-05 17:11:48 +00:00
Jan Kratochvil e237a7e2c5 gdb/gdbserver/
* linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
	New comment why.
2012-03-05 17:09:37 +00:00
Pedro Alves 275418ae46 2012-03-05 Pedro Alves <palves@redhat.com>
* i387-tdep.c (i387_supply_xsave): Assert the xsave section buffer
	is not NULL, and remove resulting dead code.
2012-03-05 16:17:52 +00:00
Thomas Schwinge 5cbb98123c * sh-tdep.c (sh_skip_prologue): Provide an upper limit on the function
prologue to sh_analyze_prologue.
	(sh_analyze_prologue): Make better use of such an upper limit, and
	generally be more cautious about accessing memory.
2012-03-05 15:16:39 +00:00
Tom Tromey 541515ad26 * ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Rename from
_initialize_ia64_hpux_tdep.
2012-03-05 14:53:56 +00:00
Pedro Alves 24490249f8 Mention PR gdb/13766 2012-03-05 14:24:03 +00:00
Pedro Alves b4d36fb80a 2012-03-05 Pedro Alves <palves@redhat.com>
* i387-tdep.c (i387_supply_xsave): If we have an xsave buffer, and
	the register state is clear, supply explicit zero, instead of
	marking the register unavailable.
2012-03-05 14:21:46 +00:00
Tristan Gingold 60c9a3c0e3 2012-03-05 Tristan Gingold <gingold@adacore.com>
* NEWS: Mention OpenVMS ia64 new target.
2012-03-05 11:46:35 +00:00
Tristan Gingold 5ab2f44149 2012-03-05 Tristan Gingold <gingold@adacore.com>
* buildvms.com: New file.
	* ia64vms-stub.c: New file.
2012-03-05 11:44:19 +00:00
Tristan Gingold 696759ad10 2012-03-05 Tristan Gingold <gingold@adacore.com>
* ia64-tdep.h: Include libunwind-frame.h and libunwind-ia64.h.
	(ia64_unw_accessors, ia64_unw_rse_accessors)
	(ia64_libunwind_descr): Declare.
	* ia64-vms-tdep.c: New file.
	* ia64-tdep.c (ia64_unw_accessors, ia64_unw_rse_accessors)
	(ia64_libunwind_descr): Make them public.
	* configure.tgt: Add ia64-*-*vms*.
	* Makefile.in (ALL_64_TARGET_OBS): Add ia64-vms-tdep.o
	(ALLDEPFILES): Add ia64-vms-tdep.c
2012-03-05 11:41:51 +00:00
Tristan Gingold 169081d053 2012-03-05 Tristan Gingold <gingold@adacore.com>
* target.h (target_object): Add TARGET_OBJECT_OPENVMS_UIB.
	* remote.c (PACKET_qXfer_uib): New enum value.
	(remote_protocol_features): Add entry for PACKET_qXfer_uib.
	(remote_xfer_partial): Handle TARGET_OBJECT_OPENVMS_UIB.
	(_initialize_remote): Call add_packet_config_cmd for
	xfer:uib packet.

doc/
2012-03-05  Tristan Gingold  <gingold@adacore.com>

	* gdb.texinfo (General Query Packets): Document xfer:uib:read.
2012-03-05 11:37:33 +00:00
Tristan Gingold 34864976a8 2012-03-05 Tristan Gingold <gingold@adacore.com>
* osabi.c (gdb_osabi_names): Add OpenVMS.
        (generic_elf_osabi_sniffer): Likewise.
        * defs.h (gdb_osabi): Add GDB_OSABI_OPENVMS.
2012-03-05 11:33:36 +00:00
gdbadmin 5fb95a7f61 *** empty log message *** 2012-03-05 00:00:32 +00:00
Jan Kratochvil 6597b100b5 gdb/
Removed unused code.
	* libunwind-frame.c (libunwind_frame_unwind)
	(libunwind_frame_base_address): Remove.
	* libunwind-frame.h (libunwind_frame_base_address): Remove declaration.
2012-03-04 19:22:47 +00:00
Yao Qi 87399aa1a1 gdb/
* common/agent.c (gdb_connect_sync_socket): Add _ markup and
	remove trailing new line.
	(agent_run_command, agent_run_command): Add _ markup.
	(agent_capability_check): Likewise.
2012-03-04 03:31:09 +00:00
Yao Qi 89b7509a3f Fix indent of changelog entries. 2012-03-04 03:11:03 +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
gdbadmin 09ddfdd717 *** empty log message *** 2012-03-04 00:00:03 +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
Yao Qi 58b4daa56a gdb:
* common/agent.c (agent_loaded_p): New.
        (agent_look_up_symbols): New global.
        * common/agent.h: Declare agent_loaded_p.

gdb/gdbserver:

        * Makefile.in (linux-low.o): Keep dependence on agent.h.
        (linux-x86-low.o): Likewise.
        * server.h: Remove in_process_agent_loaded.
        * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
        common/agent.c.
        Update callers.
2012-03-03 04:34:52 +00:00
Yao Qi 8ffcbaaf40 gdb:
* common/agent.c (struct ipa_sym_addresses) <addr_capability>: New.
	(agent_capability_check, agent_capability_invalidate): New.
	(symbol_list): New array element.
	* common/agent.h (enum agent_capa): New.
	* target.c (target_pre_inferior): Call agent_capability_invalidate.

gdb/gdbserver:
	* tracepoint.c (gdb_agent_capability): New global.
	(in_process_agent_loaded_ust): Renamed to
	`in_process_agent_supports_ust'.
	Update callers.
	(in_process_agent_supports_ust): Call agent_capability_check.
	(clear_installed_tracepoints): Assert that agent supports
	agent.
2012-03-03 04:04:35 +00:00
Yao Qi d1feda864e gdb:
* target.h (struct target_ops) <to_use_agent>: New field.
	(struct target_ops) <to_can_use_agent>: New field.
	(target_use_agent, target_can_use_agent): New macro.
	* target.c (update_current_target): Update.
	* remote.c: New enum `PACKET_QAgent'.
	(remote_protocol_features): Add a new element.
	(remote_use_agent, remote_can_use_agent): New.
	(init_remote_ops): Initialize field `can_use_agent' with
	remote_can_use_agent.  Intiailize field `use_agent' with
	remote_use_agent.
	* common/agent.c (use_agent): New global.
	* common/agent.h: Declare it.
	* tracepoint.c (info_static_tracepoint_markers_command): Add
	comment.
	* Makefile.in (SFILES): Add common/agent.c and agent.c.
	(COMMON_OBS): Add common/agent.o and agent.o
	(common-agent.o): New rule.
	* agent.c: New.

gdb/doc:
	* gdb.texinfo (In-Process Agent): New node.
	Document new commands.
	(General Query Packets): Add packet `QAgent'.

gdb/gdbserver:
	* linux-low.c (linux_supports_agent): New.
	(linux_target_ops): Initialize field `supports_agent' with
	linux_supports_agent.
	* target.h (struct target_ops) <supports_agent>: New.
	(target_supports_agent): New macro.
	* server.c (handle_general_set): Handle packet 'QAgent'.
	(handle_query): Send `QAgent+'.
	* Makefile.in (server.o): Depends on agent.h.
2012-03-03 03:32:46 +00:00
Yao Qi 2fa291aca4 gdb:
* common/agent.c: New.
	* common/agent.h: New.
	* configure.ac: Add `sys/socket.h' and `sys/un.h' to
	AC_CHECK_HEADERS.
	* configure, configh.in: Regenerated.

gdb/gdbserver:

	* Makefile.in (OBS): Add agent.o.
	Add new rule for agent.o.
	Track dependence of tracepoint.c on agent.h.
	* tracepoint.c (run_inferior_command_1):
	(run_inferior_command): Call agent_run_command.
	(gdb_ust_connect_sync_socket): Deleted.  Move it to
	common/agent.c.
	(resume_thread, stop_thread): Likewise.
	(gdb_ust_socket_init): Renamed to ...
	(gdb_agent_socket_init): ... New.
	(gdb_ust_thread): Renamed to ...
	(gdb_agent_helper_thread): ... New.
	(gdb_ust_init): Move some code to ...
	(gdb_agent_init): ... here.  New.
	[HAVE_UST]: Call gdb_ust_init.
	(initialize_tracepoint_ftlib):  Call gdb_agent_init.
	* configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
	* config.in, configure: Regenerated.
2012-03-03 03:08:36 +00:00
Kevin Buettner 9fc0568578 * sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register
unless it exists for this architecture.
2012-03-03 01:27:47 +00:00
gdbadmin 636b802b4e *** empty log message *** 2012-03-03 00:00:33 +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
Joel Brobecker a5ee536be2 language-specific read_var_value for Ada renamings
The purpose of this patch is to better support renamings in the
"info locals" command. Consider ...

    procedure Foo is
       GV : Integer renames Pck.Global_Variable;
    begin
       Increment (GV); -- STOP
    end Foo;

... Pck.Global_Variable is just an integer. After having stopped at
the "STOP" line, "info locals" yields:

    (gdb) info locals
    gv = <error reading variable gv (Cannot access memory at address 0xffffffffffffffff)>

In reality, two things are happening:

   (1) Variable "GV" does not exist, which is normal, since there is
       "GV" the renaming of another variable;

   (2) But to allow the user access to that renaming the same way
       the code has, the compiler produces an artificial variable
       whose name encodes the renaming:

        gv___XR_pck__global_variable___XE

       For practical reasons, the artificial variable itself is given
       irrelevant types and addresses.

But the "info locals" command does not act as if it was a short-cut
of "foreach VAR in locals, print VAR". Instead it gets the value of
each VAR directly, which does not work in this case, since the variable
is artificial and needs to be decoded first.

This patch makes the "read_var_value" routine language-specific.
The old implementation of "read_var_value" gets renamed to
"default_read_var_value" and all languages now use it (unchanged
behavior), except for Ada. In Ada, the new function ada_read_var_value
checks if we have a renaming, and if so, evaluates its value, or else
defers to default_read_var_value.

gdb/ChangeLog:

        * language.h (struct language_defn): New "method" la_read_var_value.
        * findvar.c: #include "language.h".
        (default_read_var_value): Renames read_var_value.  Rewrite
        function description.
        (read_var_value): New function.
        * value.h (default_read_var_value): Add prototype.
        * ada-lang.c (ada_read_renaming_var_value, ada_read_var_value):
        New functions.
        (ada_language_defn): Add entry for la_read_var_value.
        * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, language.c,
        * m2-lang.c, objc-lang.c, opencl-lang.c, p-lang.c: Update
        language_defn structures to add entry for new la_read_var_value
        field.
2012-03-02 19:29:01 +00:00
Pedro Alves f59f708a4b 2012-03-02 Tom Tromey <tromey@redhat.com>
Pedro Alves  <palves@redhat.com>

	PR breakpoints/13776:
	* breakpoint.c (breakpoint_init_inferior): Delete step-resume
	breakpoints.
	(delete_longjmp_breakpoint_at_next_stop): New.
	* breakpoint.h (delete_longjmp_breakpoint_at_next_stop): Declare.
	* target.c (generic_mourn_inferior): Call mark_breakpoints_out
	before deleting the inferior.  Add comments.
	* thread.c (clear_thread_inferior_resources): Don't delete lonjmp
	breakpoints immediately, but only on next stop.  Move that code
	next to where we mark other breakpoints for deletion.
2012-03-02 19:26:10 +00:00
Joel Brobecker 44099a67be Fix ARI violations in mips-linux-nat.c and mips-tdep.c
gdb/ChangeLog:

        * mips-linux-nat.c (mips_linux_read_description): Add missing i18n
        marker.
        * mips-tdep.c (mips_linux_reg_names): Improve comment to avoid ARI
        violation.
2012-03-02 19:14:30 +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
Pedro Alves 2a2ef594da 2012-03-02 Pedro Alves <palves@redhat.com>
* linux-thread-db.c (attach_thread): Avoid in_thread_list call.
2012-03-02 16:54:59 +00:00
Pedro Alves 0504465367 2012-03-02 Pedro Alves <palves@redhat.com>
* inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
	* linux-low.c (struct simple_pid_list): New.
	(stopped_pids): New a struct simple_pid_list pointer.
	(add_to_pid_list, pull_pid_from_list): New.
	(handle_extended_wait): Don't assume the first signal new children
	report is SIGSTOP.  Adjust call to pull_pid_from_list.
	(linux_wait_for_lwp): Adjust.
2012-03-02 16:23:42 +00:00
Ulrich Weigand b261e0c536 Fix -Wmissing-prototypes build.
* ppc-linux-nat.c (ppc_linux_get_hwcap): Make static.
	* remote-sim.c (gdbsim_has_all_memory): Likewise.
	(gdbsim_has_memory): Likewise.
2012-03-02 13:38:39 +00:00
Yao Qi a95babbf38 gdb/
Fix -Wmissing-prototypes build.
	* charset.c (phony_iconv_open): Make static.
	(phony_iconv_close, phony_iconv): Likewise.
	* i386-linux-nat.c (_initialize_i386_linux_nat): New prototype.
	* i386-windows-nat.c (_initialize_i386_windows_nat): New
	prototype.
	* mingw-hdep.c (_initialize_mingw_hdep): New prototype.
	* ser-mingw.c (create_select_thread): Make static.
	* windows-termcap.c (tgetent): New prototype.
	(tgetnum, tgetflag, tgetstr, tputs, tgoto): Likewise.
2012-03-02 12:56:50 +00:00
Jan Kratochvil d603d4b3da gdb/
Fix -Wmissing-prototypes build.
	* windows-nat.c (dll_symbol_command, ctrl_c_handler): Make them static.
	(_initialize_windows_nat, _initialize_check_for_gdb_ini)
	(_initialize_loadable): New prototypes.
2012-03-02 05:38:51 +00:00
Doug Evans 7fb3ad1f9f * dwarf2read.c (load_full_comp_unit): Remove unnecessary reading of
abbrev table, read_comp_unit will do it.
2012-03-02 01:55:15 +00:00
Yao Qi 8d00225bba gdb/gdbserver:
* tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
	debug log.
2012-03-02 00:18:51 +00:00
Yao Qi 19560ba53e gdb/gdbserver:
* tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
	`stop_pc' and `tpoint'.  Update caller.
2012-03-02 00:12:47 +00:00
Jan Kratochvil 693be288fc gdb/
Fix -Wmissing-prototypes build.
	* alpha-tdep.c (alpha_deal_with_atomic_sequence): Make it static.
	* amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): New prototype.
	* amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Likewise.
	* arm-symbian-tdep.c (arm_symbian_skip_trampoline_code): Make it static.
	(_initialize_arm_symbian_tdep): New prototype.
	* arm-wince-tdep.c (arm_wince_skip_main_prologue): Make it static.
	* i386-darwin-tdep.c (_initialize_i386_darwin_tdep): New prototype.
	* i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Make it
	static.
	* lm32-tdep.c (_initialize_lm32_tdep): New prototype.
	* microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): New
	prototype.
	* microblaze-tdep.c (microblaze_debug, microblaze_fetch_instruction)
	(microblaze_skip_prologue, microblaze_frame_cache): Make them static.
	* mips-linux-tdep.c (mips_linux_regset_from_core_section): Make it
	static.
	* moxie-tdep.c (moxie_process_record): Likewise.
	* remote-mips.c (mips_can_use_watchpoint, mips_insert_watchpoint)
	(mips_remove_watchpoint, mips_stopped_by_watchpoint): Make them static.
	* rl78-tdep.c (rl78_breakpoint_from_pc): Make it static.
	(_initialize_rl78_tdep): New prototype.
	* rx-tdep.c (rx_breakpoint_from_pc): Make it static.
	(_initialize_rx_tdep): New prototype.
	* solib-darwin.c (darwin_in_dynsym_resolve_code): Make it static.
	(_initialize_darwin_solib): New prototype.
	* solib-spu.c: Include solib-spu.h.
	(_initialize_spu_solib): New prototype.
	* spu-multiarch.c (_initialize_spu_multiarch): New prototype.
	* tic6x-tdep.c (tic6x_analyze_prologue, tic6x_skip_prologue)
	(tic6x_breakpoint_from_pc, tic6x_frame_unwind_cache)
	(tic6x_software_single_step): Make it static.
	(_initialize_tic6x_tdep): New prototype.
2012-03-02 00:06:13 +00:00
Jan Kratochvil 638234e578 gdb/
Fix -Wmissing-prototypes build.
	* cris-tdep.c (cris_can_use_hardware_watchpoint)
	(cris_region_ok_for_watchpoint, cris_stopped_data_address): Remove.
2012-03-02 00:01:24 +00:00
gdbadmin ff87ee0b35 *** empty log message *** 2012-03-02 00:00:32 +00:00
Jan Kratochvil f4a6f16df0 gdb/
Fix -Wmissing-prototypes build.
	* frv-tdep.c (frv_check_watch_resources, frv_stopped_data_address)
	(frv_have_stopped_data_address): Remove.
2012-03-01 23:58:48 +00:00
Jan Kratochvil 04dcf5fa36 gdb/
Fix -Wmissing-prototypes build.
	* Makefile.in (HFILES_NO_SRCDIR): Add sh64-tdep.h.
	* sh-tdep.c: Include sh64-tdep.h.
	* sh-tdep.h (sh64_gdbarch_init, sh64_show_regs): Remove declarations.
	* sh64-tdep.c: Include sh64-tdep.h.
	* sh64-tdep.h: New file.
2012-03-01 23:55:40 +00:00
Maciej W. Rozycki 1908093124 * mips-tdep.c (mips32_scan_prologue): Correct indentation. 2012-03-01 23:35:46 +00:00
Maciej W. Rozycki 9aac7884c5 * mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
sp_regnum once the gdbarch_init_osabi hook has been called.
2012-03-01 22:52:03 +00:00