Commit Graph

29209 Commits

Author SHA1 Message Date
Jan Kratochvil 89e208dbfe gdb/testsuite/
* gdb.base/skip-solib.exp (executable_main): New variable.
	(binfile_main): Base it on that.
	Use $executable_main in clean_restart calls.  Drop gdb_exit and
	gdb_start calls.
2011-11-02 08:43:40 +00:00
Yao Qi fd0d8c7ca3 gdb/gdbserver/
* tracepoint.c (cmd_qtstart): Remove unused local variables.
2011-11-02 04:34:22 +00:00
Yao Qi 609086b1aa gdb/gdbserver/
* target.h: Fix a typo in comment.
2011-11-02 04:20:47 +00:00
Yao Qi 7b35ec7f28 Fix date in changelog entry. 2011-11-02 04:12:56 +00:00
gdbadmin a97dcbf1ad *** empty log message *** 2011-11-02 00:00:03 +00:00
Jan Kratochvil 405e54e994 gdb/testsuite/
Fix racy FAILs.
	* lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and
	breakpoint_re globals import by async.  Set string_regex to .* for
	async.  Remove the optional thread_selected_re and breakpoint_re
	globals expectations.
2011-11-01 20:00:01 +00:00
Joseph Myers 58e8570aab * gdb.base/maint.exp: XFAIL "maint info sections DATA" on MinGW as
well as Cygwin.
2011-11-01 16:21:55 +00:00
Justin Lebar 1bfeeb0f75 2011-10-06 Justin Lebar <justin.lebar@gmail.com>
* Makefile.in: (SFILES): Add skip.c.
	(HFILES_NO_SRCDIR): Add skip.h.
	(COMMON_OBS): Add skip.o.
	* skip.h, skip.c: New.
	* breakpoint.h (set_default_breakpoint): Remove.
	(get_sal_arch): Declare.
	* breakpoint.c: Remove default_breakpoint_valid,
	default_breakpoint_address, default_breakpoint_symtab,
	default_breakpoint_line, default_breakpoint_pspace variables.
	(get_sal_arch): Make public.
	(set_default_breakpoint): Remove.
	(parse_breakpoint_sals, create_breakpoint, clear_command,
	decode_line_spec_1): Remove uses of default_breakpoint variables;
	replaced with function calls into stack.c.
	* cli/cli-cmds.h: Add cmd_list_element *skiplist.
	* cli/cli-cmds.c: Add skiplist.
	(init_cmd_lists): Initialize skiplist.
	(init_cli_cmds): Fix comment (classes of commands appear in
	alphabetical order).
	* infrun.c (handle_inferior_event): Add check that we don't step into
	a function whose pc is marked for skip.
	* stack.c: Declare last_displayed_sal_valid, last_displayed_pspace,
	last_displayed_addr, last_displayed_symtab, last_displayed_line
	variables.
	(set_last_displayed_sal): New static function.
	(print_frame_info): Switch call to set_default_breakpoint to call to
	set_last_displayed_sal.
	(clear_last_displayed_sal, last_displayed_sal_is_valid,
	get_last_displayed_pspace, get_last_displayed_addr,
	get_last_displayed_symtab, get_last_displayed_line,
	get_last_displayed_sal): New public functions.
	* stack.h (clear_last_displayed_sal, last_displayed_sal_is_valid,
	get_last_displayed_pspace, get_last_displayed_addr,
	get_last_displayed_symtab, get_last_displayed_line,
	get_last_displayed_sal): Declare.

2011-10-06  Justin Lebar <justin.lebar@gmail.com>

	Add tests for skip command.
	* testsuite/gdb.base/skip-solib-lib.c: New
	* testsuite/gdb.base/skip-solib-main.c: New
	* testsuite/gdb.base/skip-solib.exp: New
	* testsuite/gdb.base/skip.c: New
	* testsuite/gdb.base/skip.exp: New
	* testsuite/gdb.base/skip1.c: New
	* testsuite/gdb.base/Makefile.in: Adding new files.
2011-11-01 14:51:25 +00:00
Justin Lebar b60e158872 2011-11-01 Justin Lebar <justin.lebar@gmail.com>
* MAINTAINERS (Write After Approval): Add myself to the list.
2011-11-01 13:40:38 +00:00
gdbadmin a57dd5c111 *** empty log message *** 2011-11-01 00:00:32 +00:00
Pedro Alves b9fd179153 2011-10-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
	* mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
	clobber the breakpoints' shadows with fast tracepoint jumps.
	* mem-break.h (check_mem_write): Add `myaddr' parameter.
	* target.c (write_inferior_memory): Also pass MYADDR down to
	check_mem_write.

	gdb/testsuite/
        * gdb.trace/trace-break.c: New.
        * gdb.trace/trace-break.exp: New.
2011-10-31 12:55:26 +00:00
gdbadmin bb593acb76 *** empty log message *** 2011-10-31 00:00:03 +00:00
gdbadmin 79ce8740f9 *** empty log message *** 2011-10-30 00:00:33 +00:00
Yao Qi d31647d24b gdb/
* infcmd.c (disconnect_command): Call disconnect_tracing.
2011-10-29 12:36:09 +00:00
Jan Kratochvil b1d96efdaa gdb/
Code cleanup.
	* symtab.c (skip_prologue_sal): Code reformatting.
2011-10-29 07:26:07 +00:00
gdbadmin 66f11016e7 *** empty log message *** 2011-10-29 00:00:33 +00:00
Jan Kratochvil 4dfb236562 gdb/
PR symtab/13208
	* jit.c (jit_register_code): Remove unused variable my_cleanups.  Check
	for NULL from bfd_open_from_target_memory.  Fix ownership of NBFD and
	SAI.
2011-10-28 22:40:58 +00:00
Jan Kratochvil 4323feccfd gdb/testsuite/
* gdb.threads/no-unwaited-for-left.exp: Specify $srcfile for
	break-here-2.
2011-10-28 19:24:45 +00:00
Pedro Alves 0e5bf2a8c9 2011-10-28 Pedro Alves <pedro@codesourcery.com>
gdb/
	* linux-nat.c (linux_nat_filter_event): Remove `options'
	parameter, and dead code that used it.  If we're handling a
	PTRACE_EVENT_EXEC event, and the thread group leader is no longer
	in our lwp list, re-add it.
	(check_zombie_leaders): New.
	(linux_nat_wait_1): Remove `options' and `pid' locals.  Always
	wait for children with WNOHANG, and always wait for all children.
	Don't check for no resumed children upfront.  Simplify wait loop.
	Check for zombie thread group leaders after handling all wait
	statuses.  Return TARGET_WAITKIND_NO_RESUMED if there no
	unwaited-for children left.
	* infrun.c (fetch_inferior_event): Handle TARGET_WAITKIND_NO_RESUMED.
	(handle_inferior_event): Handle TARGET_WAITKIND_NO_RESUMED.
	(normal_stop): Handle TARGET_WAITKIND_NO_RESUMED.
	* target.h (enum target_waitkind) <TARGET_WAITKIND_NO_RESUMED>: New.

	gdb/testsuite/
	* gdb.threads/no-unwaited-for-left.c: New.
	* gdb.threads/no-unwaited-for-left.exp: New.
	* gdb.threads/non-ldr-exc-1.c: New.
	* gdb.threads/non-ldr-exc-1.exp: New.
	* gdb.threads/non-ldr-exc-2.c: New.
	* gdb.threads/non-ldr-exc-2.exp: New.
	* gdb.threads/non-ldr-exc-3.c: New.
	* gdb.threads/non-ldr-exc-3.exp: New.
	* gdb.threads/non-ldr-exc-4.c: New.
	* gdb.threads/non-ldr-exc-4.exp: New.
2011-10-28 18:30:00 +00:00
Jan Kratochvil 3a3dad982f gdb/testsuite/
* gdb.base/async-shell.exp: Skip the testfile for use_gdb_stub.
	* gdb.base/attach-pie-misread.exp: Likewise.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/default.exp (attach, run "r" abbreviation, run): Skip these
	testcases for use_gdb_stub.
	* gdb.dwarf2/dw2-restore.exp: Fix the run for use_gdb_stub.
	(continue): New testcase.
	* gdb.python/py-events.exp: Skip the testfile for use_gdb_stub.
	* gdb.threads/attach-into-signal.exp: Likewise.
	* gdb.threads/attach-stopped.exp: Likewise.
	* gdb.threads/attachstop-mt.exp: Likewise.
2011-10-28 17:32:30 +00:00
Sterling Augustine 821296b70d 11-10-28 Sterling Augustine <saugustine@google.com>
* psymtab.c (map_symbol_filenames_psymtab): Call QUIT.
	* symtab.c (free_completion_list): New function.
	(do_free_completion_list): Likewise.
	(default_make_symbol_completion_list_break_on): New variable
	back_to. Call make_cleanup and discard_cleanups.
	(make_source_files_completion_list): Likewise.
2011-10-28 17:29:37 +00:00
Paul Koning d6a5d40c76 * gdb.python/lib-types.exp (deep_items): Rename from deepitems. 2011-10-28 14:49:21 +00:00
Paul Koning 0aaaf06393 * gdb.texinfo (gdb.types): Rename deepitems to deep_items. 2011-10-28 14:48:59 +00:00
Paul Koning 03c3051af4 * python/lib/gdb/types.py (deep_items): Rename from deepitems.
* NEWS: Mention deep_items.
2011-10-28 14:48:38 +00:00
Pedro Alves 8e7ebaf5c6 2011-10-28 Alen Skondro <askondro@gmail.com>
* ser-tcp.c [USE_WIN32API] (ETIMEOUT): Don't define if already
	defined.
2011-10-28 13:32:05 +00:00
Jan Kratochvil ca539be87d gdb/testsuite/
* lib/mi-support.exp (breakpoint_re): Suppress match reporting.
	(mi_gdb_test): Import globals thread_selected_re
	and breakpoint_re.  Expect them optionally at the regex start.
2011-10-28 08:32:35 +00:00
Meador Inge e0c6ef61c6 2011-10-27 Meador Inge <meadori@codesourcery.com>
* MAINTAINERS (Write After Approval): Add myself to the list.
2011-10-28 03:38:00 +00:00
gdbadmin 84c9439cda *** empty log message *** 2011-10-28 00:00:03 +00:00
Joel Brobecker b56d6f31a9 handle variables stored in muliple consecutive registers
gdb/ChangeLog:

        * value.h (read_frame_register_value): Add declaration.
        * findvar.c (read_frame_register_value): New function.
        (value_from_register): Use read_frame_register_value
        instead of get_frame_register_value + value_contents_copy
        to get value contents.
2011-10-27 17:05:40 +00:00
Doug Evans d234ef5c0c * cli/cli-cmds.c (source_script_with_search): Pass full path to
source_script_from_stream if it may have been found on the search path.
	* python/py-auto-load.c (source_section_scripts): Pass full path to
	source_python_script_for_objfile.
	* python/python.c (source_python_script): Delete stream parameter.
	All callers updated.
	(source_python_script_for_objfile): Ditto.
	* python/python-internal.h (source_python_script_for_objfile): Update.
	* python/python.h (source_python_script): Update.

	testsuite/
	* gdb.python/python.exp: Test source -s.
2011-10-27 15:46:11 +00:00
Tom Tromey d849d44f82 * ada-lang.h (ada_start_decode_line_1, ada_finish_decode_line_1)
(ada_sals_for_line): Remove declarations.
2011-10-27 15:32:15 +00:00
Kevin Pouget 2231f1fb60 Move unwind reasons to an external .def file
gdb/
	* frame.c (frame_stop_reason_string): Rewrite using
	unwind_stop_reasons.def.
	* frame.h (enum unwind_stop_reason): Likewise.
	* python/py-frame.c (gdbpy_initialize_frames): Likewise.
	(gdbpy_frame_stop_reason_string): Use new enum unwind_stop_reason
	constants for bound-checking.
	* unwind_stop_reasons.def: New file.
	* stack.c (backtrace_command_1): Handle UNWIND_FIRST_ERROR as an alias
	instead of a distinct value.

doc/
	* gdb.texinfo ((Frames In Python): Document
	gdb.FRAME_UNWIND_FIRST_ERROR contant.
2011-10-27 11:04:27 +00:00
Phil Muldoon f77b9a5df0 2011-10-27 Phil Muldoon <pmuldoon@redhat.com>
PR python/13331

	* python/py-function.c (fnpy_call): Check 'args' is not NULL.
	(convert_values_to_python): Return on Python tuple allocation
	failure.  Return NULL on value conversion error.
2011-10-27 10:29:58 +00:00
Phil Muldoon 76dce0be7b 2011-10-27 Phil Muldoon <pmuldoon@redhat.com>
* python/py-breakpoint.c (bppy_set_enabled): Use TRY_CATCH.
	(bppy_set_task): Ditto.
	(bppy_delete_breakpoint): Ditto.
	* python/py-symbol.c (gdbpy_lookup_symbol): Ditto.
	(gdbpy_lookup_global_symbol): Ditto.
	* python/py-lazy-string.c (stpy_convert_to_value): Ditto.
	* python/py-frame.c (frapy_is_valid): Ditto.
	(frame_info_to_frame_object): Ditto.
	* python/py-type.c (typy_lookup_type): Ditto.
	(typy_getitem): Ditto.
	(typy_has_key): Ditto.
	(typy_richcompare): Use TRY_CATCH.  Do not return Py_NE on error.
2011-10-27 09:14:27 +00:00
gdbadmin d848dec6d9 *** empty log message *** 2011-10-27 00:00:02 +00:00
Joel Brobecker f17b69551b Regenerate gdbarch.h
Not sure why, but the version currently checked in as an extraneous
trailing whitespace that showed up as a diff when I reran gdbarch.sh.

gdb/ChangeLog:

        * gdbarch.h: Regenerate.
2011-10-26 21:23:55 +00:00
Joel Brobecker 86ba104287 Fix 'sprintf' of potential NULL pointer in 'maint print arch'
gdb/
        * gdbarch.sh (function_list): Use 'pstring' when printing
        'gcore_bfd_target'.
        * gdbarch.c: Regenerate.
2011-10-26 18:21:38 +00:00
Ulrich Weigand c34fd85260 * regcache.c (registers_changed_ptid): Invalidate thread architecture
and frame caches if PTID refers to all threads of a process.
2011-10-26 17:32:00 +00:00
Ulrich Weigand 931bb47f45 * spu-tdep.c (spu_catch_start): Pass non-NULL breakpoint ops
to create_breakpoint.
2011-10-26 17:26:29 +00:00
Ulrich Weigand 88aed45eb4 * ppc-sysv-tdep.c (ppc_sysv_use_opencl_abi): New function.
(ppc_sysv_abi_push_dummy_call): Use it.
	(do_ppc_sysv_return_value): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
2011-10-26 17:21:53 +00:00
Paul Koning 5110b5dfaa * gdb.texinfo (gdb.types): Document new deepitems function. 2011-10-26 15:10:38 +00:00
Paul Koning ab964825cc * gdb.python/lib-types.cc (struct A): New structure.
* gdb.python/lib-types.exp (deepitems): New tests.
2011-10-26 15:10:11 +00:00
Paul Koning 3eaf3fa296 * python/lib/gdb/types.py (deepitems): New function. 2011-10-26 15:09:40 +00:00
gdbadmin 4f4a26fabb *** empty log message *** 2011-10-26 00:00:03 +00:00
Paul Koning 54d8a6445f * gdb.python/py-value.exp: Add testcases for is_lazy attribute,
fetch_lazy method.
2011-10-25 18:35:49 +00:00
Paul Koning 22dbab4672 PR python/13327
* gdb.texinfo (Values From Inferior): Add is_lazy attribute,
fetch_lazy method.
2011-10-25 18:35:19 +00:00
Paul Koning 913460fcde PR python/13327
* python/py-value.c (value_to_value_object): Remove fetching of
the value if it was lazy.
(valpy_get_is_lazy): New function.
(valpy_fetch_lazy): New function.
2011-10-25 18:34:51 +00:00
gdbadmin 977888b990 *** empty log message *** 2011-10-25 00:00:32 +00:00
Joel Brobecker 2b5b9d09ed [powerpc] crash trying to allocate memory in inferior
Our testsuite noticed a crash when trying to call a function which
requires GDB to allocate memory in the inferior. Typically, this
happens when one of the parameters is a string.  For instance, our
testcase tries:

    (gdb) call debug.trace (me, "You")
    [1]    32737 segmentation fault /path/to/gdb

What happens is that GDB sees the string, and thus tries to allocate
memory for it in the inferior:

> /* Allocate NBYTES of space in the inferior using the inferior's
>    malloc and return a value that is a pointer to the allocated
>    space.  */
>
> struct value *
> value_allocate_space_in_inferior (int len)
> {
>   struct objfile *objf;
>   struct value *val = find_function_in_inferior ("malloc", &objf);

And find_function_in_inferior first searches the symtab in case
we have debug info.  But, in our case (bareboard powerpc), we don't,
so it gets "malloc"'s address from the minimal symbols, and builds
a value whose type is a TYPE_CODE_PTR, not a TYPE_CODE_FUNC.

As a result, when we later try to make the call to malloc, we end up
inside the powerpc tdep code that has:

> do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
[...]
>   if (func_type
>       && TYPE_CALLING_CONVENTION (func_type) == DW_CC_GDB_IBM_OpenCL)

The problem is that func_type is not a TYPE_CODE_FUNC, and thus
the type-specific kind is not TYPE_SPECIFIC_FUNC, and so we do
TYPE_CALLING_CONVENTION is an invalid access.

Interestingly, the other call to TYPE_CALLING_CONVENTION is correctly
preceded by a check of the type's TYPE_CODE (making sure that it is
TYPE_CODE_FUNC).

gdb/ChangeLog:

        * ppc-sysv-tdep.c (do_ppc_sysv_return_value): Do not check
        FUNC_TYPE's calling convention if FUNC_TYPE is not a function.
2011-10-24 16:51:36 +00:00
Pedro Alves e21ffe51c9 2011-10-24 Pedro Alves <pedro@codesourcery.com>
gdb/
	* linux-nat.c (linux_handle_extended_wait): When handling a clone
	event, in non-stop, if not stopping, make sure the new lwp has
	last_resume_kind set to resume_continue.  Assert that when we're
	resuming the new lwp, its last_resume_kind is resume_continue.
2011-10-24 14:25:52 +00:00