Commit Graph

29281 Commits

Author SHA1 Message Date
Joel Brobecker 2b914b527a Minor reformatting in infrun.c:handle_inferior_event
gdb/ChangeLog:

        * infrun.c (handle_inferior_event): Minor reformatting.
2011-11-07 16:30:19 +00:00
Joel Brobecker 8d26e50c57 [gdbserver] Fix watchpoint support on Windows
Watchpoint support doesn't work anymore when using gdbserver on Windows.
They just never trigger.

The problem comes from the fact that we always set the debug registers
to zero, no matter what.  This in turn comes from the fact that we
use i386_low_insert_watchpoint to compute the DR values:

      return i386_low_insert_watchpoint (&debug_reg_state,
                                         type, addr, len);

This function saves the new values in debug_reg_state.  However,
the values we actually use when setting the DR registers are
taken from two different globals:

        static unsigned dr_status_mirror;
        static unsigned dr_control_mirror;

These are really never actually changed (their value is set from
the DR values read from the inferior, but since we never change
them, in practice, they never change).

The fix is to use the values provided by debug_reg_state, and
to eliminate the two dr_[...] globals.

gdb/gdbserver/ChangeLog:

        * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
        (i386_dr_low_get_control, i386_dr_low_get_status): Use
        dr_status_mirror and dr_control_mirror from debug_reg_state.
        (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
        (i386_initial_stuff): Remove use of deleted globals.
        (i386_get_thread_context, i386_set_thread_context,
        i386_thread_added): Use dr_status_mirror and dr_control_mirror
        from debug_reg_state.
2011-11-07 14:45:09 +00:00
gdbadmin 855565bb2a *** empty log message *** 2011-11-07 00:00:03 +00:00
Doug Evans 6f809020fa * source.c (forget_cached_source_info_for_objfile): Move call to
objfile->sf->qf->forget_cached_source_info outside of
	ALL_OBJFILE_SYMTABS loop.
	(forget_cached_source_info): Delete unused variable `s'.
2011-11-06 04:24:57 +00:00
gdbadmin 6c20f2dc18 *** empty log message *** 2011-11-06 00:00:33 +00:00
Jan Kratochvil 75d1221864 gdb/
* i386-nat.c (dr_ref_count): Remove unused variable.
2011-11-05 20:25:19 +00:00
Doug Evans e565b8378e * main.c (captured_main): Set lim_at_start before calling
make_command_stats_cleanup.
2011-11-05 17:08:30 +00:00
Yao Qi a59306a3db gdb/gdbserver:
2011-11-05  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (gdb_collect): Loop over tracepoints of same
	address as TPOINT's.

gdb/testsuite:

2011-11-05  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/trace-break.exp: Add test on setting two
	fast tracepoints at the same address.
2011-11-05 13:16:23 +00:00
gdbadmin 23714b1114 *** empty log message *** 2011-11-05 00:00:33 +00:00
Doug Evans 0a1c4d10f1 * utils.c: #include "timeval-utils.h".
(cmd_stats): Rename start_time to start_cpu_time.
	New member start_wall_time.
	(report_command_stats): Report wall time.
	(make_command_stats_cleanup): Record start wall time.

	doc/
	* gdb.texinfo (Maintenance Commands): Update docs of "maint time".
2011-11-04 16:45:13 +00:00
Tom Tromey a1d705ee1b * cp-namespace.c (cp_lookup_symbol_imports): Reindent. 2011-11-04 16:37:17 +00:00
Rainer Orth 81de56bef2 * coff-pe-read.c: Include defs.h before bfd.h. 2011-11-04 14:04:06 +00:00
Phil Muldoon 3ab1ec2776 2011-11-04 Phil Muldoon <pmuldoon@redhat.com>
PR Python/13345

	* python/python.c (python_run_simple_file): Expand tilde in path.
2011-11-04 12:07:53 +00:00
Phil Muldoon cd829959ce 2011-11-04 Phil Muldoon <pmuldoon@redhat.com>
PR Python/13363

	* python/py-type.c (typy_lookup_type): Do not return a type in
          an exception handler.
2011-11-04 11:57:04 +00:00
gdbadmin ec5d23e4aa *** empty log message *** 2011-11-04 00:00:32 +00:00
Jan Kratochvil 080ad64808 gdb/
* linux-nat.c (_initialize_linux_nat): Improve help
	for `info proc stat', `info proc status', `info proc cwd',
	`info proc cmdline' and `info proc exe'.
2011-11-03 18:24:45 +00:00
Jan Kratochvil 87769f591c gdb/testsuite/
* gdb.base/commands.exp (cmd1 error): Fix false ERROR with gdbserver.
2011-11-03 17:43:51 +00:00
Tom Tromey aad1c02c74 * gdb.texinfo (Stopping): Add menu entry.
(Continuing and Stepping): Restore @node.  Use @section, not
	@subsection.
2011-11-03 14:32:49 +00:00
Maciej W. Rozycki 983fb131e9 * gdb.texinfo (Skipping Over Functions and Files): Remove node
designation.  Fix "Specify Location" cross-reference.
2011-11-03 00:16:45 +00:00
gdbadmin 398934ee75 *** empty log message *** 2011-11-03 00:00:33 +00:00
Stan Shebs 3065dfb6b4 2011-11-02 Stan Shebs <stan@codesourcery.com>
String collection for tracepoints.
	* NEWS: Mention string collection.
	* common/ax.def (tracenz): New bytecode.
	* ax-gdb.h (trace_string_kludge): Declare.
	* ax-gdb.c: Include valprint.h and c-lang.h.
	(trace_string_kludge): New global.
	(gen_traced_pop): Add string case.
	(agent_command): Add string case.
	* tracepoint.h (decode_agent_options): Declare.
	* tracepoint.c: Include cli-utils.h.
	(decode_agent_options): New function.
	(validate_actionline): Call it.
	(encode_actions_1): Ditto.
	* target.h (struct target_ops): New method to_supports_string_tracing.
	(target_supports_string_tracing): New macro.
	* target.c (update_current_target): Add to_supports_string_tracing.
	* remote.c (struct remote_state): New field string_tracing.
	(remote_string_tracing_feature): New function.
	(remote_protocol_features): New feature tracenz.
	(remote_supports_string_tracing): New function.
	(init_remote_ops): Set to_supports_string_tracing.

	* tracepoint.c (agent_mem_read_string): New function.
	(eval_agent_expr): Call it for tracenz.
	* server.c (handle_query): Report support for tracenz.

	* gdb.texinfo (Tracepoint Action Lists): Document collect/s.
	(General Query Packets): Describe tracenz feature.
	* agentexpr.texi (Bytecode Descriptions): Describe tracenz.

	* gdb.trace/collection.c: Add code using strings.
	* gdb.trace/collection.exp: Add tests of string collection.
2011-11-02 23:44:21 +00:00
Jan Kratochvil f179e16214 gdb/
* linux-nat.c: Include cli/cli-utils.h.
	(enum info_proc_what): New.
	(linux_nat_info_proc_cmd): Rename to ...
	(linux_nat_info_proc_cmd_1): ... here.  Remove variables argv and all.
	New parameter what.  Initialize cmdline_f, cwd_f, exe_f, mappings_f,
	status_f and stat_f from WHAT.  Throw error on extra parameters.
	(linux_nat_info_proc_cmd, linux_nat_info_proc_cmd_mappings)
	(linux_nat_info_proc_cmd_stat, linux_nat_info_proc_cmd_status)
	(linux_nat_info_proc_cmd_cwd, linux_nat_info_proc_cmd_cmdline)
	(linux_nat_info_proc_cmd_exe, linux_nat_info_proc_cmd_all): New.
	(_initialize_linux_nat): New variable info_proc_cmdlist.  Install `info
	proc mappings', `info proc stat`, `info proc status', `info proc cwd',
	`info proc cmdline', `info proc exe' and `info proc all' as real
	subcommands of `info proc'.
2011-11-02 18:47:16 +00:00
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
Pedro Alves 7aee8dc2c2 2011-10-24 Pedro Alves <pedro@codesourcery.com>
gdb/
	* infrun.c (handle_inferior_event): Don't assume inferior_ptid is
	already set when marking the event thread as not executing in
	non-stop mode.
2011-10-24 14:09:20 +00:00
Pedro Alves 4b4e080e83 2011-10-24 Pedro Alves <pedro@codesourcery.com>
gdb/
	* infrun.c (handle_inferior_event): Add debug output for
	TARGET_WAITKIND_NO_HISTORY.
2011-10-24 14:01:12 +00:00
Yao Qi b022178194 gdb/testsuite/
* lib/gdb.exp (can_single_step_to_signal_handler): Return 0 when
	target is tic6x-*-*.
2011-10-24 13:51:20 +00:00
Phil Muldoon baacfb07fc 2011-10-24 Phil Muldoon <pmuldoon@redhat.com>
* NEWS: Move set/show extended-prompt to "New Options". Expand
	description. Fix typos.
2011-10-24 11:49:26 +00:00
Phil Muldoon 8432bc4103 2011-10-24 Phil Muldoon <pmuldoon@redhat.com>
PR python/13310

	* python/py-param.c (call_doc_function): Correctly deference on
	function exit.
2011-10-24 11:39:50 +00:00
gdbadmin 957ff1ca67 *** empty log message *** 2011-10-24 00:00:03 +00:00
gdbadmin 9784852956 *** empty log message *** 2011-10-23 00:00:32 +00:00
gdbadmin 2954ce4ce4 *** empty log message *** 2011-10-22 00:00:33 +00:00
Joel Brobecker 6cda5a2082 [Ada] Fix number of lines in -ada-task-info output
When using the new -ada-task-info command with an argument,
the output would say that there are N entries in the returned
table, (where N is the total number of tasks present in the inferior).
But, in fact, the table would only contain at most 1 entry.

This patch fixes this by properly computing the number of
tasks being displayed before giving it to the uiout.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): Fix computation of
        number of tasks displayed in command output.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_task_info/task_switch.adb: New file.
        * gdb.ada/mi_task_info.exp: New file.
2011-10-21 18:46:06 +00:00
Jan Kratochvil 5ed9db04f8 gdb/testsuite/
* gdb.cp/expand-psymtabs-cxx.exp: New file.
	* gdb.cp/expand-psymtabs-cxx.cc: New file.
2011-10-21 16:31:17 +00:00
gdbadmin a27f53a7cb *** empty log message *** 2011-10-21 00:00:33 +00:00
Jan Kratochvil 13294f7d62 gdb/
* dwarf2-frame-tailcall.c: Include dwarf2-frame.h.
	(dwarf2_tailcall_prev_register_first): Use dwarf2_frame_cfa.
	(dwarf2_tailcall_sniffer_first): Remove variable pc_regnum.  Replace
	gdbarch_pc_regnum and frame_unwind_register_unsigned by
	gdbarch_unwind_pc.
2011-10-20 23:57:23 +00:00
Cary Coutant 460c1c54b4 * dwarf2read.c (dw2_get_file_names): Move adjustment for type
section to...
	(partial_read_comp_unit_head): ...here.  Add is_debug_type_section
	flag.  Adjust all callers.
	(process_psymtab_comp_unit): Remove adjustment for type section.
2011-10-20 23:13:01 +00:00
Aleksandar Ristovski a10964d12c * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function
arguments by adding OBJFILE.  Instead of getting objfile from
	symbol's symtab, use new argument OBJFILE.
	* cp-support.h (cp_scan_for_anonymous_namespaces): Changed function
	arguments by adding OBJFILE.
	* gdb/dwarf2read.c (new_symbol_full): Change call to
	cp_scan_for_anonymous_namespaces to match new signature.
	* gdb/stabsread.c (define_symbol): Change call to
	cp_scan_for_anonymous_namespaces to match new signature.
2011-10-20 20:06:14 +00:00
Phil Muldoon 27ca1a5b08 2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
PR python/13308
        PR python/13309

	* python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference
	leak.
	* python/py-inferior.c (gdbpy_inferiors): Fix List reference
	leak.  Delete unused variables.
2011-10-20 13:34:17 +00:00
Phil Muldoon 9df2fbc4c1 2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
PR python/12656

	* python/py-frame.c (frapy_read_var): Use const struct *block.
	* python/py-type.c (typy_lookup_typename): Likewise.
	(typy_lookup_type): Likewise.
	(typy_legacy_template_argument): Likewise.
	(typy_template_argument): Likewise.
	(gdbpy_lookup_type): Likewise.
	* python/py-symbol.c (gdbpy_lookup_symbol): Likewise.
	* python/py-block.c (blpy_block_object): Likewise.
	(blpy_iter): Likewise.
	(blpy_get_start): Likewise.
	(blpy_get_end): Likewise.
	(blpy_get_function): Likewise.
	(blpy_get_superblock): Likewise.
	(set_block):  Likewise.
	(block_to_block_object): Likewise.
	(block_object_to_block): Likewise.
	(blpy_is_valid): Likewise.
	(blpy_get_global_block): New function.
	(blpy_get_static_block): New function.
	(blpy_is_global): New function.
	(blpy_is_static): New function.
	* blockframe.c (block_innermost_frame): Likewise.
	* valops.c (value_of_variable): Likewise.
	* frame.h: Update prototypes.
	* python/python-internal.h: Likewise.
	* value.h: Likewise.

2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>

	PR python/12656

	* gdb.texinfo (Blocks In Python): Document is_static, is_global,
	global_block, static_block function.

2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>

	PR python/12656

	* gdb.python/py-block.exp: Add is_global, is_static, static_block,
	global_block tests.
2011-10-20 12:31:30 +00:00
Cary Coutant 4743b73565 * dwarf2read.c (create_debug_types_hash_table): Fix size of
type_offset field.
2011-10-20 01:11:34 +00:00
gdbadmin 5b1c20602a *** empty log message *** 2011-10-20 00:00:03 +00:00
Tom Tromey f05e2e1de6 * gdb.texinfo (Commands In Python): Add missing "@"s. 2011-10-19 17:51:01 +00:00
Cary Coutant 6caca83cb8 * dwarf2read.c (peek_abbrev_code): New function.
(dw2_get_file_names): Check for dummy compilation units.
	(create_debug_types_hash_table): Likewise.
	(process_psymtab_comp_unit): Likewise.
	(load_partial_comp_unit): Likewise.
	(load_full_comp_unit): Likewise.
2011-10-19 15:26:30 +00:00
gdbadmin 01b701aae6 *** empty log message *** 2011-10-19 00:00:32 +00:00
Tom Tromey 736086bae2 * gdb.base/jit-so.exp (one_jit_test): Remove spurious backslash. 2011-10-18 16:55:43 +00:00
Tom Tromey 4af315526a * gdb.base/source.exp: Don't include full file name in test name.
* gdb.python/python.exp: Don't include full file name in test
	name.
2011-10-18 14:14:01 +00:00
Aleksandar Ristovski 4313697959 * solib-svr4.c (read_program_header): New variables pt_phdr, pt_phdr_p,
initialize them from target PT_PHDR p_vaddr, relocate sect_addr by
	pt_phdr if PT_PHDR was found.

	* gdb.base/attach-pie-noexec.c: New files.
	* gdb.base/attach-pie-noexec.exp: New files.
2011-10-18 14:00:42 +00:00
gdbadmin 41835e6a39 *** empty log message *** 2011-10-18 00:00:32 +00:00
Joseph Myers 543a932338 * lib/gdb.exp (gdb_test_multiple): Expect newline and secondary
prompt for each extra line in command.
2011-10-17 17:10:55 +00:00
Tom Tromey 0a07729b43 2011-10-17 Joost van der Sluis <joost@cnoc.nl>
* gdbtypes.h: Added TYPE_SAFE_NAME macro to get the name of a
	type or "<unnamed type"> when there is no name assigned.
	* gnu-v3-abi.c (gnuv3_rtti_type): Use TYPE_SAFE_NAME macro to
	avoid a sigint when no name is assigned.
2011-10-17 14:04:37 +00:00
Jan Kratochvil 21ae7a4d84 gdb/
Revert:
	2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
        * dwarf2expr.c (ctx_no_read_reg): New function.
        * dwarf2expr.h (ctx_no_read_reg): New declaration.
        * dwarf2read.c (read_2_signed_bytes, read_4_signed_bytes): Remove.
        (decode_locdesc_read_mem, decode_locdesc_ctx_funcs): New.
        (decode_locdesc): Replace by a caller of dwarf_expr_eval.

gdb/testsuite/
	* gdb.dwarf2/dw2-simple-locdesc.exp (p &s.shl): KFAIL it.
	Revert the part of:
	2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.dwarf2/dw2-stack-boundary.exp (check partial symtab errors):
	Change the expected string.
2011-10-17 12:57:15 +00:00