Commit Graph

810 Commits

Author SHA1 Message Date
Pedro Alves 277e4e5235 2012-02-24 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_bigqtbuffer): Rename as ...
	(cmd_bigqtbuffer_circular): ... this.  Only handle
	'QTBuffer:circular:'.
	(handle_tracepoint_general_set): Adjust.
2012-02-24 14:46:48 +00:00
Yao Qi bf4c19f73e gdb/gdbserver/
* inferiors.c: Move code to ...
	* dll.c: .... here.  New.
	* server.h: Declare clear_dlls.
	* Makefile.in (SFILES): Add dll.c.
	(OBS): Add dll.o
	(dll.o): New rule.
2012-02-16 10:38:15 +00:00
Yao Qi d73f2619de gdb/gdbserver/
* server.c: (handle_monitor_command): Add a new parameter
	`own_buf'.
	(handle_query): Update caller.
2012-02-11 13:36:41 +00:00
Joel Brobecker f8255c2a40 [gdbserver] return ENOSYS if readlink not supported.
This reproduces on the GDBserver side what GDB does when readlink is
not supported.

gdb/gdbserver/ChangeLog:

        * configure.ac: Add readlink to AC_CHECK_FUNCS list.
        * configure, config.in: Regenerate.
        * hostio.c: Provide an alternate implementation if HAVE_READLINK
        is not defined.
2012-02-09 17:29:34 +00:00
Pedro Alves da84f473b7 2012-02-02 Pedro Alves <palves@redhat.com>
Try SIGKILL first, then PTRACE_KILL.
	* linux-low.c (linux_kill_one_lwp): New.
	(linux_kill_one_lwp): Rename to ...
	(kill_one_lwp_callback): ... this.  Use the new
	linux_kill_one_lwp.
2012-02-02 18:06:40 +00:00
Pedro Alves e886a1732a gdbserver/
2012-02-02  Pedro Alves  <palves@redhat.com>

	* tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
	inferior.

gdb/
2012-02-02  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_get_min_fast_tracepoint_insn_len): Return 0 if
	the current inferior has no execution.  Make sure the current
	remote process matches gdb's current inferior.
2012-02-02 18:04:29 +00:00
Pedro Alves be07f1a20c 2012-01-27 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_child_pid_to_exec_file): Delete.
	(elf_64_file_p): Make static.
	(linux_pid_exe_is_elf_64_file): New.
	* linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
	Delete declarations.
	(linux_pid_exe_is_elf_64_file): Declare.
	* linux-x86-low.c (x86_arch_setup): Use
	linux_pid_exe_is_elf_64_file.
2012-01-27 19:23:43 +00:00
Jan Kratochvil d8301ad1da gdb/gdbserver/
* linux-low.c (linux_wait_for_event_1): Rename to ...
	(linux_wait_for_event): ... here and merge it with former
	linux_wait_for_event - new variable wait_ptid, use it.
	(linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
2012-01-25 18:25:13 +00:00
Pedro Alves 01b1789443 2012-01-23 Pedro Alves <palves@redhat.com>
* server.c (main): Avoid yet another case of infinite loop while
	detaching/killing after a longjmp.
2012-01-23 16:40:26 +00:00
Jan Kratochvil e825046fcf gdb/gdbserver/
Code cleanup.
	* linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
2012-01-20 20:02:25 +00:00
Ulrich Weigand b9e7b9c3de ChangeLog:
* configure.ac [AC_CHECK_FUNCS]: Check for readlink.
	* config.in, configure: Regenerate.

	* target.h (struct target_ops): Add to_fileio_readlink.
	(target_fileio_readlink): Add prototype.
	* target.c (target_fileio_readlink): New function.

	* inf-child.c: Conditionally include <sys/param.h>.
	(inf_child_fileio_readlink): New function.
	(inf_child_target): Install it.

	* remote.c (PACKET_vFile_readlink): New enum value.
	(remote_hostio_readlink): New function.
	(init_remote_ops): Install it.
	(_initialize_remote): Handle vFile:readlink packet type.

doc/ChangeLog:

	* gdb.texinfo (Remote Configuration): Document
	"set remote hostio-readlink-packet" command.
	(General Query Packets): Document vFile:readlink packet.

gdbserver/ChangeLog:

	* hostio.c (handle_readlink): New function.
	(handle_vFile): Call it to handle "vFile:readlink" packets.
2012-01-20 09:47:32 +00:00
Ulrich Weigand 901f991244 2012-01-20 Pedro Alves <palves@redhat.com>
Ulrich Weigand  <ulrich.weigand@linaro.org>

ChangeLog:

	* remote.c (remote_multi_process_p): Only check for multi-process
	protocol feature, do not check for extended protocol.
	(remote_supports_multi_process): Check for extended protocol here.
	(set_general_process): Likewise.
	(extended_remote_kill): Likewise.
	(remote_pid_to_str): Likewise.
	(remote_query_supported): Always query multiprocess mode.

gdbserver/ChangeLog:

	* server.c (handle_v_requests): Only support vAttach and vRun to
	start multiple processes when in extended protocol mode.
2012-01-20 09:44:35 +00:00
Pedro Alves fc1ab1a0ff 2012-01-17 Pedro Alves <palves@redhat.com>
* tracepoint.c (initialize_tracepoint): Use mmap instead of
	memalign plus mprotect to allocate the scratch buffer.
2012-01-17 17:22:10 +00:00
Pedro Alves 7d5d4e982d 2012-01-13 Pedro Alves <palves@redhat.com>
* server.c (attach_inferior): Clear `cont_thread'.
2012-01-13 20:06:40 +00:00
Pedro Alves f128d5e9da 2012-01-13 Pedro Alves <palves@redhat.com>
* server.c (main): Avoid infinite loop while detaching/killing
	after a longjmp.
2012-01-13 20:02:36 +00:00
Doug Evans 06db92f054 * server.c (start_inferior): Set last_ptid in --wrapper case. 2012-01-09 17:17:50 +00:00
Yao Qi 32d929991d * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
defined.
	[IN_PROCESS_AGENT] (debug_agent): New global variable.
2012-01-06 05:58:29 +00:00
Yao Qi 5e0a92a986 gdb/gdbserver/
* tracepoint.c (cmd_qtdp): Print debug message
	for static tracepoint.
2012-01-04 14:39:12 +00:00
Yao Qi ae639e8c92 gdb/gdbserver/
* tracepoint.c (trace_vdebug): Differentiate debug message
	between gdbserver and IPA.
2012-01-04 14:34:49 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Yao Qi f72429c5cc gdb/gdbserver/
* tracepoint.c (tracepoint_was_hit): Don't collect for
	static tracepoint.
2012-01-03 02:26:52 +00:00
Joel Brobecker 12c3e59c33 Update the copyright header of various files...
... to follow the correct syntax (according to the gospel of
gnulib's update-copyright). In other words:
  - no comma after the last year;
  - FSF spelled exactly "Free Software Foundation, Inc.", with
    the comma and the period at the end.

sim/common/ChangeLog:

	* dv-sockser.h, sim-assert.h, sim-fpu.c: Reformat the copyright
	header.

sim/m32c/ChangeLog:

	* blinky.S, gloss.S, sample.S: Reformat copyright header.

sim/mn10300/ChangeLog:

	* sim-main.h: Reformat copyright header.

sim/ppc/ChangeLog:

	* dp-bit.c: Reformat copyright header.

gdb/ChangeLog:

        * gdb/common/gdb_thread_db.h, gdb/dbxread.c, gdb/environ.c,
        gdb/gcore.h, gdb/rs6000-tdep.h, gdb/s390-nat.c, gdb/tic6x-tdep.c:
        Reformat the copyright header.

gdb/gdbserver/ChangeLog:

	* terminal.h: Reformat copyright header.

gdb/testsuite/ChangeLog:

	* dg-extract-results.sh, gdb.arch/gcore.c, gdb.arch/gdb1558.c,
	gdb.arch/i386-gnu-cfi.c, gdb.base/complex.c, gdb.base/cvexpr.c,
	gdb.base/gcore.c, gdb.base/gdb1555-main.c, gdb.base/gdb1555.c,
	gdb.base/gdb1821.c, gdb.base/long_long.c, gdb.base/restore.c,
	gdb.base/sepdebug.c, gdb.base/type-opaque-lib.c,
	gdb.base/type-opaque-main.c, gdb.cp/maint.exp, gdb.cp/namespace1.cc,
	gdb.cp/pr9631.cc, gdb.cp/psmang1.cc, gdb.cp/psmang2.cc,
	gdb.cp/try_catch.cc, gdb.cp/virtfunc.cc, gdb.hp/gdb.base-hp/reg.exp,
	gdb.mi/basics.c, gdb.mi/mi-stack.c, gdb.mi/mi-var-child.c,
	gdb.mi/mi2-var-child.exp, gdb.mi/var-cmd.c,
	gdb.threads/thread_check.c: Reformat copyright header.
2012-01-02 15:37:37 +00:00
Joel Brobecker 6782781204 gdb/gdbserver/gdbreplay: Update copyright year in version out
gdb/ChangeLog:

	* top.c (print_gdb_version): Update copyright year.

gdb/gdbserver/ChangeLog:

	* server.c (gdbserver_version): Update copyright year.
	* gdbreplay.c (gdbreplay_version): Likewise.
2012-01-02 08:59:35 +00:00
Jan Kratochvil 3e52c33d23 gdb/gdbserver/
* linux-low.c (linux_create_inferior): Put empty if clause for write.

	Revert:
	2011-12-18  Hui Zhu  <teawater@gmail.com>
	* linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-18 20:55:08 +00:00
Hui Zhu 66f1260e72 2011-12-18 Hui Zhu <teawater@gmail.com>
* linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-18 15:49:04 +00:00
Doug Evans e7b06c57d8 * linux-low.c (linux_create_inferior): If stdio connection,
redirect stdin from /dev/null, stdout to stderr.
	* remote-utils.c (remote_is_stdio): New static global.
	(remote_connection_is_stdio): New function.
	(remote_prepare): Handle stdio connection.
	(remote_open): Ditto.
	(remote_close): Don't close stdin for stdio connections.
	(read_prim,write_prim): New functions.  Replace all calls to
	read/write to these.
	* server.c (main): Watch for "-" argument.  Move call to
	remote_prepare before start_inferior.
	* server.h (STDIO_CONNECTION_NAME): New macro.
	(remote_connection_is_stdio): Declare.
2011-12-16 19:10:58 +00:00
Doug Evans e0f9f06220 * NEWS: Add entry for stdio gdbserver.
gdbserver/
	* linux-low.c (linux_create_inferior): If stdio connection,
	redirect stdin from /dev/null, stdout to stderr.
	* remote-utils.c (remote_is_stdio): New static global.
	(remote_connection_is_stdio): New function.
	(remote_prepare): Handle stdio connection.
	(remote_open): Ditto.
	(remote_close): Don't close stdin for stdio connections.
	(read_prim,write_prim): New functions.  Replace all calls to
	read/write to these.
	* server.c (main): Watch for "-" argument.  Move call to
	remote_prepare before start_inferior.
	* server.h (STDIO_CONNECTION_NAME): New macro.
	(remote_connection_is_stdio): Declare.

	doc/
	* gdb.texinfo (Server): Document -/stdio argument to gdbserver.

	testsuite/
	* lib/gdbserver-support.exp (gdb_target_cmd): Recognize stdio
	gdbserver output.
	(gdbserver_default_get_remote_address): New function.
	(gdbserver_start): Call gdb,get_remote_address to compute argument
	to "target remote" command.
2011-12-16 19:06:38 +00:00
Doug Evans e77616d77a * remote-utils.c (prepare_resume_reply): Remove extraneous \n
in debugging output.
2011-12-16 18:45:48 +00:00
Yao Qi 8206719361 gdb/gdbserver/
* tracepoint.c: Include sys/syscall.h.
	(gdb_ust_thread): Remove preprocessor conditional.
2011-12-15 12:40:03 +00:00
Pedro Alves 82bfbe7eff 2011-12-14 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_detach_one_lwp): Call
	the_low_target.prepare_to_resume before detaching.
2011-12-14 17:33:24 +00:00
Yao Qi 712c65750b gdb/gdbserver/
* tracepoint.c (gdb_ust_thread): Don't ignore return value
	of write.
2011-12-14 07:47:15 +00:00
Yao Qi d54d1edf1a 2011-12-14 Yao Qi <yao@codesourcery.com>
* i386-low.c (i386_low_stopped_data_address): Initialize local
	variable `control'.
2011-12-14 07:41:06 +00:00
Pedro Alves 6210a125f8 2011-12-13 Pedro Alves <pedro@codesourcery.com>
PR remote/13492

	* i386-low.c (i386_low_stopped_data_address): Avoid fetching
	DR_CONTROL unless necessary.  Extend comments.
	* linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
	DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
2011-12-13 16:11:26 +00:00
Yao Qi 2ece82445d 2011-12-13 Yao Qi <yao@codesourcery.com>
* tracepoint.c (trace_buffer_alloc): Replace magic numbers with
	macros.
	(upload_fast_traceframes, upload_fast_traceframes): Likewise.
2011-12-13 01:26:56 +00:00
Jan Kratochvil 784867a51b gdb/gdbserver/
* linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
	Print new debug message for such case.
2011-12-08 10:28:58 +00:00
Jan Kratochvil 6bf36717da gdb/gdbserver/
Fix overlapping memcpy.
	* mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
	the read_inferior_memory transfer.
	(delete_fast_tracepoint_jump): New variable buf.  Use it for the
	write_inferior_memory transfer.
	(set_fast_tracepoint_jump): New variable buf.  Use it for the
	read_inferior_memory and write_inferior_memory transfers.
	(uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
	(delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
	Use it for the write_inferior_memory transfer.
	(check_mem_read, check_mem_write): New gdb_asserts for overlapping
	buffers.
2011-12-06 23:29:47 +00:00
Maciej W. Rozycki 5027555691 * linux-low.c (fetch_register, store_register): Make code
consistent, fix formatting.
2011-12-06 23:09:08 +00:00
Maciej W. Rozycki 7325beb467 * linux-low.c (usr_store_inferior_registers): Factor out code
to handle individual registers into...
	(store_register): ... this new function.
2011-12-06 23:00:15 +00:00
Ulrich Weigand c642a43456 ChangeLog:
* s390-tdep.h (S390_ORIG_R2_REGNUM): Define.
	(S390_LAST_BREAK_REGNUM): Likewise.
	(S390_SYSTEM_CALL_REGNUM): Likewise.
	(S390_NUM_REGS): Update.

	(s390_regmap_last_break): Add declaration.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.

	(tdesc_s390_linux32v1): Add declaration.
	(tdesc_s390_linux32v2): Likewise.
	(tdesc_s390_linux64v1): Likewise.
	(tdesc_s390_linux64v2): Likewise.
	(tdesc_s390x_linux64v1): Likewise.
	(tdesc_s390x_linux64v2): Likewise.

	* s390-tdep.c: Include new target description files
	"features/s390-linux32v1.c", "features/s390-linux32v2.c",
	"features/s390-linux64v1.c", "features/s390-linux64v2.c",
	"features/s390x-linux64v1.c", and "features/s390x-linux64v2.c".
	(s390_cannot_store_register): New function.
	(s390_write_pc): Likewise.
	(s390_dwarf_regmap): Add fields for new registers.
	(s390_regmap_gregset): Likewise.
	(s390x_regmap_gregset): Likewise.
	(s390_regmap_fpregset): Likewise.
	(s390_regmap_upper): Likewise.
	(s390_regmap_last_break): New variable.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.
	(s390_last_break_regset): Likewise.
	(s390x_last_break_regset): Likewise.
	(s390_system_call_regset): Likewise.
	(s390_upper_regset_sections): Rename to ...
	(s390_linux64_regset_sections): ... this.
	(s390_linux32_regset_sections): New variable.
	(s390x_linux64_regset_sections): Likewise.
	(s390_linux32v1_regset_sections): Likewise.
	(s390_linux32v2_regset_sections): Likewise.
	(s390_linux64v1_regset_sections): Likewise.
	(s390_linux64v2_regset_sections): Likewise.
	(s390x_linux64v1_regset_sections): Likewise.
	(s390x_linux64v2_regset_sections): Likewise.
	(s390_regset_from_core_section): Handle .reg-s390-last-break and
	.reg-s390-system-call core file sections.
	(s390_core_read_description): Check for presence of
	.reg-s390-last-break and .reg-s390-system-call core file
	sections and return appropriate target description.
	(s390_gdbarch_init): Detect Linux-specific registers "orig_r2",
	"last_break" and "system_call" in target description.  Install
	appropriate gdbarch_core_regset_sections array.
	Call set_gdbarch_cannot_store_register and set_gdbarch_write_pc.
	(_initialize_s390_tdep): Initialize additional target descriptions.

	* s390-nat.c: Include "elf/common.h".
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(have_regset_last_break): New static variable.
	(have_regset_system_call): Likewise.
	(s390_native_supply): Handle S390_ORIG_R2_REGNUM.
	(s390_native_collect): Likewise.
	(fetch_regset, store_regset, check_regset): New functions.
	(s390_linux_fetch_inferior_registers): Handle S390_LAST_BREAK_REGNUM
	and S390_SYSTEM_CALL_REGNUM.
	(s390_linux_store_inferior_registers): Likewise.
	(s390_read_description): Check for presence of NT_S390_LAST_BREAK
	and NT_S390_SYSTEM_CALL regsets and use appropriate description.

	* features/Makefile (WHICH): Add s390-linux32v1, s390-linux64v1,
	s390x-linux64v1, s390-linux32v2, s390-linux64v2, and s390x-linux64v2.
	(s390-linux32v1-expedite): Define.
	(s390-linux32v2-expedite): Likewise.
	(s390-linux64v1-expedite): Likewise.
	(s390-linux64v2-expedite): Likewise.
	(s390x-linux64v1-expedite): Likewise.
	(s390x-linux64v2-expedite): Likewise.

	* features/s390-linux32.xml: Add orig_r2 register.
	* features/s390-linux64.xml: Likewise.
	* features/s390x-linux64.xml: Likewise.
	* features/s390-linux32v1.xml: New file.
	* features/s390-linux32v2.xml: Likewise.
	* features/s390-linux64v1.xml: Likewise.
	* features/s390-linux64v2.xml: Likewise.
	* features/s390x-linux64v1.xml: Likewise.
	* features/s390x-linux64v2.xml: Likewise.

	* features/s390-linux32.c: Regenerate.
	* features/s390-linux64.c: Likewise.
	* features/s390x-linux64.c: Likewise.
	* features/s390-linux32v1.c: New generated file.
	* features/s390-linux32v2.c: Likewise.
	* features/s390-linux64v1.c: Likewise.
	* features/s390-linux64v2.c: Likewise.
	* features/s390x-linux64v1.c: Likewise.
	* features/s390x-linux64v2.c: Likewise.

	* regformats/s390-linux32.dat: Regenerate.
	* regformats/s390-linux64.dat: Regenerate.
	* regformats/s390x-linux64.dat: Regenerate.
	* regformats/s390-linux32v1.dat: New generated file.
	* regformats/s390-linux32v2.dat: Likewise.
	* regformats/s390-linux64v1.dat: Likewise.
	* regformats/s390-linux64v2.dat: Likewise.
	* regformats/s390x-linux64v1.dat: Likewise.
	* regformats/s390x-linux64v2.dat: Likewise.

gdbserver/ChangeLog:

	* Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
	(s390-linux32v2.o, s390-linux32v2.c): Likewise.
	(s390-linux64v1.o, s390-linux64v1.c): Likewise.
	(s390-linux64v2.o, s390-linux64v2.c): Likewise.
	(s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
	(s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
	* configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
	(srv_xmlfiles): Add new XML files.

	* linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
	and <sys/uio.h>.
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(init_registers_s390_linux32v1): Add prototype.
	(init_registers_s390_linux32v2): Likewise.
	(init_registers_s390_linux64v1): Likewise.
	(init_registers_s390_linux64v2): Likewise.
	(init_registers_s390x_linux64v1): Likewise.
	(init_registers_s390x_linux64v2): Likewise.
	(s390_num_regs): Increment to 52.
	(s390_regmap): Add orig_r2 register.
	(s390_num_regs_3264): Increment to 68.
	(s390_regmap_3264): Add orig_r2 register.
	(s390_collect_ptrace_register): Handle orig_r2 register.
	(s390_supply_ptrace_register): Likewise.
	(s390_fill_last_break): New function.
	(s390_store_last_break): Likewise.
	(s390_fill_system_call): New function.
	(s390_store_system_call): Likewise.
	(target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
	register sets.
	(s390_check_regset): New function.
	(s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
	NT_S390_SYSTEM_CALL regsets and use appropriate description.
	Update target_regsets for available register sets.

testsuite/ChangeLog:

	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out read-only
	last_break register on s390*-*-* targets.
2011-12-06 14:14:50 +00:00
Jan Kratochvil 2268b414f4 gdb/
* Makefile.in (XMLFILES): Add library-list-svr4.dtd.
	* features/library-list-svr4.dtd: New file.
	* remote.c (PACKET_qXfer_libraries_svr4): New.
	(remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4.
	(remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4.
	* solib-svr4.c (struct svr4_library_list): New.
	[HAVE_LIBEXPAT]: Include xml-support.h.
	[HAVE_LIBEXPAT] (svr4_library_list_start_library)
	[HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_children)
	[HAVE_LIBEXPAT] (svr4_library_list_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries)
	[HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries)
	[!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New.
	(svr4_read_so_list): Extend the corruption message by addresses.
	(svr4_current_sos): New variable library_list, call
	svr4_current_sos_via_xfer_libraries.
	* target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4.

gdb/gdbserver/
	* linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
	(read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
	New.
	(struct linux_target_ops): Install linux_qxfer_libraries_svr4.
	* linux-low.h (struct process_info_private): New member r_debug.
	* server.c (handle_qxfer_libraries): Call
	the_target->qxfer_libraries_svr4.
	(handle_qxfer_libraries_svr4): New function.
	(qxfer_packets): New entry "libraries-svr4".
	(handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
	* target.h (struct target_ops): New member qxfer_libraries_svr4.
	* remote.c (remote_xfer_partial): Call add_packet_config_cmd for
	PACKET_qXfer_libraries_svr4.

gdb/doc/
	* gdb.texinfo (Requirements, Remote Protocol): Reference also `Library
	List Format for SVR4 Targets'.
	(General Query Packets): New item qXfer:libraries-svr4:read.
	(Library List Format for SVR4 Targets): New node.

gdb/testsuite/
	* gdb.base/solib-corrupted.exp: Suppress test on is_remote target.
	(corrupted list): Adjust the expectation.
2011-12-02 22:26:54 +00:00
Ulrich Weigand d6db1fabcc ChangeLog:
* s390-nat.c (SUBOFF): Remove.
	(s390_native_supply, s390_native_collect): New functions.
	(supply_gregset, supply_fpregset): Use s390_native_supply.
	(fill_gregset, fill_fpregset): Use s390_native_collect.

	* s390-tdep.c (s390_pseudo_register_reggroup_p): Update comment.
	(s390_unwind_pseudo_register): New function.
	(s390_prologue_frame_unwind_cache): Unwind PSW address and mask
	registers instead of PC and CC.
	(s390_backchain_frame_unwind_cache): Likewise.
	(s390_sigtramp_frame_unwind_cache): Do not unwind PC, CC, or
	full GPR pseudos.
	(s390_trad_frame_prev_register): New function.
	(s390_frame_prev_register): Use it.
	(s390_sigtramp_frame_prev_register): Likewise.
	(s390_dwarf2_prev_register): Use s390_unwind_pseudo_register.
	(s390_dwarf2_frame_init_reg): Unwind PSW address and mask.  Use
	special callback to unwind any pseudo.

	* features/s390-core32.xml: Add pswm/pswa to save/restore group.
	* features/s390-core64.xml: Likewise.
	* features/s390x-core64.xml: Likewise.
	* features/s390-linux32.c: Regenerate.
	* features/s390-linux64.c: Likewise.
	* features/s390x-linux64.c: Likewise.

gdbserver/ChangeLog:

	* linux-s390-low.c (s390_collect_ptrace_register): Fully convert
	PSW address/mask between 8-byte and 16-byte formats.
	(s390_supply_ptrace_register): Likewise.
	(s390_get_pc, s390_set_pc): 4-byte PSW address always includes
	basic addressing mode bit.
2011-11-30 16:06:55 +00:00
Stan Shebs 242f5f1ced 2011-11-24 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
2011-11-25 04:41:15 +00:00
Stan Shebs f196051f5e * NEWS: Mention tracepoint additions.
* breakpoint.h (struct tracepoint): New field traceframe_usage.
	* breakpoint.c (print_one_breakpoint_location): Identify
	tracepoints as such when reporting hit counts, report
	trace buffer usage.
	(create_tracepoint_from_upload): Copy status info.
	* tracepoint.h (struct trace_status): Rename error_desc to stop_desc,
	add fields user_name, notes, start_time, stop_time.
	(struct uploaded_tp): Add fields hit_count, traceframe_usage.
	* tracepoint.c (trace_user): New global.
	(trace_notes): New global.
	(trace_stop_notes): New global.
	(start_tracing): Add argument and trace note handling.
	(stop_tracing): Ditto.
	(trace_start_command): Add notes argument.
	(trace_stop_command): Ditto.
	(trace_status_command): Report additional status info.
	(trace_status_mi): Similarly.
	(trace_save): Update, record tracepoint status.
	(set_disconnected_tracing): Call target method directly.
	(send_disconnected_tracing_value): Remove.
	(set_trace_user): New function.
	(set_trace_notes): New function.
	(set_trace_stop_notes): New function.
	(parse_trace_status): Handle additional status.
	(parse_tracepoint_status): New function.
	(parse_tracepoint_definition): Call it.
	(tfile_get_tracepoint_status): New function.
	(init_tfile_ops): Use it.
	(_initialize_tracepoint): Add new setshows.
	* target.h (struct target_ops): New methods to_get_tracepoint_status
	and to_set_trace_notes.
	(target_get_tracepoint_status): New macro.
	(target_set_trace_notes): New macro.
	* target.c (update_current_target): Add new methods.
	* remote.c (remote_get_tracepoint_status): New function.
	(remote_set_trace_notes): New function.
	(init_remote_ops): Add them.
	* mi/mi-main.c (mi_cmd_trace_start): Add argument to call.
	(mi_cmd_trace_stop): Ditto.

	* tracepoint.c (struct tracepoint): New field traceframe_usage.
	(tracing_start_time): New global.
	(tracing_stop_time): New global.
	(tracing_user_name): New global.
	(tracing_notes): New global.
	(tracing_stop_note): New global.
	(cmd_qtstart): Set traceframe_usage, start_time.
	(stop_tracing): Set stop_time.
	(cmd_qtstatus): Report additional status.
	(cmd_qtp): New function.
	(handle_tracepoint_query): Call it.
	(cmd_qtnotes): New function.
	(handle_tracepoint_general_set): Call it.
	(get_timestamp): Rename from tsv_get_timestamp.

	* gdb.texinfo (Starting and Stopping Trace Experiments): Document
	note-related options and variables.
	(Tracepoint Packets): Document packet changes.

	* gdb.trace/tstatus.exp: New.
	* gdb.trace/actions.c: Include string.h.
2011-11-20 23:59:49 +00:00
Stan Shebs 405f8e9499 2011-11-14 Stan Shebs <stan@codesourcery.com>
Kwok Cheung Yeung  <kcy@codesourcery.com>

	* NEWS: Document shorter fast tracepoints and qTMinFTPILen packet.
	* i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for
	the minimum instruction size for fast tracepoints.
	* target.h (struct target_ops): Add new method
	to_get_min_fast_tracepoint_insn_len.
	(target_get_min_fast_tracepoint_insn_len): New.
	* target.c (update_current_target): Set up new target operation.
	* remote.c (remote_write_bytes_aux): Fix typo.
	(remote_get_min_fast_tracepoint_insn_len): New.
	(init_remote_ops): Initialize new field.

	* gdb.texinfo (Create and Delete Tracepoints): Describe what is
	needed to get shorter fast tracepoints.
	(Tracepoint Packets): Document new qTMinFTPILen packet.

	* linux-x86-low.c (small_jump_insn): New.
	(i386_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message, build a trampoline and issue a small
	jump instruction to it.
	(x86_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message.
	(x86_get_min_fast_tracepoint_insn_len): New.
	(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
	* linux-low.h (struct linux_target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new operation.
	* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
	arguments.
	(linux_get_min_fast_tracepoint_insn_len): New function.
	(linux_target_op): Add new operation.
	* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
	(gdb_trampoline_buffer_end): Ditto.
	(gdb_trampoline_buffer_error): Ditto.
	(struct ipa_sym_addresses): Add fields for new IPA variables.
	(symbol_list): Add entries for new IPA variables.
	(struct tracepoint): Add fields to hold the address range of the
	trampoline used by the tracepoint.
	(trampoline_buffer_head): New static variable.
	(trampoline_buffer_tail): Ditto.
	(claim_trampoline_space): New function.
	(have_fast_tracepoint_trampoline_buffer): New function.
	(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
	structure.
	(install_fast_tracepoint): Ditto, also add error buffer argument.
	(cmd_qtminftpilen): New function.
	(handle_tracepoint_query): Add response to qTMinFTPILen packet.
	(fast_tracepoint_from_trampoline_address): New function.
	(fast_tracepoint_collecting): Handle trampoline as part of jump
	pad space.
	(set_trampoline_buffer_space): New function.
	(initialize_tracepoint): Initialize new IPA variables.
	* target.h (struct target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new
	get_min_fast_tracepoint_insn_len operation.
	(target_get_min_fast_tracepoint_insn_len): New.
	(install_fast_tracepoint_jump_pad): Add arguments.
	* server.h (IPA_BUFSIZ): Define.
	* linux-i386-ipa.c: Include extra header files.
	(initialize_fast_tracepoint_trampoline_buffer): New function.
	(initialize_low_tracepoint): Call it.
	* server.h (set_trampoline_buffer_space): Declare.
	(claim_trampoline_space): Ditto.
	(have_fast_tracepoint_trampoline_buffer): Ditto.

	* gdb.trace/ftrace.c: New.
	* gdb.trace/ftrace.exp: New.
2011-11-14 20:07:25 +00:00
Yao Qi 1e4d17643d gdb/
* remote.c (struct remote_state): <install_in_trace> new field.
	(PACKET_InstallInTrace): New enum value.
	(remote_install_in_trace_feature): Support InstallInTrace.
	(remote_supports_install_in_trace): Likewise.
	(remote_protocol_features): Likewise.
	(_initialize_remote): Likewise.
	(remote_can_download_tracepoint): New.
	* target.h (struct target): New field
	`to_can_download_tracepoint'.
	(target_can_download_tracepoint): New macro.
	* target.c (update_current_target): Update.
	* breakpoint.h (struct bp_location): Add comment on field
	`duplicate'.
	(should_be_inserted): Don't differentiate breakpoint and tracepoint.
	(remove_breakpoints): Don't remove tracepoints.
	(tracepoint_locations_match ): New.
	(breakpoint_locations_match): Call it.
	(disable_breakpoints_in_unloaded_shlib): Handle tracepoint.
	(download_tracepoint_locations): New.
	(update_global_location_list): Call it.
	* tracepoint.c (find_matching_tracepoint): Delete.
	(find_matching_tracepoint_location): Renamed from
	find_matching_tracepoint.  Return bp_location rather than
	tracepoint.
	(merge_uploaded_tracepoints): Set `inserted' field to 1 if
	tracepoint is found.

gdb/doc/
	* gdb.texinfo (Create and Delete Tracepoints): Describe changed
	behavior of tracepoint.
	(General Query Packets): New feature InstallInTrace.
	(Remote Configuration): Document "set remote
	install-in-trace-packet".

gdb/gdbserver/
	* server.c (handle_query): Handle InstallInTrace for qSupported.
	* tracepoint.c (add_tracepoint): Sort list.
	(install_tracepoint, download_tracepoint): New.
	(cmd_qtdp): Call them to install and download tracepoints.
	(sort_tracepoints): Removed.
	(cmd_qtstart): Update.

gdb/testsuite/
	* gdb.trace/change-loc-1.c: New.
	* gdb.trace/change-loc-2.c: New.
	* gdb.trace/change-loc.c: New.
	* gdb.trace/change-loc.exp:  New.
	* gdb.trace/change-loc.h:  New.
	* gdb.trace/trace-break.c (marker): Define new symbol.
	* gdb.trace/trace-break.exp (break_trace_same_addr_5):
        New.
	(break_trace_same_addr_6): New.
2011-11-14 15:18:54 +00:00
Yao Qi 5c73ff4ec2 * mem-break.c (inc_ref_fast_tracepoint_jump): New.
* mem-break.h: Declare.
	* tracepoint.c (cmd_qtstart): Move some code to ...
	(clone_fast_tracepoint, install_fast_tracepoint): ... here.
	New.
	(download_tracepoints): Move some code to ...
	(download_tracepoint_1): ... here.  New.
2011-11-14 14:38:41 +00:00
Yao Qi 86a3003087 gdb/gdbserver
* remote-utils.c (relocate_instruction): A comment fix.
2011-11-09 02:32:42 +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
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
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
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
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
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
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
Ulrich Weigand 55329a5ca8 Fix ChangeLog dates. 2011-09-21 16:49:14 +00:00
Ulrich Weigand 71487fd776 * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
(arm_linux_hwbp_cap): New static variable.
	(arm_linux_get_hwbp_cap): Replace by ...
	(arm_linux_init_hwbp_cap): ... this new function.
	(arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
	(arm_linux_get_hw_watchpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_max_length): Likewise.
	(arm_arch_setup): Call arm_linux_init_hwbp_cap.
	(arm_prepare_to_resume): Use perror_with_name instead of error.
2011-09-21 16:15:27 +00:00
Ulrich Weigand 09b4ad9fcb * linux-arm-low.c: Include <signal.h>.
(PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
	(struct arm_linux_hwbp_cap): New data type.
	(arm_hwbp_type, arm_hwbp_control_t): New typedefs.
	(struct arm_linux_hw_breakpoint): New data type.
	(MAX_BPTS, MAX_WPTS): Define.
	(struct arch_process_info, struct arch_lwp_info): New data types.
	(arm_linux_get_hwbp_cap): New function.
	(arm_linux_get_hw_breakpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_max_length): Likewise.
	(arm_hwbp_control_initialize): Likewise.
	(arm_hwbp_control_is_enabled): Likewise.
	(arm_hwbp_control_is_initialized): Likewise.
	(arm_hwbp_control_disable): Likewise.
	(arm_linux_hw_breakpoint_equal): Likewise.
	(arm_linux_hw_point_initialize): Likewise.
	(struct update_registers_data): New data structure.
	(update_registers_callback: New function.
	(arm_insert_point): Likewise.
	(arm_remove_point): Likewise.
	(arm_stopped_by_watchpoint): Likewise.
	(arm_stopped_data_address): Likewise.
	(arm_new_process): Likewise.
	(arm_new_thread): Likewise.
	(arm_prepare_to_resume): Likewise.
	(the_low_target): Register arm_insert_point, arm_remove_point,
	arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
	arm_new_thread, and arm_prepare_to_resume.
2011-09-21 12:39:50 +00:00
Stan Shebs 6b9801d456 * server.h (struct emit_ops): Add compare-goto fields.
* tracepoint.c (gdb_agent_op_sizes): New table.
	(emit_eq_goto): New function.
	(emit_ne_goto): New function.
	(emit_lt_goto): New function.
	(emit_le_goto): New function.
	(emit_gt_goto): New function.
	(emit_ge_goto): New function.
	(is_goto_target): New function.
	(compile_bytecodes): Recognize special cases of compare-goto
	combinations and call specialized emitters for them.
	* linux-x86-low.c (amd64_emit_eq_goto): New function.
	(amd64_emit_ne_goto): New function.
	(amd64_emit_lt_goto): New function.
	(amd64_emit_le_goto): New function.
	(amd64_emit_gt_goto): New function.
	(amd64_emit_ge_goto): New function.
	(amd64_emit_ops): Add the new functions.
	(i386_emit_eq_goto): New function.
	(i386_emit_ne_goto): New function.
	(i386_emit_lt_goto): New function.
	(i386_emit_le_goto): New function.
	(i386_emit_gt_goto): New function.
	(i386_emit_ge_goto): New function.
	(i386_emit_ops): Add the new functions.
2011-09-15 22:54:13 +00:00
Stan Shebs bf15cbda54 * linux-x86-low.c (i386_emit_prologue): Save %ebx.
(i386_emit_epilogue): Restore %ebx.
2011-09-08 22:38:29 +00:00
Jie Zhang 943ca1dd02 * server.c (step_thread): Remove definition.
(process_serial_event): Don't handle Hs.
	* server.h (step_thread): Remove declaration.
	* target.c (set_desired_inferior): Remove use of step_thread.
2011-09-01 03:14:10 +00:00
Luis Machado e3deef738c Stop threads when attaching to a PID that is the tgid. 2011-08-24 12:17:39 +00:00
Luis Machado 13da1c9782 Move common linux procfs code to common/ 2011-08-24 12:07:28 +00:00
Yao Qi 881127c98f gdb/gdbserver/
* target.h (struct target_ops): Fix indent.
	* win32-low.c (win32_target_ops): Fix comment.
2011-08-14 16:06:59 +00:00
Yao Qi 58dbd54186 gdb/gdbserver/
* Makefile.in (clean): Remove tic6x-*.c files.
	(linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
	(tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
	(tic6x-c64xp-linux.c): Likewise.
	* configure.srv: Add support for tic6x-*-uclinux.
	* linux-tic6x-low.c: New.
	* linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
2011-08-14 15:25:45 +00:00
Yao Qi 78d8519916 gdb/
* remote.c (PACKET_qXfer_fdpic): New enum value.
        (remote_protocol_features): Add qXfer:fdpic:read packet.
        (remote_xfer_partial): Support TARGET_OBJECT_FDPIC.
        (_initialize_remote): Add set/show remote read-fdpic-loadmap command.
        * target.h (enum target_object): Add TARGET_OBJECT_FDPIC.

        gdb/gdbserver:
        * target.h (struct target_ops): Add read_loadmap.
        * linux-low.c (struct target_loadseg): New type.
        (struct target_loadmap): New type.
        (linux_read_loadmap): New function.
        (linux_target_ops): Add linux_read_loadmap.
        * server.c (handle_query): Support qXfer:fdpic:read packet.
	* win32-low.c (win32_target_ops): Initialize field `read_loadmap' to NULL.

        gdb/doc/
        * gdb.texinfo : Document qXfer:fdpic:read packet.
2011-08-14 13:03:13 +00:00
Eli Zaretskii a959a88dc6 win32-low.c: Include <stdint.h>. 2011-08-05 14:21:07 +00:00
Pedro Alves 1ced966e34 2011-07-22 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* gdb.arch/i386-dr3-watch.exp: Test that the i386 watchpoints
	backend doesn't leave used debug registers behind.

	gdb/gdbserver/
	* i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
	to the inferior here.
	(i386_remove_aligned_watchpoint): Ditto.
	(i386_handle_nonaligned_watchpoint): Return immediate on fail to
	fit part of the watchpoint in the debug registers.
	(i386_update_inferior_debug_regs): New.
	(i386_low_insert_watchpoint): Work on a local mirror of the debug
	registers, and only update the inferior on success.
	(i386_low_remove_watchpoint): Ditto.

	gdb/
	* i386-nat.c (I386_DR_VACANT, I386_DR_LOCAL_ENABLE)
	(I386_DR_GLOBAL_ENABLE, I386_DR_DISABLE, I386_DR_SET_RW_LEN)
	(I386_DR_GET_RW_LEN, I386_DR_WATCH_HIT): Add state parameter and
	adjust.
	(dr_mirror, dr_status_mirror, dr_control_mirror): Delete.
	(struct i386_debug_reg_state): New.
	(i386_init_dregs): New.
	(dr_mirror): New.
	(i386_cleanup_dregs): Use i386_init_dregs.
	(i386_show_dr): Add state parameter and adjust.
	(i386_insert_aligned_watchpoint): Ditto.  Don't pass the info to
	the inferior here.
	(i386_remove_aligned_watchpoint): Likewise.
	(i386_handle_nonaligned_watchpoint): Add state parameter and adjust.
	(i386_update_inferior_debug_regs): New.
	(i386_insert_watchpoint): Work on a local mirror of the debug
	registers, and only update the inferior on success.
	(i386_remove_watchpoint): Ditto.
	(i386_region_ok_for_watchpoint): Adjust.
	(i386_stopped_data_address): Adjust.
	(i386_insert_hw_breakpoint): Adjust.
	(i386_remove_hw_breakpoint): Adjust.
2011-07-22 16:58:32 +00:00
Kwok Yeung d26e3629bb 2011-07-22 Kwok Cheung Yeung <kcy@codesourcery.com>
gdb/
	* defs.h: Add guard against inclusion in gdbserver.
	(struct ptid, ptid_t): Move to common/ptid.h.
	(xfree, xzalloc, xasprintf, xvasprintf, xstrprintf, xstrvprintf,
	xsnprintf, internal_error): Move to common/common-utils.h.
	(nomem): Delete.
	* gdb_assert.h: Move into common/ sub-directory.
	* gdb_locale.h: Ditto.
	* gdb_dirent.h: Ditto.
	* inferior.h (minus_one_ptid, null_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid):
	Move into common/ptid.h.
	* xml-support.c (xml_escape_text): Move into common/xml-utils.c.
	(gdb_xml_create_parser_and_cleanup_1, xml_fetch_context_from_file):
	Change nomem to malloc_failure.
	* xml-support.h (xml_escape_text): Move into common/xml-utils.h.
	* utils.c (nomem): Rename to malloc_failure.
	(xmalloc, xzalloc, xrealloc, xcalloc, xfree, xstrprintf, xasprintf,
	xvasprintf, xstrvprintf, xsnprintf): Move to common/common-utils.c.
	(gdb_buildargv): Change nomem to malloc_failure.
	* infrun.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal,
	ptid_is_pid): Move into common/ptid.c.
	(initialize_infrun): Delete initialization of null_ptid and
	minus_one_ptid.
	* linux-nat.c (linux_nat_xfer_osdata): Defer to
	linux_common_xfer_osdata.
	* Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
	common/ptid.c and common/buffer.c.
	(HFILES_NO_SRCDIR): Add common/common-utils.h, common/xml-utils.h,
	common/ptid.h, common/buffer.h and common/linux-osdata.h.
	(COMMON_OBS): Add xml-utils.o, common-utils.o, buffer.o and ptid.o.
	(common-utils.o, xml-utils.o, ptid.o, buffer.o, linux-osdata.o): New
	rules.
	* common/gdb_assert.h: New.
	* common/gdb_dirent.h: New.
	* common/gdb_locale.h: New.
	* common/buffer.c: New.
	* common/buffer.h: New.
	* common/ptid.c: New.
	* common/ptid.h: New.
	* common/xml-utils.c: New.
	* common/xml-utils.h: New.
	* common/common-utils.c: New.
	* common/common-utils.h: New.
	* common/linux-osdata.c: New.
	* common/linux-osdata.h: New.
	* config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-osdata.o.
	* config/arm/linux.mh (NATDEPFILES): Ditto.
	* config/i386/linux.mh (NATDEPFILES): Ditto.
	* config/i386/linux64.mh (NATDEPFILES): Ditto.
	* config/ia64/linux.mh (NATDEPFILES): Ditto.
	* config/m32r/linux.mh (NATDEPFILES): Ditto.
	* config/m68k/linux.mh (NATDEPFILES): Ditto.
	* config/mips/linux.mh (NATDEPFILES): Ditto.
	* config/pa/linux.mh (NATDEPFILES): Ditto.
	* config/powerpc/linux.mh (NATDEPFILES): Ditto.
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Ditto.
	* config/s390/s390.mh (NATDEPFILES): Ditto.
	* config/sparc/linux.mh (NATDEPFILES): Ditto.
	* config/sparc/linux64.mh (NATDEPFILES): Ditto.
	* config/xtensa/linux.mh (NATDEPFILES): Ditto.

gdbserver/
	* linux-low.c (compare_ints, unique, list_threads, show_process,
	linux_core_of_thread): Delete.
	(linux_target_ops): Change linux_core_of_thread to
	linux_common_core_of_thread.
	(linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
	* utils.c (malloc_failure): Change type of argument.
	(xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
	* Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
	common/linux-osdata.c, common/ptid.c and common/buffer.c.
	(OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
	(IPA_OBJS): Add common-utils-ipa.o.
	(ptid_h, linux_osdata_h): New macros.
	(server_h): Add common/common-utils.h, common/xml-utils.h,
	common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
	common/ptid.h.
	(common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
	ptid.o, buffer.o): New rules.
	(linux-low.o): Add common/linux-osdata.h as a dependency.
	* configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
	* configure.ac: Add AC_HEADER_DIRENT check.
	* config.in: Regenerate.
	* configure: Regenerate.
	* remote-utils.c (xml_escape_text): Delete.
	(buffer_grow, buffer_free, buffer_init, buffer_finish,
	buffer_xml_printf): Move to common/buffer.c.
	* server.c (main): Remove call to initialize_inferiors.
	* server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
	ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
	ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
	internal_error, gdb_assert, gdb_assert_fail): Delete.
	(struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
	buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
	common/buffer.h.
	* inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
	ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
	initialize_inferiors): Delete.
2011-07-21 23:46:12 +00:00
Pedro Alves 2275a1a744 2011-07-20 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (tracepoint_look_up_symbols): Return upon the first
	symbol error.
2011-07-20 11:01:21 +00:00
Pedro Alves 0a5b1e09bf 2011-05-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
	* linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
	assertion.
	* win32-i386-low.c (i386_dr_low_get_addr): Ditto.

	gdb/testsuite/
	* gdb.arch/i386-dr3-watch.c: New file.
	* gdb.arch/i386-dr3-watch.exp: New file.
2011-05-31 21:18:56 +00:00
Yao Qi 6938fd346a 2011-05-26 Yao Qi <yao@codesourcery.com>
gdb/
	* gdb_thread_db.h: Delete.  Move to ...
	* common/gdb_thread_db.h: ... here.

	gdb/gdbserver/
	* Makefile.in (thread-db.o): Track dependence to
	common/gdb_thread_db.h.
	* thread-db.c: include gdb_thread_db.h from right place.
2011-05-26 15:49:26 +00:00
Tom Tromey b481f9e0ce 2011-05-16 Adrian Cornish <gnu@bluedreamer.com>
* linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
	__FILE__ and __LINE__ to internal_error.
2011-05-16 15:59:45 +00:00
Doug Evans 98a5dd1327 Support $pdir and $sdir in libthread-db-search-path.
* NEWS: Mention $sdir,$pdir.
	* gdb_thread_db.h (LIBTHREAD_DB_SEARCH_PATH): Add $sdir:$pdir.
	* linux-thread-db.c (try_thread_db_load_from_pdir): New function.
	(try_thread_db_load_from_sdir): New function.
	(try_thread_db_load_from_dir): New function.
	(thread_db_load_search): Handle $pdir, $sdir.  Remove trying of
	system directories if search of libthread-db-search-path fails,
	that is now done via $sdir.
	(has_libpthread): New function.
	(thread_db_load): Remove search for libthread_db in directory of
	libpthread, that is now done via $pdir.

	gdbserver/
	* thread-db.c (try_thread_db_load_from_sdir): New function.
	(try_thread_db_load_from_dir): New function.
	(thread_db_load_search): Handle $sdir, ignore $pdir.
	Remove trying of system directories if search of
	libthread-db-search-path fails,	that is now done via $sdir.

	doc/
	* gdb.texinfo (Threads): Document $sdir,$pdir.
	(Server): Document $pdir exception.
2011-05-13 22:36:07 +00:00
Kwok Yeung d248b706a3 Add support for enabling and disabling tracepoints while a trace
experiment is still running.

gdb/
	* breakpoint.c (disable_breakpoint): Disable all locations
	associated with a tracepoint on target if a trace experiment is
	running.
	(disable_command): Disable a specific tracepoint location on target if
	a trace	experiment is running.
	(do_enable_breakpoint): Enable all locations associated with a
	tracepoint on target if a trace experiment is running.
	(enable_command) Enable a specific tracepoint location on target if a
	trace experiment is running.
	* target.c (update_current_target): Add INHERIT and de_fault clauses for
	to_supports_enable_disable_tracepoint, to_enable_tracepoint and
	to_disable_tracepoint.
	* target.h: Add declaration of struct bp_location.
	(struct target_ops): Add new functions
	to_supports_enable_disable_tracepoint, to_enable_tracepoint and
	to_disable_tracepoint to target operations.
	(target_supports_enable_disable_tracepoint): New macro.
	(target_enable_tracepoint): New macro.
	(target_disable_tracepoint): New macro.
	* remote.c (struct remote_state): Add new field.
	(remote_enable_disable_tracepoint_feature): New.
	(remote_protocol_features): Add new entry.
	(remote_supports_enable_disable_tracepoint): New.
	(remote_enable_tracepoint): New.
	(remote_disable_tracepoint): New.
	(init_remote_ops): Add remote_enable_tracepoint,
	remote_disable_tracepoint and remote_supports_enable_disable_tracepoint
	to remote operations.
	* tracepoint.c (start_tracing): Allow tracing to start without any
	tracepoints enabled with just a warning if they can be re-enabled
	later.
	* NEWS: Add news item for the new behaviour of the enable and disable
	GDB commands when applied to tracepoints.
	Add news items for the new remote packets QTEnable and QTDisable.

gdb/doc/
	* gdb.texinfo: Document change in the behaviour of the enable and
	disable GDB commands when applied to tracepoints.
	Document the EnableDisableTracepoints remote stub feature.
	Document QTEnable and QTDisable in the list of tracepoint packets.

gdb/gdbserver/
	* server.c (handle_query): Add EnableDisableTracepoints to the list
	of supported features.
	* tracepoint.c (clear_installed_tracepoints): Uninstall	disabled
	tracepoints.
	(cmd_qtenable_disable): New.
	(cmd_qtstart): Install tracepoints even if disabled.
	(handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
	receiving a QTEnable or QTDisable packet.
	(gdb_collect): Skip data collection if fast tracepoint is disabled.
	(ust_marker_to_static_tracepoint): Do not ignore disabled static
	tracepoints.
	(gdb_probe): Skip data collection if static tracepoint is disabled.
2011-05-12 12:09:17 +00:00
Doug Evans 84e578fbe6 * linux-thread-db.c (set_libthread_db_search_path): New function.
(_initialize_thread_db): Add setter for libthread-db-search-path.

	gdbserver/
	* thread-db.c (thread_db_handle_monitor_command): Handle elided path.

	doc/
	* gdb.texinfo (Threads): If an empty path is provided for
	libthread-db-search-path it is reset to its default value.
	(Server): Ditto.
2011-05-10 16:53:23 +00:00
Doug Evans 71f55dd81f * linux-low.c (linux_join): Skip process lookup.
* spu-low.c (spu_join): Ditto.
	* server.c (join_inferiors_callback): Delete.
	(process_serial_event): For 'D' packet (detach) call join_inferior
	directly.
2011-05-04 20:20:12 +00:00
Joseph Myers 4d393d60c4 gdb:
* configure.host (xscale*): Don't handle target.
	* configure.tgt (thumb*-*-* | strongarm*-*-* | xscale-*-*): Don't
	handle targets.

gdb/gdbserver:
	* README: Don't mention xscale*-*-linux*.
	* configure.srv (xscale*-*-linux*): Don't handle target.

gdb/testsuite:
	* gdb.base/a2-run.exp (strongarm-*-coff): Don't handle target.
	* gdb.base/float.exp (xscale*-*-*, strongarm*-*-*): Don't handle
	targets.
	* gdb.base/long_long.exp (xscale*-*-*, strongarm*-*-*): Don't
	handle targets.

sim:
	* configure.tgt (thumb*-*-* | strongarm*-*-* | xscale-*-*): Don't
	handle targets.
	* configure: Regenerate.

sim/testsuite:
	* configure: Regenerate.
	* sim/arm/allinsn.exp (xscale*-*-*): Don't handle target.
	* sim/arm/misc.exp (thumb*-*-*, xscale*-*-*): Don't handle
	targets.
	* sim/arm/iwmmxt/iwmmxt.exp: Test for arm*-*-* instead of
	xscale*-*-*.
	* sim/arm/thumb/allthumb.exp (thumb*-*-*): Don't handle target.
	* sim/arm/xscale/xscale.exp: Test for arm*-*-* instead of
	xscale*-*-*.
2011-05-04 19:28:16 +00:00
Nathan Froyd b00ad6ff40 fix strict-aliasing warnings
* linux-x86-low.c (amd64_emit_const): Call memcpy instead of
	casting pointers.
	(amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
	(i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
	(i386_emit_void_call_2): Likewise.
2011-04-27 18:37:40 +00:00
Yao Qi af96c192dc gdb/
* linux-nat.c: Move common macros to ...
        Include linux-ptrace.h.
        * common/linux-ptrace.h: ... here.  New.

gdb/gdbserver/

        * linux-low.c: Move common macros to linux-ptrace.h.
        Include linux-ptrace.h.
	* Makefile.in (linux_ptrace_h): New.
	(linux-low.o): Depends on linux-ptrace.h.
2011-04-26 15:36:04 +00:00
Jan Kratochvil 03f2bd5942 gdb/
* NEWS: Document the new gdbserver --once option.

gdb/doc/
	* gdb.texinfo (Starting and Stopping Trace Experiments): New anchor
	for disconnected tracing.
	(Multi-Process Mode for @code{gdbserver}): Mention --multi and
	extended-remote relationship.  Mention --once.
	(TCP port allocation lifecycle of @code{gdbserver}): New.

gdb/gdbserver/
	* remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
	RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
	(remote_prepare): New function with most of the TCP code from ...
	(remote_open): ... here.  Detect PORT here unconditionally.  Move also
	setting transport_is_reliable.
	* server.c (run_once): New variable.
	(gdbserver_usage): Document it.
	(main): Set run_once for `--once'.  Call remote_prepare.  Exit after
	the first run if RUN_ONCE.
	* server.h (run_once, remote_prepare): New declarations.

gdb/testsuite/
	* gdb.base/solib-disc.exp: Set gdbserver_reconnect_p.
	* lib/gdb.exp (gdb_init): Clear gdbserver_reconnect_p.
	* lib/gdbserver-support.exp (gdbserver_start): Add `--once' if
	!gdbserver_reconnect_p..
	(gdbserver_reconnect): Call error if !gdbserver_reconnect_p..
2011-04-24 08:02:21 +00:00
Tom Tromey 7a9dd1b270 gdb
* windows-tdep.c (windows_xfer_shared_library):
	* windows-nat.c (get_module_name, windows_make_so):
	* v850-tdep.c (v850_handle_pushm):
	* utils.c (null_cleanup, gdb_realpath):
	* ui-out.c (get_next_header):
	* tracepoint.c (clear_traceframe_info):
	* symtab.c (lookup_symtab):
	* serial.h (struct serial_ops):
	* mipsread.c (read_alphacoff_dynamic_symtab):
	* infcmd.c (print_return_value):
	* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address):
	* f-exp.y (parse_number):
	* exceptions.c (catch_exceptions):
	* dummy-frame.c (dummy_frame_this_id):
	* defs.h (struct cleanup):
	* breakpoint.c (disable_breakpoints_in_unloaded_shlib):
	* arm-tdep.c (arm_push_dummy_call):
	* amd64-tdep.h (amd64_collect_xsave):
	* amd64-tdep.c (amd64_collect_xsave):
	* alpha-tdep.c (alpha_heuristic_frame_unwind_cache):
	* README (typing): Remove duplicate words.
	* cli/cli-decode.c (lookup_cmd_composition): Add comma.
	* infrun.c (siginfo_value_read): Fix typo.
	* solib-frv.c (frv_fdpic_find_global_pointer): Likewise.
	* top.c (source_line_number): Add comma.
gdb/doc
	* gdbint.texinfo (Register Information Functions): Remove
	duplicate "the".
	* gdb.texinfo (Emacs): Remove duplicate "to".
	(GDB/MI Variable Objects): Remove duplicate "the".
	(General Query Packets): Likewise.
gdb/testsuite
	* gdb.mi/mi-nsmoribund.exp:
	* gdb.hp/gdb.objdbg/objdbg01.exp:
	* gdb.base/structs.exp (test_struct_returns):
	* gdb.base/call-sc.exp (test_scalar_returns):
	* gdb.base/bigcore.exp: Remove duplicate words.
gdb/gdbserver
	* win32-low.c (handle_load_dll): Remove duplicate "the".
2011-04-19 18:04:11 +00:00
Pierre Muller 812394259c Remove support for old Cygwin 1.5 versions.
* win32-low.c (win32_create_inferior): Use new cygwin_path_list
	function to avoid warning.
	(win32_add_one_solib): Use cygwin_conv_path function to avoid
	warning.
2011-04-07 23:59:59 +00:00
Pierre Muller 9e0627f141 * common/signals.c (target_signal_from_host): Add _ markup to error
function call message.
	(target_signal_to_host): Add _ markup and remove trailing new line
	from warning call message.
	(target_signal_from_command): Add _ markup to error function call
	message.
	* gdbserver/server.h (Macro _): Define it if not available.
2011-03-18 13:03:31 +00:00
Michael Snyder 348af9f72c Fix earlier changelog errors. 2011-03-14 21:33:24 +00:00
Michael Snyder 588eebeeea 2011-03-14 Michael Snyder <msnyder@vmware.com>
* gdbserver/hostio.c (handle_close): Remove unnecessary null test.
2011-03-14 21:26:24 +00:00
Michael Snyder f8f67713c0 2011-02-28 Michael Snyder <msnyder@vmware.com>
* tracepoint.c (cmd_qtv): Discard unused value 'packet'.
	(cmd_qtframe): Ditto.
	(cmd_qtbuffer): Ditto.
	(cmd_bigqtbuffer): Ditto.
2011-03-10 20:21:14 +00:00
Michael Snyder 4f269b12df 2011-02-27 Michael Snyder <msnyder@vmware.com>
* gdbserver/tracepoint.c (tracepoint_finish_step): Fix
	loop variable.
2011-03-10 20:18:42 +00:00
Michael Snyder b2c0445299 2011-03-10 Michael Snyder <msnyder@vmware.com>
* gdbserver/server.c (handle_v_run): Free alloced buffer on early
	return.
2011-03-10 20:09:18 +00:00
Joel Brobecker 43f70d4cf7 remove subdir_do recursive make command in gdbserver/Makefile.in
This fixes:

    % [...]/gdbserver/configure
    % make distclean
    [...]
    rm -f amd64-avx.c amd64-avx-linux.c
    rm -f i386-mmx.c i386-mmx-linux.c
    make[1]: Entering directory `/[...]'
    make[1]: *** No rule to make target `subdir_do'.  Stop.
    make[1]: Leaving directory `[...]'
    make: *** [distclean] Error 2

gdb/gdbserver/ChangeLog:

        * Makefile.in (maintainer-clean realclean distclean): Remove
        "make ...  subdir_do" command.
2011-03-10 07:32:02 +00:00
Michael Snyder 61adf46486 2011-03-09 Michael Snyder <msnyder@vmware.com>
* gdbserver/tracepoint.c: Fix small comment typo.
2011-03-09 15:59:12 +00:00
Yao Qi e637a4f593 gdb/
2011-03-09  Yao Qi  <yao@codesourcery.com>

	Revert:
	2011-02-11  Yao Qi  <yao@codesourcery.com>

	* common/Makefile.in: Add copyright header.

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

	* Makefile.in: Remove signals.o from COMMON_OBS.  Link
	libcommon.a.
	* configure.ac: Add common to sub dir.
	* configure: Regenerate.

gdb/gdbserver/
2011-03-09  Yao Qi  <yao@codesourcery.com>

	Revert:
	2011-03-04  Yao Qi  <yao@codesourcery.com>

	* Makefile.in: Remove GNU make feature --directory.

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

	* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
	(subdir_do): New make target.  Copied from gdb/Makefile.
	(maintainer-clean, realclean, distclean, clean): Call corresponding
	make targets in common/Makefile.

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

	* configure.ac: Call AC_PROG_RANLIB.
	* Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
	* configure: Regenerate.
2011-03-09 06:10:40 +00:00
Jan Kratochvil e6edda56ff gdb/gdbserver/
* remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
2011-03-07 20:15:12 +00:00
Joel Brobecker e51411190f gdbserver: configure + make clean fails (no 'common' subdir)
This problem was noticed during the nightly snapshot build,
but can be reduced to:

        % /path/to/gdb/gdbserver/configure
        % make clean

The "make clean" fails, because it tries to do a "make clean"
in the common/ subdirectory.  But the problem is that this
common/ subdirectory is NOT created during the configure phase,
but rather during the build phase.  The error is fatal because
we had put the common subdirectory in the list of REQUIRED_SUBDIRS.

This fixes the problem by removing it from the REQUIRED_SUBDIRS
list.

gdb/gdbserver/ChangeLog:

        * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
2011-03-06 07:40:52 +00:00
Joel Brobecker 64794aa4b4 fix make clean doesn't run in gdbserver/common
011-03-05  Yao Qi  <yao@codesourcery.com>
        * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
        (subdir_do): New make target.  Copied from gdb/Makefile.
        (maintainer-clean, realclean, distclean, clean): Call corresponding
        make targets in common/Makefile.
2011-03-05 03:45:26 +00:00
Michael Snyder cfdee94ab4 2011-03-04 Michael Snyder <msnyder@vmware.com>
* gdbserver/server.c (queue_stop_reply): Call xmalloc not malloc.
2011-03-05 00:21:10 +00:00
Yao Qi 7a76282913 2011-03-04 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove GNU make feature --directory.
2011-03-04 06:31:54 +00:00
Michael Snyder c3e8aadde1 2011-03-02 Michael Snyder <msnyder@vmware.com>
* gdbserver/linux-arm-low.c (arm_arch_setup): Replace malloc
	with xmalloc.
2011-03-02 23:40:42 +00:00
Michael Snyder 9f72fee2a6 2011-02-28 Michael Snyder <msnyder@vmware.com>
* utils.c (decimal2str): Initialize 'width' to nine, then
	don't mess with it.
2011-02-28 22:00:45 +00:00
Ulrich Weigand 8040bd496a * hostio.c (require_data): Free *data, not data. 2011-02-28 15:55:08 +00:00
Jan Kratochvil 7e52cbd0c6 gdb/gdbserver/
* hostio.c (require_data): Use free, not xfree.
2011-02-28 04:20:30 +00:00
Michael Snyder 4b812f4ed9 2011-02-27 Michael Snyder <msnyder@vmware.com>
* server.c (handle_query): Discard unused value.
2011-02-28 01:46:51 +00:00
Michael Snyder 9130f83ec8 2011-02-27 Michael Snyder <msnyder@vmware.com>
* hostio.c (require_data): Free malloc memory before returning
	error.
2011-02-27 23:32:04 +00:00
Michael Snyder 69d371133c 2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-low.c (list_threads): Call closedir for dirent.
2011-02-27 21:41:26 +00:00
Michael Snyder 2a589cef79 2011-02-27 Michael Snyder <msnyder@vmware.com>
* i386-low.c (i386-length_and_rw_bits): Comment the fact that
	a case statement falls through.
2011-02-27 21:33:10 +00:00
Michael Snyder 0adea5f702 2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-low.c (linux_xfer_siginfo): Fix fencepost error.
2011-02-27 21:20:06 +00:00
Michael Snyder 35f5825a72 2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
	in comparison.
2011-02-27 21:18:14 +00:00
Michael Snyder 238f1c7460 2011-02-26 Michael Snyder <msnyder@vmware.com>
* utils.c (decimal2str): Eliminate dead code and dead param.
	(pulongest): Drop dead param from call to decimal2str.
	(plongest): Ditto.
2011-02-26 18:53:44 +00:00
Joel Brobecker 633ff500c5 Revert the following patch (printf tracepoint op) (not approved yet)
2011-02-21  Hui Zhu  <teawater@gmail.com>
        * tracepoint.c (tp_printf): New function.
        (eval_agent_expr): Handle gdb_agent_op_printf.
2011-02-24 07:38:42 +00:00
Hui Zhu f9c6ff7236 2011-02-21 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tp_printf): New function.
	(eval_agent_expr): Handle gdb_agent_op_printf.
2011-02-21 08:39:14 +00:00
Tom Tromey 94d5e490f0 gdb
* common/ax.def: New file.
	* ax.h (enum agent_op): Use ax.def.
	* ax-general.c (aop_map): Use ax.def.
gdbserver
	* Makefile.in (tracepoint-ipa.o): Depend on ax.def.
	(tracepoint.o): Likewise.
	* tracepoint.c (enum gdb_agent_op): Use ax.def.
	(gdb_agent_op_names): Likewise.
2011-02-18 21:12:07 +00:00
Tom Tromey c7f96d2b95 gdb
* ax-general.c (aop_map): Add pick and rot.
	* dwarf2loc.c (compile_dwarf_to_ax) <DW_OP_over>: Reimplement.
	<DW_OP_rot>: Implement.
	* ax.h (enum agent_op) <aop_pick, aop_rot>: New constants.
	(ax_pick): Declare.
	* ax-general.c (ax_pick): New function.
doc
	* agentexpr.texi (Bytecode Descriptions): Document pick and rot.
gdbserver
	* tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
	gdb_agent_op_rot>: New constants.
	(gdb_agent_op_names): Add pick and roll.
	(eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
	cases.
2011-02-18 20:55:45 +00:00
Jan Kratochvil 0feedb2cc8 gdb/
* Makefile.in (ACLOCAL_AMFLAGS): Add `-I ../config'.
	* aclocal.m4: Regenerated with aclocal-1.11.1.
	* common/configure: Regenerate with autoconf-2.64.

gdb/gdbserver/
	* aclocal.m4: Regenerated with aclocal-1.11.1.
2011-02-15 21:05:54 +00:00
Pedro Alves b3b9301ef4 gdb/
* target.h (struct traceframe_info): Forward declare.
	(enum target_object): Add TARGET_OBJECT_TRACEFRAME_INFO.
	(struct target_ops) <to_traceframe_info>: New field.
	(target_traceframe_info): New.
	* target.c (update_current_target): Inherit and default
	to_traceframe_info.
	* remote.c (PACKET_qXfer_traceframe_info): New.
	(remote_protocol_features): Register qXfer:traceframe-info:read.
	(remote_xfer_partial): Handle TARGET_OBJECT_TRACEFRAME_INFO.
	(remote_traceframe_info): New.
	(init_remote_ops): Install it.
	(_initialize_remote): Install "set/show remote traceframe-info"
	commands.
	* tracepoint.h (parse_traceframe_info): Declare.
	* tracepoint.c (struct mem_range): New.
	(mem_range_s): New typedef.
	(struct traceframe_info): New.
	(traceframe_info): New global.
	(free_traceframe_info): New function.
	(clear_traceframe_info): New function.
	(start_tracing, tfind_1, set_traceframe_number): Clear traceframe
	info.
	(build_traceframe_info): New function.
	(tfile_traceframe_info): New function.
	(init_tfile_ops): Install tfile_traceframe_info.
	(traceframe_info_start_memory, free_result): New functions.
	(memory_attributes, traceframe_info_elements): New globals.
	(parse_traceframe_info, get_traceframe_info): New functions.
	* features/traceframe-info.dtd: New file.
	* Makefile.in (XMLFILES): Add traceframe-info.dtd.

	gdb/gdbserver/
	* server.c (handle_qxfer_traceframe_info): New.
	(qxfer_packets): Register "traceframe-info".
	(handle_query): Report support for qXfer:traceframe-info:read+.
	* tracepoint.c (match_blocktype): New.
	(traceframe_find_block_type): Rename to ...
	(traceframe_walk_blocks): ... this.  Add callback filter argument,
	and use it.
	(traceframe_find_block_type): New, reimplemented on top of
	traceframe_walk_blocks.
	(build_traceframe_info_xml): New.
	(traceframe_read_info): New.
	* server.h (traceframe_read_info): Declare.

	gdb/doc/
	* gdb.texinfo (Remote Configuration): Mention set/show remote
	traceframe-info.
	(Tools/Packages Optional for Building GDB): Mention that expat is
	used for traceframe info.
	(Remote Protocol) <Menu>: Add "Traceframe Info Format".
	(General Query Packets) <qSupported>: Describe the
	qXfer:traceframe-info:read feature.
	(qXfer::read): Describe qXfer:traceframe-info:read.
	(Traceframe Info Format): New section.
2011-02-14 11:13:12 +00:00
Yao Qi 4f3e6fb7a0 2011-02-11 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove signals.o from COMMON_OBS.  Link
	libcommon.a.
	* configure.ac: Add common to sub dir.
	* configure: Regenerate.

common/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	Build libcommon.a.

	* Makefile.in: New.
	* configure.ac: New.
	* aclocal.m4: New.
	* configure: Generate.

gdbserver/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Call AC_PROG_RANLIB.
	* Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
	* configure: Regenerate.
2011-02-11 09:57:25 +00:00
Pedro Alves 764880b7ed gdb/server/
* server.c (gdb_read_memory): Change return semantics to allow
	partial transfers.
	(handle_search_memory_1): Adjust.
	(process_serial_event) <'m' packet>: Handle partial transfers.
	* tracepoint.c (traceframe_read_mem): Handle partial transfers.

	gdb/testsuite/
	* gdb.trace/collection.c (global_pieces): New.
	* gdb.trace/collection.exp (gdb_collect_global_in_pieces_test):
	New procedure.
	(gdb_trace_collection_test): Call it.
2011-02-07 12:14:14 +00:00
Pedro Alves 1c79eb8a7d gdb/gdbserver/
* regcache.c (init_register_cache): Initialize
	regcache->register_status.
	(free_register_cache): Release regcache->register_status.
	(regcache_cpy): Copy register_status.
	(registers_to_string): Print 'x's for unavailable registers.
	(supply_register): Mark the register's status valid or
	unavailable, depending on whether a buffer was passed in or not.
	(supply_register_zeroed): New.
	(supply_regblock): Mark the registers' status valid or
	unavailable, depending on whether a buffer was passed in or not.
	* regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
	(struct regcache): New `register_status' field.
	(supply_register_zeroed): Declare.
	* i387-fp.c (i387_xsave_to_cache): Zero out registers using
	supply_register_zeroed, rather than passing a NULL buffer to
	supply_register.
	* tracepoint.c (fetch_traceframe_registers): Update comment.
2011-01-28 13:36:32 +00:00
Pedro Alves 85724a0e60 2011-01-28 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
	buffer explicit.
2011-01-28 12:58:00 +00:00
Pedro Alves d08aafeffe 2011-01-25 Pedro Alves <pedro@codesourcery.com>
* server.h (decode_xfer_write): Change prototype.
	* remote-utils.c (decode_xfer_write): Remove `annex' parameter,
	and don't extract the annex here.
	* server.c (decode_xfer_read): Remove `annex' parameter,
	and don't extract the annex here.
	(decode_xfer): New.
	(struct qxfer): New.
	(handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
	(handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
	(handle_qxfer_statictrace): New functions, abstracted out from
	handle_query, and made to use the struct qxfer interface.
	(handle_threads_qxfer_proper): Rename to ...
	(handle_qxfer_threads_proper): ... this.
	(handle_threads_qxfer): Rename to ...
	(handle_qxfer_threads): ... this.  Adjust.
	(qxfer_packets): New array.
	(handle_qxfer): New function.
	(handle_query): Use handle_qxfer.
2011-01-25 10:09:19 +00:00
Michael Snyder 493e2a69a4 2011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdbreplay.c: Shorten lines of >= 80 columns.
	* linux-low.c: Ditto.
	* linux-ppc-low.c: Ditto.
	* linux-s390-low.c: Ditto.
	* linux-sparc-low.c: Ditto.
	* linux-x86-low.c: Ditto.
	* linux-xtensa-low.c: Ditto.
	* mem-break.c: Ditto.
	* nto-low.c: Ditto.
	* regcache.h: Ditto.
	* remote-utils.c: Ditto.
	* server.c: Ditto.
	* server.h: Ditto.
	* thread-db.c: Ditto.
	* tracepoint.c: Ditto.
	* utils.c: Ditto.
	* win32-low.h: Ditto.
2011-01-06 00:14:09 +00:00
Joel Brobecker 449444484c Update the copyright year for most remaining files in GDB 2011-01-05 05:09:55 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Joel Brobecker 71ce852cc7 Update copyright year in version of output (gdb/gdbserver/gdbreplay)
gdb/ChangeLog:

       * top.c (print_gdb_version): Update copyright year in version output.

gdb/gdbserverChangeLog:

       * server.c (gdbserver_version): Update copyright year in version
       output.
       * gdbreplay.c (gdbreplay_version): Ditto.
2011-01-01 14:14:46 +00:00
Mike Frysinger eb826dc62c gdbserver: bfin: new port
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-12-29 16:15:42 +00:00
Mike Frysinger 39ab222a94 gdbserver: start a gitignore 2010-12-23 21:13:24 +00:00
Mike Frysinger a1f2ce7d60 gdbserver: fix warning in nommu clone
Building gdbserver for nommu targets atm fails with:
	linux-low.c: In function 'linux_tracefork_child':
	linux-low.c:4151: error: pointer of type 'void *' used in arithmetic

So cast the void* to a char*.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-16 03:27:05 +00:00
Jie Zhang f474844cb7 * Makefile.in (install): Remove dependency of install-only and
recursively invoke make for install-only.
	* data-directory/Makefile.in: Add FLAGS_TO_PASS variable.
	(install): Pass FLAGS_TO_PASS when recursively make install-only.

	gdbserver/
	* Makefile.in: Add FLAGS_TO_PASS variable.
	(install): Remove dependency of install-only and recursively
	invoke make for install-only.
2010-10-21 23:50:46 +00:00
Doug Evans f104871271 * Makefile.in (uninstall): Use $(DESTDIR). 2010-10-04 23:32:40 +00:00
Pedro Alves e6ee044df3 PR gdb/11842
gdb/
	* amd64-linux-nat.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.

	gdb/gdbserver/
	* linux-x86-low.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.
2010-09-24 13:44:01 +00:00
Pedro Alves b53a162374 gdb/
* amd64-linux-nat.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.

	gdb/gdbserver/
	* linux-x86-low.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.
2010-09-24 13:41:43 +00:00
Joel Brobecker fa1bd1e4fb Add support for x86 LynxOS
This patch adds support for x86 LynxOS (tested on LynxOS 5.0).

gdb/gdbserver/ChangeLog:

        * lynx-i386-low.c: New file.
        * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
2010-09-13 19:11:03 +00:00
Joel Brobecker 47fac8f84d [LynxOS] Remove handling of PTRACE_* values removed in Lynx5.
Some of the PTRACE_ macros/values were removed in LynxOS 5.x.
Since we have not use them so far, the chances that we will use them
one day are very small.  So I decided to delete them.

gdb/gdbserver/ChangeLog:

        * lynx-low.c (ptrace_request_to_str): Remove handling for
        request values that have been removed in LynxOS 5.x.
2010-09-13 19:10:30 +00:00
Joel Brobecker 1adfc54d0c [LynxOS] Include sys/ptrace.h instead of ptrace.h.
This is one of the changes needed in order to build gdbserver on
LynxOS 5.x.

Really interesting: On LynxOS 4.x, there is a #warning when sys/ptrace.h
is used (explaining that ptrace.h will be used instead), whereas this
file was removed from LynxOS 5.x. The contents of sys/ptrace.h on 4.x
(or at least the meat of it):

    #if defined(__GNUC__) || defined(__GNUG__)
    #if !defined(__NO_INCLUDE_WARN__)
    #warning Using <ptrace.h> instead of <sys/ptrace.h>
    #endif /* defined(__NO_INCLUDE_WARN__) */
    #endif /* defined(__GNUC__) || defined(__GNUG__) */

    #include <ptrace.h>

The fix I went for, for now, is to just include <sys/ptrace.h>
unconditionally.  I could have done some configury, but we already
have to build with -D__NO_INCLUDE_WARN__ to avoid the warnings
anyway, and that's unvoidable, due to system includes themselves
including the "wrong" header file.

Since <sys/ptrace.h> seems to be the choice that was made for LynxOS,
and since it works to include it on LynxOS 4.x, I think that's the simplest
solution.

gdb/gdbserver/ChangeLog:

        * lynx-low.c, lynx-ppc-low.c: Include <sys/ptrace.h> instead of
        <ptrace.h>
2010-09-13 19:10:19 +00:00
Nathan Sidwell c2a66c29c9 * configure.ac: Add --enable-inprocess-agent option.
* configure: Rebuilt.
2010-09-09 13:16:38 +00:00
Yao Qi 32fcada322 2010-09-06 Yao Qi <yao@codesourcery.com>
* linux-low.c (linux_kill): Remove unused variable.
	(linux_stabilize_threads): Likewise.
	* server.c (start_inferior): Likewise.
	(queue_stop_reply_callback): Likewise.
	* tracepoint.c (do_action_at_tracepoint): Likewise.
2010-09-06 15:15:50 +00:00
Yao Qi 0cccb68320 2010-09-06 Yao Qi <yao@codesourcery.com>
* linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
	on return.
2010-09-06 15:10:15 +00:00
Jan Kratochvil 423ec54cd3 gdb/
* corelow.c (core_open): Use target_signal_from_host if CORE_GDBARCH
	is NULL.
	* fork-child.c (startup_inferior) <resume_signal>: Use enum
	target_signal type.
	* linux-nat.c (linux_nat_resume): Use target_signal_to_host before
	calling strsignal.  Use enum target_signal type for saved_signo.
	(linux_handle_extended_wait) <signo>: Use enum target_signal type.
	(linux_nat_wait_1): Use enum target_signal type for signo.  Use
	target_signal_to_host before calling strsignal.
	* remote-m32r-sdi.c (m32r_wait, m32r_detach): Replace 0 by
	TARGET_SIGNAL_0.

gdb/gdbserver/
	* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
2010-09-06 13:59:03 +00:00
Pedro Alves 12ac6819b6 * Makefile.in (install-only): Replace $IPA_DEPFILES with
"$(IPA_DEPFILES)".
2010-09-06 10:43:58 +00:00
Joel Brobecker 8ed54b31b3 gdbserver support for powerpc-lynxos (4.x)
This patch adds support for powerpc-lynxos.

gdbserver/ChangeLog:

        * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
        gdbserver/lynx-ppc-low.c: New files.
        * Makefile.in (lynx_low_h): New variable.
        (lynx-low.o, lynx-ppc-low.o): New rules.
        * configure.ac: On LynxOS, link with -lnetinet.
        * configure.srv: Add handling of powerpc-*-lynxos* targets.
        * configure: regenerate.
2010-09-01 18:57:12 +00:00
Joel Brobecker bb0116a433 Import vsnprintf from libiberty if not available.
vasprintf and vsnprintf are not available on LynxOS, at least not on
version 4.0.0.  This patch updates the configury to import them from
libiberty if not available out of the box.

gdbserver/
        * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
        * configure.ac: Add check for vasprintf and vsnprintf.
        * configure, config.in: Regenerate.
        * server.h (vasprintf, vsnprintf): Add conditional declarations.
2010-09-01 18:56:45 +00:00
Joel Brobecker 0482b03b6a Generate regformats/rs6000/powerpc-32.dat
I will need this description for the ppc-lynxos debugger where, AFAICT,
we only have access to the core GP and FP registers.  So this adds
powerpc-32 to the list of targets for which a .dat file needs  to be
generated.

2010-04-30  Joel Brobecker  <brobecker@adacore.com>

        * features/Makefile (WHICH): Add rs6000/powerpc-32.
        (powerpc-32.o, powerpc-32.c): New rules.
        (clean): Also remove powerpc-32.c.
        * regformats/rs6000/powerpc-32.dat: Generate.
2010-09-01 18:56:35 +00:00
gdbadmin a778ab81e8 [gdbserver] Move malloc.h include to server.h.
This patch moves all includes of malloc.h, which were introduced
purely to get access to alloca's declaration, to server.h, next
to the include of alloca.h.

There is one exception: gdbreplay.c, which does not include server.h.
In this case, the include of alloca.h was simply moved up a bit, next
to the include of malloc.h.

gdb/gdbserver/ChangeLog:

        * gdbreplay.c: Move include of alloca.h up, next to include of
        malloc.h.
        * server.h: Add include of malloc.h.
        * mem-break.c: Remove include of malloc.h.
        * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
2010-09-01 17:29:32 +00:00
gdbadmin 8b034a19a7 Put ChangeLog entries in the right ChangeLog file. 2010-09-01 17:27:51 +00:00
gdbadmin eff1410f2b Compile memmem.o without -Werror.
This reproduces the same approach as in GDB to allow us to build
specific files without -Werror.

gdb/gdbserver/ChangeLog:

        * Makefile.in (INTERNAL_CFLAGS_BASE): New variable. Extracted
        from INTERNAL_CFLAGS.
        (INTERNAL_WARN_CFLAGS): New variable.
        (INTERNAL_CFLAGS): Adjust, using INTERNAL_WARN_CFLAGS.
2010-09-01 01:56:04 +00:00
gdbadmin 6cebaf6e1a use xsnprintf instead of snprintf.
snprintf is not available on LynxOS, so I changed the calls to snprintf
to calls to xsnprintf, which should be strictly equivalent.

gdb/gdbserver/ChangeLog:

        * utils.c (xsnprintf): Make non-static.
        * server.h: Add xsnprintf declaration.
        * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
        replace calls to snprintf by calls to xsnprintf throughout.
2010-09-01 01:53:43 +00:00
gdbadmin a1723c35ac include alloca.h if available.
On LynxOS, alloca is defined in allocal.h.  This fixes one warning that
occurs when building GDBserver for LynxOS.

gdb/gdbserver/ChangeLog:

        * configure.ac: Add configure check for alloca.
        * configure, config.in: Regenerate.
        * server.h: Include alloca.h if it exists.
        * gdbreplay.c: Include alloca.h if it exists.
2010-09-01 01:51:07 +00:00
Pedro Alves 1a98136022 * linux-low.c (__SIGRTMIN): Define if not already defined.
(linux_create_inferior): Check for __ANDROID__ rather than
	__SIGRTMIN.
	(enqueue_one_deferred_signal): Don't requeue non-RT signals that
	are already deferred.
	(linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
	(linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
	stopped and already has a pending signal to report.
	(proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
	a pending signal to report or is moving out of a jump pad.
	(linux_init_signals): Check for __ANDROID__ rather than
	__SIGRTMIN.
2010-08-28 14:51:29 +00:00
Pedro Alves b4d51a55f9 * linux-low.c (linux_stabilize_threads): Wrap debug output in a
debug_threads check.  Avoid a linear search when not doing debug
	output.
2010-08-28 14:03:27 +00:00
Pedro Alves ec48365dd8 * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
(struct gdb_event) <fd>: Change type to gdb_fildes_t.
	(struct file_handler) <fd>: Change type to gdb_fildes_t.
	(process_event): Change local fd's type to gdb_fildes_t.
	(create_file_handler): Adjust prototype.
	(delete_file_handler): Adjust prototype.
	(handle_file_event): Adjust prototype.  Use pfildes.
	(create_file_event): Adjsut prototype.
	* remote-utils.c (remote_desc, listen_desc): Change type to
	gdb_fildes_t.
	* server.h: New gdb_fildes_t typedef.
	[USE_WIN32API]: Include winsock2.h.
	(delete_file_handler, add_file_handler): Adjust prototypes.
	(pfildes): Declare.
	* utils.c (pfildes): New.
2010-08-27 16:02:49 +00:00
Pedro Alves 889bf7c5fa Fix whitespace, tabs/spaces. 2010-08-27 12:02:20 +00:00