Commit Graph

29054 Commits

Author SHA1 Message Date
Corinna Vinschen b7ff339d9e * windows-nat.c: Include wchar.h to avoid compiler warnings.
(clear_win32_environment): New function for Cygwin to clear out
	Win32 environment.
	(windows_create_inferior): Prepare new environment from in_env
	for Cygwin, too.
2011-10-07 13:52:11 +00:00
Phil Muldoon f287c1f320 2011-10-07 Phil Muldoon <pmuldoon@redhat.com>
PR python/13624

	* python/py-value.c (valpy_call): Check that arguments are
	a tuple.
        (is_intlike): Remove call to CHECK_TYPEDEF.
	(valpy_nonzero): Catch GDB exceptions.
	(valpy_absolute): Ditto.
        (valpy_lazy_string): Ditto.
        (valpy_call): Ditto.
        (valpy_get_is_optimized_out): Ditto.
        (valpy_long): Ditto.
        (valpy_float): Ditto.
        (valpy_int): Call CHECK_TYPEDEF.  Catch GDB exceptions.
        (valpy_richcompare): Ditto.
2011-10-07 13:46:11 +00:00
Phil Muldoon 99f5279d98 2011-10-07 Phil Muldoon <pmuldoon@redhat.com>
PR python/12930
	PR python/12802

	* gdb.texinfo (Breakpoints In Python): Clarify behavior in the
	stop method.
2011-10-07 13:23:18 +00:00
Ulrich Weigand 03583c206f * inferior.h (disable_randomization): Declare.
* infrun.c (disable_randomization): New global variable.
	(show_disable_randomization): New function.
	(set_disable_randomization): Likewise.
	(_initialize_infrun): Install set/show disable-randomization
	commands.
	* linux-nat.c (disable_randomization): Remove.
	(show_disable_randomization): Likewise.
	(set_disable_randomization): Likewise.
	(_initialize_linux_nat): No longer install set/show
	disable-randomization commands here.
	(linux_nat_supports_disable_randomization): New function.
	(linux_nat_add_target): Install it.
	* remote.c (PACKET_QDisableRandomization): New enum value.
	(remote_protocol_packets): Support QDisableRandomization.
	(_initialize_remote): Likewise.
	(remote_supports_disable_randomization): New function.
	(init_remote_ops): Install it.
	(extended_remote_supports_disable_randomization): New function.
	(init_extended_remote_ops): Install it.
	(extended_remote_disable_randomization): New function.
	(extended_remote_create_inferior_1): Call it.
	* target.h (struct target_ops): Add to_supports_disable_randomization.
	(target_supports_disable_randomization): Add prototype.
	* target.c (target_supports_disable_randomization): New function.
	(find_default_supports_disable_randomization): Likewise.
	(init_dummy_target): Install it.

doc/
	* gdb.texinfo (Starting your Program): "set disable-randomization"
	is no longer Linux-specific.
	(Remote Configuration): Document "set remote
	disable-randomization-packet".
	(General Query Packets): Document "QDisableRandomization" packet
	and add it to "qSupported" list.

gdbserver/
	* configure.ac: Check support for personality routine.
	* configure: Regenerate.
	* config.in: Likewise.
	* linux-low.c: Include <sys/personality.h>.
	Define ADDR_NO_RANDOMIZE if necessary.
	(linux_create_inferior): Disable address space randomization when
	forking inferior, if requested.
	(linux_supports_disable_randomization): New function.
	(linux_target_ops): Install it.
	* server.h (disable_randomization): Declare.
	* server.c (disable_randomization): New global variable.
	(handle_general_set): Handle QDisableRandomization.
	(handle_query): Likewise for qSupported.
	(main): Support --disable-randomization and --no-disable-randomization
	command line arguments.
	* target.h (struct target_ops): Add supports_disable_randomization.
	(target_supports_disable_randomization): New macro.
2011-10-07 12:06:48 +00:00
Kevin Pouget 01b7169780 Add missing files to previous commit (Allow Python notification of new object-file loadings.) 2011-10-07 08:39:57 +00:00
Kevin Pouget bd054e06e3 Fix ChangeLog messup (Allow Python notification of new object-file loadings.) 2011-10-07 07:51:20 +00:00
Kevin Pouget 20c168b519 Allow Python notification of new object-file loadings.
* Makefile.in (SUBDIR_PYTHON_SRCS): Add py-newobjfilevent.c.
	(SUBDIR_PYTHON_OBS): Add py-newobjfileevent.o.
	Add build rule for this file.
	* python/py-event.h (emit_new_objfile_event): New prototype.
	(newobjfile): New Python event emitter.
	* python/py-evts.c (gdbpy_initialize_py_events): Add new_objfile to
	Python event registry.
	* python/py-inferior.c: Include objfiles.h
	(python_new_objfile): New function.
	(gdbpy_initialize_inferior): Add python_new_objfile to the new objfile
	observers.
	* python/py-newobjfileevent.c: New file.
	* python-internal.h (gdbpy_initialize_new_objfile_event): New
	prototype.
	* python/python.c (_initialize_python): Add
	gdbpy_initialize_new_objfile_event call.
	* NEWS: Add item for new Python event "gdb.newobjfile"

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.texinfo (Events In Python): Document `gdb.NewObjFileEvent'
	event type.

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.python/py-events.exp: Test newobjfile event.
	* gdb.python/py-events.py: Register newobjfile callback.
	* gdb.python/py-events.c: Add call to shared library
	* gdb.python/py-events-shlib.c: New file.
2011-10-07 07:38:30 +00:00
Joseph Myers 8031b6f821 * gdb.base/fixsection.exp: Do not include directories in filename
in expected message.
2011-10-07 00:24:38 +00:00
gdbadmin 9ad26a41a7 *** empty log message *** 2011-10-07 00:00:02 +00:00
gdbadmin a664570eec *** empty log message *** 2011-10-06 00:00:03 +00:00
Pierre Muller 7fea69231b Add tests for passing of environment variables to inferior.
* gdb.base/testenv.c: New test source.
	* gdb.base/testenv.exp: New expect test.
2011-10-05 14:23:37 +00:00
Tristan Gingold b1c8db38fc 2011-10-05 Tristan Gingold <gingold@adacore.com>
* ada-tasks.c (read_atcb): Make ravenscar_task_name static.
        Extract the ravenscar task name from the symbol for the atcb.
2011-10-05 07:41:13 +00:00
gdbadmin 98acb30286 *** empty log message *** 2011-10-05 00:00:32 +00:00
Paul Koning 687f2a88e7 * gdb.python/py-value.c (main): Break before return. 2011-10-04 17:43:16 +00:00
Paul Koning 0dab82e9b3 * python/py-type.c (typy_make_iter): Add forward declaration.
(typy_fields_items):  Use the gdb.Type iterator.
2011-10-04 16:20:03 +00:00
Paul Koning 84ad80e63a * NEWS: Add entry for Python gdb.Type mapping methods. 2011-10-04 15:55:39 +00:00
Paul Koning 699df94d5a Fix misplaced documentation entry (Paul Koning, 2011-09-28) 2011-10-04 15:54:35 +00:00
Kevin Pouget cb6be26b8b 2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
       * python/py-exitedevent.c (create_exited_event_object): Add inferior
       to exited_event.
       * python/py-event.h (emit_exited_event): Likewise
       * python/-inferior.c (python_inferior_exit): Likewise

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.python/py-events.exp: Test the inferior attribute of exited
       event with a fork.
       * gdb.python/py-events.py: Print inferior number on exit.
       * gdb.python/py-events.c: Fork the inferior.

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.texinfo (Events In Python): Describe exited inferior attribute.
2011-10-04 08:04:13 +00:00
gdbadmin 54d2bafcf2 *** empty log message *** 2011-10-04 00:00:33 +00:00
Joel Brobecker a05336a1c8 [doco] rephrase `presence of' with `support for'.
gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Miscellaneous Commands): Minor
        rephasing.
2011-10-03 21:39:03 +00:00
Joel Brobecker 5d77fe4431 [Ada/doco] Document the new -ada-task-info GDB/MI command.
gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Ada Tasking Commands): New node.
        (GDB/MI Miscellaneous Commands): Add `ada-task-info'
        as possible feature returned by the `-list-features'
        command.
2011-10-03 21:38:51 +00:00
Joel Brobecker 6005b21039 [Ada] Add field "thread-id" in -ada-task-info output
This patch enhances the -ada-task-info command, adding a new
field called "thread-id" in the command output.  This field
provides the ID of the task's corresponding thread (if that
information could not be determined, the field is omitted).

This field is useful in the context of GDB/MI users, because
it allows a quick translation from Ada task to thread, and
thus easy use of all the commands that take a --thread argument.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): Add "thread-id" field
        in output of -ada-task-info GDB/MI command.
2011-10-03 21:38:39 +00:00
Joel Brobecker 75082e8cbb [Ada] New GDB/MI command: -ada-tasks-info
This patch introduces a new GDB/MI command: -ada-tasks-info,
which is meant to be the MI equivalent of the CLI `info tasks'
command.

This new command returns an array, with each row corresponding
to one task.  For now, the columns of the array corresponds to
the columns displayed in the CLI output.

gdb/ChangeLog:

        * ada-lang.h (struct inferior): Declare.
        (print_ada_task_info): Add declaration.
        * ada-tasks.c (print_ada_task_info): Make non-static.
        * mi/mi-cmds.c (mi_cmds): Add "ada-task-info".
        * mi/mi-cmds.h (mi_cmd_ada_task_info): Add declaration.
        * mi/mi-main.c: #include "ada-lang.h".
        (mi_cmd_list_features): Add "ada-task-info" to the list
        of supported features.
        (mi_cmd_ada_task_info): New function.
2011-10-03 21:38:31 +00:00
Joel Brobecker 7ed7d71926 Crash sourcing Python script on Windows
gdb/ChangeLog:

        * python/python.c (python_run_simple_file): New function.
        (source_python_script, source_python_script_for_objfile):
        Replace call to PyRun_SimpleFile by call to
        python_run_simple_file.
2011-10-03 20:46:19 +00:00
Edjunior Barbosa Machado fb21370048 * gdb.base/jit.exp: Add testcase name to log message 2011-10-03 20:13:57 +00:00
Paul Koning aa2071bd24 * gdb.python/py-value.exp
(python inval = gdb.parse_and_eval('*(int*)0'))
(python argc_lazy = gdb.parse_and_eval('argc'), sanity check argc)
(set argc=2, python print argc_lazy): New tests.
2011-10-03 16:15:26 +00:00
Paul Koning 3fcaed3833 * python/py-value.c (valpy_get_address): Use Py_XINCREF.
(value_to_value_object): Fetch value if it was lazy.
2011-10-03 16:14:39 +00:00
gdbadmin 34788f4a2b *** empty log message *** 2011-10-03 00:00:03 +00:00
Jan Kratochvil 8e5c319d86 gdb/
Code cleanup.
	* solib-svr4.c (svr4_default_sos):  Remove variables head and link_ptr.
	Rearrange the code for it.
2011-10-02 21:05:59 +00:00
Joel Brobecker dd11a36cfe thread-specific breakpoints not saved properly by save-breakpoint
Initially, I noticed that the save command was often missing
new lines in the file that it generated.  For instance, consider:

        % gdb save-bp
        (gdb) b break_me
        (gdb) b save-bp.c:27
        (gdb) save breakpoints bps

The contents of the bps file would be:

        % cat bps
        break break_mebreak save-bp.c:27

Looking further into the problem, I realized that the missing newlines
are just a consequence of a missing call to print_recreate_thread.
After having generated the breakpoint location in the break command,
we cannot put a new line until we have looked at whether we need to
add a 'thread NUM' argument.

gdb/ChangeLog:

        * breakpoint.c (bkpt_print_recreate): Add call to
        print_recreate_thread.

gdb/testsuite/ChangeLog:

        * gdb.base/save-bp.exp, gdb.base/save-bp.c: New files.
2011-10-02 02:13:13 +00:00
gdbadmin 2fed52b14d *** empty log message *** 2011-10-02 00:00:03 +00:00
Jan Kratochvil 46f886f1f5 gdb/testsuite/
* gdb.python/py-value.exp (test_value_in_inferior): New variable
	can_read_0, test for it.
	(python print gdb.parse_and_eval('*(int*)0')): Rename to ...
	(parse_and_eval with memory error): ... here, make it untested if
	can_read_0.
2011-10-01 11:02:11 +00:00
gdbadmin 4ca9de19cd *** empty log message *** 2011-10-01 00:00:32 +00:00
Marek Polacek c5cb204fbb gdb.python/python.exp: fix up race 2011-09-30 15:07:33 +00:00
Mike Frysinger 723b724b17 gdbserver: add support for FDPIC loadmaps
The DSBT support is very close to the FDPIC code, so extend the existing
loadmap support to work with FDPIC loadmaps too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-30 00:01:59 +00:00
gdbadmin 1f7c9b6179 *** empty log message *** 2011-09-30 00:00:32 +00:00
Joseph Myers 68fb0ec00b * lib/gdb.exp (is_amd64_regs_target, is_x86_like_target): Allow
for 64-bit multilibs from i?86-* targets.
2011-09-29 15:17:50 +00:00
Marek Polacek 6aee0d90b5 lib/gdb.exp: Fix a typo 2011-09-29 14:36:47 +00:00
Marek Polacek e9101ff5a7 gdb.base/foll-fork.exp: fix up race 2011-09-29 14:13:00 +00:00
Yao Qi 24bdad53a9 gdb/doc/
* gdb.texinfo (Files): Update options for `add-symbol-file'.
	Add one space after option `-s'.  Remove @r{} markup.
2011-09-29 02:25:49 +00:00
Yao Qi 412946b6ba gdb/
* symfile.c (add_symbol_file_command): Update message on usage.
2011-09-29 02:04:25 +00:00
gdbadmin d8250e5afa *** empty log message *** 2011-09-29 00:00:32 +00:00
Paul Koning 7a81bdbf67 * gdb.python/py-type.c (enum E): New.
* gdb.python/py-type.exp (test_fields): Add tests for Python
mapping access to fields.
(test_enums): New test for field access on enums.
2011-09-28 20:06:01 +00:00
Paul Koning a73bb89264 * python/py-type.c (make_fielditem, typy_field_names, typy_items)
(typy_length, typy_get, typy_has_key, typy_make_iter)
(typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter)
(typy_iterator_iter, typy_iterator_iternext)
(typy_iterator_dealloc): New functions to implement standard
Python mapping methods on gdb.Type object.
(gdb.TypeIterator): New Python type.
* python/python-internal.h (gdbpy_iter_kind): New enum.
* doc/gdb.texinfo (gdb.Type): Document field access by dictionary
key syntax.
2011-09-28 20:04:52 +00:00
David S. Miller fe10a582b6 Fix complex floats on sparc.
* sparc-tdep.h (SPARC_F2_REGNUM, SPARC_F3_REGNUM, SPARC_F4_REGNUM,
	SPARC_F5_REGNUM, SPARC_F6_REGNUM, SPARC_F7_REGNUM): New enums.
	* sparc-tdep.c (sparc_complex_floating_p): New function.
	(sparc32_store_arguments): Handle complex floats.
	(sparc32_extract_return_value): Likewise.
	(sparc32_store_return_value): Likewise.
	(sparc32_stabs_argument_has_addr): Likewise.
	* sparc64-tdep.c (sparc64_complex_floating_p): New function.
	(sparc64_store_floating_fields): Handle complex floats.
	(sparc64_store_arguments): Likewise.
	(sparc64_store_return_value): Likewise.
2011-09-28 17:59:42 +00:00
Eli Zaretskii c93dbcba16 Support "set environment" and "unset environment" in MinGW builds.
* windows-nat.c (env_sort) [!__CYGWIN__]: Function restored from
	before the change on 2006-12-09.
	(windows_create_inferior) [!__CYGWIN__]: Restore code that
	generates the environment block for CreateProcessA, modulo the
	Cygwin-specific parts that are not needed here.
2011-09-28 09:07:54 +00:00
gdbadmin 27ebf5b696 *** empty log message *** 2011-09-28 00:00:32 +00:00
Tristan Gingold f00c55f832 2011-09-27 Tristan Gingold <gingold@adacore.com>
* target.h (enum target_object): Add TARGET_OBJECT_DARWIN_DYLD_INFO.
	* solib-darwin.c (DYLD_VERSION_MAX): Update number.
	(darwin_solib_get_all_image_info_addr_at_init): New function.
	(darwin_solib_read_all_image_info_addr): Likewise.
	(darwin_solib_create_inferior_hook): Use the above two functions.
	* darwin-nat.c (darwin_execvp): Renames retval to res.
	(darwin_read_write_inferior): Update comment.
	(darwin_read_dyld_info): New function.
	(darwin_xfer_partial): Handle DYLD_INFO.
2011-09-27 15:30:18 +00:00
Stan Shebs 6710bf39b7 Add return address collection for tracepoints.
* tracepoint.c (encode_actions_1): Add case for $_ret.
	(validate_actionline): Check for $_ret.
	(trace_dump_actions): Ditto.
	* ax-gdb.h (gen_trace_for_return_address): Declare.
	* ax-gdb.c: Include arch-utils.h.
	(gen_trace_for_return_address): New function.
	(agent_command): Add return address special case.
	* amd64-tdep.c: Include ax.h and ax-gdb.h.
	(amd64_gen_return_address): New function.
	(amd64_init_abi): Call it.
	* i386-tdep.c: Include ax.h and ax-gdb.h.
	(i386_gen_return_address): New function.
	(i386_init_abi): Call it.
	* arch-utils.h (default_gen_return_address): Declare.
	* arch-utils.c (default_gen_return_address): New function.
	* gdbarch.sh (gen_return_address): New method.
	* gdbarch.h, gdbarch.c: Regenerate.

	* gdb.texinfo (Tracepoint Action Lists): Document $_ret.

	* gdb.trace/collection.exp: Test collection of $_ret.
2011-09-27 13:09:37 +00:00
gdbadmin efc7c64ad1 *** empty log message *** 2011-09-27 00:00:02 +00:00