Commit Graph

28804 Commits

Author SHA1 Message Date
Hui Zhu 953b98d1cf 2011-07-15 Hui Zhu <teawater@gmail.com>
* remote.c (remote_get_trace_status): Add comments.
2011-07-15 02:07:43 +00:00
gdbadmin 6d44329fb3 *** empty log message *** 2011-07-15 00:00:33 +00:00
Paul Pluzhnikov df46027df1 Cleanup: kill trailing whitespace 2011-07-14 16:41:56 +00:00
Paul Pluzhnikov 059241a073 2011-07-14 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/minsym-fallback.exp: Link in C++ mode.
2011-07-14 16:33:21 +00:00
Jan Kratochvil c8f2448ab7 gdb/
Code cleanup - constify struct lval_funcs.
	* dwarf2loc.c (pieced_value_funcs): Make it const.
	* infrun.c (siginfo_value_funcs): Likewise.
	* opencl-lang.c (opencl_value_funcs): Likewise.
	* valops.c (value_assign, value_ind): Make the funcs variable const.
	* value.c (struct value): Make location.computed.funcs target const.
	Rearrange the comments.
	(allocate_computed_value): Make the funcs parameter target const.
	(value_computed_funcs): Return the funcs target const.
	(value_free, value_copy, set_value_component_location): Make the funcs
	variable const.
	* value.h (allocate_computed_value): Make the funcs parameter target
	const.
	(value_computed_funcs): Return the funcs target const.
	* windows-tdep.c (tlb_value_funcs): Make it const.
2011-07-14 15:00:20 +00:00
Hui Zhu f652de6f62 2011-07-14 Hui Zhu <teawater@gmail.com>
* remote.c (remote_get_trace_status): Initialize p.
2011-07-14 04:46:42 +00:00
gdbadmin 41d1d0bd9b *** empty log message *** 2011-07-14 00:00:33 +00:00
Jan Kratochvil 67f41397ce gdb/
Work around kgdb.
	* remote.c (remote_get_trace_status): New variable ex.  Put
	remote_get_noisy_reply into TRY_CATCH.  Call exception_fprintf for it.
2011-07-13 17:07:16 +00:00
matt rice 28a0b48c48 * gdb.python/py-objfile-script-gdb.py: Renamed to
py-objfile-script-gdb.py.in.
* gdb.python/py-objfile-script-gdb.py.in: Renamed from
py-objfile-script-gdb.py.
* gdb.python/py-objfile-script.exp: Update reference to
py-objfile-script-gdb.py.
2011-07-13 17:00:56 +00:00
Tom Tromey d1b66e6d73 * dwarf2expr.c (execute_stack_op) <DW_OP_GNU_regval_type>: Use
value_from_contents for final conversion.
2011-07-13 16:51:22 +00:00
Jan Kratochvil 9a771b671f gdb/testsuite/
* gdb.dwarf2/dw2-op-call.S (array1): Use the real label; do not
	reference undefined label.
2011-07-13 15:18:13 +00:00
Jan Kratochvil 1632a688b3 gdb/
Code cleanup.
	* dwarf2loc.c (dwarf_expr_frame_base_1, dwarf2_evaluate_loc_desc_full):
	Indent prototypes so they do not get into tags.
2011-07-13 15:15:42 +00:00
gdbadmin 8ce909f926 *** empty log message *** 2011-07-13 00:00:33 +00:00
Jan Kratochvil a7035dbbd1 gdb/
Code cleanup making also optimized out values lazy.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
	allocate_optimized_out_value.  Twice.
	(loclist_read_variable)  Use allocate_optimized_out_value.  Once.
	* findvar.c (read_var_value): Likewise.
	* value.c (allocate_optimized_out_value): New function.
	* value.h (allocate_optimized_out_value): New declaration.
2011-07-12 21:16:48 +00:00
Jan Kratochvil d07ed419cf gdb/
Fix occasional crash of CTRL-C during DWARF read in.
	* dwarf2read.c (dwarf2_mark_helper): Return on NULL CU.
2011-07-12 20:59:03 +00:00
gdbadmin 036d672c60 *** empty log message *** 2011-07-12 00:00:03 +00:00
Tom Tromey 86d318988c * regcache.c (struct regcache_descr): Fix typo.
* i387-tdep.c (i387_supply_xsave): Fix typo.
2011-07-11 17:19:16 +00:00
Tom Tromey 2ab9532817 * dwarf2read.c (handle_DW_AT_stmt_list): New function.
(read_file_scope, read_type_unit_scope): Use it.
2011-07-11 17:17:26 +00:00
Jan Kratochvil 04ad99e60b gdb/
* dwarf2expr.c (read_sleb128): Fix signed extension overflowing host
	`int'.

gdb/testsuite/
	* gdb.dwarf2/dw2-const.S (Pointer size): Change from 4 to 8.
	(DW_AT_high_pc, DW_AT_low_pc): Remove them.
	(val8, .Ltype_const8, .Ltype_int8, DW_TAG_variable): New.
	* gdb.dwarf2/dw2-const.exp (print/x val8): New test.
2011-07-11 13:40:24 +00:00
Phil Muldoon 713389e024 2011-07-11 Phil Muldoon <pmuldoon@redhat.com>
PR python/12438
	* python/python.c: Set gdbpy_should_print_stack default to off.
	(set_python): Deprecate maint set python print-stack to
	class_deprecate.
	(_initialize_python): Deprecate maint set/show python print-stack.
	Add new prefix command, python.  Add new setting, print-backtrace.
	* NEWS: Document set python print-stack.  Document default change.

2011-07-11  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12438
	* gdb.texinfo (Python Commands): Add deprecate note to maint
          set/show python print-stack.  Document set/show python
          print-backtrace.

2011-07-11  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12438
	* gdb.python/python.exp: Add maint set/show python print-stack
          deprecated tests.  Add set/show python print-backtrace tests.
2011-07-11 13:07:38 +00:00
Phil Muldoon 754eadd19f 2011-07-11 Phil Muldoon <pmuldoon@redhat.com>
* python/py-inferior.c (infpy_dealloc): New function.
        (inferior_to_inferior_object): Return a new object, or a
	new reference to the existing object.
        (find_thread_object): Cleanup references to inferior.
        (delete_thread_object): Ditto.
        * python/py-infthread.c (create_thread_object): Do not increment
	inferior reference count.
2011-07-11 12:10:19 +00:00
gdbadmin c930b845d3 *** empty log message *** 2011-07-11 00:00:03 +00:00
gdbadmin fc4cbfac1c *** empty log message *** 2011-07-10 00:00:03 +00:00
gdbadmin 00b50a6ad4 *** empty log message *** 2011-07-09 00:00:02 +00:00
Tom Tromey 5e44ecb338 * dwarf2loc.c (locexpr_regname): New function.
(locexpr_describe_location_piece): Use it.
	(disassemble_dwarf_expression): Add per_cu argument.  Use
	locexpr_regname.
	<DW_OP_GNU_deref_type, DW_OP_GNU_const_type,
	DW_OP_GNU_regval_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret>:
	New cases.
	(locexpr_describe_location_1): Add per_cu argument.
	(locexpr_describe_location): Update.
	(loclist_describe_location): Update.
2011-07-08 19:54:55 +00:00
Tom Tromey e0e9434c89 * dwarf2expr.c (execute_stack_op): Add QUIT. 2011-07-08 16:02:59 +00:00
gdbadmin a0b50e655a *** empty log message *** 2011-07-08 00:00:03 +00:00
Jan Kratochvil 97d146f805 gdb/testsuite/
* gdb.java/jprint.exp (print a java.lang.String): xfail without system
	debug info.
2011-07-07 14:08:21 +00:00
Hui Zhu 26afc0d703 2011-07-07 Hui Zhu <teawater@gmail.com>
Revert:
	2011-07-06  Hui Zhu  <teawater@gmail.com>
	* remote.c (remote_start_remote): Add TRY_CATCH for
	remote_get_trace_status.
	* tracepoint.c (disconnect_tracing): Ditto.
2011-07-07 13:32:55 +00:00
Andrew Burgess a40a111fc7 http://sourceware.org/ml/gdb-patches/2011-07/msg00085.html
* cli/cli-setshow.c (do_setshow_command): Display var_zinteger
	variables as signed, not unsigned.
2011-07-07 08:38:37 +00:00
Joel Brobecker e2bd3b15a8 Minor forward declaration reformatting (jit.c)
gdb/ChangeLog:

 	* jit.c (jit_inferior_init): Reformat forward declaration.
2011-07-07 02:07:04 +00:00
gdbadmin 5df0ebe99e *** empty log message *** 2011-07-07 00:00:03 +00:00
matt rice e3d961fe96 MAINTAINERS (Write after approval): Add myself to the list. 2011-07-06 22:20:16 +00:00
matt rice facde0e593 gdb.python/python.exp: Update filename paths.
gdb.python/py-symtab.exp: Ditto.
2011-07-06 22:15:02 +00:00
Joel Brobecker 3b2a0cf216 Fix JIT clang-lli regression (unable to read JIT descriptor from memory)
2011-07-06  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * jit.c (jit_inferior_init): Forward declare.
        (jit_breakpoint_re_set_internal): Call jit_inferior_init.

testsuite/ChangeLog:

2011-07-06  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * gdb.base/jit-so.exp: New test.
        * gdb.base/jit-dlmain.c: New file.
        * gdb.base/jit-main.c: Allow "main" to be elsewhere.
2011-07-06 21:40:17 +00:00
Marek Polacek 438640d112 gdb.python/py-evthreads.exp: add missing $ 2011-07-06 19:52:21 +00:00
Mike Frysinger 33a365dfad gdb: testsuite: add Blackfin support
This fills out a few of the test places where needed for Blackfin targets.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-06 18:40:30 +00:00
Marek Polacek 8f7ae68682 Fix race in gdb.python/py-evthreads.exp 2011-07-06 15:00:15 +00:00
Hui Zhu 21083d0f0c Correct a email error. 2011-07-06 02:46:47 +00:00
Hui Zhu 0f3428f083 2011-07-06 Hui Zhu <teawater@gmail.com>
* remote.c (remote_start_remote): Add TRY_CATCH for
	remote_get_trace_status.
	* tracepoint.c (disconnect_tracing): Ditto.
2011-07-06 02:43:12 +00:00
gdbadmin dfea59b08c *** empty log message *** 2011-07-06 00:00:03 +00:00
Tom Tromey fc9f3a6978 * symtab.c (operator_chars): Now static.
* linespec.c (operator_chars): Don't declare.
2011-07-05 20:30:19 +00:00
Thiago Jung Bauermann 26e519b913 * ui-out.h (ui_out_field_core_addr): Fix typo in comment. 2011-07-05 18:36:52 +00:00
Tom Tromey eb2a6f420b gdb
* gnu-v3-abi.c (gnuv3_rtti_type): Check TYPE_CPLUS_REALLY_JAVA.
	* gdbtypes.h (struct cplus_struct_type) <is_java>: New field.
	(TYPE_CPLUS_REALLY_JAVA): New macro.
	* dwarf2read.c (process_structure_scope): Set
	TYPE_CPLUS_REALLY_JAVA.
gdb/testsuite
	* gdb.java/jprint.java (jprint.hi): New field.
	* gdb.java/jprint.exp: Print string.
2011-07-05 13:36:42 +00:00
Thiago Jung Bauermann 177b42fefa gdb/
* ada-lang.c: Fix typos.
	* amd64-tdep.c: Likewise.
	* breakpoint.c: Likewise.
	* cli/cli-decode.c: Likewise.
	* findcmd.c: Likewise.
	* inline-frame.c: Likewise.
	* mi/mi-main.c: Likewise.
	* minsyms.c: Likewise.
	* monitor.c: Likewise.
	* monitor.h: Likewise.
	* prologue-value.c: Likewise.
	* reverse.c: Likewise.
	* s390-tdep.c: Likewise.

gdb/testsuite/
	* gdb.base/call-sc.c: Likewise.
	* gdb.base/ifelse.exp: Likewise.
	* gdb.base/structs.c: Likewise.

gdb/doc/
	* gdb.texinfo: Likewise.
2011-07-05 04:35:00 +00:00
gdbadmin ec478a00d2 *** empty log message *** 2011-07-05 00:00:03 +00:00
Joel Brobecker efae1d9244 Minor comment reformatting in generic_elf_osabi_sniffer
Comment says it all.  I just felt that putting some new text in
a separate paragraph allowed us to clearly identify the section
about ELFOSABI_NONE, and the part that talks about the new
ELFOSABI_GNU.

gdb/ChangeLog:

        * osabi.c (generic_elf_osabi_sniffer): Minor comment reformatting.
2011-07-04 19:50:44 +00:00
Joel Brobecker 6040a59db5 ada-tasks.c: handle known tasks maintained by a simply-linked list.
The mapping between Ada tasks, and the underlying threads is
normally maintained by the GNAT runtime under the known_tasks
array.  For performance reasons, this array is just a static
array with 10_000 entries in it. However, this is not very
practical in certain environments where memory is limited.
For those environments, the runtime has been enhanced to use
an alternate scheme with a linked list.

This change enhances the Ada tasking support to recognize this
situation and use the correct way of reading the tasks info
based on the the situation.

gdb/ChangeLog  (Tristan Gingold)

	* ada-tasks.c (KNOWN_TASKS_LIST): New macro.
	(tcb_fieldno): Add activation_link field.
	(get_known_tasks_addr): Moved and rewritten.
	(get_tcb_types_info): Set activation_link field.
	(read_known_tasks_array): Add parameter.  Rewritten.
	(read_known_tasks_list): New function.
	(read_known_tasks): New function.
	(ada_build_task_list): Call read_known_tasks instead of
	read_known_tasks_array.
	* ravenscar-thread.c: Add first_task_name constant.
	(has_ravenscar_runtime): Check for task list too.
2011-07-04 19:32:07 +00:00
Joel Brobecker cb741e45a0 Minor changes in ada-tasks.c
Just some minor cleanup changes in preparation for an upcoming
change...

gdb/ChangeLog  (Tristan Gingold)

	* ada-tasks.c: Renames fieldno to actb_fieldno.
	(ada_get_task_number): Indentation.
	(get_tcb_types_info): Remove all parameters.  Write directly
	the globals.
	(ptid_from_atcb_common): Adjust.
	(read_atcb): Adjust.
2011-07-04 19:31:49 +00:00
Thiago Jung Bauermann 7475b06c20 * symtab.c (in_prologue): Remove mention of ppc's refine_prologue_limit. 2011-07-04 18:51:12 +00:00
Thiago Jung Bauermann 15230f3745 * ui-out.c (ui_out_field_core_addr): Mention that the function
description is in the header file.
	* ui-out.h (ui_out_field_core_addr): Document function.
2011-07-04 18:50:17 +00:00
Thiago Jung Bauermann 65743aba62 * ui-out.c (ui_out_get_field_separator): Remove unused function.
* ui-out.h (ui_out_get_field_separator): Remove prototype.
2011-07-04 18:48:25 +00:00
Thiago Jung Bauermann c37a5aab6b * symtab.c (expand_line_sal): Remove empty line. 2011-07-04 18:47:09 +00:00
Thomas Schwinge 59adf69ea5 ELFOSABI_GNU.
gdb/
	* osabi.c (generic_elf_osabi_sniffer) <ELFOSABI_GNU>: Handle in the
	same way as ELFOSABI_NONE.
	<ELFOSABI_LINUX, ELFOSABI_HURD>: Remove cases.
2011-07-04 18:33:37 +00:00
Thiago Jung Bauermann e5dd410683 * breakpoint.c: Fix typos in comments.
* linespec.c: Likewise.
	* symtab.c: Likewise.
2011-07-04 18:31:25 +00:00
Joel Brobecker d40102a141 Do not load .eh_frame section from separete object files
We don't need to read the .eh_frame section from the separate
object files, because this data is already present in the
main executable (it needs to, or the program wouldn't work).

We discovered this investigating a problem with the 'next' command,
which was due to unwind failures, which came from the fact that
the .eh_frame was incorrectly relocated.

gdb/ChangeLog (Tristan Gingold):

    * dwarf2-frame.c (dwarf2_build_frame_info): Do not load .eh_frame
    section in separate object files.
2011-07-04 16:30:09 +00:00
Jan Kratochvil 2f741504c0 gdb/
Fix false GCC warning.
	* linespec.c (decode_line_1): Initialize values.
2011-07-04 14:16:14 +00:00
gdbadmin 9821e17216 *** empty log message *** 2011-07-04 00:00:02 +00:00
gdbadmin 662835875e *** empty log message *** 2011-07-03 00:00:02 +00:00
Jan Kratochvil e17476d75f gdb/testsuite/
* gdb.cp/m-static.exp: Call get_compiler_info.
	(static const int initialized nowhere): Call setup_xfail for gcc <= 4.4.
	* gdb.cp/pr9167.exp (p b): Likewise.
	* gdb.cp/temargs.exp: Do not set have_pr_45024_fixed for gcc 4.6.
	(test value of P in inner_m, test type of Z in inner_m): Call
	setup_xfail for gcc <= 4.5.
2011-07-02 15:13:13 +00:00
Jan Kratochvil 46fc714c1b gdb/testsuite/
* gdb.cp/m-static.exp: Call get_compiler_info.
	(static const int initialized nowhere): Call setup_xfail for gcc<=4.4.
2011-07-02 12:08:44 +00:00
gdbadmin b50c5470c5 *** empty log message *** 2011-07-02 00:00:02 +00:00
Jan Kratochvil 418c7cf761 gdb/
* linespec.c (find_method): Accept the function type automatically only
	if it was specified with parameter types.

gdb/testsuite/
	* gdb.cp/paren-type.cc: New files.
	* gdb.cp/paren-type.exp: New files.
2011-07-01 20:27:59 +00:00
Jan Kratochvil 3d50dd94cb gdb/
Stop on first linespec terminator instead of eating what we can.
	* linespec.c (is_linespec_boundary): New function.
	(name_end): Remove function.
	(keep_name_info): New parameter on_boundary, replace the body.
	(decode_line_1): Provide the parameter to keep_name_info.
	(decode_compound): Likewise.  Drop the trailing java return type
	handling.  Twice.

gdb/testsuite/
	Stop on first linespec terminator instead of eating what we can.
	* gdb.cp/minsym-fallback-main.cc (main): Call also C::operator ().
	* gdb.cp/minsym-fallback.cc (C::operator ()): Define.
	* gdb.cp/minsym-fallback.exp (break 'C::f()'): Change to ...
	(break C::f()): ... this one.
	(break C::operator()()): New test.
	* gdb.cp/minsym-fallback.h (C::operator ()): Declare.
	* gdb.java/jmisc.exp (break jmisc.main(java.lang.String[])int): New
	test.
2011-07-01 20:19:04 +00:00
Jan Kratochvil dcf9f4ab7f gdb/
Fall back linespec to minimal symbols.
	* linespec.c (decode_line_1): New variable ex, saved_argptr.  Protect
	decode_compound by TRY_CATCH, fall back on minsyms if it failed.
	(find_method, symbol_found): Change error to cplusplus_error.

gdb/testsuite/
	Fall back linespec to minimal symbols.
	* gdb.base/psymtab.exp (Don't search past end of psymtab.): Update the
	error message.
	* gdb.cp/cplusfuncs.exp (list foo::operator int*): Likewise.
	* gdb.cp/minsym-fallback-main.cc: New file.
	* gdb.cp/minsym-fallback.cc: New file.
	* gdb.cp/minsym-fallback.exp: New file.
	* gdb.cp/minsym-fallback.h: New file.
2011-07-01 20:16:39 +00:00
Jan Kratochvil bc68c4e5f8 gdb/Changelog fix:
* symtab.c (symbol_find_demangled_name): Remove DMGL_VERBOSE.
2011-07-01 19:19:13 +00:00
Jan Kratochvil 3f542ed1a3 gdb/
* symtab.c (symbol_find_demangled_name): Likewise.

gdb/testsuite/
	* gdb.cp/no-dmgl-verbose.cc: New file.
	* gdb.cp/no-dmgl-verbose.exp: New file.
2011-07-01 19:18:36 +00:00
Jan Kratochvil 900e11f9ec gdb/
* dwarf2read.c (check_physname): New variable.
	(dwarf2_physname): Prefer DW_AT_linkage_name over dwarf2_compute_name.
	(show_check_physname): New function.
	(_initialize_dwarf2_read): Add `check-physname' for check_physname.

gdb/doc/
	* gdb.texinfo (Debugging Output): Document set debug
	check-physname.

gdb/testsuite/
	* gdb.base/break-interp.exp (reach_1, test_ld): Allow also the prefix
	__GI_.
	* gdb.cp/psymtab-parameter.cc (func): Make it a template function.
	(f): New function.
	* gdb.cp/psymtab-parameter.exp (complete break 'func(): Rename to ...
	(complete p 'func<short>(): ... here.
	* gdb.dwarf2/dw2-linkage-name-trust-main.cc: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.S: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.exp: New file.
	* gdb.cp/temargs.exp (test type of F in k3_m, test value of F in k3_m):
	Make them KFAIL gcc/49546.
2011-07-01 19:12:12 +00:00
Joel Brobecker 2301925dd2 remove comment in machoread.c (macho_symfile_read)
Does not seem to be applicable to the current code anymore.

gdb/ChangeLog:

        * machoread.c (macho_symfile_read): Delete OBE comment.
2011-07-01 18:36:45 +00:00
Joel Brobecker 38947ccadc [mach-o] get rid of current_oso global
This current_oso global was used to store the OSO's symbol table
in order to relocate common symbols.  But it is also making the
assumption that all sections are going to be immediately relocated
as macho_add_oso_symfile does:
  - Initialize the current_oso
  - Use it through symbol_file_add_from_bfd
  - Reset the current_oso (to all fields NULL)

What actually happens is that the .debug_frame section gets read
lazily, and thus relocated at a later time.  This relocation causes
current_oso.symbol_table to be initialized (see macho_symfile_relocate)
again.  And this eventually causes to trip the...

        gdb_assert (current_oso.symbol_table == NULL);

...assertion to fail because the symbol_table was never free'ed.
To be complete, this happens because macho_symfile_relocate was
called outside of macho_add_oso_symfile's control, where the
set-global/use/unset-global dance happens.

But it looks like keeping this global around is not necessary, as
this symbol table is only used to relocate the common symbols.
We can do that prior to relocating the rest of the symbols.

gdb/ChangeLog:

        * machoread.c (struct macho_oso_data): Delete.
        (current_oso): Delete.
        (macho_relocate_common_syms): New function, mostly extracted
        out of
        (macho_add_oso_symfile): Call macho_relocate_common_syms.
        Remove code that sets and unset current_oso.
        (macho_symfile_relocate): Delete handling of common symbols,
        now moved to macho_relocate_common_syms.
2011-07-01 18:36:36 +00:00
Joel Brobecker a7aa0d73a2 [Darwin] Do not crash (failed assertion) after PT_KILL ptrace error
It might not be a debugger bug that caused the PT_KILL ptrace operation
to fail.  So emit a warning instead, and try to continue.

This patch also tries to handle the case where ptrace return -1,
but left errno set to zero.  According to the ptrace man page,
it is possible for some ptrace operations to return -1 in non-error
situations, and to detect those situations, it explains that errno
should be set prior to calling ptrace, and then checked again after.

gdb/ChangeLog:

        * darwin-nat.c (darwin_ptrace): Add documentation.
        Set errno to zero before calling ptrace.  If ptrace returns
        -1 and errno is zero, then change then return zero.
        (darwin_kill_inferior): Issue a warning instead of triggering
        a failed assertion when the PT_KILL ptrace operations returned
        nonzero.
2011-07-01 18:36:28 +00:00
Joel Brobecker 5e9bc145ee Darwin/detach: Do not resume inferior after ptrace detach
When trying to detach from an inferior that we start from the debugger,
GDB prints the following warning:

    (gdb) detach
    Detaching from program: /[...]/foo, process 74593
    warning: Mach error at "/[...]/darwin-nat.c:445" in function "darwin_resume_inferior": (os/kern) failure (0x5)

The warning comes from the following code in darwin_detach:

     darwin_resume_inferior (inf);

This is because the process has already been resumed by the
PT_DETACH ptrace operation that has just been performed.

On the other hand, when trying to detach from an inferior that
was started outside of debugger control (thus after having attached
the debugger to that inferior), things go smoothly.  That's because
we don't use ptrace to control the process in that case, and so
the resume is perfectly justified.

This patch makes sure that we resume the inferior during the detach
only when we're NOT using ptrace.

gdb/ChangeLog:

        * darwin-nat.c (darwin_detach): Call darwin_resume_inferior
        only when inf->private->no_ptrace.
2011-07-01 18:36:12 +00:00
Joel Brobecker 00eb2c4ae8 bettter display for temporary Ada exception catchpoints
Temporary catchpoints on Ada exceptions are now displayed as "Temporary
catchpoint" as opposed to just "Catchpoint".  This is cosmetic only, but
in line with what's done for other catchpoints as well as breakpoints.

gdb/ChangeLog:

        * ada-lang.c (print_it_exception): Print temporary catchpoints
        as "Temporary catchpoint".
        (print_mention_exception): Likewise.

gdb/testsuite/ChangeLog:

        * gdb.ada/catch_ex.exp: Add temporary catchpoint tests.
2011-07-01 18:35:36 +00:00
Jan Kratochvil 85a20c42ea gdb/testsuite/
Test GCC PR debug/49546.
	* gdb.cp/temargs.exp (set sixth breakpoint for temargs)
	(test type of F in k3_m, test value of F in k3_m): New.
	* gdb.cp/temargs.cc (struct S3, struct K3): New.
	(main): New variable k3.  Call k3.k3_m.
2011-07-01 18:32:06 +00:00
Tom Tromey 127c81bc57 * jv-lang.c (java_language_defn): Use java_printchar,
java_printstr.
	(java_get_encoding): New function.
	(java_emit_char): Use generic_emit_char.
	(java_printchar): New function.
	(java_printstr): Likewise.
2011-07-01 18:28:52 +00:00
Joel Brobecker 25552254a3 crash when printing type of tagged type
If the debugging info is incorrect or incomplete, printing the
type description of a variable that's a variant tagged type can
trigger a crash.  The crash comes from us trying print a NULL
string which was supposed to be the parent type name.

We observed this behavior on bareboard targets where a-tags is
not always linked in, as is the case for native platforms, for
instance. Coupled with -feliminate-unused-debug-types, this leads
to GDB being unable to find type ada__tags__type_specific_data,
without which printing the type description above cannot be done
acurately.  There is an easy workaround for this limitation,
which is to compile at least 1 unit with
-fno-eliminate-unused-debug-types, but GDB should also be made
resilient to this situation.

gdb/ChangeLog:

        * ada-typeprint.c (print_record_type): If unable to decode
        the name of the parent type, use the encoded name.
2011-07-01 18:27:35 +00:00
Joel Brobecker d2d43431e8 Fix printing address of packed array
When trying to print the address of a non-packed array, GDB
correctly prints the type name and address:

    (gdb) print &var
    $2 = (access pa.var) 0xbffff1d8

However, it is behaving differently when dealing with a packed
array:

    (gdb) p &var
    (access array (4 .. 8) of boolean <packed: 1-bit elements>) (4 =>
    false, false, false, true, false)

The type description isn't all that bad, but GDB shouldn't be
printing the array value!

This patch fixes the `print` and `ptype` command on packed and
non-packed array.  It also fixes a gdb.ada test to match with
the new ouput.

gdb/ChangeLog (Jean-Charles Delay):

        * ada-typeprint.c (ada_print_type): Fix both PAD type and
        pointer to constrained packed array type output.
        * ada-valprint.c (ada_val_print_1): Fix pointer to constrained
        packed array output.

gdb/testsuite/ChangeLog (Jean-Charles Delay):

        * gdb.ada/packed_array.exp: Fix expected outout.
2011-07-01 18:27:25 +00:00
Joel Brobecker 54ae186fb5 Fix ada array bounds display
Array bounds were not correctly displayed when the SHOW parameter of
print_type functions is set to -1.  This shows up in the following
type of situation, where we have a declaration as follow:

    Anon_Array_Int_Obj : array (1..10) of Integer := (others => 8);

In GDB/MI mode, trying to print the type info for our array object
yields:

    (gdb) -var-create ai 0 Anon_Array_Int_Obj
    (gdb) -var-info-type ai
    ^done,type="array (...) of integer"

The actual bounds are missing.  Contrast this with what happens
when in GDB/CLI mode:

    (gdb) ptype Anon_Array_Int_Obj
    type = array (1 .. 10) of integer

This patch fixes array type printing accordingly. And as it turns
out, it also improves the output for one of the tests already present,
so it shows that it's not just the GDB/MI mode that's affected.

gdb/ChangeLog (Jean-Charles Delay):

	* ada-typeprint.c (print_array_type): removed if condition on show
	being negative for bounds printing.

gdb/testsuite/ChangeLog (Jean-Charles Delay):

	* gdb.ada/packed_array.exp: fixed expected output.
2011-07-01 18:27:12 +00:00
Joel Brobecker 8f17729f21 treat identical enum types as the same type
This is to avoid an unnecessary multiple-choice menu for an
expression involving an enumeral declared in two types, when
the second type is an identical copy of the first type. This
happens in the following situation:

       type Color is (Black, Red, Green, Blue, White);
       type RGB_Color is new Color range Red .. Blue;

In that case, an implict type is created, and is used as the base
type for type RGB_Color.  This base type is a copy of type Color.
We've added some extensive comments explaining the situation and
our approach further.

gdb/ChangeLog:

        * ada-lang.c (ada_identical_enum_types_p): New function.
        (symbols_are_identical_enums): New function.
        (remove_extra_symbols): Do nothing if NSYMS < 2.
        Use symbols_are_identical_enums.

gdb/testsuite/ChangeLog:

        * gdb.ada/same_enum: New testcase.
2011-07-01 18:26:50 +00:00
Joel Brobecker f5aa6869de missing type description for typedef to pointer value
If we evaluate an expression that results in a value that is a typedef
to pointer, then the debugger fails to print the type description
before printing the actual value:

    (gdb) print e.plan(1)
    $1 = 0x0

The expected output is:

    (gdb) print e.plan(1)
    $1 = (access integer) 0x0

gdb/ChangeLog:

        * ada-valprint.c (ada_value_print): Handle typedefs.

gdb/testsuite/ChangeLog:

        * gdb.ada/ptr_typedef: New testcase.
2011-07-01 18:26:22 +00:00
Joel Brobecker 8f465ea731 Add missing word in comment (ada-lang.c)
gdb/ChangeLog:

        * ada-lang.c (ada_evaluate_subexp): Add missing word in comment.
2011-07-01 18:25:59 +00:00
Joel Brobecker 828292f271 variables whose type is a typedef to an array pointer
If we declare a type as being an access to array type, and then
declare a variable of that type, for instance:

        type Some_Array is array [...];
        type Array_Access is access all Some_Array;
        Table : Array_Access := [...];

The variable "Table" may be defined in the debugging information
as being a typedef to the array pointer type. In the past, it was
defined directly as the array pointer type, but this has been changed
to make sure that the typedef type gets used.

If the typedef type wasn't used, it would allow the compiler to stop
emitting that typedef type when compiling with
-feliminate-unused-debug-types.  The removal of this typedef would
be a problem, because GDB relies on the typedef to create symbols
for pointer types, and without it, we would no longer be able to
do "ptype array_access".

This patch helps prevent incorrect output or even crashes when that
extra typedef layer is used.

The testing is already mostly covered by arrayptr.exp, but I still
added a 'ptype' test, just for good measure.

gdb/ChangeLog: (Eric Botcazou)

        * ada-lang.c (thin_descriptor_type): Deal with typedefs.
        (decode_constrained_packed_array): Likewise.
        (ada_evaluate_subexp) <TERNOP_SLICE>: Likewise.

gdb/testsuite/ChangeLog (Joel Brobecker):

        * gdb.ada/arrayptr.exp: Add ptype test.
2011-07-01 18:25:49 +00:00
Joel Brobecker 3536d9e3f5 Fix date in testsuite/ChangeLog entry. 2011-07-01 18:25:33 +00:00
Joel Brobecker 18920c4226 handle character-based enumeration typedefs
Consider the following type:

   type Char_Enum_Type is ('A', 'B', 'C', 'D');

If the compiler generates a Char_Enum_Type typedef in the debugging
information, the debugger fails in the following case:

   (gdb) p Char_Enum_Type'('B')
   $1 = 66

For our type, the underlying value of 'B' is actually 1, not 66
(ASCII 'B').  We are failing this case because we were not handling
typedef to enum types before.  This patch fixes this.

gdb/ChangeLog:

        * ada-exp.y (convert_char_literal): Handle typedef types.

gdb/testsuite/ChangeLog:

        * gdb.ada/char_enum: New testcase.
2011-07-01 18:25:17 +00:00
Joel Brobecker c90092fe9e Document ada_remove_trailing_digits more
gdb/ChangeLog:

        * ada-lang.c (ada_remove_trailing_digits): Expand documentation.
2011-07-01 18:24:52 +00:00
Yao Qi 54aeeb996d 2011-07-02 Yao Qi <yao@codesourcery.com>
* gdb.base/dump.exp (capture_pointer_with_type): New.
	Get value from address instead of name.
	Start GDB once, and do `dump' and `restore'
	tests together.
2011-07-01 16:42:42 +00:00
Mike Frysinger db863c4274 gdb: tests: set remotetimeout to gdb_load_timeout for remote targets
Rather than relying on the default remotetimeout value (which might be
too small for some slower devices), use the existing gdb_load_timeout
config option to set it.

This adds two new helpers for getting/setting the remotetimout to keep
the new logic simple.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-01 00:19:25 +00:00
gdbadmin 5429523ed4 *** empty log message *** 2011-07-01 00:00:33 +00:00
Tom Tromey f748fb4088 * varobj.c (varobj_create): Call do_cleanups on early exit path.
* valops.c (find_overload_match): Call do_cleanups on early exit
	path.
	* solib.c (solib_find): Call do_cleanups on early exit path.
2011-06-30 19:29:55 +00:00
Tom Tromey 3bb47e8bce * symfile-mem.c (symbol_file_add_from_memory): Call do_cleanups.
* solib-svr4.c (open_symbol_file_object): Call do_cleanups on all
	return paths.  Defer final do_cleanups until last return.
	* arm-tdep.c (arm_exidx_new_objfile): Make null cleanup after
	early return.
2011-06-30 18:48:19 +00:00
Tom Tromey 4727bad393 * Makefile.in (SUBDIR_MI_CFLAGS): Don't add -DMI_OUT=1. 2011-06-30 17:01:29 +00:00
Andrew Burgess bb361dbfaf http://sourceware.org/ml/gdb-patches/2011-06/msg00444.html
Add myself to the write after approval list.
2011-06-30 09:00:54 +00:00
Andrew Burgess e9e642a83f http://sourceware.org/ml/gdb-patches/2011-06/msg00442.html
Don't compile c++ tests for platforms that don't support c++.
2011-06-30 08:53:38 +00:00
gdbadmin b9c00dd73c *** empty log message *** 2011-06-30 00:00:32 +00:00
Jan Kratochvil e0d00bc749 gdb/
Disable epilogue unwinders on recent GCCs.
	* amd64-tdep.c (amd64_in_function_epilogue_p): New variable symtab,
	initialize it, return 0 on EPILOGUE_UNWIND_VALID.
	* dwarf2read.c (process_full_comp_unit): Initialize
	EPILOGUE_UNWIND_VALID.
	* i386-tdep.c (i386_in_function_epilogue_p): New variable symtab,
	initialize it, return 0 on EPILOGUE_UNWIND_VALID.
	* symtab.h (struct symtab): New field epilogue_unwind_valid.
2011-06-29 22:19:24 +00:00
Jan Kratochvil 4632c0d0ff gdb/
Code cleanup - reformatting.
	* dwarf2read.c (producer_is_gcc_ge_4_0): Rename to ...
	(producer_is_gcc_ge_4): ... here, change the return value.
	(process_full_comp_unit): New variable gcc_4_minor, adjust the value
	interpretation.
2011-06-29 22:17:57 +00:00
Jan Kratochvil 32019081a7 gdb/
Fix non-only rename list for Fortran modules import.
	* cp-namespace.c (cp_scan_for_anonymous_namespaces): Adjust the
	cp_add_using_directive caller.
	(cp_add_using_directive): New parameter excludes, describe it.  New
	variables ix and param.  Compare if also excludes match.  Allocate NEW
	with variable size, initialize EXCLUDES there.
	(cp_lookup_symbol_imports): New variable excludep, test
	current->EXCLUDES with it.
	* cp-support.h: Include vec.h.
	(struct using_direct): New field excludes, describe it.
	(DEF_VEC_P (const_char_ptr)): New.
	(cp_add_using_directive): New parameter excludes.
	* defs.h (const_char_ptr): New typedef.
	* dwarf2read.c (read_import_statement): New variables child_die,
	excludes and cleanups, read in excludes.
	(read_namespace): Adjust the cp_add_using_directive caller.

gdb/testsuite/
	Fix non-only rename list for Fortran modules import.
	* gdb.fortran/module.exp (print var_x, print var_y, print var_z): New
	tests.
	* gdb.fortran/module.f90 (module moduse): New.
	(program module): use moduse, test var_x, var_y and var_z.
2011-06-29 22:05:16 +00:00
Jan Kratochvil 70c622a3d2 gdb/
Code cleanup.
	* cp-namespace.c (cp_add_using_directive): Turn positive comparison to
	negative comparisons.
2011-06-29 22:02:58 +00:00
Tom Tromey 0ecee54cfd PR testsuite/12040:
* gdb.fortran/array-element.exp: Use f90, not f77.
	* gdb.fortran/complex.exp: Use f90, not f77.
	* gdb.fortran/derived-type.exp: Use f90, not f77.
	* gdb.fortran/library-module.exp: Use f90, not f77.
	* gdb.fortran/logical.exp: Use f90, not f77.
	* gdb.fortran/module.exp: Use f90, not f77.
	* gdb.fortran/multi-dim.exp: Use f90, not f77.
	* gdb.fortran/subarray.exp: Use f90, not f77.
2011-06-29 17:50:47 +00:00
Tom Tromey 39c4d40aa5 gdb
2011-06-29  André Pönitz  <andre.poenitz@nokia.com>

	* mi/mi-main.c (mi_cmd_list_features): Emit
	breakpoint-notifications.
gdb/doc
	* gdb.texinfo (GDB/MI Miscellaneous Commands): Document
	breakpoint-notifications feature.
2011-06-29 17:30:01 +00:00
Ulrich Weigand 6f5def7d9e * gdb.texinfo (Target Description): Remove warning about
possibly unstable format.
2011-06-29 16:28:22 +00:00
Tom Tromey 3b2b8feaf4 gdb
PR fortran/10036:
	* valprint.h (generic_emit_char, generic_printstr): Declare.
	* valprint.c (wchar_printable, append_string_as_wide)
	(print_wchar): Move from c-lang.c.
	(generic_emit_char): New function; mostly taken from c_emit_char.
	(generic_printstr): New function; mostly taken from c_printstr.
	* f-valprint.c (f_val_print) <TYPE_CODE_ARRAY>: Handle strings
	represented as arrays.
	<TYPE_CODE_CHAR>: Treat as TYPE_CODE_INT; recognize as character
	type.
	* f-typeprint.c (f_type_print_base) <TYPE_CODE_CHAR>: Treat
	identically to TYPE_CODE_INT.
	* f-lang.c (f_get_encoding): New function.
	(f_emit_char): Use generic_emit_char.
	(f_printchar): Replace comment.
	(f_printstr): Use generic_printstr.
	* dwarf2read.c (read_base_type) <DW_ATE_unsigned>: Handle Fortran
	"character" types specially.
	<DW_ATE_signed_char, DW_ATE_unsigned_char>: Make TYPE_CODE_CHAR
	for Fortran.
	* c-lang.c (wchar_printable, append_string_as_wide, print_wchar):
	Move to valprint.c
	(c_emit_char): Call generic_emit_char.
	(c_printstr): Call generic_printstr.
gdb/testsuite
	* gdb.fortran/charset.exp: New file.
	* gdb.fortran/charset.f90: New file.
2011-06-29 15:32:40 +00:00
Gary Benson 168e6d4402 gdb/
* breakpoint.c (bpstat_what): Removed duplicated case.
2011-06-29 15:20:34 +00:00
Tom Tromey 42159ca500 PR testsuite/12040:
* lib/future.exp: New file, mostly extracted from ada.exp.
	Rewrote compatibility code to use rename.
	(gdb_find_gfortran): New proc.
	(gdb_default_target_compile): Refresh from dejagnu; plus a pending
	gfortran patch.
	* lib/ada.exp (gdb_find_gnatmake, gdb_default_target_compile):
	Move to future.exp.
	* lib/gdb.exp: Always load future.exp.
2011-06-29 14:44:45 +00:00
gdbadmin d555a4fbf3 *** empty log message *** 2011-06-29 00:00:33 +00:00
Tom Tromey 1c033f8c71 * python/python-internal.h (PY_SSIZE_T_CLEAN): Define. 2011-06-28 13:09:12 +00:00
Yao Qi af69a5cef7 2011-06-28 Yao Qi <yao@codesourcery.com>
* gdb.cp/exception.cc: Don't include iostream.
	(bar): Remove print statement.
	(catcher): New.
	(main): Remove print statements.  Call function catcher.
	* gdb.cp/exception.exp : Don't match inferior's output in regexp.
	Set breakpoint on catcher, and check the value of parameter.
2011-06-28 08:36:18 +00:00
gdbadmin 50673a5a82 *** empty log message *** 2011-06-28 00:00:03 +00:00
Tom Tromey 5fe41fbfa2 * valops.c (find_overload_match): Call do_cleanups before early
return.
	* top.c (execute_command): Call do_cleanups before early return.
	(command_loop): Likewise.
	* stack.c (backtrace_command): Make a null cleanup early.  Don't
	conditionally call do_cleanups.
	* python/py-value.c (TRY_CATCH): Move cleanup handling into
	TRY_CATCH.
	* python/py-breakpoint.c (gdbpy_breakpoint_has_py_cond): Rearrange
	so cleanups are always run.
	* mi/mi-cmd-var.c (mi_cmd_var_delete): Reset old_cleanups.
	* findcmd.c (parse_find_args): Call do_cleanups on early return
	path.
	* dbxread.c (elfstab_build_psymtabs): Make a null cleanup early.
	Don't conditionally call do_cleanups.
	* cli/cli-script.c (execute_user_command): Initialize 'old_chain'
	later.
2011-06-27 19:21:51 +00:00
Eric Botcazou e26bd57dea * MAINTAINERS (Write After Approval): Use default email address. 2011-06-27 17:00:39 +00:00
Joel Brobecker 6c3097fcd3 Add Eric Botcazou to the list of `Write After Approval' contributors
* MAINTAINERS (Write After Approval): Add Eric Botcazou.
2011-06-27 16:38:27 +00:00
Joel Brobecker 369c397ba4 Add support for single register window model on SPARC
2011-06-27  Eric Botcazou  <ebotcazou@adacore.com>
        * sparc-tdep.h (struct sparc_frame_cache): Add frame_offset,
        saved_regs_mask and copied_regs_mask fields.
        (sparc_record_save_insn): New prototype.
        * sparc-tdep.c (sparc_alloc_frame_cache): Initialize the new fields.
        (sparc_record_save_insn): New function.
        (sparc_analyze_prologue): Add head comment.  Recognize store insns
        of call-saved registers.  Use OFFSET consistently.  Recognize flat
        frames and cache their settings.
        (sparc32_skip_prologue): Handle flat frames.
        (sparc_frame_cache): Add frame_offset to the base address.
        (sparc32_frame_cache): Adjust to new frame description.
        (sparc32_frame_prev_register): Likewise.
        * sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
        * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_cache): Likewise.
        * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_cache): Likewise.
        * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_cache): Force the
        frame by calling sparc_record_save_insn.
        * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_cache): Likewise.
        * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_cache): Likewise.
        * sparc64obsd-tdep.c (sparc64obsd_frame_cache): Likewise.
2011-06-27 16:36:00 +00:00
Tristan Gingold b315ab2151 2011-06-27 Tristan Gingold <gingold@adacore.com>
* dwarf2read.c (struct dwarf2_section_info): Replace was_mmapped
	field by map_addr and map_len.
	(dwarf2_read_section): Adjust for the new bfd_mmap api.
	(munmap_section_buffer): Likewise.
2011-06-27 08:41:39 +00:00
gdbadmin bd82534596 *** empty log message *** 2011-06-27 00:00:33 +00:00
gdbadmin b91ffaa0ac *** empty log message *** 2011-06-26 00:00:33 +00:00
gdbadmin 44eb0d7fc2 *** empty log message *** 2011-06-25 00:00:02 +00:00
Tom Tromey ddd49eeec4 * varobj.c (update_dynamic_varobj_children): Make 'name' const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
	* python/python.c (gdbpy_parameter): Make 'arg' const.
	(execute_gdb_command): Likewise.
	(gdbpy_decode_line): Likewise.  Copy it.
	(gdbpy_parse_and_eval): Make 'expr_string' const.  Copy it.
	(gdbpy_write): Make 'arg' const.
	* python/py-type.c (typy_lookup_typename): Make 'type_name'
	const.
	(gdbpy_lookup_type): Likewise.
	* python/py-prettyprint.c (print_children): Make 'name' const.
	* python/py-param.c (parmpy_init): Make 'name' const.  Copy it.
	* python/py-inferior.c (infpy_write_memory): Make 'buf_len' a
	Py_ssize_t.
	* python/py-function.c (fnpy_init): Make 'name' const.
	* python/py-cmd.c (cmdpy_init): Make 'name' const.  Copy it.
	(gdbpy_string_to_argv): Make 'input' const.
	* python/py-breakpoint.c (bppy_init): Make 'spec' const.  Copy
	it.
	* gdbtypes.h (lookup_typename): Update.
	* gdbtypes.c (lookup_typename): Make 'name' const.
	(lookup_struct): Likewise.
	(lookup_union): Likewise.
	(lookup_enum): Likewise.
2011-06-24 19:47:37 +00:00
Tom Tromey 5998129b54 * Makefile.in (HFILES_NO_SRCDIR): Add "common/" to
gdb_thread_db.h.  Move all common/ entries to be together.
	(TAGS): Don't depend on DEPFILES.
2011-06-24 19:29:49 +00:00
gdbadmin 756e0a9f0c *** empty log message *** 2011-06-24 00:00:03 +00:00
Yao Qi 6e586cc565 2011-06-23 Yao Qi <yao@codesourcery.com>
* infrun.c (start_remote): Move call init_wait_for_inferior to ...
	* remote.c (remote_start_remote): ... here.
	* monitor.c (monitor_open): ... here.
2011-06-23 15:08:01 +00:00
Yao Qi ab5c6a729c 2011-06-23 Yao Qi <yao@codesourcery.com>
* gdb.cp/mb-inline.exp: Parse the output of `info break' to check breakpoint
	1.2 is disabled.  KFAIL for uclinux.
2011-06-23 14:38:13 +00:00
Andrew Burgess 86c3c1fccc http://sourceware.org/ml/gdb-patches/2011-06/msg00136.html
2011-06-23  Andrew Burgess  <aburgess@broadcom.com>

	* gdbtypes.c (append_composite_type_field_aligned): Fix
	calculation of bit position based on alignment.
2011-06-23 09:51:57 +00:00
Marek Polacek 9497469fbd Fix races in mi2-var-display.exp. 2011-06-23 09:51:11 +00:00
Marek Polacek 5d197ed097 Fix races in mi2-return.exp. 2011-06-23 09:45:24 +00:00
Marek Polacek b9132588e0 Fix races in mi2-console.exp. 2011-06-23 09:40:50 +00:00
Marek Polacek e55595cad5 Fix races in mi2-basics.exp. 2011-06-23 09:38:14 +00:00
Yao Qi be777e08f4 gdb/testsuite/
* gdb.base/moribund-step.exp: Skip test if displaced stepping is not
	supported.
	* lib/gdb.exp (support_displaced_stepping): New.
2011-06-23 07:46:13 +00:00
Yao Qi 615556d61e 2011-06-23 Yao Qi <yao@codesourcery.com>
* gdb.threads/execl.exp: Skip on remote target.
2011-06-23 06:26:28 +00:00
gdbadmin 1c23ac0060 *** empty log message *** 2011-06-23 00:00:32 +00:00
Pedro Alves 28010a5d42 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (bpstat_stop_status): Call the check_status
	breakpoint_ops method.
	(print_one_breakpoint_location): Also print the condition for Ada
	exception catchpoints.
	(allocate_bp_location): New, factored out from
	allocate_bp_location.
	(allocate_bp_location): Adjust.  Call the owner breakpoint's
	allocate_location method, if there is one.
	(free_bp_location): Call the locations's dtor method, if there is
	one.
	(init_raw_breakpoint_without_location): New breakpoint_ops
	parameter.  Use it.
	(set_raw_breakpoint_without_location): Adjust.
	(init_raw_breakpoint): New breakpoint_ops parameter.  Pass it down.
	(set_raw_breakpoint): Adjust.
	(catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops)
	(catch_syscall_breakpoint_ops): Install NULL allocate_location,
	re_set and check_status methods.
	(init_catchpoint): Don't memset, initialize thread, addr_string
	and enable_state.  Pass the ops down to init_raw_breakpoint.
	(install_catchpoint): Rename to ...
	(install_breakpoint): ... this, and make extern.
	(create_fork_vfork_event_catchpoint): Adjust.
	(catch_exec_breakpoint_ops): Install NULL allocate_location,
	re_set and check_status methods.
	(create_syscall_event_catchpoint): Adjust.
	(ranged_breakpoint_ops, watchpoint_breakpoint_ops)
	(masked_watchpoint_breakpoint_ops): Install NULL
	allocate_location, re_set and check_status methods.
	(catch_exec_command_1): Adjust.
	(gnu_v3_exception_catchpoint_ops): Install NULL allocate_location,
	re_set and check_status methods.
	(create_ada_exception_breakpoint): Rename to ...
	(init_ada_exception_breakpoint): ... this.  Add a struct
	breakpoint parameter, and delete the exp_string, cond_string and
	cond parameters.  Use init_raw_breakpoint, and don't install or
	mention the breakpoint yet.  Don't clear breakpoint fields that
	init_raw_breakpoint already clears.
	(re_set_breakpoint): Delete, split into ...
	(breakpoint_re_set_default, prepare_re_set_context): ... these new
	functions.
	(breakpoint_re_set_one): Call the breakpoint's
	breakpoint_ops->re_set implementation, if there's one.  Adjust.
	* breakpoint.h: Forward declare struct bpstats and struct bp_location.
	(struct bp_location_ops): New type.
	(struct bp_location): New field `ops'.
	(struct breakpoint_ops): New `allocate_location', `re_set' and
	`check_status' fields.  Make `breakpoint_hit''s description match
	reality.
	(init_bp_location): Declare.
	(breakpoint_re_set_default): Declare.
	(create_ada_exception_breakpoint): Rename to ...
	(init_ada_exception_breakpoint): ... this.  Add a struct
	breakpoint parameter, and delete the exp_string, cond_string and
	cond parameters.
	(install_breakpoint): Declare.
	* ada-lang.c: Include exceptions.h.
	<Ada exceptions description>: Update.
	(struct ada_catchpoint_location): New type.
	(ada_catchpoint_location_dtor): New function.
	(ada_catchpoint_location_ops): New global.
	(ada_catchpoint): New type.
	(create_excep_cond_exprs): New function.
	(dtor_exception, allocate_location_exception, re_set_exception)
	(should_stop_exception, check_status_exception): New functions.
	(print_one_exception, print_mention_exception)
	(print_recreate_exception): Adjust.
	(dtor_catch_exception, allocate_location_catch_exception)
	(re_set_catch_exception, check_status_catch_exception): New
	functions.
	(catch_exception_breakpoint_ops): Install them.
	(dtor_catch_exception_unhandled)
	(allocate_location_catch_exception_unhandled)
	(re_set_catch_exception_unhandled)
	(check_status_catch_exception_unhandled): New functions.
	(catch_exception_unhandled_breakpoint_ops): Install them.
	(dtor_catch_assert, allocate_location_catch_assert)
	(re_set_catch_assert, check_status_catch_assert): New functions.
	(catch_assert_breakpoint_ops): Install them.
	(ada_exception_catchpoint_p): Delete.
	(catch_ada_exception_command_split)
	(ada_exception_catchpoint_cond_string): Rename exp_string
	parameter to excep_string.  Adjust.
	(ada_parse_catchpoint_condition): Delete.
	(ada_exception_sal): Rename the exp_string parameter to
	excep_string.  Delete the cond_string and cond parameters.
	Adjust.
	(ada_decode_exception_location): Rename the exp_string parameter
	to excep_string.  Delete the cond_string and cond parameters.
	Adjust.
	(create_ada_exception_catchpoint): New function.
	(catch_ada_exception_command, ada_decode_assert_location)
	(catch_assert_command): Adjust.
	* ada-lang.h (ada_exception_catchpoint_p): Delete declaration.
2011-06-22 17:53:44 +00:00
Pedro Alves 9ac4176b6d 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* ada-lang.c: Include arch-utils.h.
	(ada_decode_exception_location): Make static.
	(catch_ada_exception_command): Moved here from breakpoint.c.
	(ada_decode_assert_location): Make static.
	(catch_assert_command): Moved here from breakpoint.c.
	(_initialize_ada_lang): Install the exception and assert
	catchpoint commands here.
	* ada-lang.h (ada_decode_exception_location)
	(ada_decode_assert_location): Delete declarations.
	* breakpoint.c (CATCH_PERMANENT, CATCH_TEMPORARY): Moved to
	breakpoint.h.
	(create_ada_exception_breakpoint): Make extern.
	(catch_ada_exception_command, catch_assert_command): Moved to
	ada-lang.c.
	(add_catch_command): Make extern.
	(_initilize_breakpoint): Don't install the exception and assert
	catchpoint commands here.
	* breakpoint.h (CATCH_PERMANENT, CATCH_TEMPORARY): Moved from
	breakpoint.c
	(add_catch_command, create_ada_exception_breakpoint): Declare.
2011-06-22 17:52:37 +00:00
Pedro Alves c56053d23c 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (init_raw_breakpoint_without_location): Don't add
	the breakpoint to the breakpoint chain here.
	(set_raw_breakpoint_without_location): Add the breakpoint to the
	breakpoint chain here.
	(init_raw_breakpoint): Adjust comments.
	(set_raw_breakpoint): Add the breakpoint to the breakpoint chain
	here.
	(init_catchpoint): Don't set the catchpoint's breakpoint number
	here.
	(install_catchpoint): New function.
	(create_fork_vfork_event_catchpoint)
	(create_syscall_event_catchpoint, catch_exec_command_1): Adjust to
	use install_catchpoint.
2011-06-22 17:16:42 +00:00
Pedro Alves d2f3fc74b7 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (create_catchpoint_without_mention)
	(create_catchpoint): Delete.
2011-06-22 17:16:00 +00:00
Pedro Alves b4d900402c 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.h (struct breakpoint): Delete field `exec_pathname'.
	* breakpoint.c (init_raw_breakpoint_without_location): Remove
	reference to exec_pathname.
	(struct exec_catchpoint): New type.
	(dtor_catch_exec): New function.
	(insert_catch_exec, print_it_catch_exec, print_one_catch_exec): Adjust.
	(catch_exec_breakpoint_ops): Install dtor_catch_syscall.
	(catch_exec_command_1): Adjust to use init_catchpoint.
	(delete_breakpoint): Remove reference to exec_pathname.
2011-06-22 17:15:06 +00:00
Pedro Alves be5c67c19c 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.h (struct breakpoint_ops): New field `dtor'.
	(struct breakpoint): Delete field `syscalls_to_be_caught'.
	* breakpoint.c (init_raw_breakpoint_without_location): Remove
	reference to syscalls_to_be_caught.
	(catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops): Install a
	NULL `dtor'.
	(struct syscall_catchpoint): New type.
	(dtor_catch_syscall): New function.
	(insert_catch_syscall, remove_catch_syscall)
	(breakpoint_hit_catch_syscall, print_one_catch_syscall)
	(print_recreate_catch_syscall): Adjust.
	(catch_syscall_breakpoint_ops): Install dtor_catch_syscall.
	(catch_exec_breakpoint_ops): Install a NULL `dtor'.
	(create_syscall_event_catchpoint): Adjust to use init_catchpoint.
	(ranged_breakpoint_ops, watchpoint_breakpoint_ops)
	(masked_watchpoint_breakpoint_ops)
	(gnu_v3_exception_catchpoint_ops): Install a NULL `dtor'.
	(delete_breakpoint): Call the `dtor' breakpoint_ops method, if
	there is one.  Remove references to syscalls_to_be_caught.
	(catching_syscall_number): Adjust.
	* ada-lang.c (catch_exception_breakpoint_ops)
	(catch_exception_unhandled_breakpoint_ops)
	(catch_assert_breakpoint_ops): Install a NULL `dtor'.
2011-06-22 17:14:29 +00:00
Pedro Alves e29a4733b9 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.h (struct breakpoint): Delete forked_inferior_pid
	field.
	* breakpoint.c (init_raw_breakpoint_without_location): Remove
	reference to forked_inferior_pid.
	(struct fork_catchpoint): New type.
	(breakpoint_hit_catch_fork, print_it_catch_fork)
	(print_one_catch_fork, breakpoint_hit_catch_vfork)
	(print_it_catch_vfork, print_one_catch_vfork): Adjust.
	(create_fork_vfork_event_catchpoint): Adjust to use
	init_catchpoint.
2011-06-22 17:12:32 +00:00
Pedro Alves 346774a91f 2011-06-22 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (add_to_breakpoint_chain)
	(init_raw_breakpoint_without_location): New functions, factored
	out from ...
	(set_raw_breakpoint_without_location): ... this one.
	(init_raw_breakpoint): New function, factored out from
	set_raw_breakpoint and adjusted to use
	init_raw_breakpoint_without_location.
	(set_raw_breakpoint): Adjust.
	(init_catchpoint): New function, factored out from
	create_catchpoint_without_mention and adjusted to use
	init_raw_breakpoint.
	(create_catchpoint_without_mention): Adjust.
2011-06-22 17:11:30 +00:00
Marek Polacek 833b0ca776 Fix races in gdb.mi/mi-var-display.exp. 2011-06-22 16:12:46 +00:00
Marek Polacek 1ee4023ae3 Fix races in gdb.mi/mi-nsitrall.exp. 2011-06-22 15:41:47 +00:00
Marek Polacek d0b1d6240c Fix races in gdb.mi/mi-nsmoribund.exp. 2011-06-22 15:38:00 +00:00
Marek Polacek 79aa92c124 Fix races in gdb.mi/mi-return.exp. 2011-06-22 15:32:16 +00:00
Tom Tromey c38c4bc5b2 * dwarf2expr.c (execute_stack_op) <DW_OP_GNU_convert>: Treat type
argument of 0 specially.
2011-06-22 13:38:21 +00:00
Yao Qi b138ce370d gdb/
* infrun.c (handle_inferior_event): Remove write-only local variable
	`sw_single_step_trap_p'.
2011-06-22 10:09:22 +00:00
gdbadmin 8eebce8e67 *** empty log message *** 2011-06-22 00:00:33 +00:00
gdbadmin 06f68d32f6 *** empty log message *** 2011-06-21 00:00:03 +00:00
Tom Tromey 03de682319 * symtab.c (lookup_language_this): End loop if block is NULL. 2011-06-20 17:53:33 +00:00
gdbadmin e7cce27aad *** empty log message *** 2011-06-20 00:00:03 +00:00
gdbadmin be47d07c72 *** empty log message *** 2011-06-19 00:00:33 +00:00
gdbadmin 2b8ef54e82 *** empty log message *** 2011-06-18 00:00:33 +00:00
Tom Tromey 66a17cb629 * valops.c (value_of_this): Use lookup_language_this.
* symtab.h (lookup_language_this): Declare.
	* symtab.c (lookup_language_this): New function.
	(lookup_symbol_aux): Use lookup_language_this.
	* ax-gdb.c (gen_expr) <OP_THIS>: Use lookup_language_this.
2011-06-17 20:46:47 +00:00