Commit Graph

26490 Commits

Author SHA1 Message Date
Pierre Muller 9e69f3b65a * Remove unwanted space in set_length_in_type_chain parameterdeclaration 2010-04-22 12:34:24 +00:00
Pierre Muller 621791b854 PR stabs/11479.
* stabsread.c (set_length_in_type_chain): New function.
	(read_struct_type): Call set_length_in_type_chain function.
	(read_enum_type): Idem.
2010-04-22 12:30:55 +00:00
Stan Shebs 105c2d85f7 2010-04-21 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* tracepoint.c (trace_save): Open in binary mode.
2010-04-22 04:14:15 +00:00
Stan Shebs 5a9351aeae 2010-04-21 Stan Shebs <stan@codesourcery.com>
* gdb.texinfo (Tracepoint Actions): Mention synonymy of actions
 	and commands.
	(Listing Tracepoints): Update to reflect current behavior.
2010-04-22 04:09:25 +00:00
gdbadmin cbc085687d *** empty log message *** 2010-04-22 00:00:35 +00:00
Pierre Muller 9a22f0d0ae gdb ChangeLog
* gdbtypes.h (builtin_type): Add builtin_char16 and builtin_char32
	fields.
	* gdbtypes.c (gdbtypes_post_init): Set builtin_char16 and
	builtin_char32 fields.
	* printcmd.c (decode_format): Set char size to '\0'
	for strings unless explicit size is given.
	(print_formatted): Correct calculation of NEXT_ADDRESS
	for 16 or 32 bit strings.
	(do_examine): Do not force byte size for strings.
	Use builtin_char16 and builtin_char32 types to display
	16 or 32 bit-wide strings.
	(x_command): Set LAST_SIZE to 'b' for string type.

gdb/doc ChangeLog

      * gdb.texinfo (Examining memory): Update for
	change in string display with explicit size.

gdb/testsuite ChangeLog

	* gdb.base/charset.c (Strin16, String32): New variables.
	* gdb.base/charset.exp (gdb_test): Test correct display
	of 16 or 32 bit strings.
2010-04-21 23:21:04 +00:00
H.J. Lu 32d7376d07 Reformat. 2010-04-21 20:23:03 +00:00
H.J. Lu f335d1b395 Properly read i386 coredump.
2010-04-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR corefiles/11523
	* amd64-linux-tdep.c (amd64_linux_core_read_description): Check
	XCR0 first.

	* i386-linux-tdep.c (i386_linux_core_read_xcr0): Return 0 if
	there is no .reg-xstate section.
	(i386_linux_core_read_description): Check XCR0 first.
2010-04-21 20:22:20 +00:00
Mike Frysinger a9789a6b9d gdb: workaround sparc memcpy fortify error
Building on an x86_64-linux system with --enable-targets=all fails on the
sparc code with a fortify error:

cc1: warnings being treated as errors
In file included from /usr/include/string.h:640,
                 from gnulib/string.h:23,
                 from ../../gdb/gdb_string.h:25,
                 from ../../gdb/vec.h:25,
                 from ../../gdb/memattr.h:24,
                 from ../../gdb/target.h:60,
                 from ../../gdb/exec.h:23,
                 from ../../gdb/gdbcore.h:31,
                 from ../../gdb/sparc-tdep.c:29:
In function 'memcpy',
    inlined from 'sparc32_store_return_value' at ../../gdb/sparc-tdep.c:1112,
    inlined from 'sparc32_return_value' at ../../gdb/sparc-tdep.c:1170:
/usr/include/bits/string3.h:52: error: call to __builtin___memcpy_chk will
        always overflow destination buffer
make: *** [sparc-tdep.o] Error 1

This is due to the gcc optimizer bug PR37060, so tweak the gdb_assert ()
to avoid the issue.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-21 20:13:41 +00:00
Chris Moller 0b66f31738 PR 9167
* cp-valprint.c (cp_print_value_fields): Replaced obstack_base()
method of popping recursion-detection stack with a method based on
obstack_object_size().
* gdb.cp/Makefile.in (EXECUTABLES): Added pr9167.
* gdb.cp/pr9167.cc: New file.
* gdb.cp/pr9167.exp: New file.
2010-04-21 17:33:54 +00:00
Aleksandar Ristovski a8ae7dc0fb * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
* nto-x86-low.c: Include server.h
2010-04-21 13:42:56 +00:00
Pierre Muller 6e354e5ec2 gdb ChangeLog
PR pascal/11492.
	* p-valprint.c (pascal_val_print): Fix default printing of integer
	arrays.

gdb/testsuite ChangeLog
	PR pascal/11492.
	* gdb.pascal/gdb11492.pas: New file.
	* gdb.pascal/gdb11492.exp: New file.
2010-04-21 09:54:59 +00:00
Pierre Muller 57174f3173 Fix compilation warning on gcc-4.1.2.
* rs6000-aix-tdep.c (rs6000_convert_from_func_ptr_addr): Initialize
	local variable`pc' to zero.
2010-04-21 08:44:51 +00:00
Doug Evans efbae210a7 * gdb.base/source-test.gdb: New file.
Remove duplicate entry.
2010-04-21 03:27:35 +00:00
gdbadmin a906e07362 *** empty log message *** 2010-04-21 00:00:34 +00:00
Joel Brobecker 6fbc7cd8d3 Implement thread support with core files on alpha-tru64
Thread support currently does not work with core files.  Note that,
in order to thread support to work on tru64, one need to allow GDB
to write in the core file (this is because the thread debug library
needs to write).

An obvious visible symptom of the problem is that "info threads" does
not list the various threads:

    (gdb) info threads
    * 1 <main task>  0x000003ff805c0918 in __nxm_thread_kill ()
       from /usr/shlib/libpthread.so

One other noticeable consequence is that GDB generates some warnings
when using "info tasks":

    (gdb) info tasks
    warning: Could not find thread id from THREAD = 0x3ffc01b6000

    warning: Could not find thread id from THREAD = 0x20000e2b4c0

      ID       TID P-ID Pri State                  Name
    *  1 140051000    0  30 Runnable               main_task
    *  2 14005c000    1  30 Accept or Select Term  my_t

(notice also how both tasks are marked as being the active task,
which cannot be true).

The problem is that the dec-thread module has not updated its thread list
after the core file got loaded.  In fact, the list only gets resync'ed
at the end of each target-wait.  The solution was to implement the
find_new_threads target_ops method.

gdb/ChangeLog:

        Implement thread support with core files on alpha-tru64.
        * dec-thread.c (dec_thread_find_new_threads): New function,
        extracted from resync_thread_list.
        (resync_thread_list): Add OPS parameter.  Replace extracted-out
        code by call to dec_thread_find_new_threads.
        (dec_thread_wait): Update call to resync_thread_list.
        (init_dec_thread_ops): Set dec_thread_ops.to_find_new_threads.
2010-04-20 23:14:12 +00:00
Joel Brobecker 1667e6e349 Add missing directory name in last ChangeLog entry. 2010-04-20 22:51:24 +00:00
Joel Brobecker 438c98a1ed [AVR] inferior call of subprogram with pointer as argument
On AVR, the gdb view of an address is different from the machine view of the
same address.  We need to use special machinery implemented by value_pointer
to take the pointer of a value.

For instance, considering the following function...

  procedure Trace (Unit    : T; Message : String);

... where T is an access Integer (a pointer to an integer), call to this
function currently triggers the following warnings:

    (gdb) call debug.trace (me, "You")
    warning: Value does not fit in 16 bits.
    warning: Value does not fit in 16 bits.
    Tracing message: You

It could have been worse if Trace actually tried to dereference the Unit
argument...

gdb/ChangeLog (from Tristan Gingold):

	* ada-lang.c (value_pointer): New function.
	(make_array_descriptor): Call value_pointer to convert addresses to
	pointers.

Tested on avr and x86_64-linux.
2010-04-20 22:40:36 +00:00
Joel Brobecker 2971b56ba6 [AIX] Memory error while checking if pointer is descriptor.
A long time ago (Oct 2009), I noticed a problem on AIX, where something
failed with an error while the debugger was checking whether an address
was a descriptor or not.  Unfortunately, like an idiot, I forgot to write
notes about the scenario where the problem occured - I am usually pretty
meticulous about that because my memory of these things is really bad.
I hope you'll forgive me for not providing a solid testcase - if it's
any consolation, I've searched for a long time before giving up :-(.

Based on the testsuite reports that I have, I think that this happened
while inserting a breakpoint, as follow:

    (gdb) break x
    Cannot access memory at address 0x200093b4

What happened is that rs6000_convert_from_func_ptr_addr tried to read
the memory at the given address, and fail because of an exception.
It seems pretty clear that, if the address was in fact a descriptor,
GDB would have been able to read the target memory region.

So this patch protects the memory-read against exceptions, and treats
such exceptions as an indication that our address is not a descriptor.

gdb/ChangeLog:

        * rs6000-aix-tdep.c: #include exceptions.h.
        (rs6000_convert_from_func_ptr_addr): If an exception is thrown
        while reading the memory at ADDR, then ADDR cannot be a function
        descriptor.
2010-04-20 22:38:54 +00:00
Joel Brobecker be9425454f "unsupported language" error in info types when using Ada.
This implements a rudimentary version of the la_print_typedef method
for Ada.  Ada usually does not use typedefs, but there is one exception:
pointers to unconstrained arrays.  Without this patch, we sometimes
get an error in the "info types" output:

    (gdb) info types new_integer_type
    All types matching regular expression "new_integer_type":

    File foo.adb:
    Language not supported.

For now, we treat the typedef as if it did not exist - using the
underlying type instead.  This is the right thing to do for most cases,
the only exception being access to array types.  Since we already have
a general issue in handling these pointers (we confuse them with fat
pointers), we will enhance ada_print_typedef to handle these pointers
at the same time we address the general issue.

gdb/ChangeLog:

        * ada-typeprint.c (ada_print_typedef): New function.
        * ada-lang.h (ada_print_typedef): Add declaration.
        * ada-lang.c (ada_language_defn): set la_print_typdef field
        to ada_print_typedef.

gdb/testsuite/ChangeLog:

        * info_types.c, info_types.exp: New files.

Tested on x86_64-linux.
2010-04-20 22:38:02 +00:00
Joel Brobecker 1ca8fce046 Unused function in procfs.c on alpha-tru64.
The procfs_address_to_host_pointer function was not used outside of
alpha-tru64, and thus was triggering a compiler warning.  Adjusted
accordingly.

gdb/ChangeLog:

        * procfs.c (procfs_address_to_host_pointer): Only define when used.
2010-04-20 22:36:35 +00:00
Joel Brobecker e9ef4f394d procfs.c: iterate_over_mappings callback has wrong profile.
The function proc_find_memory_regions calls iterate_over_mappings as
follow:

> return iterate_over_mappings (pi, func, data,
>                               find_memory_regions_callback);

The problem is that both func and find_memory_regions_callback
do not match the profile expected by iterate_over_mappings:

> iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
>                        int (*func) (struct prmap *map,
>                                     int (*child_func) (),
>                                     void *data))

We cannot change proc_find_memory_regions such that FUNC is a pointer
to a function that takes no argument (in place of the 6 that it has).
This is because proc_find_memory_regions is used as a target_ops method.
However, it turns out that changing iterate_over_mappings to conform
to the profile imposed by the target_ops vector is possible without
much effort.

gdb/ChangeLog:

        * procfs.c (iterate_over_mappings_cb_ftype): New typedef.
        (iterate_over_mappings): Adjust function profile. Add declaration.
        (insert_dbx_link_bpt_in_region, info_mappings_callback):
        Adjust accordingly.
2010-04-20 22:35:58 +00:00
Joel Brobecker e294797a88 procfs.c: Move solib_mappings_callback up to avoid compiler warning.
There are currently 2 issues with the placement of this routine:
  - It's defined after it is being used (causing an implicit declaration);
  - It looks like it's being defined all the time, whereas it is used
    only on mips-irix (AFAICT) - shouldn't have this triggered a warning
    on sparc-solaris, for instance???

In any case, this patch moves this function up, inside the right region,
just before the function where it is actually used.

gdb/ChangeLog:

        * procfs.c (solib_mappings_callback): Move function up to avoid
        a compiler warning.
2010-04-20 22:35:03 +00:00
Joel Brobecker a223f1e7a0 procfs.c: Move find_signalled_thread and find_stop_signal.
These two functions are only used from procfs_make_note_section, which
itself is only defined if:

    #if defined (UNIXWARE) || defined (PIOCOPENLWP) || defined (PCAGENT)

So these two functions are unused on mips-irix, and they get flagged
by -Wunused-function. This patch simply moves these functions closer
to the function that uses them, which also has the effect of putting
them inside the same #if block as procfs_make_note_section.  Thus
they are defined only when used.

gdb/ChangeLog:

        * procfs.c (find_signalled_thread, find_stop_signal): Move
        these functions down to define them only when used.
2010-04-20 22:34:09 +00:00
Joel Brobecker 0c3acc0923 Wrong value printed by info locals for dynamic object.
The problem is printing the wrong value for dynamic local variables
when using the "info locals" command. Consider the following code:

   procedure Print (I1 : Positive; I2 : Positive) is
      type My_String is array (I1 .. I2) of Character;
      I : My_String := (others => 'A');
      S : String (1 .. I2 + 3) := (others => ' ');
   begin
      S (I1 .. I2) := String (I); --  BREAK
      Put_Line (S);
   end Print;

After the debugger stopped at BREAK, we try printing all local variables.
Here is what we get:

        (gdb) info locals
        i = "["00"]["00"]"
        s = "["00"]["00"]["00"]["00"]["00"]["00"]["00"]["00"]"

Curiously, printing their value using the "print" command works:

        (gdb) print i
        $1 = "AA"
        (gdb) print s
        $2 = "        "

We traced the problem to trying to get the contents of a variable
(call to value_contents) before "fix'ing" it.  For those not familiar
with the Ada language support, "fixing" a value consists of swapping
the value's dynamic type with a static version that is appropriate
for our actual value.  As a result, the dynamic type was used to
determine the value size, which is zero, and thus the value contents
was empty.

gdb/ChangeLog:

        * valprint.c (common_val_print): Fix the value before extracting
        its contents.
        * ada-lang.c (ada_to_fixed_value): Make this function extern.
        * ada-lang.h (ada_to_fixed_value): New function declaration.
        * ada-valprint.c (ada_value_print): Use ada_to_fixed_value
        to avoid code duplication and fix a bug in the handling of
        fixed types contents.

gdb/testsuite/ChangeLog:

        * gdb.ada/dyn_loc: New testcase.
2010-04-20 22:26:57 +00:00
Tom Tromey 31ef98ae61 * dwarf2read.c (dwarf2_compute_name): Handle DW_AT_linkage_name.
(read_partial_die): Likewise.
	(dwarf_attr_name): Likewise.
2010-04-20 21:19:07 +00:00
Chris Moller ec31cde594 PR 10867
* cp-valprint.c (global): Adding new static array recursion
detection obstack.
(cp_print_value_fields, cp_print_static_field): Added new static
array recursion detection code.
* gdb.cp/Makefile.in  (EXECUTABLES): Added pr10687
* gdb.cp/pr10687.cc: New file.
* gdb.cp/pr10687.exp: New file
2010-04-20 20:22:12 +00:00
Mark Kettenis e0e0e543d5 * i386-linux-tdep.c (i386_linux_regset_sections): Size of the
general-purpose register set should be 68 instead of 144.
(i386_linux_sse_regset_sections): Likewise.
(i386_linux_avx_regset_sections): Likewise.
2010-04-20 19:39:50 +00:00
Stan Shebs 08922a1050 2010-04-20 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* dwarf2loc.c (struct axs_var_loc): New struct.
	(dwarf2_tracepoint_var_loc): New function.
	(dwarf2_tracepoint_var_access): New function.
	(dwarf2_tracepoint_var_ref): Use dwarf2_tracepoint_var_loc, deal
	with DW_OP_piece.
	(locexpr_describe_location_piece): New function.
	(locexpr_describe_location_1): New function.
	(locexpr_describe_location): Call it, update signature.
	(loclist_describe_location): Rewrite to loop over locations,
	update signature.
	* symtab.h (struct symbol_computed_ops): Add address to
	describe_location arguments, return void.
	* printcmd.c (address_info): Get context PC, pass to computed
	location description.
	* tracepoint.c (scope_info): Ditto.
	* ax-gdb.c (trace_kludge): Export.
2010-04-20 18:52:59 +00:00
Tom Tromey 2dc7f7b33b * dwarf2-frame.c (decode_frame_entry_1): Handle CIE version 4.
(struct dwarf2_cie) <segment_size>: New field.
	* dwarf2read.c (partial_read_comp_unit_head): Accept DWARF 4.
	(skip_one_die): Handle DW_FORM_flag_present, DW_FORM_sec_offset,
	DW_FORM_exprloc.
	(read_attribute_value): Handle DW_FORM_flag_present,
	DW_FORM_sec_offset, DW_FORM_exprloc.
	(dump_die_shallow): Likewise.
	(attr_form_is_section_offset): Handle DW_FORM_sec_offset.
	(dwarf2_const_value): Handle DW_FORM_exprloc.
	(attr_form_is_block): Likewise.
	(struct line_header) <maximum_ops_per_instruction>: New field.
	(dwarf_decode_line_header): Set new field.
	(dwarf_decode_lines): Handle new field.
2010-04-20 17:33:14 +00:00
Sergio Durigan Junior ce4b068214 gdb/ChangeLog:
2010-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* f-exp.y: Add new production to recognize the `logical*8' type.
	(LOGICAL_S8_KEYWORD): New token.
	* f-lang.c (enum f_primitive_types)
	<f_primitive_type_logical_s8>: New field.
	(f_language_arch_info): Handling `logical*8' type.
	(build_fortran_types): Building `logical*8' type.
	* f-lang.h (struct builtin_f_type) <builtin_logical_s8>: New field.

gdb/testsuite/ChangeLog:

2010-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.fortran/logical.exp: New testcase.
	* gdb.fortran/logical.f90: New file.
2010-04-20 17:22:19 +00:00
Pierre Muller 1c07cc1903 * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
be consistent with other sources of this directory.
	(init_registers_amd64): Correct name of source file of this function
	in the comment.
2010-04-20 09:58:42 +00:00
Doug Evans 9f117f4723 (generic_readchar): Tweak previous checkin, close error_fd if EOF. 2010-04-20 06:06:38 +00:00
Doug Evans ff9f22f1a7 * ser-base.c (generic_readchar): Watch for EOF in read of error_fd.
* ser-pipe.c (pipe_open): Fix file descriptor leaks.
	(pipe_close): Ditto.
2010-04-20 05:52:07 +00:00
Doug Evans 3436961f29 * gdb.base/help.exp (help source): Update expected output. 2010-04-20 05:36:02 +00:00
Pierre Muller 437125bd80 * configure.tgt (x86_64-*-mingw*): Set BUILD_GDBSERVER to yes. 2010-04-20 00:21:33 +00:00
Pierre Muller e0a61e099d * configure.srv (x86_64-*-mingw*): New configuration for Windows
64-bit executables.
2010-04-20 00:19:35 +00:00
Pierre Muller 54709339f5 * win32-i386-low.c: Add 64-bit support.
(CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
	(init_registers_amd64): Declare.
	(mappings): Add 64-bit version of array.
	(init_windows_x86): New function.
	(the_low_target): Change init_arch field to init_windows_x86.
2010-04-20 00:17:05 +00:00
Pierre Muller e8f0053d6e * win32-low.c: Adapt to support also 64-bit architecture.
(child_xfer_memory): Use uintptr_t type for local variable `addr'.
	(get_image_name): Use SIZE_T type for local variable `done'.
	(psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
	(toolhelp_get_dll_name): Idem.
	(handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
	Use uintptr_t typecast to avoid warning.
	(handle_unload_dll): Use uintptr_t typecast to avoid warning.
	(handle_exception): Use phex_nz to avoid warning.
	(win32_wait): Remove unused local variable `process'.
2010-04-20 00:07:44 +00:00
gdbadmin 2dd893b03e *** empty log message *** 2010-04-20 00:00:03 +00:00
Pierre Muller e8e6c82edd * windows-tdep.c (windows_get_tlb_type): Change current_seh.handle
type to void function.
2010-04-19 23:52:11 +00:00
Stan Shebs 4136fdd244 2010-04-19 Stan Shebs <stan@codesourcery.com>
Vladimir Prus  <vladimir@codesourcery.com>

	* tracepoint.c (tfind_1): Add missing newline, report exit from
	tfind mode as such.
	* target.c (update_current_target): Make default
	to_trace_find return -1.
2010-04-19 22:06:17 +00:00
Mike Frysinger 0c4b2e6393 gdb: objc-lang: check symbol name before accessing memory
The current ObjC logic will check both the symbol name and the target
address space when trying to locate an appropriate selector.  The problem
is that first the target address space is checked before the symbol name.
This may lead to a lot of unnecessary host<->target transactions when
dealing with a non-OjbC target that does use function descriptors to
describe functions as every symbol will have its FD read just to have the
result thrown away with non-matching symbol names.

It also may lead to problems when a non-FD symbol is found that points near
the end of the address space as the target will throw up a memory_error().
One such example are symbols that are not functions, smaller than a FD,
and are the last valid location.  Obviously treating it as a larger data
struct can cause memory overflows.

So to speed things up and not screw over such targets, check the symbol
name (which we already have locally) first before attempting to read the
function's descriptor.  This fixes breakpoints with Blackfin Linux FDPIC
ELFs, and seems to cause no native regressions on my x86_64/Linux system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-19 19:51:39 +00:00
Pedro Alves 78076abca5 * ada-lang.c (print_recreate_exception)
<ex_catch_exception_unhandled>: It's "catch exception unhandled",
	not "catch unhandled".
2010-04-19 17:06:11 +00:00
Pierre Muller c481e77ec5 * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
`amd64-avx.o'.
2010-04-19 14:08:05 +00:00
Jan Kratochvil 4d836c0979 gdb/testsuite/
* gdb.base/solib-display.exp: Replace gdb_exit, gdb_start,
	gdb_reinitialize_dir and gdb_load by clean_restart.  Remove trailing
	gdb_exit and return.
	(executable): New variable.
	(binfile): Use it.
2010-04-19 03:13:07 +00:00
Pedro Alves 645797a830 Fix format of previous-previous entry. 2010-04-19 01:08:25 +00:00
Pedro Alves 6149aea959 PR breakpoints/8554.
Implement `save-breakpoints'.

	gdb/
	* breakpoint.c (save_cmdlist): New.
	(breakpoint_set_cmdlist, breakpoint_show_cmdlist): Moved up close
	to save_cmdlist.
	(print_recreate_catch_fork): New.
	(catch_fork_breakpoint_ops): Install it.
	(print_recreate_catch_vfork): New.
	(catch_vfork_breakpoint_ops): Install it.
	(print_recreate_catch_syscall): New.
	(catch_syscall_breakpoint_ops): Install it.
	(print_recreate_catch_exec): New.
	(catch_exec_breakpoint_ops): Install it.
	(print_recreate_exception_catchpoint): New.
	(gnu_v3_exception_catchpoint_ops): Install it.
	(save_breakpoints): New, based on tracepoint_save_command, but
	handle all breakpoint types.
	(save_breakpoints_command): New.
	(tracepoint_save_command): Rename to...
	(save_tracepoints_command): ... this, and reimplement using
	save_breakpoints.
	(save_command): New.
	(_initialize_breakpoints): Install the "save" command prefix.
	Install the "save breakpoints" command.  Make "save-tracepoints" a
	deprecated alias for "save tracepoints".
	* breakpoint.h (struct breakpoint_ops): New field `print_recreate'.
	* ada-lang.c (print_recreate_exception): New.
	(print_recreate_catch_exception): New.
	(catch_exception_breakpoint_ops): Install it.
	(print_recreate_catch_exception_unhandled): New.
	(catch_exception_unhandled_breakpoint_ops): Install it.
	(print_recreate_catch_assert): New.
	(catch_assert_breakpoint_ops): Install it.

	* NEWS: Mention the new `save breakpoints' command.  Mention the
	new `save tracepoints' alias and that `save-tracepoints' is now
	deprecated.

	gdb/doc/
	* gdb.texinfo (Save Breakpoints): New node.
	(save-tracepoints): Rename to ...
	(save tracepoints): ... this.  Mention that `save-tracepoints' is
	a deprecated alias to `save tracepoints'.

	gdb/testsuite/
	* gdb.trace/save-trace.exp: Adjust.
2010-04-19 00:48:44 +00:00
gdbadmin 8b47812243 *** empty log message *** 2010-04-19 00:00:34 +00:00
Pedro Alves 0a8fce9a70 PR tui/9217
* tui/tui-out.c: Include cli-out.h.
	(tui_table_begin, tui_table_body, tui_table_end, tui_table_header)
	(tui_begin, tui_end, tui_field_int, tui_field_skip)
	(tui_field_string, tui_field_fmt, tui_spaces, tui_text)
	(tui_message, tui_wrap_hint, tui_flush): Delete forward
	declarations.
	(struct ui_out_data): Rename to...
	(struct tui_ui_out_data): ... this.  Remove `stream' and
	`suppress_output' fields, and inherit cli_ui_out_data.
	(tui_out_data): New typedef.
	(tui_ui_out_impl): Don't initialize fields staticaly.
	(tui_table_begin, tui_table_body, tui_table_end, tui_table_header)
	(tui_begin, tui_end): Delete.
	(tui_field_int): Adjust to delegate most work to the base type.
	(tui_field_skip): Delete.
	(tui_field_string, tui_field_fmt): Adjust comment.  Adjust to
	delegate most work to the base type.
	(tui_spaces): Delete.
	(tui_text): Adjust to delegate most work to the base type.
	(tui_message): Delete.
	(tui_wrap_hint): Delete.
	(tui_flush): Delete.
	(out_field_fmt): Delete.
	(field_separator): Delete.
	(tui_out_new): Adjust to initialize the base type.
	(_initialize_tui_out): Initialize tui_ui_out_impl.
	* cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed
	cli_ui_out_data.
	(cli_out_data): Adjust.
	(cli_ui_out_impl): Make extern.
	(cli_table_header, cli_field_int, cli_field_skip): Use
	uo_field_string instead of cli_field_string.
	(cli_redirect): Adjust to use cli_out_data.
	(cli_out_data_ctor): New.
	(cli_out_new): Use it.
	* cli-out.h (struct ui_file): Remove forward declaration.
	(struct cli_ui_out_data): New, moved from cli-out.c, and renamed.
	(cli_ui_out_impl): Declare.
	(cli_out_data_ctor): Declare.
	* ui-out.c (struct ui_out) <data>: Change type to void pointer.
	(uo_field_string): No longer static.
	(ui_out_data): Change return type to void pointer.
	(ui_out_new): Change `data' parameter type to void pointer.
	* ui-out.h (struct ui_out_data): Don't forward declare.
	(ui_out_data): Change return type to void pointer.
	(ui_out_new): Change `data' parameter type to void pointer.
	(uo_field_string): Declare.
2010-04-18 00:11:55 +00:00
gdbadmin 61d05fada4 *** empty log message *** 2010-04-18 00:00:34 +00:00
Pedro Alves 172240dd22 * ui-file.c (tee_file_isatty): Return whether `tee->one' is a tty,
instead of always false.
2010-04-17 23:56:27 +00:00
Pierre Muller 12ea4b6986 * configure.ac: Use `ws2_32' library for srv_mingw.
* configure: Regenerate.
	* gdbreplay.c: Include winsock2.h instead of winsock.h.
	* remote-utils.c: Likewise.
2010-04-17 20:43:13 +00:00
H.J. Lu ed41462c79 gdb/
2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR corefiles/11511
	* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Support
	orig_rax.

gdb/testsuite/

2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR corefiles/11511
	* gdb.arch/system-gcore.exp: New.
	* gdb.arch/gcore.c: Likewise.
2010-04-17 18:53:46 +00:00
Pedro Alves cc60f2e372 * breakpoint.c (watchpoints_triggered): Use
is_hardware_watchpoint.
	(watchpoints_triggered): Ditto.
	(bpstat_check_location): Use is_watchpoint and
	is_hardware_watchpoint.
	(bpstat_check_watchpoint): Use is_watchpoint and
	is_hardware_watchpoint.
	(bpstat_stop_status): Fix comment.
	(user_settable_breakpoint): Use is_watchpoint.
	(hw_watchpoint_used_count): Use is_hardware_watchpoint.
	(disable_watchpoints_before_interactive_call_start): Use
	is_watchpoint.
	(enable_watchpoints_after_interactive_call_stop): Use
	is_watchpoint.
	(clear_command): Use is_watchpoint.
	(do_enable_breakpoint): Use is_watchpoint.
2010-04-17 18:42:46 +00:00
H.J. Lu f6d1620c59 Define xmltarget_amd64_linux_no_xml only for amd64.
2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
	if __x86_64__ is defined.
2010-04-17 14:12:31 +00:00
gdbadmin 6cfa03d350 *** empty log message *** 2010-04-17 00:00:05 +00:00
Mike Frysinger cb7db0f2a9 gdb: fdpic/frv: fix shared library loading
The recent change to reload_shared_libraries() broke FDPIC shared libraries as
the solib-frv.c code was implicitly relying on the initial order of calls
(first solib_addr() and then solib_create_inferior_hook()).  It was
maintaining internal state via enable_break{1,2}_done to handle this.

While I could tweak these values a bit more, the original code wasn't terribly
bullet proof -- if during the initial debug you attempted to view shared
libraries, the enable2_break() code would whine about the ldso internal debug
addresses being unfetchable (and would actually attempt to read address 0x8 on
the target).  So I've dropped this implicit dependency on order (i.e.
enable_break1_done) and updated the ldso poking code (i.e. enable_break2) to
silently return when the internal debug address is still set to 0.  It will
remain this way until the ldso gets a chance to initialize at which point the
code will act the same as before.

While I have no way of testing the FRV, the Blackfin FDPIC code is using this
same base in a 100% copy & paste method since we implemented FDPIC the same
way as the FRV guys (I'll address this in the future).  This fix was required
in order to handle shared libraries with Blackfin FDPIC properly, and I see no
reason why it wouldn't also work for FRV (since the uClibc ldso FDPIC code is
the same too and that's really what this is poking).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-16 22:47:42 +00:00
Kevin Buettner d77b48cf13 * m32c-tdep.c (m32c_m16c_address_to_pointer): Print warning
instead of an error if no PLT entry is found.  Return a
	potentially useful result.
	(m32c_m16c_pointer_to_address): Add code to search for function
	address when no .plt entry is found.
2010-04-16 22:46:27 +00:00
Stan Shebs f90824dcbc 2010-04-16 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_variable_command): Run a cleanup.
2010-04-16 18:22:01 +00:00
Pierre Muller 8e64287381 * configure: Regenerate. 2010-04-16 16:22:15 +00:00
Pierre Muller 9b79b476a6 * p-lang.c (pascal_one_char): Do not restrict C to 0..255 range. 2010-04-16 08:12:59 +00:00
Pierre Muller 711e434b39 Support for Windows OS Thread Information Block.
* NEWS: Document new feature.
	* remote.c (PACKET_qGetTIBAddr): New enum element.
	(remote_get_tib_address): New function.
	(init_remote_ops): Set to_get_tib_address field
	to remote_get_tib_address.
	(_initialize_remote): Add add_packet_config_cmd
	for PACKET_qGetTIBAddr.
	* target.c (update_current_target): Set default value for
	new to_get_tib_address field.
	* target.h (target_ops): New field to_get_tib_address.
	(target_get_tib_address): New macro.
	* windows-nat.c (thread_info): Add thread_local_base field.
	(windows_add_thread): Add tlb argument of type 'void *'.
	(fake_create_process): Adapt windows_add_thread call.
	(get_windows_debug_event): Idem.
	(windows_get_tib_address): New function.
	(init_windows_ops): Set to_get_tib_address field
	to remote_get_tib_address.
	(_initialize_windows_nat): Replace info_w32_cmdlist
	initialization by a call to init_w32_command_list.
	(info_w32_command, info_w32_cmdlist): Removed from here...
	to windows-tdep.c file.
	* windows-tdep.h (info_w32_cmdlist): Declare.
	(init_w32_command_list): New external function
	declaration.
	* windows-tdep.c: Add several headers.
	(info_w32_cmdlist): to here, made global.
	(thread_information_32): New struct.
	(thread_information_64): New struct.
	(TIB_NAME): New char array.
	(MAX_TIB32, MAX_TIB64, FULL_TIB_SIZE): New constants.
	(maint_display_all_tib): New static variable.
	(windows_get_tlb_type): New function.
	(tlb_value_read, tlb_value_write): New functions.
	(tlb_value_funcs): New static struct.
	(tlb_make_value): New function.
	(display_one_tib): New function.
	(display_tib): New function.
	(show_maint_show_all_tib):New function.
	(info_w32_command): Moved from windows-nat.c.
	(init_w32_command_list): New function.
	(_initialize_windows_tdep): New function.
	New "maint set/show show-all-tib" command
	New "$_tlb" internal variable.

gdbserver/ChangeLog entry:

	* server.c (handle_query): Handle 'qGetTIBAddr' query.
	* target.h (target_ops): New get_tib_address field.
	* win32-low.h (win32_thread_info): Add thread_local_base field.
	* win32-low.c (child_add_thread): Add tlb argument.
	Set thread_local_base field to TLB.
	(get_child_debug_event): Adapt to child_add_thread change.
	(win32_get_tib_address): New function.
	(win32_target_ops): Set get_tib_address field to
	win32_get_tib_address.
	* linux-low.c (linux_target_ops): Set get_tib_address field to NULL.

doc/ChangeLog entry:

	gdb.texinfo ($_tlb): Document new automatic convinience variable.
	(info w32 thread-information-block): Document new command.
	(qGetTIBAddress): Document new gdbserver query.
	(maint set/show show-all-tib): Document new command.
2010-04-16 07:49:37 +00:00
Joel Brobecker cae3f17bee * tui/tui-regs.c (tui_display_register): Add comment about
a couple of casts.
        * tui/tui-stack.c (tui_show_locator_content): Ditto.
2010-04-16 04:34:31 +00:00
Stan Shebs 2ce6d6bf7c 2010-04-15 Stan Shebs <stan@codesourcery.com>
* frame.c: Include tracepoint.h.
	(get_current_frame): Allow a trace frame to be an alternate source
	of stack frame data.
	* tracepoint.c (tfind_1): Don't try to get current stack frame if
	it won't succeed.
2010-04-16 01:12:07 +00:00
gdbadmin 47edb3fead *** empty log message *** 2010-04-16 00:00:33 +00:00
Pedro Alves 2d6e647aec s/Pedro Alves/Pedro Alves/ 2010-04-15 23:46:11 +00:00
Pedro Alves 8d95cc3b6c Fix date format in one entry. Fix whitespace throughout while there. 2010-04-15 23:43:40 +00:00
Pedro Alves 1a161f722d Remove src/gdb/ from entry. 2010-04-15 22:36:44 +00:00
Pedro Alves 7e559477b1 * ppc-linux-tdep.c (bsd_uthread_solib_loaded): Always pass 0 for
flags.
	* solib-spu.c (spu_solib_loaded): Always pass 0 for flags.
2010-04-15 20:19:24 +00:00
Doug Evans fa33c3cd05 * NEWS: Add entry for python program space support.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-progspace.o.
	(SUBDIR_PYTHON_SRCS): Add py-progspace.c.
	(py-progspace.o): New rule.
	* python/py-prettyprint.c (find_pretty_printer_from_objfiles): New
	function.
	(find_pretty_printer_from_progspace): New function.
	(find_pretty_printer_from_gdb): New function.
	(find_pretty_printer): Rewrite.
	* python/py-progspace.c: New file.
	* python/python-internal.h (program_space): Add forward decl.
	(pspace_to_pspace_object, pspy_get_printers): Declare.
	(gdbpy_initialize_pspace): Declare.
	* python/python.c: #include "progspace.h".
	(gdbpy_get_current_progspace, gdbpy_progspaces): New functions.
	(_initialize_python): Call gdbpy_initialize_pspace.
	(GdbMethods): Add current_progspace, progspaces.

	doc/
	* gdb.texinfo (Python API): Add progspaces section.
	(Selecting Pretty-Printers): Progspace pretty-printers are
	searched too.
	(Progspaces In Python): New section.

	testsuite/
	* gdb.python/py-progspace.c: New file.
	* gdb.python/py-progspace.exp: New file.
2010-04-15 19:54:13 +00:00
Doug Evans 3f7b2faa4b Add -s option to source command.
* NEWS: Document new option.
	* cli/cli-cmds.c (find_and_open_script): Add function comment.
	Delete from_tty and cleanupp args.  Split filep arg into file and
	full_pathp.  New arg search_path.
	(source_script_from_stream): New function.
	(source_script_with_search): New function.
	(source_script): Rewrite.
	(source_command): Parse "-s" option.
	(init_cli_cmds): Add "-s" docs to source command help, and reformat.
	* python/python.c (source_python_script): Make file arg a const char *.
	Don't call fclose, leave for caller.
	* python/python.h (source_python_script): Update.

	testsuite/
	* gdb.base/source-test.gdb: New file.
	* gdb.base/source.exp: Add tests for "source -s".

	doc/
	* gdb.texinfo (Command Files): Add docs for new "source -s" option.
2010-04-15 17:45:57 +00:00
gdbadmin 7a8f71bfab *** empty log message *** 2010-04-15 00:00:33 +00:00
Pedro Alves a86988f21a Avoid rereading shared libraries that haven't changed.
* solib.c (free_so_symbols): New function, from ...
	(free_so): ... here.  Call it.
	(solib_read_symbols): Don't warn here if symbols have already been
	loaded.
	(solib_add): Warn here instead, if a pattern was specified.
	(reload_shared_libraries_1): New.
	(reload_shared_libraries): Rewrite to not fetch the library list.
2010-04-14 23:20:27 +00:00
Doug Evans 589390d6ff fix typo in previous entry 2010-04-14 21:27:01 +00:00
Doug Evans e6d9b9c2fa * source.c (open): Strip DOS drive letter if present before
concatenating string to search path.
2010-04-14 21:22:29 +00:00
Pedro Alves 516ba65938 * objfiles.h (gdb_bfd_close_or_warn): Declare.
* objfiles.c (gdb_bfd_close_or_warn): New.
	* corelow.c: Include objfiles.h
	(core_close): Use gdb_bfd_close_or_warn.
	* elfread.c (build_id_verify): Ditto.
	* exec.c (exec_close, exec_close_1): Ditto.
2010-04-14 17:26:11 +00:00
Pedro Alves 048d532d6e Group errors for many missing shared libraries.
* solist.h (struct so_list): Remove from_tty.
	* solib.c (solib_bfd_open): Return NULL if we failed to open a BFD.
	(solib_map_sections): Take so_list argument.  Return 0 if we
	failed to open a BFD.  Add target sections here.
	(symbol_add_stub): Delete.
	(solib_read_symbols): Inline symbol_add_stub.  Use current flags,
	not from_tty copied from the so_list.  Don't warn a second time
	for a missing library.
	(update_solib_list): Don't save from_tty.  Use TRY_CATCH.  Do not
	add to the section table here.  Print out a single warning for all
	missing libraries.
	* bsd-uthread.c (bsd_uthread_solib_loaded): Always pass 0 for
	flags.
2010-04-14 13:49:53 +00:00
Phil Muldoon 044c0f87fe 2010-04-14 Phil Muldoon <pmuldoon@redhat.com>
* python/py-block.c (gdbpy_block_for_pc): Use i8n to encompass
	error/warning messages.  Capitalize and use complete sentences.
	(blpy_block_syms_iternext): Likewise.
	* python/py-cmd.c (parse_command_name, cmdpy_init): Likewise.
	* python/py-frame.c (FRAPY_REQUIRE_VALID, frapy_block)
	(frame_info_to_frame_object, frapy_read_var)
	(gdbpy_frame_stop_reason_string): Likewise.
	* python/py-lazy-string.c (stpy_convert_to_value)
	(gdbpy_create_lazy_string_object): Likewise.
	* python/py-objfile.c (objfpy_set_printers): Likewise.
	* python/py-prettyprint.c (gdbpy_default_visualizer): Likewise.
	* python/python.c (parameter_to_python): Likewise.
	* python/py-type.c (typy_range, typy_target): Likewise.
	* python/py-value.c (valpy_cast, valpy_length, valpy_getitem)
	(valpy_richcompare, valpy_int, valpy_long, valpy_float): Likewise.
2010-04-14 13:18:55 +00:00
Phil Muldoon 79f283fe85 2010-04-14 Phil Muldoon <pmuldoon@redhat.com>
PR python/11381

	* python/py-prettyprint.c (pretty_print_one_value): Test for
	Py_None.
	(print_string_repr): Test for Py_None.  Set flags accordingly.
	Return value depending on return type.
	(print_children): Take a value indicating whether data was printed
	before this function was called.  Alter output accordingly.
	(apply_val_pretty_printer): Capture return value from
	print_string_repr and pass to print_children.

2010-04-14  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-prettyprint.py (NoStringContainerPrinter): New printer.
	* gdb.python/py-prettyprint.c: Add justchildren struct, typedefs.
	* gdb.python/py-prettyprint.exp: New test for to_string returning None.
	* gdb.python/py-mi.exp: New test for to_string returning None.

2010-04-14  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.texinfo (Pretty Printing): Document behaviour when to_string
	returns None.
2010-04-14 12:02:46 +00:00
H.J. Lu e1caee70ee Correct PR number for PR corefiles/11481. 2010-04-14 00:40:13 +00:00
H.J. Lu b418b5529c Mention PR corefiles/11467. 2010-04-14 00:38:03 +00:00
gdbadmin 83d37c8c77 *** empty log message *** 2010-04-14 00:00:03 +00:00
Mark Kettenis 4ac5d44ece * i386-linux-tdep.c (i386_linux_regset_sections): Remove extended
register note sections.
(i386_linux_sse_regset_sections, i386_linux_avx_regset_sections):
New variables.
(i386_linux_init_abi): Install list of supported register note
sections that matches the target description.
2010-04-13 21:07:16 +00:00
Pedro Alves ad91cd9917 * remote.c (remote_get_noisy_reply): Don't error out on empty
replies.
	(remote_start_remote): Update and merge tracepoints and trace
	state variables as long as the target supports tracepoints.
	(remote_trace_init): Fix prototype.
	(remote_download_trace_state_variable): Validate reply.
	(remote_trace_set_readonly_regions): Fix prototype.
	(remote_trace_start): Fix prototype.  Check for empty reply.
	(remote_get_trace_status): Small cleanup.
	(remote_trace_stop): Fix prototype.  Check for empty reply.
	(remote_trace_find): Check for empty reply.
	(remote_save_trace_data): Validate reply.
	(remote_set_disconnected_tracing): Check for empty reply, and
	validate reply.
	(remote_set_circular_trace_buffer): Ditto.
2010-04-13 16:08:28 +00:00
Pierre Muller ae3bccd49a Suppress unused value warning during compilation.
* tui/tui-regs.c (tui_display_register): Cast wstandout and wstandend
	calls to void.
	* tui/tui-stack.c (tui_show_locator_content): Likewise.
2010-04-13 12:11:10 +00:00
Stan Shebs 523136f211 2010-04-12 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (tfile_xfer_partial): Check read result.
2010-04-13 03:53:50 +00:00
gdbadmin 02067d243b *** empty log message *** 2010-04-13 00:00:33 +00:00
Pedro Alves ef7278ebcc Remove gdb/gdbserver/ line. 2010-04-12 17:46:05 +00:00
Pedro Alves 505106cdc7 gdb/gdbserver/
* linux-low.c (linux_mourn): Also remove the process.
	* server.c (handle_target_event): Don't remove the process here.
	* nto-low.c (nto_mourn): New.
	(nto_target_ops): Install it.
	* spu-low.c (spu_mourn): New.
	(spu_target_ops): Install it.
	* win32-low.c (win32_mourn): New.
	(win32_target_ops): Install it.
2010-04-12 17:39:42 +00:00
Mike Frysinger 0d18d7205b gdb: constify remote files_info
The sim and m32r remote targets declare a local "file" variable and only
assign const strings to it before passing it to a printf() func.  So add
const markings to avoid gcc warnings like:
gdb/remote-sim.c: In function 'gdbsim_files_info':
gdb/remote-sim.c:789: warning: initialization discards qualifiers
	from pointer target type

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12 16:04:43 +00:00
Richard Earnshaw 3b273a5534 2010-04-12 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* arm-tdep.h (gdb_regnum): Add ARM_FPSCR_REGNUM
	* arm-linux-nat.c (arm_linux_vfp_register_count): New
	variable.
	(fetch_vfp_registers): New function to fetch VFP registers.
	(store_vfp_registers): New function to store VFP registers.
	(arm_linux_fetch_inferior_registers): Add support for VFP
	registers.
	(arm_linux_store_inferior_registers): Likewise.
	(arm_linux_read_description): Likewise.
	(_initialize_arm_linux_nat): Delay initialising iWMMX tdesc
	until we need it.
2010-04-12 13:52:43 +00:00
Pedro Alves e8470a0645 * server.h (buffer_xml_printf): Remove redundant `;'. 2010-04-12 13:51:22 +00:00
Pedro Alves 45ba0d0206 * regcache.c (set_register_cache): Invalidate regcaches before
changing the register cache layout.
	(regcache_invalidate_one): Allow a NULL regcache.
	* linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
	regcaches before changing the register cache layout or the target
	regsets.
2010-04-12 13:25:51 +00:00
H.J. Lu 59e0401339 Avoid unused variable warning on Linux/x86-64.
2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>

	* linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
	variable warning on Linux/x86-64.
2010-04-12 13:18:13 +00:00
Phil Muldoon fc8eb08a3a 2010-04-12 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.c: Make result global.
2010-04-12 09:49:35 +00:00
gdbadmin 02063a34cf *** empty log message *** 2010-04-12 00:00:03 +00:00
H.J. Lu 778c709509 Remove the unused variable in amd64-tdep.c.
2010-04-11  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-tdep.c (amd64_supply_xstateregset): Remove the unused
	tdep.
	(amd64_collect_xstateregset): Likewise.
2010-04-11 20:20:31 +00:00
Pedro Alves 8336d594d5 GDBserver disconnected tracing support.
* linux-low.c (linux_remove_process): Delete.
	(add_lwp): Don't set last_resume_kind here.
	(linux_kill): Use `mourn'.
	(linux_detach): Use `thread_db_detach', and `mourn'.
	(linux_mourn): New.
	(linux_attach_lwp_1): Adjust comment.
	(linux_attach): last_resume_kind moved the thread_info; adjust.
	(status_pending_p_callback): Adjust.
	(linux_wait_for_event_1): Adjust.
	(count_events_callback, select_singlestep_lwp_callback)
	(select_event_lwp_callback, cancel_breakpoints_callback)
	(db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
	(proceed_one_lwp): Adjust.
	(linux_async): Add debug output.
	(linux_thread_stopped): New.
	(linux_pause_all): New.
	(linux_target_ops): Install linux_mourn, linux_thread_stopped and
	linux_pause_all.
	* linux-low.h (struct lwp_info): Delete last_resume_kind field.
	(thread_db_free): Delete declaration.
	(thread_db_detach, thread_db_mourn): Declare.
	* thread-db.c (thread_db_init): Use thread_db_mourn.
	(thread_db_free): Delete, split in two.
	(disable_thread_event_reporting): New.
	(thread_db_detach): New.
	(thread_db_mourn): New.

	* server.h (struct thread_info) <last_resume_kind>: New field.
	<attached>: Add comment.
	<gdb_detached>: New field.
	(handler_func): Change return type to int.
	(handle_serial_event, handle_target_event): Ditto.
	(gdb_connected): Declare.
	(tracing): Delete.
	(disconnected_tracing): Declare.
	(stop_tracing): Declare.

	* server.c (handle_query) <qSupported>: Report support for
	disconnected tracing.
	(queue_stop_reply_callback): Account for running threads.
	(gdb_wants_thread_stopped): New.
	(gdb_wants_all_threads_stopped): New.
	(gdb_reattached_process): New.
	(handle_status): Clear the `gdb_detached' flag of all processes.
	In all-stop, stop all threads.
	(main): Be sure to leave tfind mode.  Handle disconnected tracing.
	(process_serial_event): If the remote connection breaks, or if an
	exit was forced with "monitor exit", force an event loop exit.
	Handle disconnected tracing on detach.
	(handle_serial_event): Adjust.
	(handle_target_event): If GDB isn't connected, forward events back
	to the inferior, unless the last process exited, in which case,
	exit gdbserver.  Adjust interface.

	* remote-utils.c (remote_open): Don't block in accept.  Instead
	register an event loop source on the listen socket file
	descriptor.  Refactor bits into ...
	(listen_desc): ... this new global.
	(gdb_connected): ... this new function.
	(enable_async_notification): ... this new function.
	(handle_accept_event): ... this new function.
	(remote_close): Clear remote_desc.

	* inferiors.c (add_thread): Set the new thread's last_resume_kind.

	* target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
	New fields.
	(mourn_inferior): Define.
	(target_process_qsupported): Avoid the dangling else problem.
	(thread_stopped): Define.
	(pause_all): Define.
	(target_waitstatus_to_string): Declare.
	* target.c (target_waitstatus_to_string): New.

	* tracepoint.c (tracing): Make extern.
	(disconnected_tracing): New.
	(stop_tracing): Make extern.  Handle tracing stops due to GDB
	disconnecting.
	(cmd_qtdisconnected): New.
	(cmd_qtstatus): Report disconnected tracing status in trace reply.
	(handle_tracepoint_general_set): Handle QTDisconnected.

	* event-loop.c (event_handler_func): Change return type to int.
	(process_event): Bail out if the event handler wants the event
	loop to stop.
	(handle_file_event): Ditto.
	(start_event_loop): Bail out if the event handler wants the event
	loop to stop.

	* nto-low.c (nto_target_ops): Adjust.
	* spu-low.c (spu_wait): Don't remove the process here.
	(spu_target_ops): Adjust.
	* win32-low.c (win32_wait): Don't remove the process here.
	(win32_target_ops): Adjust.
2010-04-11 16:33:56 +00:00
Pedro Alves 5d267c4c70 * regcache.c (realloc_register_cache): Invalidate inferior's
regcache before recreating it.
2010-04-11 01:47:48 +00:00
gdbadmin a18ebeaf85 *** empty log message *** 2010-04-11 00:00:02 +00:00
gdbadmin fcfd64c2cc *** empty log message *** 2010-04-10 00:00:07 +00:00
Jan Kratochvil 26e197f641 gdb/testsuite/
Fix non-GNU make compatibility.
	* Makefile.in ($(TEST_TARGETS)): Conditionalize it by @GMAKE_TRUE@.
2010-04-09 20:50:46 +00:00
Stan Shebs 872906844b 2010-04-09 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_status_mi): Report frames created.

	* gdb.texinfo (gdb/mi Tracepoint Commands) <-trace-status>:
	Describe the `frames-created' field, tweak grammar.
2010-04-09 20:46:40 +00:00
Stan Shebs 2114d44c8d 2010-04-09 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_dump_command): Include default-collect
	expressions.
2010-04-09 19:34:57 +00:00
Ulrich Weigand 86da934b14 * symtab.c (find_function_start_sal): Never return SAL pointing
before function start address, even if line info is missing.
2010-04-09 15:31:41 +00:00
Pedro Alves d337e9f09e * NEWS: Mention tracepoints support. 2010-04-09 15:26:54 +00:00
Pedro Alves a97153c7f8 gdb/
* tracepoint.c (trace_status_mi): Report disconnected tracing and
	circular trace buffer statuses.

	gdb/doc/
	* gdb.texinfo (gdb/mi Tracepoint Commands) <-trace-status>:
	Describe the `circular' and `disconnected' fields.
2010-04-09 15:22:09 +00:00
Jan Kratochvil 7a66d6033a gdb/
* config/djgpp/fnchange.lst: Fix typo in translations for
	symbol-without-target_section.exp and symbol-without-target_section.c.
2010-04-09 15:15:05 +00:00
H.J. Lu 5c5dcc1b7a Mention unavailable and invisible registers.
2010-04-09  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.texinfo (maint print registers): Mention unavailable and
	invisible registers.
2010-04-09 15:12:31 +00:00
Pedro Alves 623ccd7217 * tracepoint.c (cmd_qtstatus): Report trace buffer circularity. 2010-04-09 14:40:48 +00:00
Pedro Alves 2566ad2d88 * breakpoint.c (condition_command): Pass condition expression to
set_breakpoint_condition stripped from breakpoint number.
2010-04-09 13:56:08 +00:00
Phil Muldoon adc368187c 2010-04-09 Phil Muldoon <pmuldoon@redhat.com>
Thiago Jung Bauermann  <bauerman@br.ibm.com>
   	    Tom Tromey  <tromey@redhat.com>

	* breakpoint.c (condition_command): Simplify.  Move condition
	setting code to ...
	(set_breakpoint_condition): ... here.  New function.
	* breakpoint.h  (set_breakpoint_condition): Declare.
	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-breakpoint.
	(SUBDIR_PYTHON_SRCS): Likewise.
	(py-breakpoint.o): New rule.
	* python/py-breakpoint.c: New file.
	* python/python-internal.h (gdbpy_breakpoints)
	(gdbpy_initialize_breakpoints): Declare.
	(GDB_PY_SET_HANDLE_EXCEPTION) Define.


2010-04-09  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-breakpoint.exp: New File.
	* gdb.python/py-breakpoint.C: Ditto.

2010-04-09  Phil Muldoon  <pmuldoon@redhat.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>
   	    Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Breakpoints In Python): New Node.
2010-04-09 09:41:43 +00:00
Pedro Alves 219f2f2398 gdb/gdbserver/
* server.h (LONGEST): New.
	(struct thread_info) <while_stepping>: New field.
	(unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
	Declare.
	(initialize_tracepoint, handle_tracepoint_general_set)
	(handle_tracepoint_query, tracepoint_finished_step)
	(tracepoint_was_hit, release_while_stepping_state_list):
	(current_traceframe): Declare.
	* server.c (handle_general_set): Handle tracepoint packets.
	(read_memory): New.
	(write_memory): New.
	(handle_search_memory_1): Use read_memory.
	(handle_query): Report support for conditional tracepoints, trace
	state variables, and tracepoint sources.  Handle tracepoint
	queries.
	(main): Initialize the tracepoints module.
	(process_serial_event): Handle traceframe reads/writes.

	* linux-low.c (handle_tracepoints): New.
	(linux_wait_1): Call it.
	(linux_resume_one_lwp): Handle while-stepping.
	(linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
	(linux_target_ops): Install them.
	* linux-low.h (struct linux_target_ops) <supports_tracepoints>:
	New field.
	* linux-x86-low.c (x86_supports_tracepoints): New.
	(the_low_target). Install it.

	* mem-break.h (delete_breakpoint): Declare.
	* mem-break.c (delete_breakpoint): Make external.

	* target.h (struct target_ops): Add `supports_tracepoints',
	`read_pc', and `write_pc' fields.
	(target_supports_tracepoints): Define.
	* utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
	(phex_nz): New.

	* regcache.h (struct regcache) <registers_owned>: New field.
	(init_register_cache, regcache_cpy): Declare.
	(regcache_read_pc, regcache_write_pc): Declare.
	(register_cache_size): Declare.
	(supply_regblock): Declare.
	* regcache.c (init_register_cache): New.
	(new_register_cache): Use it.
	(regcache_cpy): New.
	(register_cache_size): New.
	(supply_regblock): New.
	(regcache_read_pc, regcache_write_pc): New.

	* tracepoint.c: New.

	* Makefile.in (OBS): Add tracepoint.o.
	(tracepoint.o): New rule.

	gdb/
	* regformats/regdat.sh: Include server.h.  Don't include
	regcache.h.
2010-04-09 03:40:00 +00:00
Stan Shebs 33da3f1cb5 2010-04-08 Stan Shebs <stan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	* tracepoint.h (struct trace_status): New fields disconnected_tracing
	and circular_buffer.
	(disconnect_tracing): Rename from disconnect_or_stop_tracing.
	* tracepoint.c (trace_status_command): Display target's status for
	disconnected tracing and circular buffer.
	(disconnect_tracing): Rename from disconnect_or_stop_tracing, add
	query for non-disconnected-tracing case, remove the stop_tracing
	call.
	(tfile_open): Clear disconnected and circular buffer status.
	(trace_save): Save disconnected and circular buffer status.
	(parse_trace_status): Parse disconnected and circular buffer status,
	also recognize disconnected as a stop reason.
	* remote.c (remote_set_disconnected_tracing): Only set
	QTDisconnected if the remote end supports disconnected tracing.
	Warn otherwise, if trying to enable disconnected tracing.
	* infcmd.c (detach_command): Update disconnect_tracing call.
	* cli/cli-cmds.c (quit_command): Ditto.

	* gdb.texinfo (Tracepoint Packets): Describe disconn and circular
	trace status fields.
2010-04-09 03:00:58 +00:00
Stan Shebs 64e173680a 2010-04-08 Stan Shebs <stan@codesourcery.com>
* gdb.trace/actions.exp: Clear default-collect.
	* gdb.trace/save-trace.exp: Clear default-collect.
2010-04-09 00:49:59 +00:00
H.J. Lu 4e4d83747c Replace abort with internal_error.
2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i387-tdep.c (i387_collect_xsave): Replace abort with
	internal_error.
2010-04-09 00:18:52 +00:00
gdbadmin 733e11e71f *** empty log message *** 2010-04-09 00:00:03 +00:00
Stan Shebs ad44314612 2010-04-08 Stan Shebs <stan@codesourcery.com>
* breakpoint.c (default_collect_info): New function.
	(breakpoints_info): Call it.
	(maintenance_info_breakpoints): Ditto.
	(tracepoints_info): Ditto.
2010-04-08 23:13:46 +00:00
H.J. Lu 40936b0de8 Re-indent i387_collect_xsave. 2010-04-08 22:50:34 +00:00
H.J. Lu 3a13a53b43 Support i386 without SSE.
gdb/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-linux-nat.c (have_ptrace_getfpxregs): Initialize to -1
	if HAVE_PTRACE_GETFPXREGS is defined.
	(i386_linux_read_description): Set have_ptrace_getfpxregs and
	have_ptrace_getregset to 0 if ptrace PTRACE_GETFPXREGS failed.

	* i386-linux-tdep.c: Include "features/i386/i386-mmx-linux.c"
	(i386_linux_core_read_description): Return tdesc_i386_mmx_linux
	if .reg-xfp section doesn't exist.
	(_initialize_i386_linux_tdep): Call initialize_tdesc_i386_mmx_linux.

	* i386-linux-tdep.h (tdesc_i386_mmx_linux): New.

	* i386-tdep.c: Include "features/i386/i386-mmx.c".
	(i386_go32_init_abi): Set tdesc to tdesc_i386_mmx.
	(i386_validate_tdesc_p): Make org.gnu.gdb.i386.sse optional.  Set
	xcr0 to I386_XSTATE_X87_MASK if SSE isn't available.
	(i386_gdbarch_init): Update comments.
	(_initialize_i386_tdep): Call initialize_tdesc_i386_mmx.

	* common/i386-xstate.h (I386_XSTATE_X87_MASK): New.

	* config/djgpp/fnchange.lst: Add i386 MMX XML files.

	* features/Makefile (i386/i386-mmx-expedite): New.
	(i386/i386-mmx-linux-expedite): Likewise.
	($(outdir)/i386/i386-mmx.dat): Likewise.
	($(outdir)/i386/i386-mmx-linux.dat): Likewise.

	* features/i386/i386-mmx-linux.c: New.
	* features/i386/i386-mmx-linux.xml: Likewise.
	* features/i386/i386-mmx.c: Likewise.
	* features/i386/i386-mmx.xml: Likewise.
	* regformats/i386/i386-mmx-linux.dat: Likewise.
	* regformats/i386/i386-mmx.dat: Likewise.

	* features/Makefile (WHICH): Add i386/i386-mmx and
	i386/i386-mmx-linux.

gdb/doc/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.texinfo (i386 Features): Make org.gnu.gdb.i386.avx
	optional.  Make org.gnu.gdb.i386.avx requires
	org.gnu.gdb.i386.avx.

gdb/gdbserver/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
	(i386-mmx.o): New.
	(i386-mmx.c): Likewise.
	(i386-mmx-linux.o): Likewise.
	(i386-mmx-linux.c): Likewise.

	* configure.srv (srv_i386_regobj): Add i386-mmx.o.
	(srv_i386_linux_regobj): Add i386-mmx-linux.o.
	(srv_i386_xmlfiles): Add i386/i386-mmx.xml.
	(srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.

	* linux-x86-low.c (init_registers_i386_mmx_linux): New.
	(x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
	and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
2010-04-08 22:32:38 +00:00
Doug Evans 080017175b * source.c (openp): Skip $cdir in PATH.
doc/
	* gdb.texinfo (Command Files): Document that gdb skips $cdir in
	search path, and document that gdb only scans the search path if
	the script's path doesn't specify a directory.
2010-04-08 21:08:40 +00:00
Phil Muldoon f5f8b5baf4 2010-04-08 Phil Muldoon <pmuldoon@redhat.com>
* python/py-lazy-string.c (stpy_convert_to_value): Add i8n to error string.
2010-04-08 10:47:56 +00:00
Phil Muldoon fff5cc649e 2010-04-08 Phil Muldoon <pmuldoon@redhat.com>
PR python/11417

	* python/py-lazy-string.c (stpy_convert_to_value): Check for
          a NULL address.
	  (gdbpy_create_lazy_string_object): Allow strings with a NULL
          address and a zero length.

2010-04-08  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-value: Add null string variable.
	  (test_lazy_string): Test zero length, NULL address lazy
	  strings.
2010-04-08 10:28:42 +00:00
Hui Zhu f8c4f48020 2010-04-08 Hui Zhu <teawater@gmail.com>
* i386-tdep.c (i386_process_record): Add support for insn
	rdtsc.
2010-04-08 09:23:06 +00:00
Doug Evans eb5cda8649 * python/python.c (source_python_script): Use ensure_python_env
to prepare environment for script.
2010-04-08 04:57:25 +00:00
gdbadmin 1ad0dc9bb8 *** empty log message *** 2010-04-08 00:00:03 +00:00
H.J. Lu 1570b33e44 Add x86 AVX support to gdbserver.
2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (clean): Updated.
	(i386-avx.o): New.
	(i386-avx.c): Likewise.
	(i386-avx-linux.o): Likewise.
	(i386-avx-linux.c): Likewise.
	(amd64-avx.o): Likewise.
	(amd64-avx.c): Likewise.
	(amd64-avx-linux.o): Likewise.
	(amd64-avx-linux.c): Likewise.

	* configure.srv (srv_i386_regobj): Add i386-avx.o.
	(srv_i386_linux_regobj): Add i386-avx-linux.o.
	(srv_amd64_regobj): Add amd64-avx.o.
	(srv_amd64_linux_regobj): Add amd64-avx-linux.o.
	(srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
	(srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
	(srv_i386_xmlfiles): Add i386/i386-avx.xml.
	(srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
	(srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
	(srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.

	* i387-fp.c: Include "i386-xstate.h".
	(i387_xsave): New.
	(i387_cache_to_xsave): Likewise.
	(i387_xsave_to_cache): Likewise.
	(x86_xcr0): Likewise.

	* i387-fp.h (i387_cache_to_xsave): Likewise.
	(i387_xsave_to_cache): Likewise.
	(x86_xcr0): Likewise.

	* linux-arm-low.c (target_regsets): Initialize nt_type to 0.
	* linux-crisv32-low.c (target_regsets): Likewise.
	* linux-m68k-low.c (target_regsets): Likewise.
	* linux-mips-low.c (target_regsets): Likewise.
	* linux-ppc-low.c (target_regsets): Likewise.
	* linux-s390-low.c (target_regsets): Likewise.
	* linux-sh-low.c (target_regsets): Likewise.
	* linux-sparc-low.c (target_regsets): Likewise.
	* linux-xtensa-low.c (target_regsets): Likewise.

	* linux-low.c: Include <sys/uio.h>.
	(regsets_fetch_inferior_registers): Support nt_type.
	(regsets_store_inferior_registers): Likewise.
	(linux_process_qsupported): New.
	(linux_target_ops): Add linux_process_qsupported.

	* linux-low.h (regset_info): Add nt_type.
	(linux_target_ops): Add process_qsupported.

	* linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
	and <sys/uio.h>.
	(init_registers_i386_avx_linux): New.
	(init_registers_amd64_avx_linux): Likewise.
	(xmltarget_i386_linux_no_xml): Likewise.
	(xmltarget_amd64_linux_no_xml): Likewise.
	(PTRACE_GETREGSET): Likewise.
	(PTRACE_SETREGSET): Likewise.
	(x86_fill_xstateregset): Likewise.
	(x86_store_xstateregset): Likewise.
	(use_xml): Likewise.
	(x86_linux_update_xmltarget): Likewise.
	(x86_linux_process_qsupported): Likewise.
	(target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
	(x86_arch_setup): Don't call init_registers_amd64_linux nor
	init_registers_i386_linux here.  Call
	x86_linux_update_xmltarget.
	(the_low_target): Add x86_linux_process_qsupported.

	* server.c (handle_query): Call target_process_qsupported.

	* target.h (target_ops): Add process_qsupported.
	(target_process_qsupported): New.
2010-04-07 18:49:46 +00:00
H.J. Lu c302619d21 Checkin gdb.arch/i386-avx.exp. 2010-04-07 18:47:57 +00:00
H.J. Lu a055a18785 Support amd64 AVX.
gdb/

2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-linux-nat.c: Include "regset.h", "elf/common.h",
	<sys/uio.h> and "i386-xstate.h".
	(PTRACE_GETREGSET): New.
	(PTRACE_SETREGSET): Likewise.
	(have_ptrace_getregset): Likewise.
	(amd64_linux_gregset64_reg_offset): Include 16 upper YMM
	registers.
	(amd64_linux_gregset32_reg_offset): Include 8 upper YMM
	registers.
	(amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS.
	(amd64_linux_store_inferior_registers): Likewise.
	(amd64_linux_read_description): Check and enable AVX target
	descriptions.

	* amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h"
	and "features/i386/amd64-avx-linux.c".
	(amd64_linux_regset_sections): New.
	(amd64_linux_core_read_description): Check and enable AVX
	target description.
	(amd64_linux_init_abi): Set xsave_xcr0_offset.  Call
	set_gdbarch_core_regset_sections.
	(_initialize_amd64_linux_tdep): Call
	initialize_tdesc_amd64_avx_linux.

	* amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace
	AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM.
	(tdesc_amd64_avx_linux): New.
	(amd64_linux_update_xstateregset): Likewise.

	* amd64-tdep.c: Include "features/i386/amd64-avx.c".
	(amd64_ymm_names): New.
	(amd64_ymmh_names): Likewise.
	(amd64_register_name): Likewise.
	(amd64_supply_xstateregset): Likewise.
	(amd64_collect_xstateregset): Likewise.
	(amd64_supply_xsave): Likewise.
	(amd64_collect_xsave): Likewise.
	(AMD64_NUM_REGS): Removed.
	(amd64_dwarf_reg_to_regnum): Return %ymmN register number for
	%xmmN if AVX is available.
	(amd64_pseudo_register_name): Support pseudo YMM registers.
	(amd64_regset_from_core_section): Support .reg-xstate section.
	(amd64_init_abi): Set ymmh_register_names, num_ymm_regs
	and ymm0h_regnum.  Call set_gdbarch_register_name.
	(amd64_init_abi): Call initialize_tdesc_amd64_avx.

	* amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and
	AMD64_YMM15H_REGNUM.
	(AMD64_NUM_REGS): New.
	(amd64_supply_xsave): Likewise.
	(amd64_collect_xsave): Likewise.
	(amd64_register_name): Removed.
	(amd64_register_type): Likewise.

gdb/testsuite/

2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.arch/i386-avx.c: New.
	* gdb.arch/i386-avx.exp: Likewise.

	* gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 18:46:50 +00:00
H.J. Lu 31aeac7844 Support i387 AVX.
2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* i387-tdep.c: Include "i386-xstate.h".
	(XSAVE_XSTATE_BV_ADDR): New.
	(xsave_avxh_offset): Likewise.
	(XSAVE_AVXH_ADDR): Likewise.
	(i387_supply_xsave): Likewise.
	(i387_collect_xsave): Likewise.

	* i387-tdep.h (I387_NUM_YMM_REGS): New.
	(I387_YMM0H_REGNUM): Likewise.
	(I387_YMMENDH_REGNUM): Likewise.
	(i387_supply_xsave): Likewise.
	(i387_collect_xsave): Likewise.
2010-04-07 18:44:57 +00:00
H.J. Lu c131fcee79 Support i386 AVX.
2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-linux-nat.c: Include "regset.h", "elf/common.h",
	<sys/uio.h> and "i386-xstate.h".
	(PTRACE_GETREGSET): New.
	(PTRACE_SETREGSET): Likewise.
	(fetch_xstateregs): Likewise.
	(store_xstateregs): Likewise.
	(GETXSTATEREGS_SUPPLIES): Likewise.
	(regmap): Include 8 upper YMM registers.
	(i386_linux_fetch_inferior_registers): Support XSAVE extended
	state.
	(i386_linux_store_inferior_registers): Likewise.
	(i386_linux_read_description): Check and enable AVX target
	descriptions.

	* i386-linux-tdep.c: Include "regset.h", "i387-tdep.h",
	"i386-xstate.h" and "features/i386/i386-avx-linux.c".
	(i386_linux_regset_sections): Add ".reg-xstate".
	(i386_linux_gregset_reg_offset): Include 8 upper YMM registers.
	(i386_linux_core_read_xcr0): New.
	(i386_linux_core_read_description): Check and enable AVX target
	description.
	(i386_linux_init_abi): Set xsave_xcr0_offset.
	(_initialize_i386_linux_tdep): Call
	initialize_tdesc_i386_avx_linux.

	* i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Replace
	I386_SSE_NUM_REGS with I386_AVX_NUM_REGS.
	(i386_linux_core_read_xcr0): New.
	(tdesc_i386_avx_linux): Likewise.
	(I386_LINUX_XSAVE_XCR0_OFFSET): Likewise.

	* i386-tdep.c: Include "i386-xstate.h" and
	"features/i386/i386-avx.c".
	(i386_ymm_names): New.
	(i386_ymmh_names): Likewise.
	(i386_ymmh_regnum_p): Likewise.
	(i386_ymm_regnum_p): Likewise.
	(i386_xmm_regnum_p): Likewise.
	(i386_register_name): Likewise.
	(i386_ymm_type): Likewise.
	(i386_supply_xstateregset): Likewise.
	(i386_collect_xstateregset): Likewise.
	(i386_sse_regnum_p): Removed.
	(i386_pseudo_register_name): Support pseudo YMM registers.
	(i386_pseudo_register_type): Likewise.
	(i386_pseudo_register_read): Likewise.
	(i386_pseudo_register_write): Likewise.
	(i386_dbx_reg_to_regnum): Return %ymmN register number for
	%xmmN if AVX is available.
	(i386_regset_from_core_section): Support .reg-xstate section.
	(i386_register_reggroup_p): Supper upper YMM and YMM registers.
	(i386_process_record): Replace i386_sse_regnum_p with
	i386_xmm_regnum_p.
	(i386_validate_tdesc_p): Support org.gnu.gdb.i386.avx feature.
	Set ymmh_register_names, num_ymm_regs, ymm0h_regnum and xcr0.
	(i386_gdbarch_init): Set xstateregset.  Set xsave_xcr0_offset.
	Call set_gdbarch_register_name.  Replace I386_SSE_NUM_REGS with
	I386_AVX_NUM_REGS.  Set ymmh_register_names, ymm0h_regnum and
	num_ymm_regs.  Add num_ymm_regs to set_gdbarch_num_pseudo_regs.
	Set ymm0_regnum.
	(_initialize_i386_tdep): Call initialize_tdesc_i386_avx.

	* i386-tdep.h (gdbarch_tdep): Add xstateregset, ymm0_regnum,
	xcr0, xsave_xcr0_offset, ymm0h_regnum, ymmh_register_names and
	i386_ymm_type.
	(i386_regnum): Add I386_YMM0H_REGNUM, and I386_YMM7H_REGNUM.
	(I386_AVX_NUM_REGS): New.
	(i386_xmm_regnum_p): Likewise.
	(i386_ymm_regnum_p): Likewise.
	(i386_ymmh_regnum_p): Likewise.

	* common/i386-xstate.h: New.
2010-04-07 18:43:45 +00:00
H.J. Lu 98adf0f383 Add x86 AVX XML files.
2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* config/djgpp/fnchange.lst: Add x86 AVX XML files.

	* features/Makefile (WHICH): Add i386/i386-avx,
	i386/i386-avx-linux, i386/x86-64-avx and i386/x86-64-avx-linux.
	(i386/i386-avx-expedite): New.
	(i386/i386-avx-linux-expedite): Likewise.
	(i386/x86-64-avx-expedite):Likewise.
	(i386/x86-64-avx-linux-expedite): Likewise.
	($(outdir)/i386/i386-avx.dat): New dependency.
	($(outdir)/i386/i386-avx-linux.dat): Likewise.
	($(outdir)/i386/x86-avx-64.dat): Likewise.
	($(outdir)/i386/x86-64-avx-linux.dat): Likewise.

	* features/i386/32bit-avx.xml: New.
	* features/i386/64bit-avx.xml: Likewise.
	* features/i386/i386-avx-linux.c: Likewise.
	* features/i386/i386-avx-linux.xml: Likewise.
	* features/i386/i386-avx.c: Likewise.
	* features/i386/i386-avx.xml: Likewise.
	* features/i386/x86-64-avx-linux.c: Likewise.
	* features/i386/x86-64-avx-linux.xml: Likewise.
	* features/i386/x86-64-avx.c: Likewise.
	* features/i386/x86-64-avx.xml: Likewise.
	* regformats/i386/i386-avx-linux.dat: Likewise.
	* regformats/i386/i386-avx.dat: Likewise.
	* regformats/i386/x86-64-avx-linux.dat: Likewise.
	* regformats/i386/x86-64-avx.dat: Likewise.
2010-04-07 18:41:49 +00:00
Doug Evans 05159abe96 * top.c (source_file_name): Make const char *.
* top.h (source_file_name): Update.
	* cli/cli-script.c (source_cleanup_lines_args): Make old_file
	const char *.
	(script_from_file): Change `file' arg to const char *.
	* cli/cli-script.h (script_from_file): Update.
2010-04-07 16:54:39 +00:00
Doug Evans 937502b8a9 Fix regexps in previous checkin. 2010-04-07 03:47:22 +00:00
Doug Evans 96e398662d * cli/cli-cmds.c (source_command): Run cleanups.
testsuite/
	* gdb.base/source-test.gdb: New file.
	* gdb.base/source.exp: Test source -v.
2010-04-07 03:42:55 +00:00
gdbadmin db564246a8 *** empty log message *** 2010-04-07 00:00:34 +00:00
Stan Shebs 3149d8c115 2010-04-06 Stan Shebs <stan@codesourcery.com>
* defs.h (char_ptr): Move typedef here from...
	* ada-lang.c (char_ptr): Remove.
	* charset.c (char_ptr): Remove.
	* tracepoint.h (struct uploaded_string): Remove.
	(struct uploaded_tp): Use vectors for string arrays.
	* tracepoint.c (trace_save): Use vectors of actions.
	(parse_tracepoint_definition): Ditto.
	(get_uploaded_tp): Clear vectors.
	* breakpoint.c (create_tracepoint_from_upload): Use vectors.
	(next_cmd): Change to an int.
	(read_next_cmd): Use vector of command strings.
2010-04-06 17:47:40 +00:00
Doug Evans 4cc23edeb9 * top.h (source_script, cd_command): Delete.
* main.c: #include "cli/cli-cmds.h"
2010-04-06 16:51:18 +00:00
Ulrich Weigand 5984a431b3 * gdb.cp/inherit.exp (test_print_anon_union): Fix re_class pattern. 2010-04-06 12:45:22 +00:00
Kevin Buettner bd333fb734 * m32c-tdep.c (make_types): When calling `arch_type', pass size of
type in bytes, not bits.
2010-04-06 00:14:43 +00:00
gdbadmin 3df4642a73 *** empty log message *** 2010-04-06 00:00:12 +00:00
Pierre Muller ec8a089a30 * gdb/stabsread.c (define_symbol): Add support for char
and string constants.

	* gdb/testsuite/gdb.stabs/aout.sed: Convert all backslash to double backslash
	within one line, unless it is followed by a double quote.
	* gdb/testsuite/gdb.stabs/hppa.sed: Idem.
	* gdb/testsuite/gdb.stabs/weird.def: Add char and String constants
	* gdb/testsuite/gdb.stabs/weird.exp: Check for correct parsing of
	chhar and string constants.
	* gdb/testsuite/gdb.stabs/xcoff.sed: Ignore escaped quote quotes
	in .stabs to .stabx substitution.
2010-04-05 22:43:49 +00:00
Pierre Muller 2244ba2e4a Remove remaining "%ll" uses.
* go32-nat.c (go32_pte_for_address): Replace "0x%llx" using
	hex_string call.
	* rs6000-nat.c (rs6000_ptrace64): Idem.
	* solib-pa64.c (pa64_current_sos): Idem.
	* solib-spu.c (spu_current_sos): Idem.
	* linux-nat.c (linux_nat_find_memory_regions): Replace "%lld" using
	plongest call.
	* nto-procfs.c (procfs_meminfo): Replace "0x%016llx" using
	phex (VAR, 8) call.
	* sh64-tdep.c (sh64_show_media_regs): Idem.
2010-04-05 22:18:53 +00:00
Stan Shebs fce3c1f0f1 2010-04-05 Stan Shebs <stan@codesourcery.com>
* tracepoint.c: Include gdbcore.h.
	(tfile_xfer_partial): Return partial results, also try reading
	from executable.
	(tfile_has_all_memory): New function.
	(init_tfile_ops): Use it.

	* gdb.trace/tfile.c: Add a variable split across two blocks, and a
	constant global.
	* gdb.trace/tfile.exp: Try to print them.
2010-04-05 21:57:18 +00:00
Doug Evans c375651d8a * gdb.texinfo (maint show python auto-load): Fix typo. 2010-04-05 17:14:57 +00:00
Sergio Durigan Junior 626ea16dd6 2010-03-23 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/10736:
	* xml-syscall.c (my_gdb_datadir): New variable to keep track of
	the changes in data-directory.
	(init_sysinfo): Reload the syscall XML file if the data-directory
	has changed.
2010-04-05 15:58:53 +00:00
Jan Kratochvil 1f7ccab234 gdb/
Code cleanup.
	* breakpoint.c (bpstat_stop_status): Use bpstat_causes_stop.
2010-04-05 10:07:30 +00:00
gdbadmin 0539a0deb5 *** empty log message *** 2010-04-05 00:00:03 +00:00
Stan Shebs d77f58beee 2010-04-04 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* breakpoint.c (breakpoint_1): Add filter argument, return number of
	breakpoints printed.
	(is_hardware_watchpoint): Make argument const.
	(is_watchpoint): Ditto.
	(is_tracepoint): Merge of tracepoint_type and breakpoint_is_tracepoint,
	use it everywhere.
	(breakpoints_info): Pass NULL to breakpoint_1.
	(maintenance_info_breakpoints): Ditto.
	(watchpoints_info): New function.
	(tracepoints_info): Use breakpoint_1 filter.
	(set_ignore_count): Warn that tracepoint ignore count will be ignored.
	(_initialize_breakpoint): Make "info watchpoints" its own command.
	* breakpoint.h (is_tracepoint): Rename from breakpoint_is_tracepoint.
	* mi/mi-cmd-break.c (mi_cmd_break_commands): Use is_tracepoint.

	* gdb.texinfo (Setting Breakpoints): "info watch" no longer a synonym.
	(Setting Watchpoints): Update description of "info watch".
	(Disabling Breakpoints): Only "info break" lists all.

	* gdb.base/completion.exp: Update for new "info watchpoints".
	* gdb.base/default.exp: Ditto.
	* gdb.base/help.exp: Ditto.
	* gdb.base/watchpoint.exp: Ditto.
	* gdb.trace/infotrace.exp: Update "info tracpoints" output.
2010-04-04 23:47:16 +00:00
Stan Shebs af54718eae 2010-04-04 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (tfile_fetch_registers): Add fallback case.

	* gdb.texinfo (Tracepoint Restrictions): Document PC inference.
	(tdump): Explain how tdump works.

	* gdb.trace/tfile.exp: Sharpen tfind test.
2010-04-04 23:31:29 +00:00
Jan Kratochvil 74d1f91eb1 gdb/
* infcmd.c (run_command_1): Call proceed with regcache_read_pc address.
	* config/djgpp/fnchange.lst: Add translation for break-entry.exp.

gdb/testsuite/
	* gdb.base/break-entry.exp: New.
2010-04-04 22:12:14 +00:00
Jan Kratochvil 91d91ceba4 gdb/
* breakpoint.c (bpstat_find_step_resume_breakpoint): Remove.
	* breakpoint.h (bpstat_find_step_resume_breakpoint): Remove.
2010-04-04 13:54:51 +00:00
gdbadmin 6d1ad4017d *** empty log message *** 2010-04-04 00:00:45 +00:00
Pedro Alves fc7238bbba * inferiors.c (add_thread): Set last_status kind to
TARGET_WAITKIND_IGNORE.
	* linux-low.c (cancel_breakpoint): Remove unnecessary regcache
	fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
	(linux_wait_1): Move `thread' local definition to block that uses
	it.  Don't NULL initialize `event_child'.
	(linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
	Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
	* linux-x86-low.c (x86_breakpoint_at): Read raw memory.
2010-04-03 23:14:18 +00:00
gdbadmin 1eed4def45 *** empty log message *** 2010-04-03 00:00:10 +00:00
Jan Kratochvil 60531b2469 gdb/
* dwarf2read.c (read_namespace_type): Use common "return set_die_type"
	code form.
2010-04-02 15:21:47 +00:00
Hui Zhu eb8e76db62 2010-04-02 Hui Zhu <teawater@gmail.com>
Michael Snyder <msnyder@vmware.com>

	* gdb.reverse/i386-sse-reverse.exp: New file.
	* gdb.reverse/i386-sse-reverse.c: New file.
2010-04-02 05:13:09 +00:00
Hui Zhu a3c4230a63 2010-04-02 Hui Zhu <teawater@gmail.com>
* i386-tdep.c (OT_DQUAD): New enum.
	(i386_process_record): Add code for MMX, 3DNow!, SSE, SSE2,
	SSE3, SSSE3 and SSE4.
2010-04-02 05:09:29 +00:00
Hui Zhu b15758fe2f 2010-04-02 Hui Zhu <teawater@gmail.com>
* i386-tdep.c (i386_record_lea_modrm_addr): Remove useless
	"*addr = 0".
2010-04-02 05:04:57 +00:00
Pedro Alves afd02f27b0 * tracepoint.c (trace_dump_actions): New, factored out from
trace_dump_command, and adjusted to recurse into while-stepping's
	action list.
	(trace_dump_command): Use it.
2010-04-02 01:39:53 +00:00
Pedro Alves bf65cad81d * gdb.trace/tfind.exp: Adjust expected disassembly output. 2010-04-02 01:31:59 +00:00
Pedro Alves 5cea2a2659 * breakpoint.h (struct counted_command_line): Moved definition to
breakpoint.c, and forward declare.
	(breakpoint_commands): Declare.
	* breakpoint.c (struct counted_command_line): Moved here.
	(breakpoint_commands): New.
	* tracepoint.c (encode_actions): Use breakpoint_commands.
	* remote.c (remote_download_tracepoint): Ditto.
2010-04-02 01:18:35 +00:00
gdbadmin 9406745256 *** empty log message *** 2010-04-02 00:00:34 +00:00
H.J. Lu 7c47795c2b Use hex_string instead of phex_nz for error.
2010-04-01  H.J. Lu  <hongjiu.lu@intel.com>

	* remote.c (remote_parse_stop_reply): Use hex_string instead
	of phex_nz for error.
2010-04-01 23:13:24 +00:00
Stan Shebs fff87407d4 2010-04-01 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* tracepoint.h (enum actionline_type): Remove.
	(validate_actionline): Change return to void.
	* tracepoint.c (report_agent_reqs_errors): New function.
	(validate_actionline): Call it, change return to void, report errors
	more consistently.
	(collect_symbol): Call report_agent_reqs_errors.
	(encode_actions_1): Ditto.
	(encode_actions): Don't expect a result from validate_actionline.

	* gdb.trace/actions.exp: Tweak expected output.
	* gdb.trace/while-stepping.exp: Tweak expected output.
2010-04-01 22:57:25 +00:00
Stan Shebs 615bcdefbf 2010-04-01 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_start_command): Confirm if trace is running.
	(trace_stop_command): Error if trace not running.
2010-04-01 20:30:56 +00:00
H.J. Lu fe01d6681b Support "ah", "bh", "ch", "dh" on amd64.
gdb/

2010-04-01  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-tdep.c (amd64_byte_names): Add "ah", "bh", "ch", "dh".
	(AMD64_NUM_LOWER_BYTE_REGS): New.
	(amd64_pseudo_register_read): Handle "ah", "bh", "ch", "dh".
	(amd64_pseudo_register_write): Likewise.
	(amd64_init_abi): Set num_byte_regs to 20.

gdb/testsuite/

2010-04-01  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.arch/amd64-byte.exp: Check "ah", "bh", "ch", "dh".
2010-04-01 20:02:10 +00:00
Pedro Alves bdabb07895 * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
an extended waitstatus, or by a watchpoint.
	(cancel_breakpoints_callback): Don't cancel a breakpoint if the
	thread was stepping or has been stopped by a watchpoint.
2010-04-01 15:31:26 +00:00
Pedro Alves d3bbe7a0c8 * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
(set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
	of another, then delete the previous, and validate all
	breakpoints.
	(validate_inserted_breakpoint): New.
	(delete_disabled_breakpoints): New.
	(validate_breakpoints): New.
	(check_mem_read): Validate breakpoints before trusting their
	shadow.  Delete disabled breakpoints.
	(check_mem_write): Validate breakpoints before trusting they
	should be inserted.  Delete disabled breakpoints.
	* mem-break.h (validate_breakpoints):
	* server.c (handle_query): Validate breakpoints when we see a
	qSymbol query.
2010-04-01 14:26:53 +00:00
Pedro Alves 8b07ae33f0 * linux-low.c (linux_wait_1): Avoid setting need_step_over is
there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
	if we could tell there's a GDB breakpoint at stop_pc.
	(need_step_over_p): Don't do a step over if we find a GDB
	breakpoint at the resume PC.

	* mem-break.c (struct raw_breakpoint): New.
	(enum bkpt_type): New type `gdb_breakpoint'.
	(struct breakpoint): Delete the `PC', `old_data' and `inserted'
	fields.  New field `raw'.
	(find_raw_breakpoint_at): New.
	(set_raw_breakpoint_at): Handle refcounting.  Create a raw
	breakpoint instead.
	(set_breakpoint_at): Adjust.
	(delete_raw_breakpoint): New.
	(release_breakpoint): New.
	(delete_breakpoint): Rename to...
	(delete_breakpoint_1): ... this.  Add proc parameter.  Use
	release_breakpoint.  Return ENOENT.
	(delete_breakpoint): Reimplement.
	(find_breakpoint_at): Delete.
	(find_gdb_breakpoint_at): New.
	(delete_breakpoint_at): Delete.
	(set_gdb_breakpoint_at): New.
	(delete_gdb_breakpoint_at): New.
	(gdb_breakpoint_here): New.
	(set_reinsert_breakpoint): Use release_breakpoint.
	(uninsert_breakpoint): Rename to ...
	(uninsert_raw_breakpoint): ... this.
	(uninsert_breakpoints_at): Adjust to handle raw breakpoints.
	(reinsert_raw_breakpoint): Change parameter type to
	raw_breakpoint.
	(reinsert_breakpoints_at): Adjust to handle raw breakpoints
	instead.
	(check_breakpoints): Adjust.  Use release_breakpoint.
	(breakpoint_here): Rewrite using find_raw_breakpoint_at.
	(breakpoint_inserted_here): Ditto.
	(check_mem_read): Adjust to iterate over raw breakpoints instead.
	Don't trust the breakpoint's shadow if it is not inserted.
	(check_mem_write): Adjust to iterate over raw breakpoints instead.
	(delete_all_breakpoints): Adjust.
	(free_all_breakpoints): Mark all breakpoints as uninserted, and
	use delete_breakpoint_1.

	* mem-break.h (breakpoints_supported): Delete declaration.
	(set_gdb_breakpoint_at): Declare.
	(gdb_breakpoint_here): Declare.
	(delete_breakpoint_at): Delete.
	(delete_gdb_breakpoint_at): Declare.

	* server.h (struct raw_breakpoint): Forward declare.
	(struct process_info): New field `raw_breakpoints'.

	* linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
	breakpoints.
2010-04-01 14:25:34 +00:00
Pedro Alves 86b17b608f gdb/
* breakpoint.c (multi_start, multi_end, last_was_multi): Delete.
	(prev_breakpoint_count): New.
	(set_breakpoint_count): Adjust.
	(rbreak_start_breakpoint_count): New.
	(start_rbreak_breakpoints): Adjust.
	(end_rbreak_breakpoints): Adjust.
	(struct commands_info) <arg>: New field.
	(do_map_commands_command): Tweak output to include breakpoint spec
	range.
	(commands_command_1): Adjust.  Avoid setting an xfree cleanup if
	ARG was empty on entry.  Set INFO's arg.
	(create_breakpoint): Adjust.

	* NEWS: Clarify `commands' changes.

	gdb/doc/
	* gdb.texinfo (Break Commands): Clarify `commands' changes, and
	add cross reference.

	gdb/testsuite/
	* gdb.base/commands.exp: Adjust.
	* gdb.cp/extern-c.exp: Adjust.
2010-04-01 14:11:24 +00:00
Pedro Alves 2c58c0a9a5 gdb/
* tracepoint.c: Include stack.h.
	(struct add_local_symbols_data): New.
	(do_collect_symbol): New.
	(add_local_symbols): Rewrite using iterate_over_block_arg_vars and
	iterate_over_block_local_vars.
	* stack.c (print_block_frame_locals): Rewrite as ...
	(iterate_over_block_locals): ... this.  Take a callback function
	pointer and generic data pointer, and call that instead of
	print_variable_and_value.
	(struct print_variable_and_value_data): New.
	(do_print_variable_and_value): New.
	(iterate_over_block_local_vars): New, abstracted out from
	print_frame_local_vars.
	(print_frame_local_vars): Rewrite using
	iterate_over_block_local_vars.
	(iterate_over_block_arg_vars): New, abstracted out from
	print_frame_arg_vars.
	(print_frame_arg_vars): Rewrite using iterate_over_block_arg_vars.
	* stack.h (iterate_over_block_arg_local_vars_cb): New typedef.
	(iterate_over_block_arg_vars, iterate_over_block_local_vars): Declare.

	gdb/testsuite/
	* gdb.trace/collection.c (local_test_func): Define a local struct,
	and instanciate it.
2010-04-01 11:24:01 +00:00
Pedro Alves 0db9b91c94 * gdb.trace/collection.exp (gdb_collect_args_test)
(gdb_collect_argarray_test): XFAIL the tests that assume the
	argarray argument's elements are collected.
2010-04-01 00:55:03 +00:00
gdbadmin dde5d5bf85 *** empty log message *** 2010-04-01 00:00:03 +00:00
Richard Earnshaw d476da0ef3 * arm-tdep.c (thumb_get_next_pc_raw): Correctly detect TBH
instructions.  Use the PC+4 if the base of the TBB or TBH is the
	PC register.
2010-03-31 22:10:07 +00:00
Jan Kratochvil 8072405bd6 gdb/
Fix crash on reading wrong function declaration DWARF.
	* dwarf2read.c (read_subroutine_type): New variable void_type.
	Pre-fill all TYPE_FIELD_TYPEs.  Move nparams and iparams initialization
	more close to their use.

gdb/testsuite/
	* gdb.dwarf2/dw2-bad-parameter-type.exp,
	gdb.dwarf2/dw2-bad-parameter-type.S: New.
2010-03-31 18:13:38 +00:00
Stan Shebs 8bf6485c1c 2010-03-31 Stan Shebs <stan@codesourcery.com>
* breakpoint.c (tracepoint_save_command): Include variables,
 	conditionals, tracepoint types, and default-collect.
	* tracepoint.c (save_trace_state_variables): New function.
	* tracepoint.h (save_trace_state_variables): Declare it.

	* gdb.trace/save-trace.exp: Test save/restore of default-collect
	and tracepoint conditionals.
	(gdb_verify_tracepoints): Delete unused return.
2010-03-31 17:59:49 +00:00
Pierre Muller 2ae2a0b7f1 * src/gdb/remote.c (end_thread): ARI fix: Use xstrdup instead of strdup. 2010-03-31 14:36:41 +00:00
Pedro Alves ff12863fb8 * gdb.texinfo (TUI Commands): Mention that in some cases, these
commands error out.
2010-03-31 12:19:52 +00:00
Keith Seitz 86ffb50612 * c-typeprint.c (c_type_print_args): Don't print "void"
for java, regardless of whether it is TYPE_PROTOTYPED.
  Use the passed-in language instead of current_language.
  (c_type_print_varspec_suffix): Use current_language instead
  of assuming language_c.
  * jv-typeprint.c (java_type_print_base): (bz 9320) Strip off
  any return type specifier from the physname.
2010-03-31 00:48:29 +00:00
Keith Seitz fd7f724a31 * gdb.java/jmisc.exp (ptype jmisc): Allow the constructor to
appear in the output before main.
  Remove KFAIL for gdb/2215 aka bz 9320.
2010-03-31 00:47:23 +00:00
gdbadmin 94c11f939a *** empty log message *** 2010-03-31 00:00:33 +00:00
Doug Evans 0906dd0b0a * gdb.arch/amd64-word.exp: Rename hex to hexr, the former is defined
by dejagnu.
	* gdb.arch/amd64-dword.exp: Ditto.
2010-03-30 22:25:59 +00:00
Pedro Alves 956c2c8b9a * tui/tui-interp.c (tui_is_toplevel): New.
(tui_init): Set it.
	(tui_allowed_p): New.
	* tui/tui.c (tui_enable): Check if the TUI is allowed before
	enabling it.
	* tui/tui.h (tui_allowed_p): Declare.
2010-03-30 22:21:34 +00:00
Doug Evans 8d9e771911 * gdb.base/annota1.exp (break handle_USR1): Make fail and pass text
match.
	(break printf): Ditto.
2010-03-30 22:12:07 +00:00
H.J. Lu f68eb6123c Add org.gnu.gdb.i386.avx.
2010-03-30  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.texinfo (i386 Features): Add org.gnu.gdb.i386.avx.
2010-03-30 18:37:03 +00:00
Tom Tromey 98e5a990dd 2010-03-30 Ozkan Sezer <sezeroz@gmail.com>
* serial.h: Include winsock2.h before windows.h.
2010-03-30 18:08:04 +00:00
H.J. Lu c8d5aac9db Add xmlRegisters= to qSupported packet.
gdb/

2010-03-30  H.J. Lu  <hongjiu.lu@intel.com>

	* NEWS: Mention xmlRegisters= in qSupported packet.

	* i386-tdep.c: Include "remote.h".
	(_initialize_i386_tdep): Call register_remote_support_xml.

	* remote.c (remote_support_xml): New.
	(register_remote_support_xml): Likewise.
	(remote_query_supported_append): Likewise.
	(remote_query_supported): Support remote_support_xml.

	* remote.h (register_remote_support_xml): New.

gdb/doc/

2010-03-30  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.texinfo (General Query Packets): Add xmlRegisters.
2010-03-30 15:45:16 +00:00
Stan Shebs 42e08e6983 2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_find_line_command): Remove dead code.
2010-03-30 00:19:43 +00:00
gdbadmin fe5c95995a *** empty log message *** 2010-03-30 00:00:33 +00:00
Stan Shebs 7d13fe92bd 2010-03-29 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* gdb.texinfo (GDB/MI Tracepoint Commands): Add notes about the
	GDBN equivalent.
	(Set Tracepoints): Remove mention that conditional tracepoints
	don't exist.
	(Tracepoint Actions): Clarify when while-stepping collection
	happens, note that while-stepping does not automatically collect
	$pc.
2010-03-29 23:47:28 +00:00
Stan Shebs 409873ef5c 2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.h (struct uploaded_string): New struct.
	(struct uploaded_tp): New fields for source strings.
	* breakpoint.c (this_utp, next_cmd): New globals.
	(read_uploaded_action): New function.
	(create_tracepoint_from_upload): Fill in more parts
	of a tracepoint.
	* tracepoint.c (encode_source_string): New function.
	(trace_save): Write out source strings, fix error checks.
	(parse_tracepoint_definition): Add source string parsing.
	* remote.c (PACKET_TracepointSource): New packet type.
	(remote_download_command_source): New function.
	(remote_download_tracepoint): Download source pieces also.
	(_initialize_remote): Add packet config command.

	* gdb.texinfo (Tracepoint Packets): Describe QTDPsrc.
	(General Query Packets): Describe TracepointSource.
2010-03-29 23:45:06 +00:00
Sami Wagiaalla 1da644f033 2010-03-29 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/nsusing.exp: Marked imported declaration test as xfail with
	gcc < 4.4.
	* gdb.cp/shadow.exp: Ditto.
2010-03-29 20:35:19 +00:00
Stan Shebs a040585484 2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (collect_symbol): Send LOC_UNRESOLVED symbols to
	expression handler.
2010-03-29 17:58:17 +00:00
Stan Shebs 76a2b9588c 2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (start_tracing): Check tracepoints before sending
	commands to target, don't start if all tracepoints disabled.
2010-03-29 17:41:38 +00:00
Pedro Alves a8121990c1 * gdb.trace/collection.exp (run_trace_experiment): Make sure
"tstart" is silent.
2010-03-29 00:46:54 +00:00
gdbadmin 0e780da906 *** empty log message *** 2010-03-29 00:00:03 +00:00
Pedro Alves 6e79d36707 * gdb.trace/collection.exp (executable): New.
(binfile): Use it.
	(fpreg, spreg, pcreg): New.
	(test_register): Use gdb_test_multiple.  Pass /x to print.
	(prepare_for_trace_test): New.
	(run_trace_experiment): Use "continue", not gdb_run_cmd.
	(gdb_collect_args_test, gdb_collect_argstruct_test)
	(gdb_collect_argarray_test, gdb_collect_locals_test): Use
	prepare_for_trace_test.
	(gdb_collect_registers_test): Use prepare_for_trace_test.  Use
	fpreg, spreg and pcreg.
	(gdb_collect_expression_test, gdb_collect_globals_test): Use
	prepare_for_trace_test.
	(gdb_trace_collection_test): Use fpreg, spreg and pcreg.  Don't
	try to detect tracing support here.  Don't set breakpoints at
	`begin' or `end' here.
	<global scope>: Use clean_restart.  Run to main before checking
	for tracing support.  Check for for tracing support here.
2010-03-28 23:17:57 +00:00
Jan Kratochvil 09248348a7 gdb/testsuite/
* gdb.base/break-interp.exp (test_core, test_attach, test_ld): Add
	" as $displacement" to "seen displacement message".
2010-03-28 19:08:24 +00:00
Pedro Alves 12f2d60102 Whoops. Use tab, not spaces. 2010-03-28 18:11:20 +00:00
Pedro Alves d350db3834 gdb/
* cli/cli-script.c (process_next_line): Handle 'stepping'.

	gdb/testsuite/
	* gdb.trace/while-dyn.exp (executable): New variable.
	(binfile): Use it.
	(test_while_stepping): New function.  Move most tests here.  Call
	it once for each of the while-stepping, stepping and ws aliases.
2010-03-28 18:00:57 +00:00
gdbadmin 69f6c109fa *** empty log message *** 2010-03-28 00:00:03 +00:00
Eli Zaretskii ee8e71d48b * gdb.texinfo (ARM): Document arguments to "target sim".
(Set Catchpoints): Use @dots{} instead of @r{...}.
2010-03-27 09:01:26 +00:00
Stan Shebs 8b9b7ef838 2010-03-26 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (disconnect_or_stop_tracing): Get out of tfind mode.
2010-03-27 00:12:34 +00:00
gdbadmin 7989c76eac *** empty log message *** 2010-03-27 00:00:34 +00:00
Stan Shebs 9766ced415 2010-03-26 Tom Tromey <tromey@redhat.com>
* breakpoint.c (commands_command_1): Duplicate 'arg'.
2010-03-26 23:49:31 +00:00
Ulrich Weigand 059acae734 * breakpoint.c (expand_line_sal_maybe): Always call skip_prologue_sal.
(skip_prologue_sal): Remove local definition.
	(resolve_sal_pc): Remove now unnecessary code.
	* linespec.c (minsym_found): Call skip_prologue_sal.
	* symtab.c (find_function_start_pc): Remove.
	(find_function_start_sal): Extract prologue skipping into ...
	(skip_prologue_sal): ... this new function.  Handle code both
	with and without debug info.  Respect SAL's explicit_pc and
	explicit_line flags.  Inline old find_function_start_pc.
	* symtab.h (find_function_start_pc): Remove.
	(skip_prologue_sal): Add prototype.
2010-03-26 19:41:50 +00:00
Ulrich Weigand 4a811a977f * dwarf2read.c (read_func_scope): Also scan specification DIEs
for DW_TAG_imported_module children.
2010-03-26 18:55:30 +00:00
Ulrich Weigand 907af001f7 ChangeLog:
* dwarf2read.c (dwarf2_name): Work around GCC bugzilla debug/41828 by
	ignoring spurious DW_AT_name attributes for unnamed structs or unions.
	* completer.c (add_struct_fields): Fix inverted logic.

testsuite/ChangeLog:

	* gdb.cp/inherit.exp (test_ptype_si): XFAIL test for GCC versions
	that do not provide the tagless_struct type name at all.
	(test_print_anon_union): Do not check value of uninitialized
	union member.  Do not use cp_test_ptype_class, so we can accept
	"long" as well as "long int".
2010-03-26 18:05:46 +00:00
Ulrich Weigand dde2d684b0 * breakpoint.c (bpstat_clear_actions): Reset bs->commands_left. 2010-03-26 16:41:54 +00:00
Pedro Alves a609a0c8ae * tracepoint.c (current_trace_status): Don't make sure error_desc
is non-NULL here.
	(parse_trace_status): Release a previous error_desc string, and
	set it to NULL by default.  If stop reason is tracepoint_error,
	make sure error_desc is not left NULL.
2010-03-26 15:26:29 +00:00
Pedro Alves 610197fd46 gdb/
* tracepoint.c (trace_save): Remove X from tracepoint error
	description.

	gdb/testsuite/
	* gdb.trace/tfile.c (tohex, bin2hex): New.
	(write_error_trace_file): Hexify error description.
2010-03-26 14:31:48 +00:00
Pedro Alves 99b5e152aa gdb/
* tracepoint.c (parse_trace_status): Don't allow plain strings in
	the terror description.  Don't expect an X prefix.

	gdb/doc/
	* gdb.texinfo (Tracepoint Packets): Remove mention that
	terror:string may be plain text, and drop mention of X prefix.
2010-03-26 13:35:06 +00:00
Vladimir Prus cd64ee3183 * gdb.texinfo (GDB/MI Tracepoint Commands): Add comma after @xref. 2010-03-26 08:08:07 +00:00
Stan Shebs 6c28cbf2b6 2010-03-25 Stan Shebs <stan@codesourcery.com>
* tracepoint.h (trace_stop_reason): Add tracepoint_error.
	(struct trace_status): New field error_desc.
	* tracepoint.c (stop_reason_names): Add terror.
	(current_trace_status): Ensure non-NULL error description.
	(trace_status_command): Add error report.
	(trace_status_mi): Ditto.
	(trace_save): Add special case for error description.
	(parse_trace_status): Add case for errors.

	* gdb.texinfo (Tracepoint Packets): Document trace error status.

	* gdb.trace/tfile.c: Generate an additional trace file, improve
	portability.
	* gdb.trace/tfile.exp: Test trace file with an error stop, delete
	files in a better way.
2010-03-26 01:46:29 +00:00
gdbadmin 0de81d1453 *** empty log message *** 2010-03-26 00:00:03 +00:00
Keith Seitz 418835ccec * dwarf2read.c (read_subroutine_type): If the compilation unit
language is Java, mark any formal parameter named "this" as
  artificial (GCC/43521).
  (dwarf2_name): Add special handling for Java constructors.
2010-03-25 22:13:15 +00:00
Keith Seitz e62b8c7ea4 * gdb.java/jprint.exp: XFAIL printing of static class members
because of GCC debuginfo problem.
2010-03-25 22:12:07 +00:00
Tom Tromey aa7d318d60 PR gdb/11327, PR gdb/11328, PR breakpoints/11368:
* infrun.c (handle_inferior_event): Change initialization of
	stop_stack_dummy.
	(handle_inferior_event): Change assignment to stop_stack_dummy.
	(normal_stop): Update use of stop_stack_dummy.
	(struct inferior_status) <stop_stack_dummy>: Change type.
	* inferior.h (stop_stack_dummy): Update.
	* infcmd.c (stop_stack_dummy): Change type.
	* infcall.c (cleanup_delete_std_terminate_breakpoint): New
	function.
	(call_function_by_hand): Call set_std_terminate_breakpoint.
	Rewrite std::terminate handling.
	* breakpoint.h (enum bptype) <bp_std_terminate,
	bp_std_terminate_master>: New.
	(enum stop_stack_kind): New.
	(struct bpstat_what) <call_dummy>: Change type.
	(set_std_terminate_breakpoint, delete_std_terminate_breakpoint):
	Declare.
	* breakpoint.c (create_std_terminate_master_breakpoint): New
	function.
	(update_breakpoints_after_exec): Handle bp_std_terminate_master.
	Call create_std_terminate_master_breakpoint.
	(print_it_typical): Handle new breakpoint kinds.
	(bpstat_stop_status): Handle bp_std_terminate_master.
	(bpstat_what): Correctly set call_dummy field.  Handle
	bp_std_terminate_master and bp_std_terminate.
	(print_one_breakpoint_location): Update.
	(allocate_bp_location): Update.
	(set_std_terminate_breakpoint): New function.
	(delete_std_terminate_breakpoint): Likewise.
	(create_thread_event_breakpoint): Update.
	(delete_command): Update.
	(breakpoint_re_set_one): Update.
	(breakpoint_re_set): Call create_std_terminate_master_breakpoint.
2010-03-25 20:48:53 +00:00
Jan Kratochvil 82ccf5a577 gdb/
* symfile.c (build_section_addr_info_from_bfd): New.
	(build_section_addr_info_from_objfile): Base it on
	build_section_addr_info_from_bfd.
	(addrs_section_compar, addrs_section_sort): New.
	(addr_info_make_relative): New variables my_cleanup, abfd_addrs,
	addrs_sorted, abfd_addrs_sorted and addrs_to_abfd_addrs.  Build
	addrs_to_abfd_addrs.  Use it for recalculating ADDRS.

gdb/testsuite/
	* gdb.base/dup-sect.exp, gdb.base/dup-sect.S: New.
2010-03-25 20:29:30 +00:00
gdbadmin f541940721 *** empty log message *** 2010-03-25 00:00:33 +00:00
Michael Snyder 737c4c52da 2010-03-24 Michael Snyder <msnyder@localhost.localdomain>
* elfread.c (find_separate_debug_file_by_buildid):
	Remove unused local variable.
2010-03-24 21:58:31 +00:00
Daniel Jacobowitz 293e2f9ec5 * gdb.base/completion.exp: Allow long instead of long int.
* gdb.base/ending-run.exp: Match _rt_entry.* for RealView.
	* gdb.base/gdbvars.c (main): Remove unused usestubs code.  Reference
	variable p.
	* gdb.base/maint.exp: Allow ER_RO and ER_RW instead of .text and .data.
	* gdb.base/pointers.exp: Allow long instead of long int.
	* gdb.base/printcmds.exp: XFAIL for RealView on ARM EABI.
	* gdb.base/step-line.exp: Allow a directory before the source file name.
2010-03-24 21:28:14 +00:00
Tom Tromey 95a42b64a1 gdb
PR breakpoints/9352:
	* NEWS: Mention changes to `commands' and `rbreak'.
	* symtab.c (do_end_rbreak_breakpoints): New function.
	(rbreak_command): Call start_rbreak_breakpoints; arrange to call
	end_rbreak_breakpoints.
	* breakpoint.c (breakpoint_count, tracepoint_count): Now static.
	(set_breakpoint_count): Likewise.  Clear last_was_multi.
	(multi_start, multi_end, last_was_multi): New globals.
	(start_rbreak_breakpoints, end_rbreak_breakpoints): New
	functions.
	(struct commands_info): New
	(do_map_commands_command): New function.
	(commands_command_1): New function.
	(commands_command): Use it.
	(commands_from_control_command): Likewise.
	(do_delete_breakpoint): New function.
	(delete_command): Use it.
	(map_breakpoint_numbers): Add 'data' argument.  Pass to callback.
	(do_map_disable_breakpoint): New function.
	(disable_command): Use it.
	(do_map_enable_breakpoint): New function.
	(enable_command): Use it.
	(enable_once_breakpoint): Add argument.
	(enable_once_command): Update.
	(enable_delete_breakpoint): Add argument.
	(enable_delete_command): Update.
	(break_command_really): Set last_was_multi when needed.
	(check_tracepoint_command): Fix formatting.
	(validate_commands_for_breakpoint): New function.
	(breakpoint_set_commands): Use it.
	(tracepoint_save_command): Update.
	* breakpoint.h (start_rbreak_breakpoints, end_rbreak_breakpoints):
	Declare.
gdb/doc
	PR breakpoints/9352:
	* gdb.texinfo (Break Commands): Update.
gdb/testsuite
	PR breakpoints/9352:
	* gdb.base/default.exp: Update.
	* gdb.base/commands.exp: Update.
	* gdb.cp/extern-c.exp: Test setting commands on multiple
	breakpoints at once.
2010-03-24 21:24:09 +00:00
Daniel Jacobowitz 2390201f4b * gdb.base/call-signal-resume.exp, gdb.base/unwindonsignal.exp: Skip
if gdb,nosignals.
	* gdb.base/watchpoints.c: Do not include unnecessary headers.
	* lib/gdb.exp (gdb_test_multiple): Relax pattern for "the program
	exited".
2010-03-24 21:20:39 +00:00
Pedro Alves 6bf5e0ba81 * linux-low.c (status_pending_p_callback): Fix comment.
(linux_wait_for_event_1): Move most of the internal breakpoint
	handling from here...
	(linux_wait_1): ... to here.
	(count_events_callback): New.
	(select_singlestep_lwp_callback): New.
	(select_event_lwp_callback): New.
	(cancel_breakpoints_callback): New.
	(select_event_lwp): New.
	(linux_wait_1): Simplify internal breakpoint handling.  Give equal
	priority to all LWPs that have had events that should be reported
	to the client.  Cancel breakpoints when about to reporting the
	event to the client, not while stopping lwps.  No longer cancel
	finished single-steps here.
	(cancel_finished_single_step): Delete.
	(cancel_finished_single_steps): Delete.
2010-03-24 21:12:45 +00:00
Tom Tromey 9add0f1b43 * breakpoint.h (struct counted_command_line): New struct.
(struct breakpoint) <commands>: Change type.
	(struct bpstats) <commands>: Change type.
	<commands_left>: New field.
	* breakpoint.c (alloc_counted_command_line): New function.
	(incref_counted_command_line): Likewise.
	(decref_counted_command_line): Likewise.
	(do_cleanup_counted_command_line): Likewise.
	(make_cleanup_decref_counted_command_line): Likewise.
	(breakpoint_set_commands): Use decref_counted_command_line and
	alloc_counted_command_line.
	(commands_command): Don't error if breakpoint commands are
	executing.
	(commands_from_control_command): Likewise.
	(bpstat_free): Update.
	(bpstat_copy): Likewise.
	(bpstat_clear_actions): Likewise.
	(bpstat_do_actions_1): Likewise.
	(bpstat_stop_status): Likewise.
	(print_one_breakpoint_location): Likewise.
	(delete_breakpoint): Likewise.
	(bpstat_alloc): Initialize new field.
	(tracepoint_save_command): Update.
	* tracepoint.c (encode_actions): Update.
	(trace_dump_command): Update.
2010-03-24 21:12:18 +00:00
Pedro Alves 414a389f5c * mem-break.c (enum bkpt_type): New.
(struct breakpoint): New field `type'.
	(set_breakpoint_at): Change return type to struct breakpoint
	pointer.  Set type to `other_breakpoint' by default.
	(delete_breakpoint): Rewrite, supporting more than one breakpoint
	in the breakpoint list.
	(delete_reinsert_breakpoints): Only delete reinsert breakpoints.
	(reinsert_breakpoint): Rename to ...
	(reinsert_raw_breakpoint): ... this.
	(reinsert_breakpoints_at): Adjust.
	* mem-break.h (struct breakpoint): Declare.
	(set_breakpoint_at): Change return type to struct breakpoint
	pointer.
2010-03-24 21:11:25 +00:00
Stan Shebs 8c9a6790dd 2010-03-24 Stan Shebs <stan@codesourcery.com>
* gdb.trace/tfile.exp: Expect "trace frame", with a space.
2010-03-24 21:11:06 +00:00
Daniel Jacobowitz a6c727b2f1 * dwarf2-frame.c (dwarf2_frame_find_quirks): Use producer_is_realview.
* dwarf2read.c (load_full_comp_unit): Read DW_AT_producer.
	(read_structure_type): For RealView, set TYPE_STUB on structures with
	no byte size and no children.
	(read_subroutine_type): Mark functions as prototyped by default.
	* symtab.c (producer_is_realview): New function.
	* symtab.h (expand_line_sal): Fix declaration formatting.
	(producer_is_realview): Declare.

	testsuite/
	* gdb.base/callfuncs.exp (do_function_calls): Add XFAILs for RealView.
	* gdb.base/ptype.exp (ptype_maybe_prototyped): Add overprototyped
	argument.  Handle "short" and "long".
	(Top level): Pass overprototyped output for old_fptr and xptr.
2010-03-24 21:06:33 +00:00
Daniel Jacobowitz 0d39a07082 * arm-tdep.c (skip_prologue_function): New function.
(submask, bit, bits, sbits, BranchDest): Move higher in the file.
	(thumb_analyze_prologue): Document return value.  Recognize more
	Thumb instructions, skippable calls, and some Thumb-2 instructions.
	Add debug output.
	(arm_skip_prologue): Remove call dummy check.  Check the prologue
	for non-GNU compilers.
	(arm_instruction_changes_pc): New function.
	(arm_analyze_prologue): New function, broken out from
	arm_scan_prologue.  Recognize more ARM instructions and skippable
	calls.  Update comments.  Handle NULL cache.  Return the address
	of the first unrecognized instruction.  Do not skip past other
	instructions which change control flow.  Add debug output.
	(arm_scan_prologue): Use arm_analyze_prologue.
	(ARM_PC_32): Delete.
	(shifted_reg_val): Simplify ARM_PC_32 check.
2010-03-24 20:23:13 +00:00
Vladimir Prus 4baf5cf487 * tracepoint.c (tvariables_info_1): Actually compute
the number of rows in the result.
2010-03-24 19:37:06 +00:00
Pedro Alves 4a5e7a5b0a gdb/
* remote.c (crc32): Constify `buf' parameter.
	(remote_verify_memory): New, abstracted out from...
	(compare_sections_command): ... this.  Remove hardcoded target
	checks.
	(init_remote_ops): Install remote_verify_memory.
	* target.c (target_verify_memory): New.
	* target.h (struct target_ops) <to_verify_memory>: New field.
	(target_verify_memory): Declare.
2010-03-24 01:12:13 +00:00
Pedro Alves 2280c721d8 * server.c (handle_query): Assign, not compare. 2010-03-24 00:14:54 +00:00
Pedro Alves d50171e439 Teach linux gdbserver to step-over-breakpoints.
* linux-low.c (can_hardware_single_step): New.
	(supports_breakpoints): New.
	(handle_extended_wait): If stopping threads, read the stop pc of
	the new cloned LWP.
	(get_pc): New.
	(get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
	low target doesn't support retrieving the PC.
	(add_lwp): Set last_resume_kind to resume_continue.
	(linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
	(linux_attach): Don't clear stop_expected.  Set the lwp's
	last_resume_kind to resume_stop.
	(linux_detach_one_lwp): Don't check for removed breakpoints.
	(check_removed_breakpoint): Delete.
	(status_pending_p): Rename to ...
	(status_pending_p_callback): ... this.  Don't check for removed
	breakpoints.  Don't consider threads that are stopped from GDB's
	perspective.
	(linux_wait_for_lwp): Always read the stop_pc here.
	(cancel_breakpoint): New.
	(step_over_bkpt): New global.
	(linux_wait_for_event_1): Implement stepping over breakpoints.
	(gdb_wants_lwp_stopped): New.
	(gdb_wants_all_stopped): New.
	(linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
	single-step traps here.  Store the thread's last reported target
	wait status.
	(send_sigstop): Don't clear stop_expected.  Always set it,
	instead.
	(mark_lwp_dead): Remove reference to pending_is_breakpoint.
	(cancel_finished_single_step): New.
	(cancel_finished_single_steps): New.
	(wait_for_sigstop): Don't cancel finished single-step traps here.
	(linux_resume_one_lwp): Don't check for removed breakpoints.
	Don't set `step' on non-hardware step archs.
	(linux_set_resume_request): Ignore resume_stop requests if already
	stopping or stopped.  Set the lwp's last_resume_kind.
	(resume_status_pending_p): Don't check for removed breakpoints.
	(need_step_over_p): New.
	(start_step_over): New.
	(finish_step_over): New.
	(linux_resume_one_thread): Always queue a sigstop for resume_stop
	requests.  Clear the thread's last reported target waitstatus.
	Don't use the `suspended' flag.  Don't consider pending breakpoints.
	(linux_resume): Start a step-over if necessary.
	(proceed_one_lwp): New.
	(proceed_all_lwps): New.
	(unstop_all_lwps): New.
	* linux-low.h (struct lwp_info): Rewrite comment for the
	`suspended' flag.  Add the `stop_pc' field.  Delete the
	`pending_stop_pc' field.  Tweak the `stepping' flag's comment.
	Add `'last_resume_kind' and `need_step_over' fields.
	* inferiors.c (struct thread_info): Delete, moved elsewhere.
	* mem-break.c (struct breakpoint): Delete `reinserting' flag.
	Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
	(set_raw_breakpoint_at): New.
	(set_breakpoint_at): Rewrite to use it.
	(reinsert_breakpoint_handler): Delete.
	(set_reinsert_breakpoint): New.
	(reinsert_breakpoint_by_bp): Delete.
	(delete_reinsert_breakpoints): New.
	(uninsert_breakpoint): Rewrite.
	(uninsert_breakpoints_at): New.
	(reinsert_breakpoint): Rewrite.
	(reinsert_breakpoints_at): New.
	(check_breakpoints): Rewrite.
	(breakpoint_here): New.
	(breakpoint_inserted_here): New.
	(check_mem_read): Adjust.
	* mem-break.h (breakpoints_supported, breakpoint_here)
	(breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
	(reinsert_breakpoint_by_bp): Delete declaration.
	(delete_reinsert_breakpoints): Declare.
	(reinsert_breakpoint): Delete declaration.
	(reinsert_breakpoints_at): Declare.
	(uninsert_breakpoint): Delete declaration.
	(uninsert_breakpoints_at): Declare.
	(check_breakpoints): Adjust prototype.
	* server.h: Adjust include order.
	(struct thread_info): Declare here.  Add a `last_status' field.
2010-03-24 00:05:03 +00:00
gdbadmin 8541339168 *** empty log message *** 2010-03-24 00:00:04 +00:00
Pedro Alves 4dfd542337 * gdb.threads/pthreads.c (thread1, thread2, main): Fix printf
format strings and add casts to avoid compiler warnings.
2010-03-23 23:50:22 +00:00
Michael Snyder 30ba68cb7e 2010-03-23 Michael Snyder <msnyder@vmware.com>
* server.c (crc32): New function.
	(handle_query): Add handling for 'qCRC:' request.
2010-03-23 22:43:50 +00:00
Vladimir Prus 1814801734 * gdb.texinfo (GDB/MI Tracepoint Commands): Document MI tracepoint
commands.
2010-03-23 22:10:08 +00:00
Vladimir Prus 011aacb08e Implement -trace-save.
* mi-cmds.h (mi_cmds_trace_save): Declare.
	* mi-cmds.c (mi_cmds): Register -trace-save.
	* mi/mi-main.c (mi_cmd_trace_save): New.
	* remote.c (remote_save_trace_data): Take const parameter.
	* target.h (struct target_ops::to_save_trace_data): Take
	const parameter.
	* target.c (update_current_target): Adjust to the above.
	* tracepoint.c (trave_save): New, extracted from
	(trace_save_command): ...this.
	(tfile_trace_find): Remove message that is unnecessary now
	that 'tfind' reports found frame.
	* tracepoint.h (trace_save): Declare.
2010-03-23 22:05:46 +00:00
Vladimir Prus f197e0f1b1 Implement -trace-find.
* mi/mi-cmds.c (mi_cmds): Register -trace-find.
	* mi/mi-cmds.h (mi_cmd_trace_find): Declare.
	* mi/mi-main.c (mi_cmd_trace_find): New.
	* target.h (struct target_ops): Document to_trace_find.
	* tracepoint.h (tfind_1): Declare.
	* tracepoint.c (finish_tfind_command): Rename to...
	(tfind_1): ...this.
	* remote.c (remote_trace_find): Return -1 if target say
	there's no frame.  Improve error diagnostics.
2010-03-23 22:01:47 +00:00
Vladimir Prus 40e1c229a2 -trace-define-variable and -trace-list-variables.
* tracepoint.c (create_trace_state_variable): Make
    	private copy of name, as opposed to assuming the
    	pointer lives forever.
    	(tvariables_info_1): New.
    	(tvariables_info): Use the above.
    	* tracepoint.h (create_trace_state_variable, tvariables_info_1):
    	Declare.
    	* mi/mi-cmds.c (mi_cmds): Register -trace-define-variable
    	and -trace-list-variables.
    	* mi/mi-cmds.h (mi_cmd_trace_define_variable)
    	(mi_cmd_trace_list_variables): New.
    	* mi/mi-main.c (mi_cmd_trace_define_variable)
    	(mi_cmd_trace_list_variables): New.
2010-03-23 21:50:11 +00:00
Vladimir Prus 9b4c786c6c Implement -break-passcount.
* mi/mi-cmd-break.c (mi_cmd_break_passcount): New.
	* mi/mi-cmds.c (mi_cmds): Register -break-passcount.
	* mi/mi-cmds.h (mi_cmd_break_passcount): Declare.
2010-03-23 21:48:14 +00:00
Vladimir Prus f224b49dcd -trace-start/-trace-end/-trace-status.
* mi/mi-cmds.c (mi_cmds): Register -trace-start, -trace-status
	and -trace-stop.
	* mi/mi-cmds.h (mi_cmd_trace_start, mi_cmd_trace_status)
	(mi_cmd_trace_stop): Declare.
	* mi/mi-main.c (mi_cmd_trace_start, mi_cmd_trace_status)
	(mi_cmd_trace_stop): New.
	* tracepoint.c (start_tracing): New, extracted from...
	(trace_start_command): ...this.
	(trace_status_mi): New.
	* tracepoint.h (struct trace_status): Document
	stopping_tracepoint.
	(start_tracing, stop_tracing, trace_status_mi): Declare.
2010-03-23 21:46:33 +00:00
Vladimir Prus 6534d786b1 Implement creating tracepoints with -break-insert.
* mi/mi-cmd-break.c (mi_cmd_break_insert): Handle -a
	to mean that tracepoint should be created.
2010-03-23 21:41:55 +00:00
Vladimir Prus 51661e93bc * breakpoint.c (check_no_tracepoint_commands): Use
current spelling of 'teval'.
2010-03-23 21:36:05 +00:00
Vladimir Prus 58ddf7c9cd Remove conflict marker. 2010-03-23 21:34:30 +00:00
Vladimir Prus a7bdde9e63 Unify actions and commands
* defs.h (read_command_lines, read_command_lines_1): New
	parameters validator and closure.
	* tracepoint.h (struct action_line): Remove.
	* breakpoint.h (struct breakpoint): Remove the 'actions'
	field.
	* defs.h (enum command_control_type): New value
	while_stepping_control.
	(struct command_line): Add comments.
	* breakpoint.c (breakoint_is_tracepoint): New.
	(breakpoint_set_commands): For tracepoints,
	verify the commands are permissible.
	(check_tracepoint_commands): New.
	(commands_command): Require that each new line is validated using
	check_tracepoint_command, if we set commands for a tracepoint.
	(create_tracepoint_from_upload): Likewise.
	(print_one_breakpoint_location): Remove the code to print
	actions specifically.
	(tracepoint_save_command): Relay to print_command_lines.
	* cli/cli-script.c (process_next_line): New parameters validator
	and closure. Handle 'while-stepping'. Call validator if not null.
	(read_command_lines, read_command_lines1): Likewise.
	(recurse_read_control_structure): New parameters validator and
	closure. Handle while_stepping_control.
	(print_command_lines): Handle while-stepping.
	(get_command_line, define_command, document_command): Adjust.
	* remote.c (remote_download_tracepoint): Adjust.
	* tracepoint.c (make_cleanup_free_actions, read_actions)
	(free_actions, do_free_actions_cleanup): Remove.
	(trace_actions_command): Use read_command_lines.
	(validate_actionline): Use error in one place.
	(encode_actions_1): New, extracted from...
	(encode_actions): ...this. Also use cleanups for exception
	safety.
	(trace_dump_command): Adjust.
	* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
	it's tracepoint.
2010-03-23 21:32:28 +00:00
Mike Frysinger 64e3cf3d4f gdb: fix building with system readline
Building gdb with --enable-targets=all and --with-system-readline hits a
failure in a few targets all related to the inclusion of some opcodes
headers.  The usage of the bundled readline results in an -I to the top
srcdir, but if that isn't used, then there is no such -I path.  A few gdb
targets use this implicitly to include opcodes/ source header files.  So
make sure there is always an explicit -I path to the opcodes/ directory.
2010-03-23 21:31:29 +00:00