3 * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
4 aarch64_linux_get_debug_reg_capacity.
8 * Makefile.in (aarch64-linux-hw-point.o): New rule.
9 * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
10 * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
11 (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
12 (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
13 (AARCH64_HWP_ALIGNMENT): Likewise.
14 (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
15 (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
16 (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
17 (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
18 (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
19 (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
20 (struct aarch64_debug_reg_state): Likewise.
21 (struct arch_lwp_info): Likewise.
22 (aarch64_align_watchpoint): Likewise.
23 (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
24 (aarch64_watchpoint_length): Likewise.
25 (aarch64_point_encode_ctrl_reg): Likewise
26 (aarch64_point_is_aligned): Likewise.
27 (aarch64_align_watchpoint): Likewise.
28 (aarch64_linux_set_debug_regs):
29 (aarch64_dr_state_insert_one_point): Likewise.
30 (aarch64_dr_state_remove_one_point): Likewise.
31 (aarch64_handle_breakpoint): Likewise.
32 (aarch64_handle_aligned_watchpoint): Likewise.
33 (aarch64_handle_unaligned_watchpoint): Likewise.
34 (aarch64_handle_watchpoint): Likewise.
38 * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
39 and don't aarch64_get_debug_reg_state. All callers update.
40 (aarch64_handle_aligned_watchpoint): Likewise.
41 (aarch64_handle_unaligned_watchpoint): Likewise.
42 (aarch64_handle_watchpoint): Likewise.
43 (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
44 (aarch64_remove_point): Likewise.
48 * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
50 (aarch64_handle_unaligned_watchpoint): Likewise.
54 Revert the previous 3 commits:
55 Move gdb_regex* to common/
56 Move linux_find_memory_regions_full & co.
57 gdbserver build-id attribute generator
62 gdbserver build-id attribute generator.
63 * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
64 (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
65 (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
67 (get_dynamic): Use find_pdhr to traverse program headers.
68 (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
69 (compare_mapping_entry_range, struct find_memory_region_callback_data)
70 (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
71 (get_hex_build_id): New.
72 (linux_qxfer_libraries_svr4): Add optional build-id attribute
73 to reply XML document.
78 * target.c: Include target/target-utils.h and fcntl.h.
79 (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
80 (target_fileio_read_stralloc): New functions.
84 * Makefile.in (OBS): Add gdb_regex.o.
92 Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
93 * Makefile.in (OBS): Add target-utils.o.
94 (linux-maps.o, target-utils.o): New.
95 * configure.srv (srv_linux_obj): Add linux-maps.o.
99 * linux-aarch64-low.c (aarch64_supports_range_stepping): New
101 (the_low_target): Install it.
105 * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
106 Instead, ignore ECHILD, and throw an error for other errnos.
110 * event-loop.c (struct callback_event) <data>: Change type to
111 gdb_client_data instance instead of gdb_client_data pointer.
112 (append_callback_event): Adjust.
116 * linux-aarch64-low.c: Add comments for each linux_target_ops
117 method. Remove comments already covered in target_ops and
118 linux_target_ops definitions.
119 (the_low_target): Add comments for each unimplemented method.
123 * linux-aarch64-low.c (aarch64_regmap): Remove.
124 (aarch64_usrregs_info): Remove.
125 (regs_info): Set field usrregs to NULL.
129 * linux-low.c: Include "rsp-low.h"
130 (linux_low_encode_pt_config, linux_low_encode_raw): New.
131 (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
132 (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
133 (handle_btrace_enable_pt): New.
134 (handle_btrace_general_set): Support "pt".
135 (handle_btrace_conf_general_set): Support "pt:size".
139 * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
144 * linux-aarch64-low.c: Remove comment about endianness.
145 (aarch64_breakpoint): Change type to gdb_byte[]. Set to "brk #0".
146 (aarch64_breakpoint_at): Change type of insn to gdb_byte[]. Use
151 * linux-i386-ipa.c (stdint.h): Do not include.
152 * lynx-i386-low.c (stdint.h): Likewise.
153 * lynx-ppc-low.c (stdint.h): Likewise.
154 * mem-break.c (stdint.h): Likewise.
155 * thread-db.c (stdint.h): Likewise.
156 * tracepoint.c (stdint.h): Likewise.
157 * win32-low.c (stdint.h): Likewise.
161 * server.c (write_qxfer_response): Update call to
162 remote_escape_output.
167 Merge multiple hex conversions.
168 * gdbreplay.c (tohex): Rename to 'fromhex'.
169 (logchar): Use fromhex.
173 * server.c (handle_qxfer_libraries): Set `version' attribute for
178 * target.h (struct target_ops) <multifs_open>: New field.
179 <multifs_unlink>: Likewise.
180 <multifs_readlink>: Likewise.
181 * linux-low.c (nat/linux-namespaces.h): New include.
182 (linux_target_ops): Initialize the_target->multifs_open,
183 the_target->multifs_unlink and the_target->multifs_readlink.
184 * hostio.h (hostio_handle_new_gdb_connection): New declaration.
185 * hostio.c (hostio_fs_pid): New static variable.
186 (hostio_handle_new_gdb_connection): New function.
187 (handle_setfs): Likewise.
188 (handle_open): Use the_target->multifs_open as appropriate.
189 (handle_unlink): Use the_target->multifs_unlink as appropriate.
190 (handle_readlink): Use the_target->multifs_readlink as
192 (handle_vFile): Handle vFile:setfs packets.
193 * server.c (handle_query): Call hostio_handle_new_gdb_connection
194 after target_handle_new_gdb_connection.
198 * configure.ac (AC_CHECK_FUNCS): Add setns.
199 * config.in: Regenerate.
200 * configure: Likewise.
201 * Makefile.in (SFILES): Add nat/linux-namespaces.c.
202 (linux-namespaces.o): New rule.
203 * configure.srv (srv_linux_obj): Add linux-namespaces.o.
207 * hostio.c (handle_open): Process mode argument with
212 * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
213 * linux-x86-low.c: Likewise.
217 * linux-low.c (handle_extended_wait): Initialize
218 thread_info.last_resume_kind for new fork children.
222 * target.h (target_handle_new_gdb_connection): Rewrite using if
227 * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
228 * configure, config.in: Regenerate.
229 * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
234 * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
235 PTRACE_EVENT_VFORK_DONE.
236 (linux_low_ptrace_options, extended_event_reported): Add vfork
238 * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
239 and "vforkdone" for RSP 'T' Stop Reply Packet.
240 * server.h (report_vfork_events): Declare
245 * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
246 (the_low_target) <new_fork>: Initialize new member.
247 * linux-arm-low.c (arm_new_fork): New function.
248 (the_low_target) <new_fork>: Initialize new member.
249 * linux-low.c (handle_extended_wait): Call new target function
251 * linux-low.h (struct linux_target_ops) <new_fork>: New member.
252 * linux-mips-low.c (mips_add_watchpoint): New function
253 extracted from mips_insert_point.
254 (the_low_target) <new_fork>: Initialize new member.
255 (mips_linux_new_fork): New function.
256 (mips_insert_point): Call mips_add_watchpoint.
257 * linux-x86-low.c (x86_linux_new_fork): New function.
258 (the_low_target) <new_fork>: Initialize new member.
262 * linux-low.c (handle_extended_wait): Implement return value,
263 rename argument 'event_child' to 'event_lwp', handle
264 PTRACE_EVENT_FORK, call internal_error for unrecognized event.
265 (linux_low_ptrace_options): New function.
266 (linux_low_filter_event): Call linux_low_ptrace_options,
267 use different argument fo linux_enable_event_reporting,
268 use return value from handle_extended_wait.
269 (extended_event_reported): New function.
270 (linux_wait_1): Call extended_event_reported and set
271 status to report fork events.
272 (linux_write_memory): Add pid to debug message.
273 (reset_lwp_ptrace_options_callback): New function.
274 (linux_handle_new_gdb_connection): New function.
275 (linux_target_ops): Initialize new structure member.
276 * linux-low.h (struct lwp_info) <waitstatus>: New member.
277 * lynx-low.c: Initialize new structure member.
278 * remote-utils.c (prepare_resume_reply): Implement stop reason
279 "fork" for "T" stop message.
280 * server.c (handle_query): Call handle_new_gdb_connection.
281 * server.h (report_fork_events): Declare global flag.
282 * target.h (struct target_ops) <handle_new_gdb_connection>:
284 (target_handle_new_gdb_connection): New macro.
285 * win32-low.c: Initialize new structure member.
289 * mem-break.c (APPEND_TO_LIST): Define macro.
290 (clone_agent_expr): New function.
291 (clone_one_breakpoint): New function.
292 (clone_all_breakpoints): New function.
293 * mem-break.h: Declare new functions.
297 * linux-low.c (linux_supports_fork_events): New function.
298 (linux_supports_vfork_events): New function.
299 (linux_target_ops): Initialize new structure members.
300 (initialize_low): Call linux_check_ptrace_features.
301 * lynx-low.c (lynx_target_ops): Initialize new structure
303 * server.c (report_fork_events, report_vfork_events):
305 (handle_query): Add new features to qSupported packet and
307 (captured_main): Initialize new global variables.
308 * target.h (struct target_ops) <supports_fork_events>:
310 <supports_vfork_events>: New member.
311 (target_supports_fork_events): New macro.
312 (target_supports_vfork_events): New macro.
313 * win32-low.c (win32_target_ops): Initialize new structure
318 * server.c (handle_qxfer_exec_file): Use current process
323 * linux-nios2-low.c: Include elf/common.h. Adjust comments.
324 Remove HAVE_PTRACE_GETREGS conditionals.
325 (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
326 instead of PTRACE_GETREGS and PTRACE_SETREGS.
330 * linux-low.c (linux_supports_conditional_breakpoints): New
332 (linux_target_ops): Install new target method.
333 * lynx-low.c (lynx_target_ops): Install NULL hook for
334 supports_conditional_breakpoints.
335 * nto-low.c (nto_target_ops): Likewise.
336 * spu-low.c (spu_target_ops): Likewise.
337 * win32-low.c (win32_target_ops): Likewise.
338 * server.c (handle_query): Check
339 target_supports_conditional_breakpoints.
340 * target.h (struct target_ops) <supports_conditional_breakpoints>:
342 (target_supports_conditional_breakpoints): New macro.
347 * server.c (start_inferior): If the process exits, mourn it.
351 * hostio.c (fileio_open_flags_to_host): Factored out to
352 fileio_to_host_openflags in common/fileio.c. Single use
357 * linux-xtensa-low.c (xtensa_fill_gregset)
358 (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
363 * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
364 (regs_info): Replace usrregs pointer with NULL.
368 * target.h (struct target_ops) <pid_to_exec_file>: New field.
369 * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
370 * server.c (handle_qxfer_exec_file): New function.
371 (qxfer_packets): Add exec-file entry.
372 (handle_query): Report qXfer:exec-file:read as supported packet.
376 * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
380 * hostio-errno.c (errno_to_fileio_error): Remove function.
381 Update caller to use remote_fileio_to_fio_error.
385 * linux-low.c (linux_insert_point): Call
386 insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
387 (linux_remove_point): Call remove_memory_breakpoint if type is
389 * linux-x86-low.c (x86_insert_point): Don't call
390 insert_memory_breakpoint.
391 (x86_remove_point): Don't call remove_memory_breakpoint.
396 * server.c (gdbserver_usage): Reorganize and extend the usage
401 * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
402 output. Also dump TRAP_TRACE.
403 (linux_low_filter_event): In debug output, distinguish a
404 resume_stop SIGSTOP from a delayed SIGSTOP.
408 * linux-x86-low.c (x86_linux_new_thread): Moved to
410 (x86_linux_prepare_to_resume): Likewise.
414 * Makefile.in (x86-linux-dregs.o): New rule.
415 * configure.srv: Add x86-linux-dregs.o to relevant targets.
416 * linux-x86-low.c: Include nat/x86-linux-dregs.h.
417 (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
418 (x86_linux_dr_get): Likewise.
419 (x86_linux_dr_set): Likewise.
420 (update_debug_registers_callback): Likewise.
421 (x86_linux_dr_set_addr): Likewise.
422 (x86_linux_dr_get_addr): Likewise.
423 (x86_linux_dr_set_control): Likewise.
424 (x86_linux_dr_get_control): Likewise.
425 (x86_linux_dr_get_status): Likewise.
426 (x86_linux_update_debug_registers): Likewise.
430 * linux-x86-low.c (x86_linux_update_debug_registers):
431 New function, factored out from...
432 (x86_linux_prepare_to_resume): ...this.
436 * linux-x86-low.c (x86_linux_dr_get): Update comments.
437 (x86_linux_dr_set): Likewise.
438 (update_debug_registers_callback): Likewise.
439 (x86_linux_dr_set_addr): Likewise.
440 (x86_linux_dr_get_addr): Likewise.
441 (x86_linux_dr_set_control): Likewise.
442 (x86_linux_dr_get_control): Likewise.
443 (x86_linux_dr_get_status): Likewise.
444 (x86_linux_prepare_to_resume): Likewise.
448 * linux-x86-low.c (x86_linux_dr_get): Add assertion.
449 Use perror_with_name. Pass string through gettext.
450 (x86_linux_dr_set): Likewise.
454 * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
455 (x86_linux_dr_set_addr): ...this.
456 (x86_dr_low_get_addr): Rename to...
457 (x86_linux_dr_get_addr): ...this.
458 (x86_dr_low_set_control): Rename to...
459 (x86_linux_dr_set_control): ...this.
460 (x86_dr_low_get_control): Rename to...
461 (x86_linux_dr_get_control): ...this.
462 (x86_dr_low_get_status): Rename to...
463 (x86_linux_dr_get_status): ...this.
464 (x86_dr_low): Update with new function names.
468 * Makefile.in (x86-linux.o): New rule.
469 * configure.srv: Add x86-linux.o to relevant targets.
470 * linux-low.c (lwp_set_arch_private_info): New function.
471 (lwp_arch_private_info): Likewise.
472 * linux-x86-low.c: Include nat/x86-linux.h.
473 (arch_lwp_info): Removed structure.
474 (update_debug_registers_callback):
475 Use lwp_set_debug_registers_changed.
476 (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
477 and lwp_set_debug_registers_changed.
478 (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
482 * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
483 * linux-arm-low.c (arm_new_thread): Likewise.
484 * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
485 * linux-mips-low.c (mips_linux_new_thread): Likewise.
486 * linux-x86-low.c (x86_linux_new_thread): Likewise.
487 * linux-low.c (add_lwp): Update the_low_target.new_thread call.
491 * linux-low.c (ptid_of_lwp): New function.
492 (lwp_is_stopped): Likewise.
493 (lwp_stop_reason): Likewise.
494 * linux-x86-low.c (update_debug_registers_callback):
496 (x86_linux_prepare_to_resume): Use ptid_of_lwp and
501 * linux-low.h (linux_stop_lwp): Remove declaration.
505 * linux-low.h: Include nat/linux-nat.h.
506 * linux-low.c (iterate_over_lwps_args): New structure.
507 (iterate_over_lwps_filter): New function.
508 (iterate_over_lwps): Likewise.
509 * linux-x86-low.c (update_debug_registers_callback):
510 Update signature to what iterate_over_lwps expects.
511 Remove PID check that iterate_over_lwps now performs.
512 (x86_dr_low_set_addr): Use iterate_over_lwps.
513 (x86_dr_low_set_control): Likewise.
517 * linux-x86-low.c (x86_debug_reg_state): New function.
518 (x86_linux_prepare_to_resume): Use the above.
522 * linux-low.c (current_lwp_ptid): New function.
523 * linux-x86-low.c: Include nat/linux-nat.h.
524 (x86_dr_low_get_addr): Use current_lwp_ptid.
525 (x86_dr_low_get_control): Likewise.
526 (x86_dr_low_get_status): Likewise.
530 * tracepoint.c (cmd_qtstatus): Make "str" const.
534 * server.c (handle_general_set): Make "req_str" const.
538 * linux-low.c (linux_resume_one_lwp): Rename to ...
539 (linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here,
540 instead call perror_with_name.
541 (check_ptrace_stopped_lwp_gone): New function.
542 (linux_resume_one_lwp): Reimplement as wrapper around
543 linux_resume_one_lwp_throw that swallows errors if the LWP is
548 * linux-low.c (count_events_callback, select_event_lwp_callback):
549 No longer check whether the thread has resume_stop as last resume
554 * linux-low.c (count_events_callback, select_event_lwp_callback):
555 Use the lwp's status_pending_p field, not the thread's.
559 * linux-low.c (select_event_lwp_callback): Update comments to
560 no longer mention SIGTRAP.
564 * server.c (handle_query): Do not report vFile:fstat as supported.
568 * hostio.c (sys/types.h): New include.
569 (sys/stat.h): Likewise.
570 (common-remote-fileio.h): Likewise.
571 (handle_fstat): New function.
572 (handle_vFile): Handle vFile:fstat packets.
576 * configure.ac (AC_CHECK_MEMBERS): Add checks for
577 struct stat.st_blocks and struct stat.st_blksize.
578 * configure: Regenerate.
579 * config.in: Likewise.
580 * Makefile.in (SFILES): Add common/common-remote-fileio.c.
581 (OBS): Add common-remote-fileio.o.
582 (common-remote-fileio.o): New rule.
586 * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
587 'struct sockaddr' pointer in 'accept' call.
593 * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
594 or <winsock2.h> here. Instead include "gdb_socket.h".
595 (remote_open): Use union gdb_sockaddr_u.
596 * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
597 or <winsock2.h> here. Instead include "gdb_socket.h".
598 (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
599 * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
601 (init_named_socket, gdb_agent_helper_thread): Use union
606 * configure.ac (build_warnings): Move
607 -Wdeclaration-after-statement to the C-specific set.
608 * configure: Regenerate.
612 * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
613 or <winsock2.h> here. Instead include "gdb_socket.h".
614 (remote_open): Use union gdb_sockaddr_u.
615 * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
616 or <winsock2.h> here. Instead include "gdb_socket.h".
617 (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
618 * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
620 (init_named_socket, gdb_agent_helper_thread): Use union
625 Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
630 * linux-aarch64-low.c (aarch64_insert_point): Use
631 show_debug_regs as a boolean.
632 (aarch64_remove_point): Likewise.
636 * lynx-low.c (lynx_target_ops): Install NULL hooks for
637 stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
638 stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
639 * nto-low.c (nto_target_ops): Likewise.
640 * spu-low.c (spu_target_ops): Likewise.
641 * win32-low.c (win32_target_ops): Likewise.
645 * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
646 Decide whether a breakpoint triggered based on the SIGTRAP's
648 (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
649 breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
650 (linux_low_filter_event): Check for breakpoints before checking
652 (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
654 (linux_stopped_by_sw_breakpoint)
655 (linux_supports_stopped_by_sw_breakpoint)
656 (linux_stopped_by_hw_breakpoint)
657 (linux_supports_stopped_by_hw_breakpoint): New functions.
658 (linux_target_ops): Install new target methods.
662 * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
663 * server.c (swbreak_feature, hwbreak_feature): New globals.
664 (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
665 (captured_main): Clear swbreak_feature and hwbreak_feature.
666 * server.h (swbreak_feature, hwbreak_feature): Declare.
667 * target.h (struct target_ops) <stopped_by_sw_breakpoint,
668 supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
669 supports_stopped_by_hw_breakpoint>: New fields.
670 (target_supports_stopped_by_sw_breakpoint)
671 (target_stopped_by_sw_breakpoint)
672 (target_supports_stopped_by_hw_breakpoint)
673 (target_stopped_by_hw_breakpoint): Declare.
677 enum lwp_stop_reason -> enum target_stop_reason
678 * linux-low.c (check_stopped_by_breakpoint): Adjust.
679 (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
680 (linux_wait_1, stuck_in_jump_pad_callback)
681 (move_out_of_jump_pad_callback, linux_resume_one_lwp)
682 (linux_stopped_by_watchpoint):
683 * linux-low.h (enum lwp_stop_reason): Delete.
684 (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
685 * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
689 * Makefile.in (SFILES): Add linux-aarch64-low.c.
693 * hostio.c (handle_vFile): Fix prefix lengths.
697 * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
702 * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
703 (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
704 (clean): Add "rm -f" for above C files.
705 * configure.srv (srv_regobj): Add s390-vx-linux64.o,
706 s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
707 (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
708 s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
709 * linux-s390-low.c (HWCAP_S390_VX): New macro.
710 (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
711 (init_registers_s390x_vx_linux64)
712 (init_registers_s390x_tevx_linux64)
713 (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
714 (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
716 (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
717 (s390_store_vxrs_high): New functions.
718 (s390_regsets): Add entries for NT_S390_VXRS_LOW and
720 (s390_arch_setup): Add logic for selecting one of the new target
721 descriptions. Activate the new vector regsets if applicable.
722 (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
723 init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
724 and init_registers_s390x_tevx_linux64.
728 * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
733 * linux-x86-low.c (u_debugreg_offset): New function.
734 (x86_linux_dr_get, x86_linux_dr_set): Use it.
738 * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
739 [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
740 [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
741 ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
742 (ps_lsetfpregs, ps_getpid)
743 (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
744 (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
745 (ps_lsetxregs, ps_plog): Declare.
749 * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
750 IP_AGENT_EXPORT_FUNC.
751 * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
752 IP_AGENT_EXPORT_FUNC.
753 * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
754 (IP_AGENT_EXPORT): Delete.
755 (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
756 (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
757 (gdb_trampoline_buffer_error, collecting, gdb_collect)
758 (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
759 (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
760 (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
761 (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
762 (traceframe_read_count, traceframe_write_count)
763 (traceframes_created, trace_state_variables, get_raw_reg)
764 (get_trace_state_variable_value, set_trace_state_variable_value)
765 (ust_loaded, helper_thread_id, cmd_buf): Use
766 IPA_SYM_EXPORTED_NAME.
767 (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
768 (tracepoints) Use IP_AGENT_EXPORT_VAR.
769 (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
770 IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
771 (last_tracepoint): Move into !IN_PROCESS_AGENT block.
772 (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
773 EXTERN_C_PUSH/EXTERN_C_POP.
774 (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
775 (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
776 wrap in EXTERN_C_PUSH/EXTERN_C_POP.
777 (trace_buffer_ctrl, trace_buffer_ctrl_curr)
778 (traceframe_write_count, traceframe_read_count)
779 (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
780 (about_to_request_buffer_space, get_trace_state_variable_value)
781 (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
782 (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
783 EXTERN_C_PUSH/EXTERN_C_POP.
784 (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
785 (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
786 (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
787 and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
788 (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
789 (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
790 (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
791 * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
793 (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
794 (IP_AGENT_EXPORT_VAR_DECL): Define.
796 (gdb_agent_get_raw_reg): Declare.
801 Rename symbols whose names are reserved C++ keywords throughout.
805 * Makefile.in (COMPILER): New, get it from autoconf.
806 (CXX): Get from autoconf instead.
807 (COMPILE.pre): Use COMPILER.
808 (CC-LD): Rename to ...
809 (CC_LD): ... this. Use COMPILER.
810 (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
811 (CXX_FOR_TARGET): Default to g++ instead of gcc.
812 * acinclude.m4: Include build-with-cxx.m4.
813 * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
814 Disable -Werror by default if building in C++ mode.
815 (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
816 -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
817 the C++ compiler. Save/restore CXXFLAGS too.
818 * configure: Regenerate.
822 * acinclude.m4: Include libiberty.m4.
823 * configure.ac: Call libiberty_INIT.
824 * config.in, configure: Regenerate.
828 * linux-low.c (linux_wait_1): When incrementing the PC past a
829 program breakpoint always use the_low_target.breakpoint_len as
830 increment, rather than the maximum between that and
831 the_low_target.decr_pc_after_break.
835 * linux-low.c (check_stopped_by_breakpoint): Don't check if the
836 thread was doing a step-over; always adjust the PC if
837 we stepped over a permanent breakpoint.
838 (linux_wait_1): If we stepped over breakpoint that was on top of a
839 permanent breakpoint, manually advance the PC past it.
843 * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
845 (x86_fill_gregset, x86_store_gregset): Use it when handling
850 * thread-db.c: Include "nat/linux-procfs.h".
851 (thread_db_init): Skip listing new threads if the kernel supports
852 PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
856 * linux-low.c (status_pending_p_callback): Use ptid_match.
861 * linux-low.c (wstatus_maybe_breakpoint): Remove.
862 (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
863 (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
868 * tracepoint.c (cmd_qtinit): Add check for current_thread.
872 * linux-low.c (linux_low_btrace_conf): Print size.
873 * server.c (handle_btrace_conf_general_set): New.
874 (hanle_general_set): Call handle_btrace_conf_general_set.
875 (handle_query): Report Qbtrace-conf:bts:size as supported.
879 * linux-low.c (linux_low_enable_btrace): Update parameters.
880 (linux_low_btrace_conf): New.
881 (linux_target_ops)<to_btrace_conf>: Initialize.
882 * server.c (current_btrace_conf): New.
883 (handle_btrace_enable): Rename to ...
884 (handle_btrace_enable_bts): ... this. Pass ¤t_btrace_conf
885 to target_enable_btrace. Update comment. Update users.
886 (handle_qxfer_btrace_conf): New.
887 (qxfer_packets): Add btrace-conf entry.
888 (handle_query): Report qXfer:btrace-conf:read as supported packet.
889 * target.h (target_ops)<enable_btrace>: Update parameters and comment.
890 (target_ops)<read_btrace_conf>: New.
891 (target_enable_btrace): Update parameters.
892 (target_read_btrace_conf): New.
896 * server.c (handle_btrace_general_set): Remove call to
897 target_supports_btrace.
898 (supported_btrace_packets): New.
899 (handle_query): Call supported_btrace_packets.
900 * target.h: include btrace-common.h.
901 (btrace_target_info): Removed.
902 (supports_btrace, target_supports_btrace): Update parameters.
906 * Makefile.in (SFILES): Add common/btrace-common.c.
907 (OBS): Add common/btrace-common.o.
908 (btrace-common.o): Add build rules.
909 * linux-low: Include btrace-common.h.
910 (linux_low_read_btrace): Use struct btrace_data. Call
911 btrace_data_init and btrace_data_fini.
915 * thread-db.c (find_new_threads_callback): Add debug output.
919 * linux-low.c (handle_extended_wait): Don't resume LWPs here.
920 (resume_stopped_resumed_lwps): New function.
921 (linux_wait_for_event_filtered): Use it.
925 * Makefile.in (SFILES): Add linux-personality.c.
926 (linux-personality.o): New rule.
927 * configure.srv (srv_linux_obj): Add linux-personality.o to the
928 list of objects to be built.
929 * linux-low.c: Include nat/linux-personality.h.
930 (linux_create_inferior): Remove code to disable address space
931 randomization (moved to ../nat/linux-personality.c). Create
932 cleanup to disable address space randomization.
936 * Makefile.in (posix-strerror.o): New rule.
937 (mingw-strerror.o): Likewise.
938 * configure: Regenerated.
939 * configure.ac: Source file ../common/common.host. Initialize new
940 variable srv_host_obs. Add srv_host_obs to GDBSERVER_DEPFILES.
944 * Makefile.in (SFILES): Add nat/ppc-linux.c.
945 (ppc-linux.o): New rule.
946 * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
947 * configure.ac: AC_CHECK_FUNCS(getauxval).
948 * config.in: Re-generated.
949 * configure: Re-generated.
950 * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
951 ppc64_64bit_inferior_p
955 * linux-ppc-low.c: Include "nat/ppc-linux.h".
956 (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
957 (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Likewise.
958 (PT_ORIG_R3, PT_TRAP): Likewise.
959 (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
960 (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
961 (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
965 * i387-fp.c (i387_cache_to_xsave): In look over
966 num_avx512_zmmh_high_registers, replace use of struct i387_xsave
967 zmmh_low_space field by use of zmmh_high_space.
971 * linux-low.c (step_over_bkpt): Move higher up in the file.
972 (handle_extended_wait): Don't store the stop_pc here.
973 (get_stop_pc): Adjust comments and rename to ...
974 (check_stopped_by_breakpoint): ... this. Record whether the LWP
975 stopped for a software breakpoint or hardware breakpoint.
976 (thread_still_has_status_pending_p): New function.
977 (status_pending_p_callback): Use
978 thread_still_has_status_pending_p. If the event is no longer
979 interesting, resume the LWP.
980 (handle_tracepoints): Add assert.
981 (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
982 (wstatus_maybe_breakpoint): New function.
983 (cancel_breakpoint): Delete function.
984 (check_stopped_by_watchpoint): New function, factored out from
985 linux_low_filter_event.
986 (lp_status_maybe_breakpoint): Delete function.
987 (linux_low_filter_event): Remove filter_ptid argument.
988 Leave thread group exits pending here. Store the LWP's stop PC.
989 Always leave events pending.
990 (linux_wait_for_event_filtered): Pull all events out of the
991 kernel, and leave them all pending.
992 (count_events_callback, select_event_lwp_callback): Consider all
994 (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
995 (select_event_lwp): Only give preference to the stepping LWP in
996 all-stop mode. Adjust comments.
997 (ignore_event): New function.
998 (linux_wait_1): Delete 'retry' label. Use ignore_event. Remove
999 references to cancel_breakpoints. Adjust to renames. Also give
1000 equal priority to all LWPs that have had events in non-stop mode.
1001 If reporting a software breakpoint event, unadjust the LWP's PC.
1002 (linux_wait): If linux_wait_1 returned an ignored event, retry.
1003 (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
1005 (linux_resume_one_lwp): Store the LWP's PC. Adjust.
1006 (resume_status_pending_p): Use thread_still_has_status_pending_p.
1007 (linux_stopped_by_watchpoint): Adjust.
1008 (linux_target_ops): Remove reference to linux_cancel_breakpoints.
1009 * linux-low.h (enum lwp_stop_reason): New.
1010 (struct lwp_info) <stop_pc>: Adjust comment.
1011 <stopped_by_watchpoint>: Delete field.
1012 <stop_reason>: New field.
1013 * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
1014 * mem-break.c (software_breakpoint_inserted_here)
1015 (hardware_breakpoint_inserted_here): New function.
1016 * mem-break.h (software_breakpoint_inserted_here)
1017 (hardware_breakpoint_inserted_here): Declare.
1018 * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
1019 (cancel_breakpoints): Delete.
1020 * tracepoint.c (clear_installed_tracepoints, stop_tracing)
1021 (upload_fast_traceframes): Remove references to
1026 * thread-db.c (find_new_threads_callback): Ignore thread if the
1027 kernel thread ID is -1.
1031 * linux-low.c (linux_attach_fail_reason_string): Move to
1032 nat/linux-ptrace.c, and rename.
1033 (linux_attach_lwp): Update comment.
1034 (attach_proc_task_lwp_callback): New function.
1035 (linux_attach): Adjust to rename and use
1036 linux_proc_attach_tgid_threads.
1037 (linux_attach_fail_reason_string): Delete declaration.
1041 * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
1042 * server.c (gdbserver_version): Likewise.
1046 * remote-utils.c: Include ctype.h.
1047 (input_interrupt): Explicitly handle the case when the char
1048 received is the NUL byte. Improve the printing of non-ASCII
1053 * linux-low.c (linux_low_filter_event): Update call to
1054 linux_enable_event_reporting following the addition of
1055 a new parameter to that function.
1060 * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
1061 (AARCH64_FPCR_REGNO): Likewise.
1062 (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
1063 (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
1064 (aarch64_store_fpregset): Likewise.
1068 * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
1069 Remove FIXME comment about assumption about N.
1073 * configure.ac: If large-file support is disabled in GDBserver,
1074 pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
1075 * configure: Regenerate.
1079 * linux-low.c (regsets_fetch_inferior_registers): Suppress the
1080 warning upon ENODATA from ptrace.
1081 * linux-s390-low.c (s390_store_tdb): New.
1082 (s390_regsets): Add regset for NT_S390_TDB.
1086 * linux-low.c (regsets_store_inferior_registers): Skip regsets
1087 without a fill_function.
1088 * linux-s390-low.c (s390_fill_last_break): Remove.
1089 (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
1090 (s390_arch_setup): Use regset's size instead of fill_function for
1095 * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
1096 the regset's store function when ptrace returned an error.
1097 * regcache.c (get_thread_regcache): Invalidate register cache
1098 before fetching inferior's registers.
1102 * linux-low.c (regsets_fetch_inferior_registers): Rephrase
1103 while-loop as for-loop.
1104 (regsets_store_inferior_registers): Likewise.
1108 * configure.ac(AC_CHECK_FUNCS): Remove readlink.
1109 * config.in, configure: Re-generate.
1110 * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
1115 * configure.ac: Don't invoke AC_FUNC_ALLOCA.
1116 (AC_CHECK_HEADERS): Remove malloc.h.
1117 * configure: Re-generated.
1118 * config.in: Re-generated.
1119 * server.h: Don't include alloca.h and malloc.h.
1120 * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
1121 Don't include malloc.h.
1125 * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
1126 corresponding ERRNO check in same block.
1130 * server.c (cont_thread): Update comment.
1131 (start_inferior, attach_inferior): No longer clear cont_thread.
1132 (handle_v_cont): No longer set cont_thread.
1133 (captured_main): Clear cont_thread each time a GDB connects.
1137 * linux-low.c (linux_wait_1): Don't force a wait for the Hc
1138 thread, and don't resume all threads if the Hc thread has exited.
1142 * linux-low.c (linux_request_interrupt): Always send a SIGINT to
1143 the process group instead of to a specific LWP.
1148 * win32-arm-low.c (arm_set_thread_context): Remove current_event
1150 (arm_set_thread_context): Delete.
1151 (the_low_target): Adjust.
1152 * win32-i386-low.c (debug_registers_changed)
1153 (debug_registers_used): Delete.
1154 (update_debug_registers_callback): New function.
1155 (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
1156 needing to update their debug registers.
1157 (win32_get_current_dr): New function.
1158 (x86_dr_low_get_addr, x86_dr_low_get_control)
1159 (x86_dr_low_get_status): Fetch the debug register from the thread
1161 (i386_initial_stuff): Adjust.
1162 (i386_get_thread_context): Remove current_event parameter. Don't
1163 clear debug_registers_changed nor copy DR values to
1165 (i386_set_thread_context): Delete.
1166 (i386_prepare_to_resume): New function.
1167 (i386_thread_added): Mark the thread as needing to update irs
1169 (the_low_target): Remove i386_set_thread_context and install
1170 i386_prepare_to_resume.
1171 * win32-low.c (win32_get_thread_context): Adjust.
1172 (win32_set_thread_context): Use SetThreadContext
1174 (win32_prepare_to_resume): New function.
1175 (win32_require_context): New function, factored out from ...
1176 (thread_rec): ... this.
1177 (continue_one_thread): Call win32_prepare_to_resume on each thread
1178 we're about to continue.
1179 (win32_resume): Call win32_prepare_to_resume on the event thread.
1180 * win32-low.h (struct win32_thread_info)
1181 <debug_registers_changed>: New field.
1182 (struct win32_target_ops): Change prototype of set_thread_context,
1183 delete set_thread_context and add prepare_to_resume.
1184 (win32_require_context): New declaration.
1188 * server.h: Do not include common-exceptions.h.
1192 * server.h: Do not include cleanups.h.
1196 * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
1201 * linux-low.c (lp_status_maybe_breakpoint): New function.
1202 (linux_low_filter_event): Call lp_status_maybe_breakpoint.
1203 (count_events_callback): Likewise.
1204 (select_event_lwp_callback): Likewise.
1205 (cancel_breakpoints_callback): Likewise.
1209 * linux-low.c (handle_extended_wait): Call
1210 linux_ptrace_get_extended_event.
1211 (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
1212 linux_is_extended_waitstatus.
1216 * Makefile.in (CPPFLAGS): Define.
1217 (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
1218 (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
1222 * inferiors.h (current_inferior): Renamed as...
1223 (current_thread): New variable. All uses updated.
1224 * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
1225 (maybe_move_out_of_jump_pad): Likewise.
1226 (cancel_breakpoint): Likewise.
1227 (linux_low_filter_event): Likewise.
1228 (wait_for_sigstop): Likewise.
1229 (linux_resume_one_lwp): Likewise.
1230 (need_step_over_p): Likewise.
1231 (start_step_over): Likewise.
1232 (linux_stabilize_threads): Renamed save_inferior as saved_thread.
1233 * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
1234 * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
1235 and save_inferior as saved_thread.
1236 * regcache.c (get_thread_regcache): Renamed saved_inferior as
1238 (regcache_invalidate_thread): Likewise.
1239 * remote-utils.c (prepare_resume_reply): Likewise.
1240 * thread-db.c (thread_db_get_tls_address): Likewise.
1241 (disable_thread_event_reporting): Likewise.
1242 (remove_thread_event_breakpoints): Likewise.
1243 * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
1245 * target.h (set_desired_inferior): Renamed as...
1246 (set_desired_thread): New declaration. All uses updated.
1247 * server.c (myresume): Updated comment to reference thread instead
1249 (handle_serial_event): Likewise.
1250 (handle_target_event): Likewise.
1255 * regcache.h: Include common-regcache.h.
1256 (regcache_read_pc): Don't declare.
1257 * regcache.c (get_thread_regcache_for_ptid): New function.
1262 * symbol.c: New file.
1263 * Makefile.in (SFILES): Add symbol.c.
1264 (OBS): Add symbol.o.
1268 * target.c (target_stop_ptid, target_continue_ptid): New
1274 * target.h: Include target/target.h.
1275 * target.c (target_read_memory, target_read_uint32)
1276 (target_write_memory): New functions.
1280 * server.h (debug_hw_points): Don't declare.
1281 * server.c (debug_hw_points): Don't define. Replace all uses
1282 with show_debug_regs.
1283 * linux-aarch64-low.c (debug_hw_points): Don't define. Replace
1284 all uses with show_debug_regs.
1288 * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
1289 endianness into account.
1290 (ppc_supply_ptrace_register): Likewise.
1294 * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
1295 to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
1299 * linux-x86-low.c (x86_linux_prepare_to_resume): Use
1300 ALL_DEBUG_ADDRESS_REGISTERS.
1304 * i386-low.h: Renamed as...
1305 * x86-low.h: New file. All type, function and variable name
1306 prefixes changed from "i386_" to "x86_". All references updated.
1307 * i386-low.c: Renamed as...
1308 * x86-low.c: New file. All type, function and variable name
1309 prefixes changed from "i386_" to "x86_". All references updated.
1313 * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
1314 (x86_linux_new_thread): Likewise.
1318 * server.h (setjmp.h): Do not include.
1319 (toplevel): Do not declare.
1320 (common-exceptions.h): Include.
1321 (cleanups.h): Likewise.
1322 * server.c (toplevel): Do not define.
1323 (exit_code): New static global.
1324 (detach_or_kill_for_exit_cleanup): New function.
1325 (main): New function. Original main renamed to...
1326 (captured_main): New function.
1327 * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
1331 * Makefile.in (SFILES): Add common/common-exceptions.c.
1332 (OBS): Add common-exceptions.o.
1333 (common-exceptions.o): New rule.
1334 * utils.c (prepare_to_throw_exception): New function.
1338 * config.in: Regenerate.
1339 * configure: Likewise.
1343 * Makefile.in (SFILES): Add common/cleanups.c.
1345 (cleanups.o): New rule.
1349 * utils.c (internal_vwarning): New function.
1353 * utils.h (fatal): Remove declaration.
1354 * utils.c (fatal): Remove function.
1358 * tracepoint.c (gdb_agent_init): Replace fatal with
1360 (initialize_tracepoint): Likewise.
1364 * remote-utils.c (remote_prepare): Replace fatal with error.
1368 * linux-low.c (linux_async): Replace fatal with warning.
1370 (linux_start_non_stop): Return -1 if linux_async failed.
1374 * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
1376 (i386_dr_low_get_addr): Remove vague comment.
1377 * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
1382 * inferiors.c (get_thread_process): Replace check with gdb_assert.
1383 * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
1385 (linux_resume_one_lwp): Likewise.
1386 * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
1388 * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
1389 with internal_error.
1390 * regcache.c (get_thread_regcache): Replace check with gdb_assert.
1391 (init_register_cache): Replace fatal with gdb_assert_not_reached.
1392 (find_register_by_name): Replace fatal with internal_error.
1393 (find_regno): Likewise.
1394 * tdesc.c (init_target_desc): Replace check with gdb_assert.
1395 * thread-db.c (thread_db_create_event): Likewise.
1396 (thread_db_load_search): Likewise.
1397 (try_thread_db_load_1): Likewise.
1398 * tracepoint.c (get_jump_space_head): Replace fatal with
1400 (claim_trampoline_space): Likewise.
1401 (have_fast_tracepoint_trampoline_buffer): Likewise.
1402 (cmd_qtstart): Likewise.
1403 (stop_tracing): Likewise.
1404 (fast_tracepoint_collecting): Likewise.
1405 (target_malloc): Likewise.
1406 (download_tracepoint): Likewise.
1407 (download_trace_state_variables): Replace check with gdb_assert.
1408 (upload_fast_traceframes): Replace fatal with internal_error.
1413 * Makefile.in (SFILES): Add common/common-debug.c.
1414 (OBS): Add common-debug.o.
1415 (common-debug.o): New rule.
1416 * debug.h (debug_printf): Don't declare.
1417 * debug.c (debug_printf): Renamed and rewritten as...
1418 (debug_vprintf): New function.
1422 * utils.h: Do not include print-utils.h.
1427 * server.h: Add static assertion.
1428 (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
1433 * Makefile.in (SFILES): Add common/errors.c.
1434 (OBS): Add errors.o.
1435 (IPA_OBS): Add errors-ipa.o.
1436 (errors.o): New rule.
1437 (errors-ipa.o): Likewise.
1438 * utils.h (perror_with_name, error, warning): Don't declare.
1439 * utils.c (warning): Renamed and rewritten as...
1440 (vwarning): New function.
1441 (error): Renamed and rewritten as...
1442 (verror): New function.
1443 (internal_error): Renamed and rewritten as...
1444 (internal_verror): New function.
1448 * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
1449 * configure: Regenerate.
1450 * config.in: Likewise.
1451 * server.h: Do not include errno.h.
1452 * event-loop.c: Likewise.
1453 * hostio-errno.c: Likewise.
1454 * linux-low.c: Likewise.
1455 * remote-utils.c: Likewise.
1456 * spu-low.c: Likewise.
1457 * utils.c: Likewise.
1458 * gdbreplay.c: Unconditionally include errno.h.
1462 * server.h: Do not include string.h.
1463 * event-loop.c: Likewise.
1464 * linux-low.c: Likewise.
1465 * regcache.c: Likewise.
1466 * remote-utils.c: Likewise.
1467 * spu-low.c: Likewise.
1468 * utils.c: Likewise.
1472 * server.h: Do not include gdb_assert.h.
1476 * server.h: Do not include common-utils.h.
1480 * server.h: Do not include ptid.h.
1481 * notif.h: Likewise.
1485 * server.h: Do not include gdb_locale.h.
1489 * server.h: Do not include gdb/signals.h.
1490 * win32-low.c: Likewise.
1494 * server.h: Do not include pathmax.h.
1498 * server.h: Do not include libiberty.h.
1499 * linux-bfin-low.c: Likewise.
1503 * server.h: Do not include ansidecl.h.
1507 * linux-x86-low.c: Do not include stddef.h.
1508 * lynx-ppc-low.c: Likewise.
1509 * tracepoint.c: Likewise.
1513 * server.h: Do not include stdarg.h.
1514 * nto-low.c: Likewise.
1518 * server.h: Do not include stdlib.h.
1519 * inferiors.c: Likewise.
1520 * linux-low.c: Likewise.
1521 * regcache.c: Likewise.
1522 * spu-low.c: Likewise.
1523 * tracepoint.c: Likewise.
1524 * utils.c: Likewise.
1528 * server.h: Do not include stdio.h.
1529 * linux-low.c: Likewise.
1530 * remote-utils.c: Likewise.
1531 * spu-low.c: Likewise.
1532 * utils.c: Likewise.
1533 * wincecompat.c: Likewise.
1537 * regcache.c (init_register_cache): Move conditionals inside if.
1541 * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
1545 * ax.h: Do not include server.h.
1546 * gdbthread.h: Likewise.
1547 * lynx-low.h: Likewise.
1548 * notif.h: Likewise.
1552 * server.h: Include common-defs.h.
1553 Do not include config.h or build-gnulib-gdbserver/config.h.
1557 * hostio-errno.c: Move server.h to top of includes list.
1558 * inferiors.c: Likewise.
1559 * linux-x86-low.c: Likewise.
1560 * notif.c: Include server.h.
1565 * server.h (CORE_ADDR): Now unsigned.
1569 * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
1573 * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
1578 * linux-low.c (kill_wait_lwp): New function, based on
1579 kill_one_lwp_callback, but use my_waitpid directly.
1580 (kill_one_lwp_callback, linux_kill): Use it.
1584 * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
1585 before setting DR0..DR3.
1589 * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
1590 * configure: Regenerated.
1591 * config.in: Likewise.
1595 * Makefile.in (SFILES): Update locations for files moved
1597 (object file files): Reordered.
1601 * i386-low.h (i386_dr_low_can_set_addr): Removed.
1602 (i386_dr_low_set_addr): Likewise.
1603 (i386_dr_low_get_addr): Likewise.
1604 (i386_dr_low_can_set_control): Likewise.
1605 (i386_dr_low_set_control): Likewise.
1606 (i386_dr_low_get_control): Likewise.
1607 (i386_dr_low_get_status): Likewise.
1608 (i386_get_debug_register_length): Likewise.
1609 * linux-x86-low.c (i386_dr_low_set_addr):
1610 Changed signature. Made static.
1611 (i386_dr_low_get_addr): Likewise.
1612 (i386_dr_low_set_control): Likewise.
1613 (i386_dr_low_get_control): Likewise.
1614 (i386_dr_low_get_status): Likewise.
1615 (i386_dr_low): New global variable.
1616 * win32-i386-low.c (i386_dr_low_set_addr):
1617 Changed signature. Made static.
1618 (i386_dr_low_get_addr): Likewise.
1619 (i386_dr_low_set_control): Likewise.
1620 (i386_dr_low_get_control): Likewise.
1621 (i386_dr_low_get_status): Likewise.
1622 (i386_dr_low): New global variable.
1626 * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
1627 * Makefile.in (AR, AR_FLAGS): Define.
1628 * configure: Regenerate.
1632 * Makefile.in (i386-dregs.o): New rule.
1633 * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
1634 * i386-low.c (target.h): Remove include.
1635 (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
1636 (DR_CONTROL_SHIFT): Likewise.
1637 (DR_CONTROL_SIZE): Likewise.
1638 (DR_RW_EXECUTE): Likewise.
1639 (DR_RW_WRITE): Likewise.
1640 (DR_RW_READ): Likewise.
1641 (DR_RW_IORW): Likewise.
1642 (DR_LEN_1): Likewise.
1643 (DR_LEN_2): Likewise.
1644 (DR_LEN_4): Likewise.
1645 (DR_LEN_8): Likewise.
1646 (DR_LOCAL_ENABLE_SHIFT): Likewise.
1647 (DR_GLOBAL_ENABLE_SHIFT): Likewise.
1648 (DR_ENABLE_SIZE): Likewise.
1649 (DR_LOCAL_SLOWDOWN): Likewise.
1650 (DR_GLOBAL_SLOWDOWN): Likewise.
1651 (DR_CONTROL_RESERVED): Likewise.
1652 (I386_DR_CONTROL_MASK): Likewise.
1653 (I386_DR_VACANT): Likewise.
1654 (I386_DR_LOCAL_ENABLE): Likewise.
1655 (I386_DR_GLOBAL_ENABLE): Likewise.
1656 (I386_DR_DISABLE): Likewise.
1657 (I386_DR_SET_RW_LEN): Likewise.
1658 (I386_DR_GET_RW_LEN): Likewise.
1659 (I386_DR_WATCH_HIT): Likewise.
1660 (i386_wp_op_t): Likewise.
1661 (i386_show_dr): Likewise.
1662 (i386_length_and_rw_bits): Likewise.
1663 (i386_insert_aligned_watchpoint): Likewise.
1664 (i386_remove_aligned_watchpoint): Likewise.
1665 (i386_handle_nonaligned_watchpoint): Likewise.
1666 i386_update_inferior_debug_regs(): Likewise.
1667 (i386_dr_insert_watchpoint): Likewise.
1668 (i386_dr_remove_watchpoint): Likewise.
1669 (i386_dr_region_ok_for_watchpoint): Likewise.
1670 (i386_dr_stopped_data_address): Likewise.
1671 (i386_dr_stopped_by_watchpoint): Likewise.
1675 * i386-low.c (i386_dr_show): Renamed to
1676 i386_show_dr and made static. All uses updated.
1677 (i386_dr_length_and_rw_bits): Renamed to
1678 i386_length_and_rw_bits and made static.
1680 (i386_dr_insert_aligned_watchpoint): Renamed to
1681 i386_insert_aligned_watchpoint and made static.
1683 (i386_dr_remove_aligned_watchpoint): Renamed to
1684 i386_remove_aligned_watchpoint and made static.
1686 (i386_dr_update_inferior_debug_regs): Renamed to
1687 i386_update_inferior_debug_regs and made static.
1692 * i386-low.h (i386_dr_low_can_set_addr): New macro.
1693 (i386_dr_low_can_set_control): Likewise.
1694 (i386_get_debug_register_length): Likewise.
1695 * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
1696 (i386_dr_low_can_set_control): Likewise.
1697 (i386_get_debug_register_length): Likewise.
1701 * i386-low.h (i386-dregs.h): New include.
1702 (DR_FIRSTADDR): Now in i386-dregs.h.
1703 (DR_LASTADDR): Likewise.
1704 (DR_NADDR): Likewise.
1705 (DR_STATUS): Likewise.
1706 (DR_CONTROL): Likewise.
1707 (i386_debug_reg_state): Likewise.
1708 (i386_dr_insert_watchpoint): Likewise.
1709 (i386_dr_remove_watchpoint): Likewise.
1710 (i386_dr_region_ok_for_watchpoint): Likewise.
1711 (i386_dr_stopped_data_address): Likewise.
1712 (i386_dr_stopped_by_watchpoint): Likewise.
1713 * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
1717 * i386-low.h (i386_low_insert_watchpoint): Renamed to
1718 i386_dr_insert_watchpoint.
1719 (i386_low_remove_watchpoint): Renamed to
1720 i386_dr_remove_watchpoint.
1721 (i386_low_region_ok_for_watchpoint): Renamed to
1722 i386_dr_region_ok_for_watchpoint.
1723 (i386_low_stopped_data_address): Renamed to
1724 i386_dr_stopped_data_address.
1725 (i386_low_stopped_by_watchpoint): Renamed to
1726 i386_dr_stopped_by_watchpoint.
1727 * i386-low.c (i386_show_dr): Renamed to
1728 i386_dr_show and made nonstatic. All uses updated.
1729 (i386_length_and_rw_bits): Renamed to
1730 i386_dr_length_and_rw_bits and made nonstatic.
1732 (i386_insert_aligned_watchpoint): Renamed to
1733 i386_dr_insert_aligned_watchpoint and made nonstatic.
1735 (i386_remove_aligned_watchpoint): Renamed to
1736 i386_dr_remove_aligned_watchpoint and made nonstatic.
1738 (i386_update_inferior_debug_regs): Renamed to
1739 i386_dr_update_inferior_debug_regs and made nonstatic.
1741 (i386_low_insert_watchpoint): Renamed to
1742 i386_dr_insert_watchpoint. All uses updated.
1743 (i386_low_remove_watchpoint): Renamed to
1744 i386_dr_remove_watchpoint. All uses updated.
1745 (i386_low_region_ok_for_watchpoint): Renamed to
1746 i386_dr_region_ok_for_watchpoint. All uses updated.
1747 (i386_low_stopped_data_address): Renamed to
1748 i386_dr_stopped_data_address. All uses updated.
1749 (i386_low_stopped_by_watchpoint): Renamed to
1750 i386_dr_stopped_by_watchpoint. All uses updated.
1754 * i386-low.c (i386_dr_low_can_set_addr): New macro.
1755 (i386_dr_low_can_set_control): Likewise.
1756 (i386_insert_aligned_watchpoint): New check.
1760 * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
1765 * i386-low.c (i386_length_and_rw_bits): Use internal_error
1766 instead of fatal and error.
1767 (i386_handle_nonaligned_watchpoint): Likewise.
1771 * i386-low.c (i386_get_debug_register_length): New macro.
1772 (TARGET_HAS_DR_LEN_8): Remove conditional. Use above macro.
1773 (i386_show_dr): Use debug_printf instead of fprintf. Use
1774 phex to format values.
1778 * i386-low.h: Comment changes.
1779 * i386-low.c: Likewise.
1783 * i386-low.c: Whitespace changes.
1787 * utils.c (freeargv): Remove.
1791 * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
1792 * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
1793 (parse_debug_format_options): Likewise.
1794 (gdbserver_usage): Likewise.
1795 * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
1796 (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
1797 (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
1799 ($(LIBGNU)): Depend on libiberty.
1800 (all-lib): Recurse into all subdirs.
1801 (install-only): Invoke "install" target in subdirs.
1802 (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
1804 * configure: Rebuild.
1805 * configure.ac: Add ACX_CONFIGURE_DIR for libiberty. Don't check
1806 for vasprintf, vsnprintf, or gettimeofday.
1807 * configure.srv: Don't add safe-ctype.o or lbasename.o to
1812 * development.sh: Delete.
1813 * Makefile.in (config.status): Adjust dependency on development.sh.
1814 * configure.ac: Adjust development.sh source call.
1815 * configure: Regenerate.
1819 * ax.c (gdb_free_agent_expr): New function.
1820 * ax.h (gdb_free_agent_expr): New declaration.
1821 * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
1823 (clear_breakpoint_conditions, clear_breakpoint_commands): Make
1825 (clear_breakpoint_conditions_and_commands): New function.
1826 * mem-break.h (clear_breakpoint_conditions): Delete declaration.
1827 (clear_breakpoint_conditions_and_commands): New declaration.
1831 * linux-aarch64-low.c (asm/ptrace.h): Include.
1835 Fix TLS access for -static -pthread.
1836 * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
1837 (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
1838 (thread_db_load_search, try_thread_db_load_1): Initialize it.
1842 * linux-aarch64-low.c (aarch64_insert_point)
1843 (aarch64_remove_point): No longer check whether the type is
1844 supported here. Adjust to new interface.
1845 (the_low_target): Install aarch64_supports_z_point_type as
1846 supports_z_point_type method.
1847 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
1848 (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
1849 instead of a Z packet char. Adjust.
1850 (arm_supports_z_point_type): New function.
1851 (arm_insert_point, arm_remove_point): Adjust to new interface.
1852 (the_low_target): Install arm_supports_z_point_type.
1853 * linux-crisv32-low.c (cris_supports_z_point_type): New function.
1854 (cris_insert_point, cris_remove_point): Adjust to new interface.
1855 Don't check whether the type is supported here.
1856 (the_low_target): Install cris_supports_z_point_type.
1857 * linux-low.c (linux_supports_z_point_type): New function.
1858 (linux_insert_point, linux_remove_point): Adjust to new interface.
1859 * linux-low.h (struct linux_target_ops) <insert_point,
1860 remove_point>: Take an enum raw_bkpt_type instead of a char. Add
1861 raw_breakpoint pointer parameter.
1862 <supports_z_point_type>: New method.
1863 * linux-mips-low.c (mips_supports_z_point_type): New function.
1864 (mips_insert_point, mips_remove_point): Adjust to new interface.
1865 Use mips_supports_z_point_type.
1866 (the_low_target): Install mips_supports_z_point_type.
1867 * linux-ppc-low.c (the_low_target): Install NULL as
1868 supports_z_point_type method.
1869 * linux-s390-low.c (the_low_target): Install NULL as
1870 supports_z_point_type method.
1871 * linux-sparc-low.c (the_low_target): Install NULL as
1872 supports_z_point_type method.
1873 * linux-x86-low.c (x86_supports_z_point_type): New function.
1874 (x86_insert_point): Adjust to new insert_point interface. Use
1875 insert_memory_breakpoint. Adjust to new
1876 i386_low_insert_watchpoint interface.
1877 (x86_remove_point): Adjust to remove_point interface. Use
1878 remove_memory_breakpoint. Adjust to new
1879 i386_low_remove_watchpoint interface.
1880 (the_low_target): Install x86_supports_z_point_type.
1881 * lynx-low.c (lynx_target_ops): Install NULL as
1882 supports_z_point_type callback.
1883 * nto-low.c (nto_supports_z_point_type): New.
1884 (nto_insert_point, nto_remove_point): Adjust to new interface.
1885 (nto_target_ops): Install nto_supports_z_point_type.
1886 * mem-break.c: Adjust intro comment.
1887 (struct raw_breakpoint) <raw_type, size>: New fields.
1888 <inserted>: Update comment.
1889 <shlib_disabled>: Delete field.
1890 (enum bkpt_type) <gdb_breakpoint>: Delete value.
1891 <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
1892 gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
1893 (raw_bkpt_type_to_target_hw_bp_type): New function.
1894 (find_enabled_raw_code_breakpoint_at): New function.
1895 (find_raw_breakpoint_at): New type and size parameters. Use them.
1896 (insert_memory_breakpoint): New function, based off
1897 set_raw_breakpoint_at.
1898 (remove_memory_breakpoint): New function.
1899 (set_raw_breakpoint_at): Reimplement.
1900 (set_breakpoint): New, based on set_breakpoint_at.
1901 (set_breakpoint_at): Reimplement.
1902 (delete_raw_breakpoint): Go through the_target->remove_point
1903 instead of assuming memory breakpoints.
1904 (find_gdb_breakpoint_at): Delete.
1905 (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
1906 (find_gdb_breakpoint): New function.
1907 (set_gdb_breakpoint_at): Delete.
1908 (z_type_supported): New function.
1909 (set_gdb_breakpoint_1): New function, loosely based off
1910 set_gdb_breakpoint_at.
1911 (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
1912 (delete_gdb_breakpoint_at): Delete.
1913 (delete_gdb_breakpoint_1): New function, loosely based off
1914 delete_gdb_breakpoint_at.
1915 (delete_gdb_breakpoint): New function.
1916 (clear_gdb_breakpoint_conditions): Rename to ...
1917 (clear_breakpoint_conditions): ... this. Don't handle a NULL
1919 (add_condition_to_breakpoint): Make static.
1920 (add_breakpoint_condition): Take a struct breakpoint pointer
1921 instead of an address. Adjust.
1922 (gdb_condition_true_at_breakpoint): Rename to ...
1923 (gdb_condition_true_at_breakpoint_z_type): ... this, and add
1925 (gdb_condition_true_at_breakpoint): Reimplement.
1926 (add_breakpoint_commands): Take a struct breakpoint pointer
1927 instead of an address. Adjust.
1928 (gdb_no_commands_at_breakpoint): Rename to ...
1929 (gdb_no_commands_at_breakpoint_z_type): ... this. Add z_type
1930 parameter. Return true if no breakpoint was found. Change debug
1932 (gdb_no_commands_at_breakpoint): Reimplement.
1933 (run_breakpoint_commands): Rename to ...
1934 (run_breakpoint_commands_z_type): ... this. Add z_type parameter,
1935 and change return type to boolean.
1936 (run_breakpoint_commands): New function.
1937 (gdb_breakpoint_here): Also check for Z1 breakpoints.
1938 (uninsert_raw_breakpoint): Don't try to reinsert a disabled
1939 breakpoint. Go through the_target->remove_point instead of
1940 assuming memory breakpoint.
1941 (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
1942 software and hardware breakpoints.
1943 (reinsert_raw_breakpoint): Go through the_target->insert_point
1944 instead of assuming memory breakpoint.
1945 (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
1946 software and hardware breakpoints.
1947 (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
1948 Check both software and hardware breakpoints.
1949 (validate_inserted_breakpoint): Assert the breakpoint is a
1950 software breakpoint. Set the inserted flag to -1 instead of
1951 setting shlib_disabled.
1952 (delete_disabled_breakpoints): Adjust.
1953 (validate_breakpoints): Only validate software breakpoints.
1954 Adjust to inserted flag change.
1955 (check_mem_read, check_mem_write): Skip breakpoint types other
1956 than software breakpoints. Adjust to inserted flag change.
1957 * mem-break.h (enum raw_bkpt_type): New enum.
1958 (raw_breakpoint, struct process_info): Forward declare.
1959 (Z_packet_to_target_hw_bp_type): Delete declaration.
1960 (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
1961 (set_gdb_breakpoint, delete_gdb_breakpoint)
1962 (clear_breakpoint_conditions): New declarations.
1963 (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
1964 (breakpoint_inserted_here): Update comment.
1965 (add_breakpoint_condition, add_breakpoint_commands): Replace
1966 address parameter with a breakpoint pointer parameter.
1967 (gdb_breakpoint_here): Update comment.
1968 (delete_gdb_breakpoint_at): Delete.
1969 (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
1970 * server.c (process_point_options): Take a struct breakpoint
1971 pointer instead of an address. Adjust.
1972 (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
1973 delete_gdb_breakpoint.
1974 * spu-low.c (spu_target_ops): Install NULL as
1975 supports_z_point_type method.
1976 * target.h: Include mem-break.h.
1977 (struct target_ops) <prepare_to_access_memory>: Update comment.
1978 <supports_z_point_type>: New field.
1979 <insert_point, remove_point>: Take an enum raw_bkpt_type argument
1980 instead of a char. Also take a raw breakpoint pointer.
1981 * win32-arm-low.c (the_low_target): Install NULL as
1982 supports_z_point_type.
1983 * win32-i386-low.c (i386_supports_z_point_type): New function.
1984 (i386_insert_point, i386_remove_point): Adjust to new interface.
1985 (the_low_target): Install i386_supports_z_point_type.
1986 * win32-low.c (win32_supports_z_point_type): New function.
1987 (win32_insert_point, win32_remove_point): Adjust to new interface.
1988 (win32_target_ops): Install win32_supports_z_point_type.
1989 * win32-low.h (struct win32_target_ops):
1990 <supports_z_point_type>: New method.
1991 <insert_point, remove_point>: Take an enum raw_bkpt_type argument
1992 instead of a char. Also take a raw breakpoint pointer.
1996 * mem-break.h: Include break-common.h.
1997 (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
1998 (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
1999 (Z_packet_to_target_hw_bp_type): New declaration.
2000 * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
2001 * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
2002 (Z_PACKET_ACCESS_WP): Delete macros.
2003 (Z_packet_to_hw_type): Delete function.
2004 * i386-low.h: Don't include break-common.h here.
2005 (Z_packet_to_hw_type): Delete declaration.
2006 * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
2007 Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
2008 * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
2009 Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
2010 * linux-aarch64-low.c: Don't include break-common.h here.
2011 (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
2012 (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
2013 (Z_packet_to_target_hw_bp_type): Delete function.
2014 * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
2016 (mips_insert_point, mips_remove_point): Use
2017 Z_packet_to_target_hw_bp_type.
2021 * linux-aarch64-low.c: Include break-common.h.
2022 (enum target_point_type): Delete.
2023 (Z_packet_to_point_type): Rename to ...
2024 (Z_packet_to_target_hw_bp_type): ... this, and return a
2025 target_hw_bp_type instead.
2026 (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
2027 instead of an enum target_point_type.
2028 (aarch64_point_encode_ctrl_reg): Likewise. Compute type mask from
2030 (aarch64_dr_state_insert_one_point)
2031 (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
2032 (aarch64_handle_aligned_watchpoint)
2033 (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
2034 Take an enum target_hw_bp_type instead of an enum
2036 (aarch64_supports_z_point_type): New function.
2037 (aarch64_insert_point, aarch64_remove_point): Use it. Adjust to
2038 use Z_packet_to_target_hw_bp_type.
2042 * configure.ac: Only use -Werror by default when DEVELOPMENT
2044 * configure: Regenerate.
2048 Fix gdbserver qGetTLSAddr for x86_64 -m32.
2049 * linux-x86-low.c (X86_64_USER_REGS): New.
2050 (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
2054 * Makefile.in (i386-avx512.c): Fix the typo of generated file
2060 * linux-low.c (linux_attach_fail_reason_string): New function.
2061 (linux_attach_lwp): Delete.
2062 (linux_attach_lwp_1): Rename to ...
2063 (linux_attach_lwp): ... this. Take a ptid instead of a pid as
2064 argument. Remove "initial" parameter. Return int instead of
2065 void. Don't error or warn here.
2066 (linux_attach): Adjust to call linux_attach_lwp. Call error on
2067 failure to attach to the tgid. Call warning when failing to
2069 * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
2070 argument. Remove "initial" parameter. Return int instead of
2071 void. Don't error or warn here.
2072 (linux_attach_fail_reason_string): New declaration.
2073 * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
2074 interface change. Use linux_attach_fail_reason_string.
2079 * Makefile.in: Added rules to handle new files
2080 i386-avx512.c i386-avx512-linux.c amd64-avx512.c
2081 amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
2082 * configure.srv (srv_i386_regobj): Add i386-avx512.o.
2083 (srv_i386_linux_regobj): Add i386-avx512-linux.o.
2084 (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
2085 (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
2087 (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
2088 (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
2089 (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
2090 i386/x32-avx512.xml.
2091 (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
2092 (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
2093 i386/x32-avx512-linux.xml.
2094 * i387-fp.c (num_avx512_k_registers): New constant for number
2096 (num_avx512_zmmh_low_registers): New constant for number of
2097 lower ZMM registers (0-15).
2098 (num_avx512_zmmh_high_registers): New constant for number of
2099 higher ZMM registers (16-31).
2100 (num_avx512_ymmh_registers): New contant for number of higher
2101 YMM registers (ymm16-31 added by avx521 on x86_64).
2102 (num_avx512_xmm_registers): New constant for number of higher
2103 XMM registers (xmm16-31 added by AVX512 on x86_64).
2104 (struct i387_xsave): Add space for AVX512 registers.
2105 (i387_cache_to_xsave): Change raw buffer size to 64 characters.
2106 Add code to handle AVX512 registers.
2107 (i387_xsave_to_cache): Add code to handle AVX512 registers.
2108 * linux-x86-low.c (init_registers_amd64_avx512_linux): New
2109 prototypei from generated file.
2110 (tdesc_amd64_avx512_linux): Likewise.
2111 (init_registers_x32_avx512_linux): Likewise.
2112 (tdesc_x32_avx512_linux): Likewise.
2113 (init_registers_i386_avx512_linux): Likewise.
2114 (tdesc_i386_avx512_linux): Likewise.
2115 (x86_64_regmap): Add AVX512 registers.
2116 (x86_linux_read_description): Add code to handle AVX512 XSTATE
2118 (initialize_low_arch): Add code to initialize AVX512 registers.
2122 * mem-break.c (find_gdb_breakpoint_at): Make static.
2123 * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
2127 * i386-low.c: Don't include break-common.h here.
2128 (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
2129 prototype to take target_hw_bp_type as argument instead of a Z
2131 * i386-low.h: Include break-common.h here.
2132 (Z_packet_to_hw_type): Declare.
2133 (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
2135 * linux-x86-low.c (x86_insert_point): Convert the packet number to
2136 a target_hw_bp_type before calling i386_low_insert_watchpoint.
2137 (x86_remove_point): Convert the packet number to a
2138 target_hw_bp_type before calling i386_low_remove_watchpoint.
2139 * win32-i386-low.c (i386_insert_point): Convert the packet number
2140 to a target_hw_bp_type before calling i386_low_insert_watchpoint.
2141 (i386_remove_point): Convert the packet number to a
2142 target_hw_bp_type before calling i386_low_remove_watchpoint.
2146 * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
2150 * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
2151 Check if the condition or command is NULL before checking if the
2152 breakpoint is known. On success, return true.
2153 * mem-break.h (add_breakpoint_condition): Document return.
2154 (add_breakpoint_commands): Add describing comment.
2155 * server.c (skip_to_semicolon): New function.
2156 (process_point_options): Use it.
2160 * linux-low.c (linux_read_loadmap): Pass current_inferior directly
2166 * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
2168 * linux-low.c (delete_lwp, handle_extended_wait): Add debug
2170 (last_thread_of_process_p): Take a PID argument instead of a
2172 (linux_wait_for_lwp): Delete.
2173 (num_lwps, check_zombie_leaders, not_stopped_callback): New
2175 (linux_low_filter_event): New function, party factored out from
2176 linux_wait_for_event.
2177 (linux_wait_for_event): Rename to ...
2178 (linux_wait_for_event_filtered): ... this. Add new filter ptid
2179 argument. Partly rewrite. Always use waitpid(-1, WNOHANG) and
2180 sigsuspend. Check for zombie leaders.
2181 (linux_wait_for_event): Reimplement as wrapper around
2182 linux_wait_for_event_filtered.
2183 (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED. Assume that if
2184 a normal or signal exit is seen, it's the whole process exiting.
2185 (wait_for_sigstop): No longer a for_each_inferior callback.
2186 Rewrite on top of linux_wait_for_event_filtered.
2187 (stop_all_lwps): Call wait_for_sigstop directly.
2188 * server.c (resume, handle_target_event): Handle
2189 TARGET_WAITKIND_NO_RESUMED.
2193 * win32-low.c (psapi_get_dll_name,
2194 * win32_CreateToolhelp32Snapshot): Delete.
2195 (win32_CreateToolhelp32Snapshot, win32_Module32First)
2196 (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
2198 (handle_load_dll): Add function description.
2199 Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
2203 * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
2205 (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
2206 base address when calling win32_add_one_solib.
2207 (handle_load_dll): Delete local variable load_addr.
2208 Remove 0x1000 offset applied to DLL base address when calling
2209 win32_add_one_solib.
2210 (handle_unload_dll): Add comment.
2214 * win32-low.c (win32_add_all_dlls): Renames
2215 win32_ensure_ntdll_loaded. Rewrite function documentation.
2216 Adjust implementation to always load all DLLs.
2217 Add 0x1000 offset to DLL base address when calling
2218 win32_add_one_solib.
2219 (child_initialization_done): New static global.
2220 (do_initial_child_stuff): Set child_initialization_done to
2221 zero during child initialization, and 1 after. Replace call
2222 to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
2224 (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
2225 (handle_unload_dll): Add function documentation.
2226 (get_child_debug_event): Ignore load and unload DLL events
2227 during child initialization.
2231 Remove global all_lwps.
2232 * inferiors.h (ptid_of): Move here from linux-low.h.
2233 (pid_of, lwpid_of): Ditto.
2234 * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
2235 parameter is a struct thread_info * now.
2236 (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
2237 directly. Pass &all_threads to find_inferior instead of &all_lwps.
2238 (aarch64_stopped_data_address): Fetch lwpid from current_inferior
2240 (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
2241 (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
2242 * linux-arm-low.c (update_registers_callback): Update, "entry"
2243 parameter is a struct thread_info * now.
2244 Fetch lwpid from current_inferior directly.
2245 (arm_insert_point): Pass &all_threads to find_inferior instead of
2247 (arm_remove_point): Ditto.
2248 (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
2249 (arm_prepare_to_resume): Fetch pid from thread.
2250 (arm_read_description): Fetch lwpid from current_inferior directly.
2251 * linux-low.c (all_lwps): Delete.
2252 (delete_lwp): Delete call to remove_inferior.
2253 (handle_extended_wait): Fetch lwpid from thread.
2254 (add_lwp): Don't set lwp->entry.id. Remove call to
2255 add_inferior_to_list.
2256 (linux_attach_lwp_1): Fetch pid from current_inferior directly.
2257 (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
2258 (kill_one_lwp_callback): Ditto.
2259 (linux_kill): Don't dereference NULL pointer.
2260 Fetch ptid,lwpid from thread.
2261 (get_detach_signal): Fetch ptid from thread.
2262 (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
2263 Simplify call to regcache_invalidate_thread.
2264 (delete_lwp_callback): Update, "entry" parameter is a
2265 struct thread_info * now. Fetch pid from thread.
2266 (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
2267 (status_pending_p_callback): Update, "entry" parameter is a
2268 struct thread_info * now. Fetch ptid from thread.
2269 (find_lwp_pid): Update, "entry" parameter is a
2270 struct thread_info * now.
2271 (linux_wait_for_lwp): Fetch pid from thread.
2272 (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
2273 (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
2274 (enqueue_one_deferred_signal): Fetch lwpid from thread.
2275 (dequeue_one_deferred_signal): Ditto.
2276 (cancel_breakpoint): Fetch ptid from current_inferior.
2277 (linux_wait_for_event): Pass &all_threads to find_inferior,
2278 not &all_lwps. Fetch ptid, lwpid from thread.
2279 (count_events_callback): Update, "entry" parameter is a
2280 struct thread_info * now.
2281 (select_singlestep_lwp_callback): Ditto.
2282 (select_event_lwp_callback): Ditto.
2283 (cancel_breakpoints_callback): Ditto.
2284 (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
2286 (select_event_lwp): Ditto. Fetch ptid from event_thread.
2287 (unsuspend_one_lwp): Update, "entry" parameter is a
2288 struct thread_info * now.
2289 (unsuspend_all_lwps): Pass &all_threads to find_inferior,
2291 (linux_stabilize_threads): Ditto. And for for_each_inferior.
2292 Fetch lwpid from thread, not lwp.
2293 (linux_wait_1): Fetch ptid, lwpid from current_inferior.
2294 Pass &all_threads to find_inferior, not &all_lwps.
2295 (send_sigstop): Fetch lwpid from thread, not lwp.
2296 (send_sigstop_callback): Update, "entry" parameter is a
2297 struct thread_info * now.
2298 (suspend_and_send_sigstop_callback): Ditto.
2299 (wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp.
2300 (stuck_in_jump_pad_callback): Update, "entry" parameter is a
2301 struct thread_info * now.
2302 (move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid
2304 (lwp_running): Update, "entry" parameter is a
2305 struct thread_info * now.
2306 (stop_all_lwps): Fetch ptid from thread.
2307 Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
2308 (linux_resume_one_lwp): Fetch lwpid from thread.
2309 (linux_set_resume_request): Update, "entry" parameter is a
2310 struct thread_info * now. Fetch pid, lwpid from thread.
2311 (resume_status_pending_p): Update, "entry" parameter is a
2312 struct thread_info * now.
2313 (need_step_over_p): Ditto. Fetch lwpid from thread.
2314 (start_step_over): Fetch lwpid from thread.
2315 (linux_resume_one_thread): Update, "entry" parameter is a
2316 struct thread_info * now. Fetch lwpid from thread.
2317 (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
2318 (proceed_one_lwp): Update, "entry" parameter is a
2319 struct thread_info * now. Fetch lwpid from thread.
2320 (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
2321 struct thread_info * now.
2322 (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
2323 (unstop_all_lwps): Ditto. Fetch lwpid from thread.
2324 (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
2326 (regsets_store_inferior_registers): Ditto.
2327 (fetch_register, store_register): Ditto.
2328 (linux_read_memory, linux_write_memory): Ditto.
2329 (linux_request_interrupt): Ditto.
2330 (linux_read_auxv): Ditto.
2331 (linux_xfer_siginfo): Ditto.
2332 (linux_qxfer_spu): Ditto.
2333 (linux_qxfer_libraries_svr4): Ditto.
2334 * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
2335 moved to inferiors.h.
2337 (get_thread_lwp): Update.
2338 (struct lwp_info): Delete member "entry". Simplify comment for
2341 * linux-mips-low.c (mips_read_description): Fetch lwpid from
2342 current_inferior directly.
2343 (update_watch_registers_callback): Update, "entry" parameter is a
2344 struct thread_info * now. Fetch pid from thread.
2345 (mips_linux_prepare_to_resume): Fetch ptid from thread.
2346 (mips_insert_point): Fetch lwpid from current_inferior.
2347 Pass &all_threads to find_inferior, not &all_lwps.
2348 (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
2349 (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
2351 (mips_stopped_data_address): Ditto.
2352 * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
2354 * linux-tile-low.c (tile_arch_setup): Ditto.
2355 * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
2356 (update_debug_registers_callback): Update, "entry" parameter is a
2357 struct thread_info * now. Fetch pid from thread.
2358 (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
2359 Pass &all_threads to find_inferior, not &all_lwps.
2360 (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
2361 (i386_dr_low_set_control): Fetch pid from current_inferior directly.
2362 Pass &all_threads to find_inferior, not &all_lwps.
2363 (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
2364 (i386_dr_low_get_status): Ditto.
2365 (x86_linux_prepare_to_resume): Fetch ptid from thread.
2366 (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
2367 (x86_linux_read_description): Ditto.
2368 * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2372 * inferiors.c (get_first_inferior): Fix buglet.
2376 * gdbthread.h (add_thread): Change result type to struct thread_info *.
2377 * inferiors.c (add_thread): Change result type to struct thread_info *.
2378 All callers updated.
2379 (add_lwp): Call add_thread here instead of in callers.
2380 All callers updated.
2381 * linux-low.h (get_lwp_thread): Rewrite.
2382 (struct lwp_info): New member "thread".
2386 * linux-low.c (add_lwp): Change result to struct lwp_info *.
2387 All callers updated.
2391 * inferiors.c (add_thread): Fix whitespace.
2395 * dll.c (clear_dlls): Replace accessing list implemention details
2397 * gdbthread.h (get_first_thread): Declare.
2398 * inferiors.c (for_each_inferior_with_data): New function.
2399 (get_first_thread): New function.
2400 (find_thread_ptid): Simplify.
2401 (get_first_inferior): New function.
2402 (clear_list): Delete.
2403 (one_inferior_p): New function.
2404 (clear_inferior_list): New function.
2405 (clear_inferiors): Update.
2406 * inferiors.h (for_each_inferior_with_data): Declare.
2407 (clear_inferior_list): Declare.
2408 (one_inferior_p): Declare.
2409 (get_first_inferior): Declare.
2410 * linux-low.c (linux_wait_for_event): Replace accessing list
2411 implemention details with API function.
2412 * server.c (target_running): Ditto.
2413 (accumulate_file_name_length): New function.
2414 (emit_dll_description): New function.
2415 (handle_qxfer_libraries): Replace accessing list implemention
2416 details with API function.
2417 (handle_qxfer_threads_worker): New function.
2418 (handle_qxfer_threads_proper): Replace accessing list implemention
2419 details with API function.
2420 (handle_query): Ditto.
2421 (visit_actioned_threads_callback_ftype): New typedef.
2422 (visit_actioned_threads_data): New struct.
2423 (visit_actioned_threads): Rewrite to be find_inferior callback.
2424 (resume): Call find_inferior.
2425 (handle_status): Replace accessing list implemention
2426 details with API function.
2427 (process_serial_event): Replace accessing list implemention details
2429 * target.c (set_desired_inferior): Replace accessing list implemention
2430 details with API function.
2431 * tracepoint.c (same_process_p): New function.
2432 (gdb_agent_about_to_close): Replace accessing list implemention
2433 details with API function.
2434 * win32-low.c (child_delete_thread): Replace accessing list
2435 implemention details with API function.
2436 (match_dll_by_basename): New function.
2437 (dll_is_loaded_by_basename): New function.
2438 (win32_ensure_ntdll_loaded): Replace accessing list implemention
2439 details call to dll_is_loaded_by_basename.
2443 * dll.h (struct dll_info): Add comment.
2444 * gdbthread.h (struct thread_info): Add comment.
2445 (current_ptid): Simplify.
2446 * inferiors.c (add_process): Update.
2447 (remove_process): Update.
2448 * inferiors.h (struct process_info): Rename member "head" to "entry".
2449 * linux-low.c (delete_lwp): Update.
2451 (last_thread_of_process_p): Update.
2452 (kill_one_lwp_callback, linux_kill): Update.
2453 (status_pending_p_callback): Update.
2454 (wait_for_sigstop): Update. Simplify read of ptid.
2455 (start_step_over): Update.
2456 * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
2457 (get_lwp_thread): Update.
2458 (struct lwp_info): Rename member "head" to "entry".
2459 * regcache.h (inferior_list_entry): Delete.
2460 * server.c (kill_inferior_callback): Update.
2461 (detach_or_kill_inferior_callback): Update.
2462 (print_started_pid): Update.
2463 (print_attached_pid): Update.
2464 (process_serial_event): Simplify read of ptid.
2465 * thread-db.c (thread_db_create_event): Update.
2466 (thread_db_get_tls_address): Update.
2467 * win32-low.c (current_inferior_ptid): Simplify.
2471 * target.h (struct target_ops) <supports_btrace>: Add target_ops
2473 (target_supports_btrace): Update.
2477 * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
2478 (rsp-low-ipa.o): New target.
2482 * ax.c (gdb_parse_agent_expr): Use hex2bin, not
2483 convert_ascii_to_int.
2484 * regcache.c (registers_to_string): Likewise.
2485 * remote-utils.c (decode_M_packet): Likewise.
2486 * server.c (process_serial_event): Likewise.
2490 * server.c (handle_query, handle_v_run): Use hex2bin, not
2492 * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
2496 * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
2497 convert_int_to_ascii.
2498 * regcache.c (registers_to_string, collect_register_as_string):
2500 * remote-utils.c (look_up_one_symbol, relocate_instruction):
2502 * server.c (process_serial_event): Likewise.
2503 * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
2504 (cmd_qtbuffer, cstr_to_hexstr): Likewise.
2508 * remote-utils.c (look_up_one_symbol, monitor_output): Use
2509 bin2hex, not hexify.
2510 * tracepoint.c (cmd_qtstatus): Likewise.
2514 * remote-utils.c (monitor_output): Pass explicit length to
2519 * tracepoint.c: Include rsp-low.h.
2520 * server.c: Include rsp-low.h.
2521 * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
2522 (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
2524 * remote-utils.c: Include rsp-low.h.
2525 (fromhex, hexchars, ishex, unhexify, tohex, hexify)
2526 (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
2527 (convert_int_to_ascii, convert_ascii_to_int): Move to
2529 * regcache.c: Include rsp-low.h.
2530 * ax.c: Include rsp-low.h.
2531 * Makefile.in (SFILES): Add common/rsp-low.c.
2532 (OBS): Add rsp-low.o.
2533 (rsp-low.o): New target.
2537 * utils.h (pulongest, plongest, phex_nz): Don't declare.
2538 Include print-utils.h.
2539 * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
2540 (plongest, thirty_two, phex_nz): Remove.
2541 * Makefile.in (SFILES): Add common/print-utils.c.
2542 (OBS): Add print-utils.o.
2543 (print-utils-ipa.o): New target.
2544 (print-utils.o): New target.
2545 (IPA_OBJS): Add print-utils-ipa.o.
2549 * Makefile.in (SFILES): Fix indentation.
2553 * linux-low.c (linux_wait_for_event): Improve comment.
2554 (linux_wait_1): Keep current_inferior in sync with event_child.
2558 * gdbthread.h (gdb_id_to_thread): Delete, unused.
2562 * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
2563 * configure: Regenerate.
2564 * config.in: Regenerate.
2565 * Makefile.in (SFILES): Add debug.c.
2567 * debug.c: New file.
2568 * debug.h: New file.
2569 * linux-aarch64-low.c (*): Update all debugging printfs to use
2570 debug_printf instead of fprintf.
2571 * linux-arm-low.c (*): Ditto.
2572 * linux-cris-low.c (*): Ditto.
2573 * linux-crisv32-low.c (*): Ditto.
2574 * linux-m32r-low.c (*): Ditto.
2575 * linux-sparc-low.c (*): Ditto.
2576 * linux-x86.c (*): Ditto.
2577 * linux-low.c (*): Ditto.
2578 (linux_wait_1): Add calls to debug_enter, debug_exit.
2579 (linux_wait): Remove redundant debugging printf.
2580 (stop_all_lwps): Add calls to debug_enter, debug_exit.
2581 (linux_resume, unstop_all_lwps): Ditto.
2582 * mem-break.c (*): Update all debugging printfs to use
2583 debug_printf instead of fprintf.
2584 * remote-utils.c (*): Ditto.
2585 * thread-db.c (*): Ditto.
2586 * server.c #include <ctype.h>, "gdb_vecs.h".
2587 (debug_threads): Moved to debug.c.
2588 (*): Update all debugging printfs to use debug_printf instead of
2590 (start_inferior): Replace call to fflush with call to debug_flush.
2591 (monitor_show_help): Mention set debug-format.
2592 (parse_debug_format_options): New function.
2593 (handle_monitor_command): Handle "monitor set debug-format".
2594 (gdbserver_usage): Mention --debug-format.
2595 (main): Parse --debug-format.
2596 * server.h (debug_threads): Declaration moved to debug.h.
2598 * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
2599 trace_debug_1 that uses debug_printf.
2600 (tracepoint_look_up_symbols): Update all debugging printfs to use
2601 debug_printf instead of fprintf.
2605 * linux-xtensa-low.c: Include asm/ptrace.h instead of
2611 * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
2612 defined after including gdb_proc_service.h.
2616 * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
2617 (match_dll): Use it.
2621 * target.h (target_ops) <read_btrace>: Change parameters and
2622 return type to allow error reporting.
2623 * server.c (handle_qxfer_btrace): Support delta reads. Pass
2624 trace reading errors on.
2625 * linux-low.c (linux_low_read_btrace): Pass trace reading
2627 (linux_low_disable_btrace): New.
2631 * inferiors.c (thread_id_to_gdb_id): Delete.
2632 * inferiors.h (thread_id_to_gdb_id): Delete.
2636 * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
2637 "-I$(srcdir)/../". Fixes MinGW compilation errors with old GCC
2642 * server.c (handle_status): Don't discard previous queued stop
2643 replies or thread's pending status here.
2644 (main) <disconnection>: Do it here instead.
2648 * gdbthread.h (struct thread_info) <status_pending_p>: New field.
2649 * server.c (visit_actioned_threads, handle_pending_status): New
2651 (handle_v_cont): Factor out parts to ...
2652 (resume): ... this new function. If in all-stop, and a thread
2653 being resumed has a pending status, report it without actually
2655 (myresume): Adjust to use the new 'resume' function.
2656 (clear_pending_status_callback, set_pending_status_callback)
2657 (find_status_pending_thread_callback): New functions.
2658 (handle_status): Handle the case of multiple threads having
2659 interesting statuses to report. Report threads' real last signal
2660 instead of always reporting GDB_SIGNAL_TRAP. Look for a thread
2661 with an interesting thread to report the status for, instead of
2662 always reporting the status of the first thread.
2666 * gdbserver.c (gdbserver_version): Set copyright year to 2014.
2667 * gdbreplay.c (gdbreplay_version): Likewise.
2671 * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
2672 iov.iov_len with the real length in use.
2676 * Makefile.in (safe-ctype.o, lbasename.o): New rules.
2677 * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
2678 for all targets that use win32-low.c.
2679 * win32-low.c (win32_ensure_ntdll_loaded): New function.
2680 (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
2684 * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
2685 if equal to TARGET_WAITKIND_LOADED.
2686 * win32-low.c (cached_status): New static global.
2687 (win32_wait): Add declaration.
2688 (do_initial_child_stuff): Flush all initial pending debug events
2689 up to the initial breakpoint.
2690 (win32_wait): If CACHED_STATUS was set, return that instead
2691 of doing a real wait. Remove the code resuming the execution
2692 of the inferior after receiving a TARGET_WAITKIND_LOADED event
2693 during the initial phase. Also remove the code changing
2694 OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
2695 TARGET_WAITKIND_STOPPED.
2699 * notif.c (handle_notif_ack): Return 0 if no notification
2704 * linux-low.c (linux_set_resume_request): Fix comment.
2708 * linux-low.c (resume_status_pending_p): Tweak comment.
2712 * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
2713 amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
2714 * configure.srv (srv_i386_regobj): Add i386-mpx.o.
2715 (srv_i386_linux_regobj): Add i386-mpx-linux.o.
2716 (srv_amd64_regobj): Add amd64-mpx.o.
2717 (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
2718 (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
2719 (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
2720 * i387-fp.c (num_pl_bnd_register) Added constant.
2721 (num_pl_bnd_cfg_registers) Added constant.
2722 (struct i387_xsave) Added reserved area and MPX fields.
2723 (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
2724 * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
2726 (tdesc_i386_mpx_linux): Add MPX amd64 target.
2727 (init_registers_amd64_mpx_linux): Declare new function.
2728 (tdesc_amd64_mpx_linux): Add MPX amd64 target.
2729 (x86_64_regmap): Add MPX registers.
2730 (x86_linux_read_description): Add MPX case.
2731 (initialize_low_arch): Initialize MPX targets.
2735 * configure: Rebuild.
2736 * configure.ac: Don't check for stdlib.h.
2737 * gdbreplay.c: Unconditionally include stdlib.h.
2741 * config.in: Rebuild.
2742 * configure: Rebuild.
2743 * configure.ac: Don't use AC_HEADER_DIRENT.
2747 * server.h: Don't check HAVE_STRING_H.
2748 * gdbreplay.c: Don't check HAVE_STRING_H.
2749 * configure: Rebuild.
2753 * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
2758 * configure, config.in: Rebuild.
2759 * configure.ac: Remove unused configury.
2763 * acinclude.m4: Include common.m4, codeset.m4.
2764 * configure, config.in: Rebuild.
2765 * configure.ac: Use GDB_AC_COMMON.
2769 * linux-s390-low.c (HWCAP_S390_TE): New define.
2770 (s390_arch_setup): Consider the TE field in the HWCAP for
2771 determining 'have_regset_tdb'.
2776 * tracepoint.c (download_tracepoint_1): Remove unnecessary double
2781 * server.c (process_serial_event): Don't output "GDBserver
2782 exiting" if GDB is connected through stdio.
2783 * target.c (mywait): Likewise, be silent if GDB is connected
2788 * lynx-low.c (lynx_add_threads_after_attach): New function.
2789 (lynx_attach): Remove call to add_thread. Add call to
2790 lynx_add_threads_after_attach instead.
2794 * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
2795 * config.in, configure: Regenerated.
2800 * server.c (start_inferior): Clear 'resume_info'.
2804 * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
2809 * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
2810 linux-tile-low.o to srv_tgtobj.
2814 * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
2819 * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
2820 (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
2821 (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
2822 (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
2823 (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
2824 (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
2828 * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
2829 explicit header dependencies and use $COMPILE/$POSTCOMPILE.
2833 * linux-amd64-ipa.c: Include tracepoint.h.
2834 * linux-i386-ipa.c: Include tracepoint.h.
2838 * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
2839 (ps_get_thread_area): New function.
2843 * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
2844 (initialize_low_arch): Call init_registers_crisv32 rather than
2845 init_register_crisv32.
2849 * server.h (handle_vFile, hostio_last_error_from_errno): Move
2851 * hostio.h: ... this new file.
2852 * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
2853 win32-low.c: Include hostio.h.
2857 * server.h (gdb_client_data, handler_func, callback_handler_func)
2858 (delete_file_handler, add_file_handler, append_callback_event)
2859 (delete_callback_event, start_event_loop, initialize_event_loop):
2860 Move to event-loop.h and include it.
2861 * event-loop.h: New file.
2865 * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
2866 * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
2867 (loaded_dll, unloaded_dll): Move to ...
2868 * dll.h: ... this new file.
2869 * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
2873 * server.h (current_process, get_thread_process, all_processes)
2874 (add_inferior_to_list, for_each_inferior, current_inferior)
2875 (remove_inferior, add_process, remove_process, find_process_pid)
2876 (have_started_inferiors_p, have_attached_inferiors_p)
2877 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
2878 (clear_inferiors, find_inferior, find_inferior_id)
2879 (inferior_target_data, set_inferior_target_data)
2880 (inferior_regcache_data, set_inferior_regcache_data): Move to
2881 inferiors.h, and include it.
2882 * inferiors.h: New file.
2886 * server.h (struct emit_ops, current_insn_ptr, emit_error):
2892 * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
2894 * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
2895 (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
2896 (handle_tracepoint_general_set, handle_tracepoint_query)
2897 (tracepoint_finished_step, tracepoint_was_hit)
2898 (release_while_stepping_state_list, current_traceframe)
2899 (in_readonly_region, traceframe_read_mem)
2900 (fetch_traceframe_registers, traceframe_read_sdata)
2901 (traceframe_read_info, struct fast_tpoint_collect_status)
2902 (fast_tracepoint_collecting, force_unlock_trace_buffer)
2903 (handle_tracepoit_bkpts, initialize_low_tracepoint)
2904 (supply_fast_tracepoint_registers)
2905 (supply_static_tracepoint_registers, set_trampoline_buffer_space)
2906 (ipa_tdesc, claim_trampoline_space)
2907 (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
2908 (agent_mem_read, agent_get_trace_state_variable_value)
2909 (agent_set_trace_state_variable_value, agent_tsv_read)
2910 (agent_mem_read_string, get_raw_reg_func_addr)
2911 (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
2912 * tracepoint.h: ... this new file.
2916 * server.h (perror_with_name, error, fatal, warning, paddress)
2917 (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
2919 * utils.h: New file.
2923 * server.h (remote_debug, noack_mode, transport_is_reliable)
2924 (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
2925 (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
2926 (getpkt, remote_prepare, remote_open, remote_close, write_ok)
2927 (write_enn, initialize_async_io, enable_async_io)
2928 (disable_async_io, check_remote_input_interrupt_request)
2929 (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
2930 (dead_thread_notify, prepare_resume_reply)
2931 (decode_address_to_semicolon, decode_address, decode_m_packet)
2932 (decode_M_packet, decode_X_packet, decode_xfer_write)
2933 (decode_search_memory_packet, unhexify, hexify)
2934 (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
2935 (look_up_one_symbol, relocate_instruction)
2936 (monitor_output): Move to remote-utils.h, and include it.
2937 * remote-utils.h: New file.
2941 * server.h (_): Delete.
2945 * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
2946 (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
2948 (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
2952 * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
2953 or WriteProcessMemory complete successfully and handle
2954 ERROR_PARTIAL_COPY error.
2958 * server.c (gdb_read_memory): Return -1 on traceframe memory read
2959 error instead of EIO.
2964 * linux-low.c: Include filestuff.h.
2965 (linux_create_inferior) <pid == 0>: Call close_most_fds.
2966 * lynx-low.c: Include filestuff.h.
2967 (lynx_create_inferior) <pid == 0>: Call close_most_fds.
2968 * server.c: Include filestuff.h.
2969 (main): Call notice_open_fds.
2970 * spu-low.c: Include filestuff.h.
2971 (spu_create_inferior) <pid == 0>: Call close_most_fds.
2975 * Makefile.in: Explain why ../target and ../nat are not
2976 listed as include file search paths.
2977 (linux-waitpid.o): New object file rule.
2978 * configure.srv (srv_native_linux_obj): New variable.
2979 Replace all occurrences of linux native object files with
2980 $srv_native_linux_obj.
2981 * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
2982 (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
2983 (linux_enable_event_reporting): Remove declaration.
2984 (my_waitpid): Moved to common/linux-waitpid.c.
2985 (linux_wait_for_event): Pass ptid when calling
2986 linux_enable_event_reporting.
2987 (linux_supports_tracefork_flag): Remove.
2988 (linux_enable_event_reporting): Likewise.
2989 (linux_tracefork_grandchild): Remove.
2990 (STACK_SIZE): Moved to common/linux-ptrace.c.
2991 (linux_tracefork_child): Remove.
2992 (linux_test_for_tracefork): Remove.
2993 (linux_look_up_symbols): Call linux_supports_traceclone.
2994 (initialize_low): Remove call to linux_test_for_tracefork.
2995 * linux-low.h (PTRACE_TYPE_ARG3): Move to
2996 common/linux-ptrace.h.
2997 (PTRACE_TYPE_ARG4): Likewise.
2998 Include linux-ptrace.h.
3002 * config.in: Renegerate.
3006 * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
3007 (SFILES): Remove $(srcdir)/common/target-common.c and
3008 add $(srcdir)/target/waitstatus.c.
3009 (OBS): Remove target-common.o and add waitstatus.o.
3010 (server_h): Remove $(srcdir)/../common/target-common.h and
3011 add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
3012 and $(srcdir)/../target/waitstatus.h.
3013 (target-common.o): Remove.
3014 (waitstatus.o): New target object file.
3015 * target.h: Do not include target-common.h and
3016 include target/resume.h, target/wait.h and
3017 target/waitstatus.h.
3021 * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
3022 to PTRACE_TYPE_ARG3.
3023 * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
3024 to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
3026 * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
3027 (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
3033 * Makefile.in (SFILES): Add common/mips-linux-watch.c.
3034 (mips-linux-watch.o): New rule.
3035 (mips_linux_watch_h): New variable.
3036 * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
3038 * linux-mips-low.c: Include mips-linux-watch.h.
3039 (struct arch_process_info, struct arch_lwp_info): New.
3040 (update_watch_registers_callback): New function.
3041 (mips_linux_new_process, mips_linux_new_thread) New functions.
3042 (mips_linux_prepare_to_resume, mips_insert_point): New
3044 (mips_remove_point, mips_stopped_by_watchpoint): New
3046 (rsp_bp_type_to_target_hw_bp_type): New function.
3047 (mips_stopped_data_address): New function.
3048 (the_low_target): Add watchpoint support functions.
3052 * i386-low.c: Include break-common.h.
3053 (enum target_hw_bp_type): Remove.
3057 * Makefile.in (SFILES): /common/target-common.c.
3058 (OBS): Add target-common.o.
3059 (server_h): Add $(srcdir)/../common/target-common.h.
3060 (target-common.o): New target.
3061 * server.c (queue_stop_reply_callback): Free
3062 status string after use.
3063 * target.c (target_waitstatus_to_string): Remove.
3064 * target.h: Include target-common.h.
3065 (resume_kind): Likewise.
3066 (target_waitkind): Likewise.
3067 (target_waitstatus): Likewise.
3068 (TARGET_WNOHANG): Likewise.
3072 * Makefile.in (host_alias): Use @host_noncanonical@.
3073 (target_alias): Use @target_noncanonical@.
3074 * configure.ac: Use ACX_NONCANONICAL_TARGET and
3075 ACX_NONCANONICAL_HOST.
3076 * configure: Regenerated.
3081 * configure.ac (version_host, version_target): Set and AC_SUBST them.
3082 * configure: Rebuild.
3083 * Makefile.in (version_host, version_target): Get from configure.
3084 (version.c): Use $(version_host) and $(version_target).
3088 * Makefile.in (config.status): Depend on development.sh.
3089 * acinclude.m4: Include libmcheck.m4.
3090 * configure: Regenerate.
3094 * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
3095 attribute inside the parentheses.
3096 (winapi_DebugSetProcessKillOnExit): Ditto.
3097 (winapi_DebugBreakProcess): Ditto.
3098 (winapi_GenerateConsoleCtrlEvent): Ditto.
3102 * notif.h (notif_event): Add a dummy member to avoid compiler
3107 * hostio.c (HOSTIO_PATH_MAX): Define.
3108 (require_filename, handle_open, handle_unlink, handle_readlink):
3113 * server.h: Include "pathmax.h".
3114 * linux-low.c: Don't include sys/param.h.
3115 (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
3117 * win32-low.c: Don't include sys/param.h.
3118 (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
3122 * event-loop.c: Don't check HAVE_UNISTD_H before including
3124 * gdbreplay.c: Likewise.
3125 * remote-utils.c: Likewise.
3126 * server.c: Likewise.
3127 * configure.ac: Don't check for unistd.h.
3128 * configure: Regenerate.
3132 * Makefile.in (version.c): Use version.in, not
3137 * configure.ac (version_host, version_target): Set and AC_SUBST them.
3138 * configure: Rebuild.
3139 * Makefile.in (version_host, version_target): Get from configure.
3140 (version.c): Use $(version_host) and $(version_target).
3144 Fix trace-status to output user name without trailing colon.
3145 * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
3149 Fix trace-status to output proper start-time and stop-time.
3150 * tracepoint.c (cmd_qtstatus): Modify trace-status output to
3151 output start time and stop time in hex as gdb expects.
3155 * tracepoint.c (build_traceframe_info_xml): Output trace state
3156 variables present in the trace buffer.
3160 * Makefile.in (version.c): Use bfd/version.h, common/version.in,
3162 (version.o): Remove.
3163 * gdbreplay.c: Include version.h.
3164 (version, host_name): Don't declare.
3165 * server.h: Include version.h.
3166 (version, host_name): Don't declare.
3170 * linux-x86-low.c (linux_is_elf64): Delete global.
3171 (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
3172 with local linux_pid_exe_is_elf_64_file use.
3176 * linux-low.c (regset_disabled, disable_regset): New functions.
3177 (regsets_fetch_inferior_registers)
3178 (regsets_store_inferior_registers): Use them.
3179 (initialize_regsets_info); Don't allocate the disabled_regsets
3181 * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
3186 * linux-low.c (initialize_regsets_info): Use xcalloc instead of
3191 * linux-x86-low.c (initialize_low_arch): Call
3192 init_registers_x32_avx_linux.
3196 Fix compatibility with Android Bionic.
3197 * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
3203 * Makefile.in (OBS): Add tdesc.o.
3204 (IPA_OBJS): Add tdesc-ipa.o.
3205 (tdesc-ipa.o): New rule.
3206 * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
3208 * linux-low.c (new_inferior): Delete.
3209 (disabled_regsets, num_regsets): Delete.
3210 (linux_add_process): Adjust to set the new per-process
3212 (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
3213 (linux_wait_for_lwp): Adjust. Only call arch_setup if the event
3214 was a stop. When calling arch_setup, switch the current inferior
3215 to the thread that got an event.
3216 (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
3217 (regsets_fetch_inferior_registers)
3218 (regsets_store_inferior_registers): New regsets_info parameter.
3220 (linux_register_in_regsets): New regs_info parameter. Adjust to
3222 (register_addr, fetch_register, store_register): New usrregs_info
3223 parameter. Adjust to use it.
3224 (usr_fetch_inferior_registers, usr_store_inferior_registers): New
3225 parameter regs_info. Adjust to use it.
3226 (linux_fetch_registers): Get the current inferior's regs_info, and
3228 (linux_store_registers): Ditto.
3229 [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
3230 (initialize_low): Don't initialize the target_regsets here. Call
3231 initialize_low_arch.
3232 * linux-low.h (target_regsets): Delete declaration.
3233 (struct regsets_info): New.
3234 (struct usrregs_info): New.
3235 (struct regs_info): New.
3236 (struct process_info_private) <new_inferior>: New field.
3237 (struct linux_target_ops): Delete the num_regs, regmap, and
3238 regset_bitmap fields. New field regs_info.
3239 [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
3240 * i387-fp.c (num_xmm_registers): Delete.
3241 (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
3242 calls to new interface.
3243 (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
3244 (i387_xsave_to_cache): Adjust find_regno calls to new interface.
3245 Infer the number of xmm registers from the regcache's target
3247 * i387-fp.h (num_xmm_registers): Delete.
3248 * inferiors.c (add_thread): Don't install the thread's regcache
3250 * proc-service.c (gregset_info): Fetch the current inferior's
3251 regs_info. Adjust to use it.
3252 * regcache.c: Include tdesc.h.
3253 (register_bytes, reg_defs, num_registers)
3254 (gdbserver_expedite_regs): Delete.
3255 (get_thread_regcache): If the thread doesn't have a regcache yet,
3256 create one, instead of aborting gdbserver.
3257 (regcache_invalidate_one): Rename to ...
3258 (regcache_invalidate_thread): ... this.
3259 (regcache_invalidate_one): New.
3260 (regcache_invalidate): Only invalidate registers of the current
3262 (init_register_cache): Add target_desc parameter, and use it.
3263 (new_register_cache): Ditto. Assert the target description has a
3264 non zero registers_size.
3265 (regcache_cpy): Add assertions. Adjust.
3266 (realloc_register_cache, set_register_cache): Delete.
3267 (registers_to_string, registers_from_string): Adjust.
3268 (find_register_by_name, find_regno, find_register_by_number)
3269 (register_cache_size): Add target_desc parameter, and use it.
3270 (free_register_cache_thread, free_register_cache_thread_one)
3271 (regcache_release, register_cache_size): New.
3272 (register_size): Add target_desc parameter, and use it.
3273 (register_data, supply_register, supply_register_zeroed)
3274 (supply_regblock, supply_register_by_name, collect_register)
3275 (collect_register_as_string, collect_register_by_name): Adjust.
3276 * regcache.h (struct target_desc): Forward declare.
3277 (struct regcache) <tdesc>: New field.
3278 (init_register_cache, new_register_cache): Add target_desc
3280 (regcache_invalidate_thread): Declare.
3281 (regcache_invalidate_one): Delete declaration.
3282 (regcache_release): Declare.
3283 (find_register_by_number, register_cache_size, register_size)
3284 (find_regno): Add target_desc parameter.
3285 (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
3287 * remote-utils.c: Include tdesc.h.
3288 (outreg, prepare_resume_reply): Adjust.
3289 * server.c: Include tdesc.h.
3290 (gdbserver_xmltarget): Delete declaration.
3291 (get_features_xml, process_serial_event): Adjust.
3292 * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
3294 (struct process_info) <tdesc>: New field.
3295 (ipa_tdesc): Declare.
3296 * tdesc.c: New file.
3297 * tdesc.h: New file.
3298 * tracepoint.c: Include tdesc.h.
3299 [IN_PROCESS_AGENT] (ipa_tdesc): Define.
3300 (get_context_regcache): Adjust to pass ipa_tdesc down.
3301 (do_action_at_tracepoint): Adjust to get the register cache size
3302 from the context regcache's description.
3303 (traceframe_walk_blocks): Adjust to get the register cache size
3304 from the current trace frame's description.
3305 (traceframe_get_pc): Adjust to get current trace frame's
3306 description and pass it down.
3307 (gdb_collect): Adjust to get the register cache size from the
3309 * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
3310 (gdbserver_xmltarget): Delete.
3311 (initialize_low_tracepoint): Set the ipa's target description.
3312 * linux-i386-ipa.c (tdesc_i386_linux): Declare.
3313 (initialize_low_tracepoint): Set the ipa's target description.
3314 * linux-x86-low.c: Include tdesc.h.
3315 [__x86_64__] (is_64bit_tdesc): New.
3316 (ps_get_thread_area, x86_get_thread_area): Use it.
3317 (i386_cannot_store_register): Rename to ...
3318 (x86_cannot_store_register): ... this. Use is_64bit_tdesc.
3319 (i386_cannot_fetch_register): Rename to ...
3320 (x86_cannot_fetch_register): ... this. Use is_64bit_tdesc.
3321 (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
3323 (target_regsets): Rename to ...
3324 (x86_regsets): ... this.
3325 (x86_get_pc, x86_set_pc): Adjust register_size calls to new
3327 (x86_siginfo_fixup): Use is_64bit_tdesc.
3328 [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
3329 (tdesc_x32_avx_linux, tdesc_x32_linux)
3330 (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
3332 (x86_linux_update_xmltarget): Delete.
3333 (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
3334 (have_ptrace_getfpxregs, have_ptrace_getregset): New.
3335 (AMD64_LINUX_USER64_CS): New.
3336 (x86_linux_read_description): New, based on
3337 x86_linux_update_xmltarget.
3338 (same_process_callback): New.
3339 (x86_arch_setup_process_callback): New.
3340 (x86_linux_update_xmltarget): New.
3341 (x86_regsets_info): New.
3342 (amd64_linux_regs_info): New.
3343 (i386_linux_usrregs_info): New.
3344 (i386_linux_regs_info): New.
3345 (x86_linux_regs_info): New.
3346 (x86_arch_setup): Reimplement.
3347 (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
3348 (x86_emit_ops): Ditto.
3349 (the_low_target): Adjust. Install x86_linux_regs_info,
3350 x86_cannot_fetch_register, and x86_cannot_store_register.
3351 (initialize_low_arch): New.
3352 * linux-ia64-low.c (tdesc_ia64): Declare.
3353 (ia64_fetch_register): Adjust.
3354 (ia64_usrregs_info, regs_info): New globals.
3355 (ia64_regs_info): New function.
3356 (the_low_target): Adjust.
3357 (initialize_low_arch): New function.
3358 * linux-sparc-low.c (tdesc_sparc64): Declare.
3359 (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
3361 (sparc_arch_setup): New function.
3362 (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
3363 (the_low_target): Adjust.
3364 (initialize_low_arch): New function.
3365 * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
3366 (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
3367 (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
3368 (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
3369 (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
3370 (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
3371 (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
3372 (tdesc_powerpc_isa205_vsx64l): Declare.
3373 (ppc_cannot_store_register, ppc_collect_ptrace_register)
3374 (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
3375 (ppc_set_pc, ppc_get_hwcap): Adjust.
3376 (ppc_usrregs_info): Forward declare.
3377 (!__powerpc64__) ppc_regmap_adjusted: New global.
3378 (ppc_arch_setup): Adjust to the current process'es target
3380 (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
3381 (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
3382 (ppc_store_evrregset): Adjust.
3383 (target_regsets): Rename to ...
3384 (ppc_regsets): ... this, and make static.
3385 (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
3386 (ppc_regs_info): New function.
3387 (the_low_target): Adjust.
3388 (initialize_low_arch): New function.
3389 * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
3390 (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
3391 (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
3392 (tdesc_s390x_linux64v2): Declare.
3393 (s390_collect_ptrace_register, s390_supply_ptrace_register)
3394 (s390_fill_gregset, s390_store_last_break): Adjust.
3395 (target_regsets): Rename to ...
3396 (s390_regsets): ... this, and make static.
3397 (s390_get_pc, s390_set_pc): Adjust.
3398 (s390_get_hwcap): New target_desc parameter, and use it.
3399 [__s390x__] (have_hwcap_s390_high_gprs): New global.
3400 (s390_arch_setup): Adjust to set the current process'es target
3401 description. Don't adjust the regmap.
3402 (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
3403 [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
3404 (regs_info_3264): New globals.
3405 (s390_regs_info): New function.
3406 (the_low_target): Adjust.
3407 (initialize_low_arch): New function.
3408 * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
3409 (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
3410 [__mips64] (init_registers_mips_linux)
3411 (init_registers_mips_dsp_linux): Delete defines.
3412 [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
3413 (have_dsp): New global.
3414 (mips_read_description): New, based on mips_arch_setup.
3415 (mips_arch_setup): Reimplement.
3416 (get_usrregs_info): New function.
3417 (mips_cannot_fetch_register, mips_cannot_store_register)
3418 (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
3419 (mips_fill_fpregset, mips_store_fpregset): Adjust.
3420 (target_regsets): Rename to ...
3421 (mips_regsets): ... this, and make static.
3422 (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
3423 (dsp_regs_info, regs_info): New globals.
3424 (mips_regs_info): New function.
3425 (the_low_target): Adjust.
3426 (initialize_low_arch): New function.
3427 * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
3428 (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
3430 (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
3431 (arm_read_description): New, with bits factored from
3433 (arm_arch_setup): Reimplement.
3434 (target_regsets): Rename to ...
3435 (arm_regsets): ... this, and make static.
3436 (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
3437 (arm_regs_info): New function.
3438 (the_low_target): Adjust.
3439 (initialize_low_arch): New function.
3440 * linux-m68k-low.c (tdesc_m68k): Declare.
3441 (target_regsets): Rename to ...
3442 (m68k_regsets): ... this, and make static.
3443 (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
3444 (m68k_regs_info): New function.
3445 (m68k_arch_setup): New function.
3446 (the_low_target): Adjust.
3447 (initialize_low_arch): New function.
3448 * linux-sh-low.c (tdesc_sharch): Declare.
3449 (target_regsets): Rename to ...
3450 (sh_regsets): ... this, and make static.
3451 (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
3452 (sh_regs_info, sh_arch_setup): New functions.
3453 (the_low_target): Adjust.
3454 (initialize_low_arch): New function.
3455 * linux-bfin-low.c (tdesc_bfin): Declare.
3456 (bfin_arch_setup): New function.
3457 (bfin_usrregs_info, regs_info): New globals.
3458 (bfin_regs_info): New function.
3459 (the_low_target): Adjust.
3460 (initialize_low_arch): New function.
3461 * linux-cris-low.c (tdesc_cris): Declare.
3462 (cris_arch_setup): New function.
3463 (cris_usrregs_info, regs_info): New globals.
3464 (cris_regs_info): New function.
3465 (the_low_target): Adjust.
3466 (initialize_low_arch): New function.
3467 * linux-cris-low.c (tdesc_crisv32): Declare.
3468 (cris_arch_setup): New function.
3469 (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
3470 (cris_regs_info): New function.
3471 (the_low_target): Adjust.
3472 (initialize_low_arch): New function.
3473 * linux-m32r-low.c (tdesc_m32r): Declare.
3474 (m32r_arch_setup): New function.
3475 (m32r_usrregs_info, regs_info): New globals.
3476 (m32r_regs_info): Adjust.
3477 (initialize_low_arch): New function.
3478 * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
3479 (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
3480 (tic6x_usrregs_info): Forward declare.
3481 (tic6x_read_description): New function, based on ...
3482 (tic6x_arch_setup): ... this. Reimplement.
3483 (target_regsets): Rename to ...
3484 (tic6x_regsets): ... this, and make static.
3485 (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
3486 (tic6x_regs_info): New function.
3487 (the_low_target): Adjust.
3488 (initialize_low_arch): New function.
3489 * linux-xtensa-low.c (tdesc_xtensa): Declare.
3490 (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
3491 (target_regsets): Rename to ...
3492 (xtensa_regsets): ... this, and make static.
3493 (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
3495 (xtensa_arch_setup, xtensa_regs_info): New functions.
3496 (the_low_target): Adjust.
3497 (initialize_low_arch): New function.
3498 * linux-nios2-low.c (tdesc_nios2_linux): Declare.
3499 (nios2_arch_setup): Set the current process'es tdesc.
3500 (target_regsets): Rename to ...
3501 (nios2_regsets): ... this.
3502 (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
3503 (nios2_regs_info): New function.
3504 (the_low_target): Adjust.
3505 (initialize_low_arch): New function.
3506 * linux-aarch64-low.c (tdesc_aarch64): Declare.
3507 (aarch64_arch_setup): Set the current process'es tdesc.
3508 (target_regsets): Rename to ...
3509 (aarch64_regsets): ... this.
3510 (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
3511 (aarch64_regs_info): New function.
3512 (the_low_target): Adjust.
3513 (initialize_low_arch): New function.
3514 * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
3516 (target_regsets): Rename to ...
3517 (tile_regsets): ... this.
3518 (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
3519 (tile_regs_info): New function.
3520 (tile_arch_setup): Set the current process'es tdesc.
3521 (the_low_target): Adjust.
3522 (initialize_low_arch): New function.
3523 * spu-low.c (tdesc_spu): Declare.
3524 (spu_create_inferior, spu_attach): Set the new process'es tdesc.
3525 * win32-arm-low.c (tdesc_arm): Declare.
3526 (arm_arch_setup): New function.
3527 (the_low_target): Install arm_arch_setup instead of
3529 * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
3530 (init_windows_x86): Rename to ...
3531 (i386_arch_setup): ... this. Set `win32_tdesc'.
3532 (the_low_target): Adjust.
3533 * win32-low.c (win32_tdesc): New global.
3534 (child_add_thread): Don't create the thread cache here.
3535 (do_initial_child_stuff): Set the new process'es tdesc.
3536 * win32-low.h (struct target_desc): Forward declare.
3537 (win32_tdesc): Declare.
3538 * lynx-i386-low.c (tdesc_i386): Declare global.
3539 (lynx_i386_arch_setup): Set `lynx_tdesc'.
3540 * lynx-low.c (lynx_tdesc): New global.
3541 (lynx_add_process): Set the new process'es tdesc.
3542 * lynx-low.h (struct target_desc): Forward declare.
3543 (lynx_tdesc): Declare global.
3544 * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
3545 (lynx_ppc_arch_setup): Set `lynx_tdesc'.
3546 * nto-low.c (nto_tdesc): New global.
3547 (do_attach): Set the new process'es tdesc.
3548 * nto-low.h (struct target_desc): Forward declare.
3549 (nto_tdesc): Declare.
3550 * nto-x86-low.c (tdesc_i386): Declare.
3551 (nto_x86_arch_setup): Set `nto_tdesc'.
3555 * server.c (handle_query): Add "augmented-libraries-svr4-read+"
3556 to qSupported response when appropriate.
3557 (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
3558 with nonzero-length annex.
3559 * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
3560 arguments supplied in annex.
3565 * linux-x86-low.c (ps_get_thread_area): Properly extend address to
3566 64 bits in 64-cross-32 environment.
3570 * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
3571 (aarch64-without-fpu.c): Delete rule.
3572 * configure.srv (aarch64*-*-linux*): Remove references to
3573 aarch64-without-fpu.o and aarch64-without-fpu.xml.
3574 * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
3579 * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
3580 instead of strchr/decode_address. Error if the range isn't split
3581 with a ','. Don't assume there's be a ':' in the action.
3586 * linux-low.c (lwp_in_step_range): New function.
3587 (linux_wait_1): If the thread was range stepping and stopped
3588 outside the stepping range, report the stop to GDB. Otherwise,
3589 continue stepping. Add range stepping debug output.
3590 (linux_set_resume_request): Copy the step range from the resume
3592 (linux_supports_range_stepping): New.
3593 (linux_target_ops) <supports_range_stepping>: Set to
3594 linux_supports_range_stepping.
3595 * linux-low.h (struct linux_target_ops)
3596 <supports_range_stepping>: New field.
3597 (struct lwp_info) <step_range_start, step_range_end>: New fields.
3598 * linux-x86-low.c (x86_supports_range_stepping): New.
3599 (the_low_target) <supports_range_stepping>: Set to
3600 x86_supports_range_stepping.
3601 * server.c (handle_v_cont): Handle 'r' action.
3602 (handle_v_requests): Append ";r" if the target supports range
3604 * target.h (struct thread_resume) <step_range_start,
3605 step_range_end>: New fields.
3606 (struct target_ops) <supports_range_stepping>:
3608 (target_supports_range_stepping): New macro.
3612 * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
3613 confusion in comment.
3617 * lynx-low.c (struct process_info_private): New type.
3618 (lynx_add_process): New function.
3619 (lynx_create_inferior, lynx_attach): Replace calls to
3620 add_process by calls to lynx_add_process.
3621 (lynx_resume): If PTID is null, then try using
3622 current_process()->private->last_wait_event_ptid.
3624 (lynx_clear_inferiors): Delete. The contents of that function
3625 has been inlined in lynx_mourn;
3626 (lynx_wait_1): Save the ptid in the process's private data.
3627 (lynx_mourn): Free the process' private data. Replace call
3628 to lynx_clear_inferiors by call to clear_inferiors.
3632 * i386-low.c (i386_length_and_rw_bits): Move the comment to
3637 * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
3638 PT_DATA_ADDR and PT_TEXT_END_ADDR. Update comments.
3639 (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
3640 PT_TEXT_END_ADDR guards. Update comments.
3641 (linux_target_op) <read_offsets>: Conditionally define to
3642 linux_read_offsets if the target is UCLIBC and if it defines
3643 PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
3648 * Makefile.in (SFILES): Add linux-nios2-low.c.
3649 (clean): Add action to delete nios2-linux.c.
3650 (nios2-linux.c): New rule.
3651 * configure.srv: Add nios2*-*-linux*.
3652 * linux-nios2-low.c: New.
3656 * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
3661 * ax.c (ax_printf): Add fflush.
3665 * Makefile.in (SFILES): Add filestuff.c.
3666 (OBS): Add filestuff.o.
3667 (filestuff.o): New target.
3668 * config.in, configure: Rebuild.
3669 * configure.ac: Check for fdwalk, pipe2.
3673 * configure.ac (USE_THREAD_DB): Delete variable.
3674 (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
3675 Don't AC_SUBST USE_THREAD_DB.
3676 * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
3677 * config.in, configure: Regenerate.
3681 * linux-low.h (struct lwp_info) <thread_known>: Move under
3682 the USE_THREAD_DB #ifdef.
3686 * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
3687 (linux-low.o): Delete rule.
3688 * linux-low.h: Always include "gdb_thread_db.h" instead of
3689 conditionally including thread_db.h.
3690 (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
3695 * Makefile.in (install-only): Fix make install regression.
3699 Convert man pages to texinfo, new gdbinit.5 texinfo page.
3700 * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
3702 * gdbserver.1: Remove.
3706 * linux-low.c (handle_extended_wait): Don't call
3707 linux_enable_event_reporting.
3712 * Makefile.in (SHELL): Use @SHELL@.
3716 * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
3721 * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
3722 Remove extraneous NULL element.
3726 * tracepoint.c (traceframe_read_tsv): Look for the last matched
3727 'V' block in trace frame.
3731 * target.h (struct target_ops): Add btrace ops.
3732 (target_supports_btrace): New macro.
3733 (target_enable_btrace): New macro.
3734 (target_disable_btrace): New macro.
3735 (target_read_btrace): New macro.
3736 * gdbthread.h (struct thread_info): Add btrace field.
3737 * server.c: Include btrace-common.h.
3738 (handle_btrace_general_set): New function.
3739 (handle_btrace_enable): New function.
3740 (handle_btrace_disable): New function.
3741 (handle_general_set): Call handle_btrace_general_set.
3742 (handle_qxfer_btrace): New function.
3743 (struct qxfer qxfer_packets[]): Add btrace entry.
3744 * inferiors.c (remove_thread): Disable btrace.
3745 * linux-low: Include linux-btrace.h.
3746 (linux_low_enable_btrace): New function.
3747 (linux_low_read_btrace): New function.
3748 (linux_target_ops): Add btrace ops.
3749 * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
3750 Add srv_linux_btrace=yes.
3751 (x86_64-*-linux*): Add linux-btrace.o.
3752 Add srv_linux_btrace=yes.
3753 * configure.ac: Define HAVE_LINUX_BTRACE.
3754 * config.in: Regenerated.
3755 * configure: Regenerated.
3759 * server.c (handle_qxfer): Preserve error message if -3 is
3761 (qxfer): Document the -3 return value.
3765 * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
3766 (linux_btrace_h): New variable.
3767 (linux-btrace.o): New rule.
3772 * tracepoint.c (trace_buffer_size): New global.
3773 (DEFAULT_TRACE_BUFFER_SIZE): New define.
3774 (init_trace_buffer): Change to one-argument function. Allocate
3775 trace buffer memory.
3776 (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
3777 handle QTBuffer:size packet.
3778 (cmd_bigqtbuffer_size): New function.
3779 (initialize_tracepoint): Call init_trace_buffer with
3780 DEFAULT_TRACE_BUFFER_SIZE.
3781 * server.c (handle_query): Add QTBuffer:size in the
3786 * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
3787 (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
3789 (cmd_qtsp): Adjust condition. Do post increment.
3790 Set cur_action and cur_step_action back to 0.
3795 * linux-low.c (linux_write_memory): Return early success if LEN is
3800 * configure.srv: Add x86_64-*-cygwin* as target.
3804 * configure.ac: Invoke AC_SYS_LARGEFILE.
3805 * configure, config.in: Rebuild.
3809 * win32-low.c: Throughout, fix format strings and casts of
3810 printf-like functions to avoid type related warnings on all
3812 (get_child_debug_event): Print dwDebugEventCode as hex since
3813 that's how it's usually documented.
3817 * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
3822 * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
3823 (reg-tilegx32.c): New rule.
3824 * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
3825 * linux-tile-low.c (tile_arch_setup): New function. Invoke
3826 different register info initializer according to elf class.
3827 (init_registers_tilgx32): New function. The tilegx32 register info
3829 (tile_fill_gregset): Use "uint_reg_t" to represent register size.
3830 (tile_store_gregset): Likewise.
3834 * server.c (process_point_options): Print debug message when
3835 debug_threads is true.
3839 * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
3846 * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
3847 instead of strtoul to extract address from packet.
3848 (process_serial_event) <'z'>: Likewise.
3852 * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
3858 * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
3859 TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
3863 * tracepoint.c (cmd_qtdpsrc): Use savestring.
3867 * tracepoint.c (save_string): Delete.
3868 (add_tracepoint_action): Use savestring instead of save_string.
3872 * linux-xtensa-low.c: Ditto.
3873 * xtensa-xtregs.c: Ditto.
3877 * thread-db.c (thread_db_get_tls_address): NULL pointer check
3882 * linux-aarch64-low.c (aarch64_arch_setup): Clamp
3883 aarch64_num_wp_regs and aarch64_num_bp_regs to
3884 AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
3888 * linux-aarch64-low.c (ps_get_thread_area): Replace
3889 PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
3896 * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
3897 (aarch64.c, aarch64-without-fpu.c): New targets.
3898 * configure.srv (aarch64*-*-linux*): New.
3899 * linux-aarch64-low.c: New file.
3903 * linux-low.c (handle_extended_wait, linux_create_inferior)
3904 (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
3905 (dequeue_one_deferred_signal, linux_resume_one_thread)
3906 (fetch_register, linux_write_memory, linux_enable_event_reporting)
3907 (linux_tracefork_grandchild, linux_test_for_tracefork)
3908 (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
3909 PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
3910 where the argument is 0.
3914 * event-loop.c: Include "queue.h".
3915 (gdb_event_p): New typedef.
3916 (struct gdb_event) <next_event>: Remove.
3917 (event_queue): Change to QUEUE(gdb_event_p).
3918 (async_queue_event): Remove.
3919 (gdb_event_xfree): New.
3920 (initialize_event_loop): New.
3921 (process_event): Use API from QUEUE.
3922 (wait_for_event): Likewise.
3923 * server.c (main): Call initialize_event_loop.
3924 * server.h (initialize_event_loop): Declare.
3928 * ax.h (struct eval_agent_expr_context): New.
3929 (gdb_eval_agent_expr): Update declaration.
3930 * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
3931 TFRAME. Add new argument CTX.
3932 * server.h (struct eval_agent_expr_context): Declare.
3933 (agent_mem_read, agent_tsv_read): Update declaration.
3934 (agent_mem_read_string): Likewise.
3935 * tracepoint.c (eval_tracepoint_agent_expr): Remove.
3936 (add_traceframe_block): Add new argument TPOINT.
3937 Increase TPOINT->traceframe_usage.
3938 (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
3939 eval_tracepoint_agent_expr.
3940 (condition_true_at_tracepoint): Likewise.
3941 (agent_mem_read): Remove argument TFRAME. Add argument CTX.
3942 (agent_mem_read_string, agent_tsv_read): Likewise.
3946 * linux-low.c (linux_resume_one_lwp): Don't check
3947 'lwp->bp_reinsert != 0'.
3952 * lynx-low.c (ptrace_request_to_str): Define a temporary
3953 macro and use it to simplify this function's implementation.
3957 * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
3962 * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
3966 * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
3970 * lynx-low.c (lynx_resume): Use the resume_info parameter
3971 to determine the ptid for the lynx_ptrace call, unless
3972 it is equal to minus_one_ptid, in which case we use the
3973 ptid of the current_inferior.
3974 (lynx_wait_1): After having received a thread create/exit
3975 event, resume the inferior's execution using the signaling
3976 thread's ptid, rather than the old ptid.
3980 * lynx-low.c (lynx_resume): Delete variable ret.
3984 * gdbreplay.c (gdbreplay_version): Update copyright year.
3985 * server.c (gdbserver_version): Likewise.
3989 * lynx-low.c (lynx_wait_1): Add debug trace before adding
3994 * lynx-low.c (ptrace_request_to_str): Add handling for
3999 * lynx-low.c (lynx_attach): Delete variable new_process.
4003 * lynx-low.c (lynx_create_inferior): Delete variable
4008 * lynx-low.c (ptrace_request_to_str): Do not handle
4009 PTRACE_GETTHREADLIST if this macro does not exist.
4013 * Makefile.in (OBS): Add notif.o.
4014 * notif.c, notif.h: New.
4015 * server.c: Include "notif.h".
4016 (struct vstop_notif) <next>: Remove.
4018 (queue_stop_reply): Update.
4019 (push_event, send_next_stop_reply): Remove.
4020 (discard_queued_stop_replies): Update.
4021 (notif_stop): New variable.
4022 (handle_v_stopped): Remove.
4023 (handle_v_requests): Don't call handle_v_stopped. Call
4024 handle_ack_notif instead.
4025 (queue_stop_reply_callback): Call notif_event_enque instead
4026 of queue_stop_reply.
4027 (handle_status): Don't call send_next_stop_reply, call
4028 notif_write_event instead.
4029 (kill_inferior_callback): Likewise.
4030 (detach_or_kill_inferior_callback): Likewise.
4031 (main): Call initialize_notif.
4032 (process_serial_event): Call QUEUE_is_empty.
4033 (handle_target_event): Call notif_push instead of push event.
4034 * server.h (push_event): Remove declaration.
4038 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
4039 (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
4042 (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
4043 (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
4044 (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
4045 (amd64-linux-ipa.o, ax.o): Rewrite.
4046 (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
4047 (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
4048 (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
4049 (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
4050 (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
4051 (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
4052 (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
4053 (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
4054 (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
4055 (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
4056 (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
4057 (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
4058 (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
4059 (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
4060 (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
4061 (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
4062 (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
4063 (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
4064 (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
4065 (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
4066 (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
4067 (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
4068 (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
4069 (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
4070 (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
4071 (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
4072 (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
4073 (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
4074 (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
4075 (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
4076 (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
4077 (reg-tilegx.o): Remove.
4078 (all_object_files): New macro.
4079 Include .deps files.
4080 * aclocal.m4, configure: Rebuild.
4081 * acinclude.m4: Include depstand.m4, lead-dot.m4.
4082 * configure.ac: Invoke ZW_CREATE_DEPDIR,
4083 ZW_PROG_COMPILER_DEPENDENCIES. Compute GMAKE condition.
4088 * server.h (current_insn_ptr, emit_error): Declare 'extern'.
4092 * configure.ac: Check for linux/perf_event.h.
4093 * config.in: Regenerated.
4094 * configure: Regenerated.
4098 * hostio.c (handle_readlink): Decrease buffer size
4099 parameter passed to readlink by one byte.
4103 * configure.ac (build_warnings): Append '-Wempty-body'.
4104 * configure: Regenerated.
4105 * linux-low.c (linux_create_inferior): Use braces for empty 'if'
4110 * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
4111 * config.in: Regenerate.
4112 * configure: Regenerate.
4113 * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
4114 Use "gdb_wait.h" header instead of <sys/wait.h> header.
4115 * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
4116 * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
4118 * server.c: Remove HAVE_WAIT_H conditional. Use "gdb_wait.h" header
4119 instead of <sys/wait.h> header.
4120 * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
4124 * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
4125 (various make rules): Remove -DGDBSERVER
4129 * spu-low.c (current_ptid): Move it to ..
4130 * gdbthread.h: ... here. New.
4131 * remote-utils.c (read_ptid): Use macro 'current_ptid'.
4132 * server.c (myresume, process_serial_event): Likewise.
4133 * thread-db.c (thread_db_find_new_threads): Likewise.
4134 * tracepoint.c (run_inferior_command): Likewise.
4138 * server.c (handle_search_memory_1): Include access length in
4143 * linux-crisv32-low.c: Fix compile errors.
4147 * tracepoint.c (cmd_qtsv): Adjust debug message.
4148 Don't check CUR_TPOINT.
4152 * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
4153 * server.h: Include 'libiberty.h' and 'ansidecl.h'.
4154 (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
4155 Remove declarations of xmalloc, xreallloc, xstrdup and
4157 * Makefile.in (libiberty_h): New.
4158 (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
4159 (linux-bfin-low.o): Append dependency 'libiberty.h'.
4163 * server.h: Remove declaration of 'xsnprintf'.
4167 * server.h: Include build-gnulib-gbserver/config.h.
4168 * gdbreplay.c: Likewise.
4172 * Makefile.in (SFILES): Add gdb_vecs.c.
4173 (OBS): Add gdb_vecs.o.
4174 (gdb_vecs_h, host_defs_h): New variables.
4175 (thread-db.o): Add $(gdb_vecs_h) dependency.
4176 (gdb_vecs.o): New rule.
4177 * thread-db.c: #include "gdb_vecs.h".
4178 (thread_db_load_search): Use a vector to iterate over path elements.
4179 Handle text appearing after "$pdir".
4181 * configure.ac: Add check for strstr.
4182 * config.in: Regenerate.
4183 * configure: Regenerate.
4187 * hostio.c (handle_pread): If pread fails, fall back to attempting
4189 (handle_pwrite): Likewise for pwrite.
4193 * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
4194 between unsupported TYPE and unimplementable ADDR/LEN combination.
4195 (arm_insert_point): Act on new return value.
4199 * server.c (process_point_options): Only skip tokens if we find
4200 one that is unrecognized. Don't treat 'X' specially while
4201 skipping unrecognized tokens.
4205 * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
4206 to 4-byte-align HW breakpoint addresses for Thumb.
4212 * server.h: Declare gdb_agent_about_to_close.
4213 * target.c (kill_inferior): Include "agent.h".
4214 New. Send command 'kill'.
4215 * target.h (kill_inferior): Removed macro.
4216 * tracepoint.c (gdb_agent_about_to_close): New.
4217 (gdb_agent_helper_thread): Handle command 'close'.
4218 Wait endlessly until the inferior stops.
4219 Install gdb_agent_remove_socket to atexit hook.
4220 (agent_socket_name): New static variable.
4221 (gdb_agent_socket_init): Replace local variable 'name' with
4222 'agent_socket_name'.
4223 (gdb_agent_remove_socket): New.
4227 * server.c (process_point_options): Stop at 'X' when parsing.
4231 * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
4233 * linux-x86-low.c (x86_insert_point, x86_remove_point):
4234 Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
4235 hardware breakpoint.
4239 * gdbserver/linux-low.c (initialize_low): Call
4240 linux_ptrace_init_warnings.
4244 * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
4249 * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
4250 (ax.o): Add it to build rule.
4252 (OBS): Add format.o.
4253 (IPA_OBS): Add format.o.
4254 * server.c (handle_query): Claim support for breakpoint commands.
4255 (process_point_options): Add command case.
4256 (process_serial_event): Leave running if there are printfs in
4258 * mem-break.h (any_persistent_commands): Declare.
4259 (add_breakpoint_commands): Declare.
4260 (gdb_no_commands_at_breakpoint): Declare.
4261 (run_breakpoint_commands): Declare.
4262 * mem-break.c (struct point_command_list): New struct.
4263 (struct breakpoint): New field command_list.
4264 (any_persistent_commands): New function.
4265 (add_commands_to_breakpoint): New function.
4266 (add_breakpoint_commands): New function.
4267 (gdb_no_commands_at_breakpoint): New function.
4268 (run_breakpoint_commands): New function.
4269 * linux-low.c (linux_wait_1): Test for and run breakpoint commands
4271 * ax.c: Include format.h.
4272 (ax_printf): New function.
4273 (gdb_eval_agent_expr): Add printf opcode.
4277 * server.c (start_inferior): Remove duplicated writes to fields
4278 'last_resume_kind' and 'last_status' of 'current_inferior'.
4283 * linux-low.c (linux_set_resume_request): Simplify predicate. Add
4285 * server.c (handle_v_cont): Extend comment.
4289 * linux-low.c (linux_attach): Add 'static'.
4293 * ax.c (gdb_eval_agent_expr): Print `top' in hex.
4297 Fix gcc -flto compilation warning.
4298 * server.c (main): Make variable multi_mode and attach volatile.
4302 * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
4303 if the platform doesn't know about it.
4307 * Makefile.in (SFILES): Add linux-tile-low.c.
4308 (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
4309 * configure.srv: Handle tilegx-*-linux*.
4310 * linux-tile-low.c: New file.
4314 * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
4320 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
4326 Replace target_signal with gdb_signal throughout.
4330 * linux-low.c (linux_store_registers): Avoid the copying sequence
4331 when no data has been retrieved by ptrace.
4335 * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
4336 Include asm/ptrace.h.
4337 (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
4342 * linux-low.c (linux_store_registers): Don't re-retrieve data
4343 with ptrace that has already been obtained from /proc. Always
4344 copy any data retrieved with ptrace to the buffer supplied.
4349 * linux-low.c (enum stopping_threads_kind): New.
4350 (stopping_threads): Change type to `enum stopping_threads_kind'.
4351 (handle_extended_wait): If stopping and suspending threads, leave
4352 the new_lwp suspended too.
4353 (linux_wait_for_event): Adjust.
4354 (stop_all_lwps): Set `stopping_threads' to
4355 STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
4356 whether we're suspending threads or just stopping them. Assert no
4361 * server.h: Move some code to ...
4362 * gdbthread.h: ... here. New.
4363 * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
4364 (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
4365 (nto-low.o, win32-low.o): Likewise.
4366 * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
4367 * regcache.c, remote-utils.c, server.c: Likewise.
4368 * target.c, tracepoint.c, win32-low.c: Likewise.
4372 * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
4373 (PTRACE_ARG4_TYPE): Likewise.
4374 (PTRACE_XFER_TYPE): Likewise.
4375 * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
4376 ptrace to PTRACE_ARG3_TYPE.
4377 * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
4378 (PTRACE_ARG4_TYPE): Likewise.
4379 (PTRACE_XFER_TYPE): Likewise.
4380 (linux_detach_one_lwp): Cast fourth argument of
4381 ptrace to long then PTRACE_ARG4_TYPE.
4382 (regsets_fetch_inferior_registers): Cast third argument of
4383 ptrace to long then PTRACE_ARG3_TYPE.
4384 (regsets_store_inferior_registers): Likewise.
4388 * configure: Regenerate.
4392 * Makefile.in (GNULIB_BUILDDIR): New.
4393 (LIBGNU, INCGNU, GNULIB_H): Adjust.
4394 (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
4395 (all, install-only, uninstall, clean-info, all-lib, clean): No
4396 longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do.
4397 (maintainer-clean realclean distclean): Use subdir_do.
4399 (gnulib/import/Makefile): Adjust. Replace gnulib/import with
4400 $(GNULIB_BUILDDIR). Don't pass argument to config.status.
4401 * acinclude.m4: Include acx_configure_dir.m4.
4402 * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
4403 calls. Call AC_PROG_RANLIB. Configure gnulib using
4406 (GNULIB_STDINT_H): Adjust.
4407 (AC_OUTPUT): Don't output gnulib/Makefile anymore.
4408 * gdbreplay.c: Include build-gnulib/config.h.
4409 * server.h: Likewise.
4410 * aclocal.m4: Regenerate.
4411 * config.in: Regenerate.
4412 * configure: Regenerate.
4416 * Makefile.in (LIBGNU, INCGNU): Adjust.
4417 (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
4418 (all, install-only, uninstall, clean-info, all-lib, clean)
4419 (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
4420 * configure.ac: Adjust AC_OUTPUT output.
4421 * aclocal.m4: Regenerate.
4422 * configure: Regenerate.
4426 * Makefile.in (generated_files): New.
4427 (server_h): Remove the explicit dependency on config.h, and depend
4428 on $generated_files.
4432 * Makefile.in (INCGNU): Add -Ignulib.
4436 * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
4437 (INCGNU): ... this, and spell out -I here.
4438 (GNULIB_LIB): Rename to ...
4440 (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
4444 * config.in: Regenerate.
4448 * configure.ac: Remove AC_CHECK_DECLS check for memmem.
4449 * server.h (memmem): Remove declaration.
4450 * config.in: Regenerate.
4451 * configure: Regenerate.
4455 * Makefile.in (SFILES): Add common/vec.c.
4461 * remote-utils.c (prepare_resume_reply): Replace with macro
4462 target_core_of_thread.
4463 * server.c (handle_qxfer_threads_proper): Likewise.
4464 * target.h (traget_core_of_thread): New macro.
4468 * aclocal.m4: Regenerate.
4469 * configure: Regenerate.
4473 * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
4474 duplicated on address.
4478 * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
4479 (struct tracepoint_action_ops) <send>: New field.
4480 (m_tracepoint_action_send, r_tracepoint_action_send): New.
4481 (agent_expr_send, x_tracepoint_action_send): New.
4482 (l_tracepoint_action_send): New.
4483 (cmd_qtdp): Download and install tracepoint
4484 according to `use_agent'.
4485 (run_inferior_command): Add one more parameter `len'.
4487 (tracepoint_send_agent): New.
4488 (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
4492 * tracepoint.c (download_tracepoints): Moved to ...
4493 (cmd_qtstart): ... here.
4497 * tracepoint.c: Include inttypes.h.
4498 (struct collect_memory_action): Use sized types.
4499 (struct tracepoint): Likewise.
4500 (cmd_qtdp, stop_tracing): Update print specifiers.
4501 (cmd_qtp, response_tracepoint): Likewise.
4502 (collect_data_at_tracepoint): Likewise.
4503 (collect_data_at_step): Likewise.
4507 Import gnulib module inttypes.
4508 * aclocal.m4, config.in, configure: Regenerated.
4512 * Makefile.in (maintainer-clean, realclean, distclean): Remove
4513 Makefile and config.status at last.
4517 * tracepoint.c: Include stdint.h unconditionally.
4521 * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
4522 on BFD_HAVE_SYS_PROCFS_TYPE.
4523 * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
4524 * configure: Regenerate.
4525 * config.in: Likewise.
4529 * Makefile.in (clean): Also remove x32.c x32-linux.c
4530 x32-avx.c x32-avx-linux.c.
4531 (x32.o): New target.
4533 (x32-linux.o): Likewise.
4534 (x32-linux.c): Likewise.
4535 (x32-avx.o): Likewise.
4536 (x32-avx.c): Likewise.
4537 (x32-avx-linux.o): Likewise.
4538 (x32-avx-linux.c): Likewise.
4540 * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
4541 (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
4542 (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
4543 (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
4544 (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
4545 i386/x32-avx-linux.xml.
4547 * linux-x86-low.c (init_registers_x32_linux): New prototype.
4548 (init_registers_x32_avx_linux): Likwise.
4549 (x86_linux_update_xmltarget): Call init_registers_x32_linux
4550 or init_registers_x32_avx_linux if linux_is_elf64 is false.
4554 * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
4555 (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
4556 (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
4557 (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
4562 * linux-x86-low.c (compat_x32_clock_t): New.
4563 (compat_x32_siginfo_t): Likewise.
4564 (compat_x32_siginfo_from_siginfo): Likewise.
4565 (siginfo_from_compat_x32_siginfo): Likewise.
4566 (linux_is_elf64): Likewise.
4567 (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
4568 and siginfo_from_compat_x32_siginfo for x32.
4569 (x86_arch_setup): Set linux_is_elf64.
4574 * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
4576 (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
4577 * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
4578 * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
4579 compatible with process.
4583 * Makefile.in: Define abs_top_srcdir and abs_srcdir.
4584 (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
4585 (install-only, install-info, clean): Handle sub dir gnulib.
4586 (all-lib, am--refresh): New targets.
4587 (memmem.o): Remove target.
4588 * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
4589 Invoke gl_EARLY. Invoke AC_CHECK_PROGS for make.
4590 (AC_REPLACE_FUNCS): Remove memmem.
4591 Invoke gl_INIT and AM_INIT_AUTOMAKE.
4592 (AC_OUTPUT): Generate Makefile in gnulib/.
4593 * aclocal.m4, config.in, configure: Regenerated.
4597 * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
4601 -Werror=strict-aliasing
4603 * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
4608 * linux-sparc-low.c (sparc_fill_gregset_to_stack)
4609 (sparc_store_gregset_from_stack, sparc_store_gregset)
4610 (sparc_breakpoint_at): Fix formatting.
4614 * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
4616 * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
4617 [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
4618 * config.in: Regenerate.
4619 * configure: Likewise.
4623 * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
4624 Correct ptrace arguments.
4628 * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
4629 (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
4630 (IA64_FR1_REGNUM): New defines.
4631 (ia64_fetch_register): New.
4632 (the_low_target): Install it.
4633 * linux-low.h (struct linux_target_ops) <fetch_register>: New
4635 * linux-low.c (linux_fetch_registers): Try the
4636 the_low_target.fetch_register hook first.
4638 * linux-arm-low.c (the_low_target): Adjust.
4639 * linux-bfin-low.c (the_low_target): Adjust.
4640 * linux-cris-low.c (the_low_target): Adjust.
4641 * linux-crisv32-low.c (the_low_target): Adjust.
4642 * linux-m32r-low.c (the_low_target): Adjust.
4643 * linux-m68k-low.c (the_low_target): Adjust.
4644 * linux-mips-low.c (the_low_target): Adjust.
4645 * linux-ppc-low.c (the_low_target): Adjust.
4646 * linux-s390-low.c (the_low_target): Adjust.
4647 * linux-sh-low.c (the_low_target): Adjust.
4648 * linux-sparc-low.c (the_low_target): Adjust.
4649 * linux-tic6x-low.c (the_low_target): Adjust.
4650 * linux-x86-low.c (the_low_target): Adjust.
4651 * linux-xtensa-low.c (the_low_target): Adjust.
4655 * server.c (handle_qxfer_libraries): Don't bail early if
4656 the_target->qxfer_libraries_svr4 is not NULL.
4660 * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
4664 * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
4665 "library-list-svr4" element's start tag when the the DSO list is
4670 * linux-low.c (read_one_ptr): Read the inferior's pointer through
4671 a variable whose type size is the same as the inferior's pointer
4676 * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
4678 * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
4679 * linux-x86-low.c (x86_siginfo_fixup): Likewise.
4680 * linux-low.h: Include <signal.h>.
4681 (struct siginfo): Remove forward declaration.
4682 (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
4687 * .gitignore: Ignore more files.
4692 * server.c (cont_thread, general_thread): Add describing comments.
4693 (start_inferior): Clear `cont_thread'.
4694 (handle_v_cont): Don't set `cont_thread' if resuming all threads
4699 * tracepoint.c (install_tracepoint): Move duplicated tracepoint
4701 (cmd_qtdp): ... here.
4705 * tracepoint.c (struct tracepoint_action_ops): New.
4706 (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
4707 (m_tracepoint_action_download): New.
4708 (r_tracepoint_action_download): New.
4709 (x_tracepoint_action_download): New.
4710 (l_tracepoint_action_download): New.
4711 (add_tracepoint_action): Install `action->ops' according type.
4712 (download_tracepoint_1): Move code `download' function pointer
4713 of various tracepoint_action_ops.
4717 * linux-low.c (linux_attach_lwp_1): New variable buffer. Call
4718 linux_ptrace_attach_warnings.
4722 * Makefile.in (linux-ptrace.o): New.
4723 * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
4724 (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
4725 (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
4726 (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
4727 (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
4729 * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
4734 Fix PR server/13392.
4735 * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
4737 * tracepoint.c (remove_tracepoint): New.
4738 (cmd_qtdp): Call remove_tracepoint when failed to install.
4742 * linux-low.c (get_detach_signal): New.
4743 (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
4744 Pass on pending signals to PTRACE_DETACH. Check the result of the
4746 * server.c (program_signals, program_signals_p): New.
4747 (handle_general_set): Handle QProgramSignals.
4748 * server.h (program_signals, program_signals_p): Declare.
4753 * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
4758 * tracepoint.c (tracepoint_look_up_symbols): Update call to
4759 agent_look_up_symbols.
4763 * Makefile.in (linux-low.o): Keep dependence on agent.h.
4764 (linux-x86-low.o): Likewise.
4765 * server.h: Remove in_process_agent_loaded.
4766 * tracepoint.c (in_process_agent_loaded): Removed. Moved it
4772 * tracepoint.c (gdb_agent_capability): New global.
4773 (in_process_agent_loaded_ust): Renamed to
4774 `in_process_agent_supports_ust'.
4776 (in_process_agent_supports_ust): Call agent_capability_check.
4777 (clear_installed_tracepoints): Assert that agent supports
4782 * linux-low.c (linux_supports_agent): New.
4783 (linux_target_ops): Initialize field `supports_agent' with
4784 linux_supports_agent.
4785 * target.h (struct target_ops) <supports_agent>: New.
4786 (target_supports_agent): New macro.
4787 * server.c (handle_general_set): Handle packet 'QAgent'.
4788 (handle_query): Send `QAgent+'.
4789 * Makefile.in (server.o): Depends on agent.h.
4793 * Makefile.in (OBS): Add agent.o.
4794 Add new rule for agent.o.
4795 Track dependence of tracepoint.c on agent.h.
4796 * tracepoint.c (run_inferior_command_1):
4797 (run_inferior_command): Call agent_run_command.
4798 (gdb_ust_connect_sync_socket): Deleted. Move it to
4800 (resume_thread, stop_thread): Likewise.
4801 (gdb_ust_socket_init): Renamed to ...
4802 (gdb_agent_socket_init): ... New.
4803 (gdb_ust_thread): Renamed to ...
4804 (gdb_agent_helper_thread): ... New.
4805 (gdb_ust_init): Move some code to ...
4806 (gdb_agent_init): ... here. New.
4807 [HAVE_UST]: Call gdb_ust_init.
4808 (initialize_tracepoint_ftlib): Call gdb_agent_init.
4809 * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
4810 * config.in, configure: Regenerated.
4814 * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
4815 * linux-low.c (struct simple_pid_list): New.
4816 (stopped_pids): New a struct simple_pid_list pointer.
4817 (add_to_pid_list, pull_pid_from_list): New.
4818 (handle_extended_wait): Don't assume the first signal new children
4819 report is SIGSTOP. Adjust call to pull_pid_from_list.
4820 (linux_wait_for_lwp): Adjust.
4824 * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
4829 * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
4830 `stop_pc' and `tpoint'. Update caller.
4834 * linux-low.h (linux_target_ops): Add regset_bitmap member.
4835 * linux-low.c (use_linux_regsets): New macro.
4836 [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
4837 [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
4838 (linux_register_in_regsets): New function.
4839 (usr_fetch_inferior_registers): Skip registers covered by
4841 (usr_store_inferior_registers): Likewise.
4842 (usr_fetch_inferior_registers): New macro.
4843 (usr_store_inferior_registers): Likewise.
4844 (linux_fetch_registers): Handle mixed regset/non-regset targets.
4845 (linux_store_registers): Likewise.
4846 * linux-mips-low.c (init_registers_mips_dsp_linux): New
4848 (init_registers_mips64_dsp_linux): Likewise.
4849 (init_registers_mips_linux): New macro.
4850 (init_registers_mips_dsp_linux): Likewise.
4851 (mips_dsp_num_regs): Likewise.
4852 (DSP_BASE, DSP_CONTROL): New fallback macros.
4853 (mips_base_regs): New macro.
4854 (mips_regmap): Use it. Fix the size.
4855 (mips_dsp_regmap): New variable.
4856 (mips_dsp_regset_bitmap): Likewise.
4857 (mips_arch_setup): New function.
4858 (mips_cannot_fetch_register): Use the_low_target.regmap rather
4860 (mips_cannot_store_register): Likewise.
4861 (the_low_target): Update .arch_setup, .num_regs and .regmap
4862 initializers. Add .regset_bitmap initializer.
4863 * linux-arm-low.c (the_low_target): Add .regset_bitmap
4865 * linux-bfin-low.c (the_low_target): Likewise.
4866 * linux-cris-low.c (the_low_target): Likewise.
4867 * linux-crisv32-low.c (the_low_target): Likewise.
4868 * linux-ia64-low.c (the_low_target): Likewise.
4869 * linux-m32r-low.c (the_low_target): Likewise.
4870 * linux-m68k-low.c (the_low_target): Likewise.
4871 * linux-ppc-low.c (the_low_target): Likewise.
4872 * linux-s390-low.c (the_low_target): Likewise.
4873 * linux-sh-low.c (the_low_target): Likewise.
4874 * linux-sparc-low.c (the_low_target): Likewise.
4875 * linux-tic6x-low.c (the_low_target): Likewise.
4876 * linux-x86-low.c (the_low_target): Likewise.
4877 * linux-xtensa-low.c (the_low_target): Likewise.
4878 * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
4879 mips64-dsp-linux.o to srv_regobj. Add mips-dsp-linux.xml,
4880 mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
4882 * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
4883 (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
4888 * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
4889 `step_over_finished' is true.
4893 * linux-low.c (pid_is_stopped): Delete, moved to common/.
4894 (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
4899 * linux-low.c (pid_is_stopped): New.
4900 (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
4904 * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
4909 * linux-mips-low.c (mips_regmap): Correct the index of $f9.
4911 2012-02-24 Luis Machado <lgustavo@codesourcery>
4913 * server.c (handle_query): Advertise support for target-side
4914 breakpoint condition evaluation.
4915 (process_point_options): New function.
4916 (process_serial_event): When inserting a breakpoint, check for
4917 a target-side condition that should be evaluated.
4919 * mem-break.c: Include regcache.h and ax.h.
4920 (point_cond_list_t): New data structure.
4921 (breakpoint) <cond_list>: New field.
4922 (find_gdb_breakpoint_at): Make non-static.
4923 (delete_gdb_breakpoint_at): Clear any target-side
4925 (clear_gdb_breakpoint_conditions): New function.
4926 (add_condition_to_breakpoint): Likewise.
4927 (add_breakpoint_condition): Likewise.
4928 (gdb_condition_true_at_breakpoint): Likewise.
4929 (gdb_breakpoint_here): Return result directly instead
4930 of going through a local variable.
4932 * mem-break.h (find_gdb_breakpoint_at): New prototype.
4933 (clear_gdb_breakpoint_conditions): Likewise.
4934 (add_breakpoint_condition): Likewise.
4935 (gdb_condition_true_at_breakpoint): Likewise.
4937 * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
4938 (need_step_over_p): Take target-side breakpoint condition into
4941 2012-02-24 Luis Machado <lgustavo@codesourcery>
4943 * server.h: Include tracepoint.h.
4944 (agent_mem_read, agent_get_trace_state_variable_value,
4945 agent_set_trace_state_variable_value,
4946 agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
4947 get_set_tsv_func_addr): New prototypes.
4949 * ax.h: New include file.
4950 * ax.c: New source file.
4952 * tracepoint.c: Include ax.h.
4953 (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
4954 agent_expr, eval_result_type): Move to ax.h.
4955 (parse_agent_expr): Rename to ...
4956 (gdb_parse_agent_expr): ... this, make it non-static and move
4958 (unparse_agent_expr) Rename to ...
4959 (gdb_unparse_agent_expr): ... this, make it non-static and move
4961 (eval_agent_expr): Rename to ...
4962 (eval_tracepoint_agent_expr): ... this.
4963 (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
4964 forward declarations.
4965 (add_tracepoint_action): Call gdb_parse_agent_expr (...).
4966 (agent_get_trace_state_variable_value): New function.
4967 (agent_set_trace_state_variable_value): New function.
4968 (cmd_qtdp): Call gdb_parse_agent_expr (...).
4969 (response_tracepoint): Call gdb_unparse_agent_expr (...).
4970 (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
4971 (condition_true_at_tracepoint): Likewise.
4972 (parse_agent_expr): Rename to ...
4973 (gdb_parse_agent_expr): ... this and move to ax.c.
4974 (unparse_agent_expr): Rename to ...
4975 (gdb_unparse_agent_expr): ... this and move to ax.c.
4976 (gdb_agent_op_name): Move to ax.c.
4977 (eval_agent_expr): Rename to ...
4978 (gdb_eval_agent_expr): ... this, use regcache passed as parameter
4980 (eval_tracepoint_agent_expr): New function.
4981 (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
4983 (current_insn_ptr, emit_error, struct bytecode_address): Move to
4985 (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
4986 emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
4987 emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
4988 emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
4989 emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
4990 emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
4991 emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
4992 emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
4993 (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
4994 (compile_bytecodes): Remove forward declaration.
4995 (is_goto_target): Move to ax.c.
4996 (compile_bytecodes): Move to ax.c and call
4997 agent_get_trace_state_variable_value (...) and
4998 agent_set_trace_state_variable_value (...).
5000 * Makefile.in: Update ax.c and IPA dependencies.
5004 * tracepoint.c (cmd_bigqtbuffer): Rename as ...
5005 (cmd_bigqtbuffer_circular): ... this. Only handle
5006 'QTBuffer:circular:'.
5007 (handle_tracepoint_general_set): Adjust.
5011 * inferiors.c: Move code to ...
5012 * dll.c: .... here. New.
5013 * server.h: Declare clear_dlls.
5014 * Makefile.in (SFILES): Add dll.c.
5020 * server.c: (handle_monitor_command): Add a new parameter
5022 (handle_query): Update caller.
5026 * configure.ac: Add readlink to AC_CHECK_FUNCS list.
5027 * configure, config.in: Regenerate.
5028 * hostio.c: Provide an alternate implementation if HAVE_READLINK
5033 Try SIGKILL first, then PTRACE_KILL.
5034 * linux-low.c (linux_kill_one_lwp): New.
5035 (linux_kill_one_lwp): Rename to ...
5036 (kill_one_lwp_callback): ... this. Use the new
5041 * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
5046 * linux-low.c (linux_child_pid_to_exec_file): Delete.
5047 (elf_64_file_p): Make static.
5048 (linux_pid_exe_is_elf_64_file): New.
5049 * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
5050 Delete declarations.
5051 (linux_pid_exe_is_elf_64_file): Declare.
5052 * linux-x86-low.c (x86_arch_setup): Use
5053 linux_pid_exe_is_elf_64_file.
5057 * linux-low.c (linux_wait_for_event_1): Rename to ...
5058 (linux_wait_for_event): ... here and merge it with former
5059 linux_wait_for_event - new variable wait_ptid, use it.
5060 (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
5064 * server.c (main): Avoid yet another case of infinite loop while
5065 detaching/killing after a longjmp.
5070 * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
5074 * hostio.c (handle_readlink): New function.
5075 (handle_vFile): Call it to handle "vFile:readlink" packets.
5080 * server.c (handle_v_requests): Only support vAttach and vRun to
5081 start multiple processes when in extended protocol mode.
5085 * tracepoint.c (initialize_tracepoint): Use mmap instead of
5086 memalign plus mprotect to allocate the scratch buffer.
5090 * server.c (attach_inferior): Clear `cont_thread'.
5094 * server.c (main): Avoid infinite loop while detaching/killing
5099 * server.c (start_inferior): Set last_ptid in --wrapper case.
5103 * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
5105 [IN_PROCESS_AGENT] (debug_agent): New global variable.
5109 * tracepoint.c (cmd_qtdp): Print debug message
5110 for static tracepoint.
5114 * tracepoint.c (trace_vdebug): Differentiate debug message
5115 between gdbserver and IPA.
5119 * tracepoint.c (tracepoint_was_hit): Don't collect for
5124 * terminal.h: Reformat copyright header.
5128 * server.c (gdbserver_version): Update copyright year.
5129 * gdbreplay.c (gdbreplay_version): Likewise.
5133 * linux-low.c (linux_create_inferior): Put empty if clause for write.
5137 * linux-low.c (linux_create_inferior): Save return value to ret.
5141 * linux-low.c (linux_create_inferior): Save return value to ret.
5145 * linux-low.c (linux_create_inferior): If stdio connection,
5146 redirect stdin from /dev/null, stdout to stderr.
5147 * remote-utils.c (remote_is_stdio): New static global.
5148 (remote_connection_is_stdio): New function.
5149 (remote_prepare): Handle stdio connection.
5150 (remote_open): Ditto.
5151 (remote_close): Don't close stdin for stdio connections.
5152 (read_prim,write_prim): New functions. Replace all calls to
5153 read/write to these.
5154 * server.c (main): Watch for "-" argument. Move call to
5155 remote_prepare before start_inferior.
5156 * server.h (STDIO_CONNECTION_NAME): New macro.
5157 (remote_connection_is_stdio): Declare.
5159 * remote-utils.c (prepare_resume_reply): Remove extraneous \n
5160 in debugging output.
5164 * tracepoint.c: Include sys/syscall.h.
5165 (gdb_ust_thread): Remove preprocessor conditional.
5169 * linux-low.c (linux_detach_one_lwp): Call
5170 the_low_target.prepare_to_resume before detaching.
5174 * tracepoint.c (gdb_ust_thread): Don't ignore return value
5179 * i386-low.c (i386_low_stopped_data_address): Initialize local
5186 * i386-low.c (i386_low_stopped_data_address): Avoid fetching
5187 DR_CONTROL unless necessary. Extend comments.
5188 * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
5189 DR0-3 if not used. If any watchpoint was set, clear DR_STATUS.
5193 * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
5195 (upload_fast_traceframes, upload_fast_traceframes): Likewise.
5199 * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
5200 Print new debug message for such case.
5204 Fix overlapping memcpy.
5205 * mem-break.c (set_raw_breakpoint_at): New variable buf. Use it for
5206 the read_inferior_memory transfer.
5207 (delete_fast_tracepoint_jump): New variable buf. Use it for the
5208 write_inferior_memory transfer.
5209 (set_fast_tracepoint_jump): New variable buf. Use it for the
5210 read_inferior_memory and write_inferior_memory transfers.
5211 (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
5212 (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
5213 Use it for the write_inferior_memory transfer.
5214 (check_mem_read, check_mem_write): New gdb_asserts for overlapping
5219 * linux-low.c (fetch_register, store_register): Make code
5220 consistent, fix formatting.
5224 * linux-low.c (usr_store_inferior_registers): Factor out code
5225 to handle individual registers into...
5226 (store_register): ... this new function.
5230 * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
5231 (s390-linux32v2.o, s390-linux32v2.c): Likewise.
5232 (s390-linux64v1.o, s390-linux64v1.c): Likewise.
5233 (s390-linux64v2.o, s390-linux64v2.c): Likewise.
5234 (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
5235 (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
5236 * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
5237 (srv_xmlfiles): Add new XML files.
5239 * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
5241 (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
5242 (init_registers_s390_linux32v1): Add prototype.
5243 (init_registers_s390_linux32v2): Likewise.
5244 (init_registers_s390_linux64v1): Likewise.
5245 (init_registers_s390_linux64v2): Likewise.
5246 (init_registers_s390x_linux64v1): Likewise.
5247 (init_registers_s390x_linux64v2): Likewise.
5248 (s390_num_regs): Increment to 52.
5249 (s390_regmap): Add orig_r2 register.
5250 (s390_num_regs_3264): Increment to 68.
5251 (s390_regmap_3264): Add orig_r2 register.
5252 (s390_collect_ptrace_register): Handle orig_r2 register.
5253 (s390_supply_ptrace_register): Likewise.
5254 (s390_fill_last_break): New function.
5255 (s390_store_last_break): Likewise.
5256 (s390_fill_system_call): New function.
5257 (s390_store_system_call): Likewise.
5258 (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
5260 (s390_check_regset): New function.
5261 (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
5262 NT_S390_SYSTEM_CALL regsets and use appropriate description.
5263 Update target_regsets for available register sets.
5268 * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
5269 (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
5271 (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
5272 * linux-low.h (struct process_info_private): New member r_debug.
5273 * server.c (handle_qxfer_libraries): Call
5274 the_target->qxfer_libraries_svr4.
5275 (handle_qxfer_libraries_svr4): New function.
5276 (qxfer_packets): New entry "libraries-svr4".
5277 (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
5278 * target.h (struct target_ops): New member qxfer_libraries_svr4.
5279 * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
5280 PACKET_qXfer_libraries_svr4.
5284 * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
5285 PSW address/mask between 8-byte and 16-byte formats.
5286 (s390_supply_ptrace_register): Likewise.
5287 (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
5288 basic addressing mode bit.
5292 * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
5296 * tracepoint.c (struct tracepoint): New field traceframe_usage.
5297 (tracing_start_time): New global.
5298 (tracing_stop_time): New global.
5299 (tracing_user_name): New global.
5300 (tracing_notes): New global.
5301 (tracing_stop_note): New global.
5302 (cmd_qtstart): Set traceframe_usage, start_time.
5303 (stop_tracing): Set stop_time.
5304 (cmd_qtstatus): Report additional status.
5305 (cmd_qtp): New function.
5306 (handle_tracepoint_query): Call it.
5307 (cmd_qtnotes): New function.
5308 (handle_tracepoint_general_set): Call it.
5309 (get_timestamp): Rename from tsv_get_timestamp.
5314 * linux-x86-low.c (small_jump_insn): New.
5315 (i386_install_fast_tracepoint_jump_pad): Add arguments for
5316 trampoline and error message, build a trampoline and issue a small
5317 jump instruction to it.
5318 (x86_install_fast_tracepoint_jump_pad): Add arguments for
5319 trampoline and error message.
5320 (x86_get_min_fast_tracepoint_insn_len): New.
5321 (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
5322 * linux-low.h (struct linux_target_ops): Add arguments to
5323 install_fast_tracepoint_jump_pad operation, add new operation.
5324 * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
5326 (linux_get_min_fast_tracepoint_insn_len): New function.
5327 (linux_target_op): Add new operation.
5328 * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
5329 (gdb_trampoline_buffer_end): Ditto.
5330 (gdb_trampoline_buffer_error): Ditto.
5331 (struct ipa_sym_addresses): Add fields for new IPA variables.
5332 (symbol_list): Add entries for new IPA variables.
5333 (struct tracepoint): Add fields to hold the address range of the
5334 trampoline used by the tracepoint.
5335 (trampoline_buffer_head): New static variable.
5336 (trampoline_buffer_tail): Ditto.
5337 (claim_trampoline_space): New function.
5338 (have_fast_tracepoint_trampoline_buffer): New function.
5339 (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
5341 (install_fast_tracepoint): Ditto, also add error buffer argument.
5342 (cmd_qtminftpilen): New function.
5343 (handle_tracepoint_query): Add response to qTMinFTPILen packet.
5344 (fast_tracepoint_from_trampoline_address): New function.
5345 (fast_tracepoint_collecting): Handle trampoline as part of jump
5347 (set_trampoline_buffer_space): New function.
5348 (initialize_tracepoint): Initialize new IPA variables.
5349 * target.h (struct target_ops): Add arguments to
5350 install_fast_tracepoint_jump_pad operation, add new
5351 get_min_fast_tracepoint_insn_len operation.
5352 (target_get_min_fast_tracepoint_insn_len): New.
5353 (install_fast_tracepoint_jump_pad): Add arguments.
5354 * server.h (IPA_BUFSIZ): Define.
5355 * linux-i386-ipa.c: Include extra header files.
5356 (initialize_fast_tracepoint_trampoline_buffer): New function.
5357 (initialize_low_tracepoint): Call it.
5358 * server.h (set_trampoline_buffer_space): Declare.
5359 (claim_trampoline_space): Ditto.
5360 (have_fast_tracepoint_trampoline_buffer): Ditto.
5364 * server.c (handle_query): Handle InstallInTrace for qSupported.
5365 * tracepoint.c (add_tracepoint): Sort list.
5366 (install_tracepoint, download_tracepoint): New.
5367 (cmd_qtdp): Call them to install and download tracepoints.
5368 (sort_tracepoints): Removed.
5369 (cmd_qtstart): Update.
5373 * mem-break.c (inc_ref_fast_tracepoint_jump): New.
5374 * mem-break.h: Declare.
5375 * tracepoint.c (cmd_qtstart): Move some code to ...
5376 (clone_fast_tracepoint, install_fast_tracepoint): ... here.
5378 (download_tracepoints): Move some code to ...
5379 (download_tracepoint_1): ... here. New.
5383 * remote-utils.c (relocate_instruction): A comment fix.
5387 * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
5388 (i386_dr_low_get_control, i386_dr_low_get_status): Use
5389 dr_status_mirror and dr_control_mirror from debug_reg_state.
5390 (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
5391 (i386_initial_stuff): Remove use of deleted globals.
5392 (i386_get_thread_context, i386_set_thread_context,
5393 i386_thread_added): Use dr_status_mirror and dr_control_mirror
5394 from debug_reg_state.
5398 * tracepoint.c (gdb_collect): Loop over tracepoints of same
5399 address as TPOINT's.
5403 * tracepoint.c (agent_mem_read_string): New function.
5404 (eval_agent_expr): Call it for tracenz.
5405 * server.c (handle_query): Report support for tracenz.
5409 * tracepoint.c (cmd_qtstart): Remove unused local variables.
5413 * target.h: Fix a typo in comment.
5417 * mem-break.c (check_mem_write): Add `myaddr' parameter. Don't
5418 clobber the breakpoints' shadows with fast tracepoint jumps.
5419 * mem-break.h (check_mem_write): Add `myaddr' parameter.
5420 * target.c (write_inferior_memory): Also pass MYADDR down to
5425 * configure.ac: Check support for personality routine.
5426 * configure: Regenerate.
5427 * config.in: Likewise.
5428 * linux-low.c: Include <sys/personality.h>.
5429 Define ADDR_NO_RANDOMIZE if necessary.
5430 (linux_create_inferior): Disable address space randomization when
5431 forking inferior, if requested.
5432 (linux_supports_disable_randomization): New function.
5433 (linux_target_ops): Install it.
5434 * server.h (disable_randomization): Declare.
5435 * server.c (disable_randomization): New global variable.
5436 (handle_general_set): Handle QDisableRandomization.
5437 (handle_query): Likewise for qSupported.
5438 (main): Support --disable-randomization and --no-disable-randomization
5439 command line arguments.
5440 * target.h (struct target_ops): Add supports_disable_randomization.
5441 (target_supports_disable_randomization): New macro.
5445 * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
5447 [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
5448 [!PT_GETDSBT] (target_loadmap): New definition.
5449 (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
5450 (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
5451 LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
5452 and PT_GETDSBT to LINUX_LOADMAP.
5453 [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
5454 (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
5458 * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
5459 (arm_linux_hwbp_cap): New static variable.
5460 (arm_linux_get_hwbp_cap): Replace by ...
5461 (arm_linux_init_hwbp_cap): ... this new function.
5462 (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
5463 (arm_linux_get_hw_watchpoint_count): Likewise.
5464 (arm_linux_get_hw_watchpoint_max_length): Likewise.
5465 (arm_arch_setup): Call arm_linux_init_hwbp_cap.
5466 (arm_prepare_to_resume): Use perror_with_name instead of error.
5470 * linux-arm-low.c: Include <signal.h>.
5471 (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
5472 (struct arm_linux_hwbp_cap): New data type.
5473 (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
5474 (struct arm_linux_hw_breakpoint): New data type.
5475 (MAX_BPTS, MAX_WPTS): Define.
5476 (struct arch_process_info, struct arch_lwp_info): New data types.
5477 (arm_linux_get_hwbp_cap): New function.
5478 (arm_linux_get_hw_breakpoint_count): Likewise.
5479 (arm_linux_get_hw_watchpoint_count): Likewise.
5480 (arm_linux_get_hw_watchpoint_max_length): Likewise.
5481 (arm_hwbp_control_initialize): Likewise.
5482 (arm_hwbp_control_is_enabled): Likewise.
5483 (arm_hwbp_control_is_initialized): Likewise.
5484 (arm_hwbp_control_disable): Likewise.
5485 (arm_linux_hw_breakpoint_equal): Likewise.
5486 (arm_linux_hw_point_initialize): Likewise.
5487 (struct update_registers_data): New data structure.
5488 (update_registers_callback: New function.
5489 (arm_insert_point): Likewise.
5490 (arm_remove_point): Likewise.
5491 (arm_stopped_by_watchpoint): Likewise.
5492 (arm_stopped_data_address): Likewise.
5493 (arm_new_process): Likewise.
5494 (arm_new_thread): Likewise.
5495 (arm_prepare_to_resume): Likewise.
5496 (the_low_target): Register arm_insert_point, arm_remove_point,
5497 arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
5498 arm_new_thread, and arm_prepare_to_resume.
5502 * server.h (struct emit_ops): Add compare-goto fields.
5503 * tracepoint.c (gdb_agent_op_sizes): New table.
5504 (emit_eq_goto): New function.
5505 (emit_ne_goto): New function.
5506 (emit_lt_goto): New function.
5507 (emit_le_goto): New function.
5508 (emit_gt_goto): New function.
5509 (emit_ge_goto): New function.
5510 (is_goto_target): New function.
5511 (compile_bytecodes): Recognize special cases of compare-goto
5512 combinations and call specialized emitters for them.
5513 * linux-x86-low.c (amd64_emit_eq_goto): New function.
5514 (amd64_emit_ne_goto): New function.
5515 (amd64_emit_lt_goto): New function.
5516 (amd64_emit_le_goto): New function.
5517 (amd64_emit_gt_goto): New function.
5518 (amd64_emit_ge_goto): New function.
5519 (amd64_emit_ops): Add the new functions.
5520 (i386_emit_eq_goto): New function.
5521 (i386_emit_ne_goto): New function.
5522 (i386_emit_lt_goto): New function.
5523 (i386_emit_le_goto): New function.
5524 (i386_emit_gt_goto): New function.
5525 (i386_emit_ge_goto): New function.
5526 (i386_emit_ops): Add the new functions.
5530 * linux-x86-low.c (i386_emit_prologue): Save %ebx.
5531 (i386_emit_epilogue): Restore %ebx.
5535 * server.c (step_thread): Remove definition.
5536 (process_serial_event): Don't handle Hs.
5537 * server.h (step_thread): Remove declaration.
5538 * target.c (set_desired_inferior): Remove use of step_thread.
5542 * linux-low.c: Include linux-procfs.h.
5543 (linux_attach_lwp_1): Update comments.
5544 (linux_attach): Scan for existing threads when attaching to a
5545 process that is the tgid.
5546 * Makefile.in: Update dependencies.
5550 * configure.srv: Add linux-procfs.o dependencies.
5554 * target.h (struct target_ops): Fix indent.
5555 * win32-low.c (win32_target_ops): Fix comment.
5560 * Makefile.in (clean): Remove tic6x-*.c files.
5561 (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
5562 (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
5563 (tic6x-c64xp-linux.c): Likewise.
5564 * configure.srv: Add support for tic6x-*-uclinux.
5565 * linux-tic6x-low.c: New.
5566 * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
5571 * target.h (struct target_ops): Add read_loadmap.
5572 * linux-low.c (struct target_loadseg): New type.
5573 (struct target_loadmap): New type.
5574 (linux_read_loadmap): New function.
5575 (linux_target_ops): Add linux_read_loadmap.
5576 * server.c (handle_query): Support qXfer:fdpic:read packet.
5577 * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
5582 * win32-low.c: Include <stdint.h>.
5586 * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
5587 to the inferior here.
5588 (i386_remove_aligned_watchpoint): Ditto.
5589 (i386_handle_nonaligned_watchpoint): Return immediate on fail to
5590 fit part of the watchpoint in the debug registers.
5591 (i386_update_inferior_debug_regs): New.
5592 (i386_low_insert_watchpoint): Work on a local mirror of the debug
5593 registers, and only update the inferior on success.
5594 (i386_low_remove_watchpoint): Ditto.
5598 * linux-low.c (compare_ints, unique, list_threads, show_process,
5599 linux_core_of_thread): Delete.
5600 (linux_target_ops): Change linux_core_of_thread to
5601 linux_common_core_of_thread.
5602 (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
5603 * utils.c (malloc_failure): Change type of argument.
5604 (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
5605 * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
5606 common/linux-osdata.c, common/ptid.c and common/buffer.c.
5607 (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
5608 (IPA_OBJS): Add common-utils-ipa.o.
5609 (ptid_h, linux_osdata_h): New macros.
5610 (server_h): Add common/common-utils.h, common/xml-utils.h,
5611 common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
5613 (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
5614 ptid.o, buffer.o): New rules.
5615 (linux-low.o): Add common/linux-osdata.h as a dependency.
5616 * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
5617 * configure.ac: Add AC_HEADER_DIRENT check.
5618 * config.in: Regenerate.
5619 * configure: Regenerate.
5620 * remote-utils.c (xml_escape_text): Delete.
5621 (buffer_grow, buffer_free, buffer_init, buffer_finish,
5622 buffer_xml_printf): Move to common/buffer.c.
5623 * server.c (main): Remove call to initialize_inferiors.
5624 * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
5625 ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
5626 ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
5627 internal_error, gdb_assert, gdb_assert_fail): Delete.
5628 (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
5629 buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
5631 * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
5632 ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
5633 initialize_inferiors): Delete.
5637 * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
5642 * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
5644 * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
5648 * Makefile.in (thread-db.o): Track dependence to
5649 common/gdb_thread_db.h.
5650 * thread-db.c: include gdb_thread_db.h from right place.
5654 * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
5655 __FILE__ and __LINE__ to internal_error.
5659 * thread-db.c (try_thread_db_load_from_sdir): New function.
5660 (try_thread_db_load_from_dir): New function.
5661 (thread_db_load_search): Handle $sdir, ignore $pdir.
5662 Remove trying of system directories if search of
5663 libthread-db-search-path fails, that is now done via $sdir.
5667 * server.c (handle_query): Add EnableDisableTracepoints to the list
5668 of supported features.
5669 * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
5671 (cmd_qtenable_disable): New.
5672 (cmd_qtstart): Install tracepoints even if disabled.
5673 (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
5674 receiving a QTEnable or QTDisable packet.
5675 (gdb_collect): Skip data collection if fast tracepoint is disabled.
5676 (ust_marker_to_static_tracepoint): Do not ignore disabled static
5678 (gdb_probe): Skip data collection if static tracepoint is disabled.
5682 * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
5686 * linux-low.c (linux_join): Skip process lookup.
5687 * spu-low.c (spu_join): Ditto.
5688 * server.c (join_inferiors_callback): Delete.
5689 (process_serial_event): For 'D' packet (detach) call join_inferior
5694 * README: Don't mention xscale*-*-linux*.
5695 * configure.srv (xscale*-*-linux*): Don't handle target.
5699 * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
5701 (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
5702 (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
5703 (i386_emit_void_call_2): Likewise.
5707 * linux-low.c: Move common macros to linux-ptrace.h.
5708 Include linux-ptrace.h.
5709 * Makefile.in (linux_ptrace_h): New.
5710 (linux-low.o): Depends on linux-ptrace.h.
5714 * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
5715 RUN_ONCE. Comment for the LISTEN_DESC delete_file_handler call.
5716 (remote_prepare): New function with most of the TCP code from ...
5717 (remote_open): ... here. Detect PORT here unconditionally. Move also
5718 setting transport_is_reliable.
5719 * server.c (run_once): New variable.
5720 (gdbserver_usage): Document it.
5721 (main): Set run_once for `--once'. Call remote_prepare. Exit after
5722 the first run if RUN_ONCE.
5723 * server.h (run_once, remote_prepare): New declarations.
5727 * win32-low.c (handle_load_dll): Remove duplicate "the".
5731 Remove support for old Cygwin 1.5 versions.
5732 * win32-low.c (win32_create_inferior): Use new cygwin_path_list
5733 function to avoid warning.
5734 (win32_add_one_solib): Use cygwin_conv_path function to avoid
5739 * gdbserver/server.h (Macro _): Define it if not available.
5743 * hostio.c (handle_close): Remove unnecessary null test.
5747 * Makefile.in (maintainer-clean realclean distclean): Remove
5748 "make ... subdir_do" command.
5752 * tracepoint.c (tracepoint_finish_step): Fix loop variable.
5754 * server.c (handle_v_run): Free alloced buffer on early return.
5761 * Makefile.in: Remove GNU make feature --directory.
5765 * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
5766 (subdir_do): New make target. Copied from gdb/Makefile.
5767 (maintainer-clean, realclean, distclean, clean): Call corresponding
5768 make targets in common/Makefile.
5772 * configure.ac: Call AC_PROG_RANLIB.
5773 * Makefile.in: Remove signals.o from OBS. Link libcommon.a.
5774 * configure: Regenerate.
5778 * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
5782 * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
5786 * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
5787 (subdir_do): New make target. Copied from gdb/Makefile.
5788 (maintainer-clean, realclean, distclean, clean): Call corresponding
5789 make targets in common/Makefile.
5793 * Makefile.in: Remove GNU make feature --directory.
5797 * server.c (queue_stop_reply): Call xmalloc not malloc.
5801 * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
5805 * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
5806 (cmd_qtframe): Ditto.
5807 (cmd_qtbuffer): Ditto.
5808 (cmd_bigqtbuffer): Ditto.
5810 * utils.c (decimal2str): Initialize 'width' to nine, then
5815 * hostio.c (require_data): Free *data, not data.
5819 * hostio.c (require_data): Use free, not xfree.
5823 * server.c (handle_query): Discard unused value.
5825 * hostio.c (require_data): Free malloc memory before returning
5830 * linux-low.c (list_threads): Call closedir for dirent.
5834 * i386-low.c (i386-length_and_rw_bits): Comment the fact that
5835 a case statement falls through.
5837 * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
5839 * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
5844 * utils.c (decimal2str): Eliminate dead code and dead param.
5845 (pulongest): Drop dead param from call to decimal2str.
5850 Revert the following patch (not approved yet):
5852 * tracepoint.c (tp_printf): New function.
5853 (eval_agent_expr): Handle gdb_agent_op_printf.
5857 * tracepoint.c (tp_printf): New function.
5858 (eval_agent_expr): Handle gdb_agent_op_printf.
5862 * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
5863 (tracepoint.o): Likewise.
5864 * tracepoint.c (enum gdb_agent_op): Use ax.def.
5865 (gdb_agent_op_names): Likewise.
5869 * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
5870 gdb_agent_op_rot>: New constants.
5871 (gdb_agent_op_names): Add pick and roll.
5872 (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
5877 * aclocal.m4: Regenerated with aclocal-1.11.1.
5881 * server.c (handle_qxfer_traceframe_info): New.
5882 (qxfer_packets): Register "traceframe-info".
5883 (handle_query): Report support for qXfer:traceframe-info:read+.
5884 * tracepoint.c (match_blocktype): New.
5885 (traceframe_find_block_type): Rename to ...
5886 (traceframe_walk_blocks): ... this. Add callback filter argument,
5888 (traceframe_find_block_type): New, reimplemented on top of
5889 traceframe_walk_blocks.
5890 (build_traceframe_info_xml): New.
5891 (traceframe_read_info): New.
5892 * server.h (traceframe_read_info): Declare.
5896 * configure.ac: Call AC_PROG_RANLIB.
5897 * Makefile.in: Remove signals.o from OBS. Link libcommon.a.
5898 * configure: Regenerate.
5902 * server.c (gdb_read_memory): Change return semantics to allow
5904 (handle_search_memory_1): Adjust.
5905 (process_serial_event) <'m' packet>: Handle partial transfers.
5906 * tracepoint.c (traceframe_read_mem): Handle partial transfers.
5910 * regcache.c (init_register_cache): Initialize
5911 regcache->register_status.
5912 (free_register_cache): Release regcache->register_status.
5913 (regcache_cpy): Copy register_status.
5914 (registers_to_string): Print 'x's for unavailable registers.
5915 (supply_register): Mark the register's status valid or
5916 unavailable, depending on whether a buffer was passed in or not.
5917 (supply_register_zeroed): New.
5918 (supply_regblock): Mark the registers' status valid or
5919 unavailable, depending on whether a buffer was passed in or not.
5920 * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
5921 (struct regcache): New `register_status' field.
5922 (supply_register_zeroed): Declare.
5923 * i387-fp.c (i387_xsave_to_cache): Zero out registers using
5924 supply_register_zeroed, rather than passing a NULL buffer to
5926 * tracepoint.c (fetch_traceframe_registers): Update comment.
5930 * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
5935 * server.h (decode_xfer_write): Change prototype.
5936 * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
5937 and don't extract the annex here.
5938 * server.c (decode_xfer_read): Remove `annex' parameter,
5939 and don't extract the annex here.
5941 (struct qxfer): New.
5942 (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
5943 (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
5944 (handle_qxfer_statictrace): New functions, abstracted out from
5945 handle_query, and made to use the struct qxfer interface.
5946 (handle_threads_qxfer_proper): Rename to ...
5947 (handle_qxfer_threads_proper): ... this.
5948 (handle_threads_qxfer): Rename to ...
5949 (handle_qxfer_threads): ... this. Adjust.
5950 (qxfer_packets): New array.
5951 (handle_qxfer): New function.
5952 (handle_query): Use handle_qxfer.
5956 * gdbreplay.c: Shorten lines of >= 80 columns.
5957 * linux-low.c: Ditto.
5958 * linux-ppc-low.c: Ditto.
5959 * linux-s390-low.c: Ditto.
5960 * linux-sparc-low.c: Ditto.
5961 * linux-x86-low.c: Ditto.
5962 * linux-xtensa-low.c: Ditto.
5963 * mem-break.c: Ditto.
5965 * regcache.h: Ditto.
5966 * remote-utils.c: Ditto.
5969 * thread-db.c: Ditto.
5970 * tracepoint.c: Ditto.
5972 * win32-low.h: Ditto.
5976 * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
5981 * server.c (gdbserver_version): Update copyright year in version
5983 * gdbreplay.c (gdbreplay_version): Ditto.
5987 * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
5988 * linux-bfin-low.c: New file.
5989 * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
5990 PT_DATA_ADDR for BFIN targets.
5991 * Makefile.in (SFILES): Add linux-bfin-low.c.
5992 (clean): Remove reg-bfin.c.
5993 (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
5994 * README: Mention supported Blackfin targets.
5998 * .gitignore: New file.
6002 * linux-low.c (linux_tracefork_child): Add char* cast to arg.
6006 * Makefile.in: Add FLAGS_TO_PASS variable.
6007 (install): Remove dependency of install-only and recursively
6008 invoke make for install-only.
6012 * Makefile.in (uninstall): Use $(DESTDIR).
6018 * linux-x86-low.c (compat_siginfo_from_siginfo)
6019 (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
6020 si_code is < 0. Check for si_code == SI_TIMER before checking for
6025 * lynx-i386-low.c: New file.
6026 * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
6030 * lynx-low.c (ptrace_request_to_str): Remove handling for
6031 request values that have been removed in LynxOS 5.x.
6035 * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
6040 * configure.ac: Add --enable-inprocess-agent option.
6041 * configure: Rebuilt.
6045 * linux-low.c (linux_kill): Remove unused variable.
6046 (linux_stabilize_threads): Likewise.
6047 * server.c (start_inferior): Likewise.
6048 (queue_stop_reply_callback): Likewise.
6049 * tracepoint.c (do_action_at_tracepoint): Likewise.
6053 * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
6058 * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
6062 * Makefile.in (install-only): Replace $IPA_DEPFILES with
6067 * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
6068 gdbserver/lynx-ppc-low.c: New files.
6069 * Makefile.in (lynx_low_h): New variable.
6070 (lynx-low.o, lynx-ppc-low.o): New rules.
6071 * configure.ac: On LynxOS, link with -lnetinet.
6072 * configure.srv: Add handling of powerpc-*-lynxos* targets.
6073 * configure: regenerate.
6077 * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
6078 * configure.ac: Add check for vasprintf and vsnprintf.
6079 * configure, config.in: Regenerate.
6080 * server.h (vasprintf, vsnprintf): Add conditional declarations.
6084 * gdbreplay.c: Move include of alloca.h up, next to include of
6086 * server.h: Add include of malloc.h.
6087 * mem-break.c: Remove include of malloc.h.
6088 * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
6092 * Makefile.in (memmem.o): Build with -Wno-error.
6096 * utils.c (xsnprintf): Make non-static.
6097 * server.h: Add xsnprintf declaration.
6098 * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
6099 replace calls to snprintf by calls to xsnprintf throughout.
6103 * configure.ac: Add configure check for alloca.
6104 * configure, config.in: Regenerate.
6105 * server.h: Include alloca.h if it exists.
6106 * gdbreplay.c: Include alloca.h if it exists.
6110 * linux-low.c (__SIGRTMIN): Define if not already defined.
6111 (linux_create_inferior): Check for __ANDROID__ rather than
6113 (enqueue_one_deferred_signal): Don't requeue non-RT signals that
6114 are already deferred.
6115 (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
6116 (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
6117 stopped and already has a pending signal to report.
6118 (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
6119 a pending signal to report or is moving out of a jump pad.
6120 (linux_init_signals): Check for __ANDROID__ rather than
6125 * linux-low.c (linux_stabilize_threads): Wrap debug output in a
6126 debug_threads check. Avoid a linear search when not doing debug
6131 * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
6132 (struct gdb_event) <fd>: Change type to gdb_fildes_t.
6133 (struct file_handler) <fd>: Change type to gdb_fildes_t.
6134 (process_event): Change local fd's type to gdb_fildes_t.
6135 (create_file_handler): Adjust prototype.
6136 (delete_file_handler): Adjust prototype.
6137 (handle_file_event): Adjust prototype. Use pfildes.
6138 (create_file_event): Adjsut prototype.
6139 * remote-utils.c (remote_desc, listen_desc): Change type to
6141 * server.h: New gdb_fildes_t typedef.
6142 [USE_WIN32API]: Include winsock2.h.
6143 (delete_file_handler, add_file_handler): Adjust prototypes.
6145 * utils.c (pfildes): New.
6149 * configure.ac (build_warnings): Add -Wno-char-subscripts.
6150 * configure: Regenerate.
6154 * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
6155 (linux_done_accessing_memory): ... this.
6156 (linux_target_ops): Adjust.
6157 * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
6158 * nto-low.c (nto_target_ops): Adjust comment.
6159 * server.c (gdb_read_memory, gdb_write_memory): Adjust.
6160 * spu-low.c (spu_target_ops): Adjust comment.
6161 * target.h (target_ops): Rename unprepare_to_access_memory field
6162 to done_accessing_memory.
6163 (unprepare_to_access_memory): Rename to ...
6164 (done_accessing_memory): ... this.
6168 * linux-low.c (linux_prepare_to_access_memory): New.
6169 (linux_unprepare_to_access_memory): New.
6170 (linux_target_ops): Install them.
6171 * server.c (read_memory): Rename to ...
6172 (gdb_read_memory): ... this. Use
6173 prepare_to_access_memory/prepare_to_access_memory.
6174 (write_memory): Rename to ...
6175 (gdb_write_memory): ... this. Use
6176 prepare_to_access_memory/prepare_to_access_memory.
6177 (handle_search_memory_1): Adjust.
6178 (process_serial_event): Adjust.
6179 * target.h (struct target_ops): New fields
6180 prepare_to_access_memory and unprepare_to_access_memory.
6181 (prepare_to_access_memory, unprepare_to_access_memory): New.
6182 * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
6183 prepare_to_access_memory/prepare_to_access_memory.
6184 * nto-low.c (nto_target_ops): Adjust.
6185 * spu-low.c (spu_target_ops): Adjust.
6186 * win32-low.c (win32_target_ops): Adjust.
6190 * Makefile.in (WARN_CFLAGS): Get it from configure.
6191 (WERROR_CFLAGS): New.
6192 (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
6193 * configure.ac: Introduce --enable-werror, which adds -Werror to
6194 the compiler command line. Enabled by default. Disable with
6195 --disable-werror. Add -Wdeclaration-after-statement
6196 Wpointer-arith and -Wformat-nonliteral to warning flags.
6197 * configure: Regenerate.
6201 * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
6205 * gdbreplay.c (remote_error): New.
6207 (expect): Use gdbchar. Check for error reading from GDB.
6208 Clarify sync error output.
6209 (play): Check for errors writing to GDB.
6210 * linux-low.c (sigchld_handler): Really ignore `write' errors.
6211 * remote-utils.c (getpkt): Check for errors writing to the remote
6216 * linux-low.c (linux_wait_1): Move non-debugging code out of
6217 `debug_threads' control.
6221 * linux-low.c (linux_wait_1): Don't set last_status here.
6222 * server.c (push_event, queue_stop_reply_callback): Assert we're
6223 not pushing a TARGET_WAITKIND_IGNORE event.
6224 (start_inferior, start_inferior, attach_inferior, handle_v_cont)
6225 (myresume, handle_target_event): Set the thread's last_resume_kind
6226 and last_status from the target returned status.
6232 * linux-x86-low.c (update_debug_registers_callback): New.
6233 (i386_dr_low_set_addr): Use it.
6234 (i386_dr_low_get_addr): New.
6235 (i386_dr_low_set_control): Use update_debug_registers_callback.
6236 (i386_dr_low_get_control): New.
6237 (i386_dr_low_get_status): Adjust.
6238 * linux-low.c (linux_stop_lwp): New.
6239 * linux-low.h (linux_stop_lwp): Declare.
6241 * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
6242 argument instead of a i386_debug_reg_state.
6243 (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
6244 a i386_debug_reg_state.
6245 (i386_insert_aligned_watchpoint): Adjust.
6246 (i386_remove_aligned_watchpoint): Adjust.
6247 (i386_low_stopped_data_address): Read the debug registers from the
6248 inferior instead of from the mirrors.
6249 * i386-low.h (struct i386_debug_reg_state): Extend comment.
6250 (i386_dr_low_get_addr): Declare.
6251 (i386_dr_low_get_control): Declare.
6252 (i386_dr_low_get_status): Change prototype.
6254 * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
6255 (i386_dr_low_get_addr): New.
6256 (i386_dr_low_get_control): New.
6257 (i386_dr_low_get_status): Adjust prototype. Return
6259 (i386_initial_stuff): Clear dr_status_mirror and
6261 (i386_get_thread_context): Adjust.
6262 (i386_set_thread_context): Adjust.
6263 (i386_thread_added): Adjust.
6267 * linux-low.h (linux_thread_area): Delete declaration.
6271 * linux-low.c (linux_wait_1): Correctly return the ptid of the child
6272 after its termination.
6276 * linux-low.c (gdb_wants_lwp_stopped): Delete.
6277 (gdb_wants_all_stopped): Delete.
6278 (linux_wait_1): Don't call them.
6279 * server.c (handle_v_cont): Tag all threads as want-stopped.
6280 (gdb_wants_thread_stopped): Fix comments. Tag the thread that
6281 stopped as "client-wants-stopped".
6285 * Makefile.in (signals_h): New.
6286 (server_h): Depend on it.
6287 (server.o): Don't depend on $(signals_def).
6288 (signals.o): Depend on $(signals_def).
6292 * Makefile.in (signals_def): New.
6293 (server_h): Append include/gdb/signals.h and signals_def.
6294 (server.o): Append signals_def.
6298 * server.c (handle_target_event): Use target_signal_to_host for
6299 resume_info.sig initialization.
6300 * target.h (struct thread_resume) <sig>: New comment.
6304 * server.c (handle_query): strcpy() the returned string from paddress()
6305 instead of sprintf().
6306 * utils.c (paddress): Return phex_nz().
6310 * server.c (handle_v_cont): Call mourn_inferior if process
6312 (myresume): Likewise.
6316 Static tracepoints, and integration with UST.
6318 * configure.ac: Handle --with-ust. substitute ustlibs and ustinc.
6319 * mem-break.c (uninsert_all_breakpoints)
6320 (reinsert_all_breakpoints): New.
6321 * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
6322 * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
6323 (gdb_agent_ust_loaded, helper_thread_id)
6324 (gdb_agent_helper_thread_id): New macros.
6325 (struct ipa_sym_addresses): Add addr_ust_loaded,
6326 addr_helper_thread_id, addr_cmd_buf.
6327 (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
6328 (in_process_agent_loaded_ust): New.
6329 (write_e_ust_not_loaded): New.
6330 (maybe_write_ipa_ust_not_loaded): New.
6331 (struct collect_static_trace_data_action): New.
6332 (enum tracepoint_type) <static_tracepoint>: New.
6333 (struct tracepoint) <handle>: Mention static tracepoints.
6334 (struct static_tracepoint_ctx): New.
6335 (CMD_BUF_SIZE): New.
6336 (add_tracepoint_action): Handle static tracepoint actions.
6337 (unprobe_marker_at): New.
6338 (clear_installed_tracepoints): Handle static tracepoints.
6339 (cmd_qtdp): Handle static tracepoints.
6340 (probe_marker_at): New.
6341 (cmd_qtstart): Handle static tracepoints.
6342 (response_tracepoint): Handle static tracepoints.
6343 (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
6344 (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
6345 (get_context_regcache): Handle static tracepoints.
6346 (do_action_at_tracepoint): Handle static tracepoint actions.
6347 (traceframe_find_block_type): Handle static trace data blocks.
6348 (traceframe_read_sdata): New.
6349 (download_tracepoints): Download static tracepoint actions.
6350 [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
6351 (GDB_PROBE_NAME): New.
6356 (ust_marker_to_static_tracepoint): New.
6358 (collect_ust_data_at_tracepoint): New.
6359 (gdb_ust_probe): New.
6360 (UNIX_PATH_MAX, SOCK_DIR): New.
6361 (gdb_ust_connect_sync_socket): New.
6362 (resume_thread, stop_thread): New.
6363 (run_inferior_command): New.
6364 (init_named_socket): New.
6365 (gdb_ust_socket_init): New.
6366 (cstr_to_hexstr): New.
6368 (first_marker, next_marker): New.
6369 (response_ust_marker): New.
6370 (cmd_qtfstm, cmd_qtsstm): New.
6371 (unprobe_marker_at, probe_marker_at): New.
6372 (cmd_qtstmat, gdb_ust_thread): New.
6373 (gdb_ust_init): New.
6374 (initialize_tracepoint_ftlib): Call gdb_ust_init.
6375 * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
6377 (x86_64_st_collect_regmap): New.
6378 (X86_64_NUM_ST_COLLECT_GREGS): New.
6379 (AMD64_RIP_REGNUM): New.
6380 (supply_static_tracepoint_registers): New.
6381 * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
6383 (i386_st_collect_regmap): New.
6384 (i386_NUM_ST_COLLECT_GREGS): New.
6385 (supply_static_tracepoint_registers): New.
6386 * server.c (handle_query): Handle qXfer:statictrace:read.
6387 <qSupported>: Report support for StaticTracepoints, and
6388 qXfer:statictrace:read features.
6389 * server.h (traceframe_read_sdata)
6390 (supply_static_tracepoint_registers): Declare.
6391 * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
6392 (unpack_varlen_hex): Include in IPA build.
6393 * Makefile.in (ustlibs, ustinc): New.
6394 (IPA_OBJS): Add remote-utils-ipa.o.
6395 ($(IPA_LIB)): Link -ldl and -lpthread.
6397 (IPAGENT_CFLAGS): Add UST_CFLAGS.
6398 * config.in, configure: Regenerate.
6403 * linux-x86-low.c (always_true): Delete.
6404 (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
6405 trying to fool the compiler with always_true.
6409 * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
6410 conditions in gdbserver.
6414 * spu-low.c (spu_read_memory): Wrap around local store limit.
6415 (spu_write_memory): Likewise.
6419 * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
6420 (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
6422 * server.h (struct emit_ops): Replace int64_t uses with LONGEST
6424 * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
6425 uses with LONGEST uses.
6432 * linux-x86-low.c: Include limits.h.
6437 (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
6438 (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
6439 (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
6440 (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
6441 (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
6442 (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
6443 (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
6444 (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
6445 (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
6446 (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
6447 (amd64_emit_void_call_2): New.
6448 (amd64_emit_ops): New.
6449 (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
6450 (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
6451 (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
6452 (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
6453 (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
6454 (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
6455 (i386_emit_goto, i386_write_goto_address, i386_emit_const)
6456 (i386_emit_call, i386_emit_reg, i386_emit_pop)
6457 (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
6458 (i386_emit_stack_adjust, i386_emit_int_call_1)
6459 (i386_emit_void_call_2): New.
6460 (i386_emit_ops): New.
6461 (x86_emit_ops): New.
6462 (the_low_target): Install x86_emit_ops.
6463 * server.h (struct emit_ops): New.
6464 (get_raw_reg_func_addr): Declare.
6465 (current_insn_ptr, emit_error): Declare.
6466 * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
6467 (set_trace_state_variable_value): New defines.
6468 (struct ipa_sym_addresses): New fields addr_get_raw_reg,
6469 addr_get_trace_state_variable_value and
6470 addr_set_trace_state_variable_value.
6471 (symbol_list): New fields for get_raw_reg,
6472 get_trace_state_variable_value and set_trace_state_variable_value.
6473 (condfn): New typedef.
6474 (struct tracepoint): New field `compiled_cond'.
6475 (do_action_at_tracepoint): Clear compiled_cond.
6476 (get_trace_state_variable_value, set_trace_state_variable_value):
6478 (condition_true_at_tracepoint): If there's a compiled condition,
6480 (current_insn_ptr, emit_error): New globals.
6481 (struct bytecode_address): New.
6482 (get_raw_reg_func_addr): New.
6483 (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
6484 (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
6485 (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
6486 (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
6487 (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
6488 (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
6489 (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
6490 (compile_tracepoint_condition, compile_bytecodes): New.
6491 * target.h (emit_ops): Forward declare.
6492 (struct target_ops): New field emit_ops.
6493 (target_emit_ops): New.
6494 * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
6495 * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
6496 * linux-low.c (linux_emit_ops): New.
6497 (linux_target_ops): Install it.
6498 * linux-low.h (struct linux_target_ops): New field emit_ops.
6502 * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
6503 * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
6508 * Makefile.in (IPA_DEPFILES, extra_libraries): New.
6509 (all): Depend on $(extra_libraries).
6510 (install-only): Install the IPA.
6511 (IPA_OBJS, IPA_LIB): New.
6512 (clean): Remove the IPA lib.
6513 (IPAGENT_CFLAGS): New.
6514 (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
6515 (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
6516 (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
6517 * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
6518 * configure.ac: Check for atomic builtins support in the compiler.
6519 (IPA_DEPFILES, extra_libraries): Define.
6520 * configure.srv (ipa_obj): Add description.
6521 (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
6522 (i[34567]86-*-linux*): Set ipa_obj.
6523 (x86_64-*-linux*): Set ipa_obj.
6524 * linux-low.c (stabilizing_threads): New.
6525 (supports_fast_tracepoints): New.
6526 (linux_detach): Stabilize threads before detaching.
6527 (handle_tracepoints): Handle internal tracing breakpoints. Assert
6528 the lwp is either not stabilizing, or is moving out of a jump pad.
6529 (linux_fast_tracepoint_collecting): New.
6530 (maybe_move_out_of_jump_pad): New.
6531 (enqueue_one_deferred_signal): New.
6532 (dequeue_one_deferred_signal): New.
6533 (linux_wait_for_event_1): If moving out of a jump pad, defer
6534 pending signals to later.
6535 (linux_stabilize_threads): New.
6536 (linux_wait_1): Check if threads need moving out of jump pads, and
6538 (stuck_in_jump_pad_callback): New.
6539 (move_out_of_jump_pad_callback): New.
6541 (linux_resume_one_lwp): Handle moving out of jump pads.
6542 (linux_set_resume_request): Dequeue deferred signals.
6543 (need_step_over_p): Also step over fast tracepoint jumps.
6544 (start_step_over): Also uninsert fast tracepoint jumps.
6545 (finish_step_over): Also reinsert fast tracepoint jumps.
6546 (linux_install_fast_tracepoint_jump): New.
6547 (linux_target_ops): Install linux_stabilize_threads and
6548 linux_install_fast_tracepoint_jump_pad.
6549 * linux-low.h (linux_target_ops) <get_thread_area,
6550 install_fast_tracepoint_jump_pad>: New fields.
6551 (struct lwp_info) <collecting_fast_tracepoint,
6552 pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
6553 (linux_get_thread_area): Declare.
6554 * linux-x86-low.c (jump_insn): New.
6555 (x86_get_thread_area): New.
6556 (append_insns): New.
6558 (amd64_install_fast_tracepoint_jump_pad): New.
6559 (i386_install_fast_tracepoint_jump_pad): New.
6560 (x86_install_fast_tracepoint_jump_pad): New.
6561 (the_low_target): Install x86_get_thread_area and
6562 x86_install_fast_tracepoint_jump_pad.
6563 * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
6564 (struct fast_tracepoint_jump): New.
6565 (fast_tracepoint_jump_insn): New.
6566 (fast_tracepoint_jump_shadow): New.
6567 (find_fast_tracepoint_jump_at): New.
6568 (fast_tracepoint_jump_here): New.
6569 (delete_fast_tracepoint_jump): New.
6570 (set_fast_tracepoint_jump): New.
6571 (uninsert_fast_tracepoint_jumps_at): New.
6572 (reinsert_fast_tracepoint_jumps_at): New.
6573 (set_breakpoint_at): Use write_inferior_memory.
6574 (uninsert_raw_breakpoint): Use write_inferior_memory.
6575 (check_mem_read): Mask out fast tracepoint jumps.
6576 (check_mem_write): Mask out fast tracepoint jumps.
6577 * mem-break.h (struct fast_tracepoint_jump): Forward declare.
6578 (set_fast_tracepoint_jump): Declare.
6579 (delete_fast_tracepoint_jump)
6580 (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
6581 (reinsert_fast_tracepoint_jumps_at): Declare.
6582 * regcache.c: Don't compile many functions when building the
6583 in-process agent library.
6584 (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
6585 the register buffer in the heap.
6586 (free_register_cache): If the register buffer isn't owned by the
6587 regcache, don't free it.
6588 (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
6589 pre-existing register caches.
6590 * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
6592 (convert_ascii_to_int): : Constify `from' parameter type.
6593 (decode_M_packet, decode_X_packet): Replace the `to' parameter by
6594 a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc
6595 the needed buffer in-place.
6596 (relocate_instruction): New.
6597 * server.c (handle_query) <qSymbols>: If the target supports
6598 tracepoints, give it a chance of looking up symbols. Report
6599 support for fast tracepoints.
6600 (handle_status): Stabilize threads.
6601 (process_serial_event): Adjust.
6602 * server.h (struct fast_tracepoint_jump): Forward declare.
6603 (struct process_info) <fast_tracepoint_jumps>: New field.
6604 (convert_ascii_to_int, convert_int_to_ascii): Adjust.
6605 (decode_X_packet, decode_M_packet): Adjust.
6606 (relocate_instruction): Declare.
6607 (in_process_agent_loaded): Declare.
6608 (tracepoint_look_up_symbols): Declare.
6609 (struct fast_tpoint_collect_status): Declare.
6610 (fast_tracepoint_collecting): Declare.
6611 (force_unlock_trace_buffer): Declare.
6612 (handle_tracepoint_bkpts): Declare.
6613 (initialize_low_tracepoint)
6614 (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
6615 * target.h (struct target_ops) <stabilize_threads,
6616 install_fast_tracepoint_jump_pad>: New fields.
6617 (stabilize_threads, install_fast_tracepoint_jump_pad): New.
6618 * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
6619 [HAVE_STDINT_H]: Include stdint.h.
6620 (trace_debug_1): Rename to ...
6621 (trace_vdebug): ... this.
6622 (trace_debug): Rename to ...
6623 (trace_debug_1): ... this. Add `level' parameter.
6625 (ATTR_USED, ATTR_NOINLINE): New.
6626 (IP_AGENT_EXPORT): New.
6627 (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
6628 (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
6629 (about_to_request_buffer_space, trace_buffer_is_full)
6630 (stopping_tracepoint, expr_eval_result, error_tracepoint)
6631 (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
6632 (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
6633 (traceframe_write_count, traceframes_created)
6634 (trace_state_variables)
6635 New renaming defines.
6636 (struct ipa_sym_addresses): New.
6637 (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
6639 (ipa_sym_addrs): New.
6640 (all_tracepoint_symbols_looked_up): New.
6641 (in_process_agent_loaded): New.
6642 (write_e_ipa_not_loaded): New.
6643 (maybe_write_ipa_not_loaded): New.
6644 (tracepoint_look_up_symbols): New.
6645 (debug_threads) [IN_PROCESS_AGENT]: New.
6646 (read_inferior_memory) [IN_PROCESS_AGENT]: New.
6647 (UNKNOWN_SIDE_EFFECTS): New.
6648 (stop_tracing): New.
6649 (flush_trace_buffer): New.
6650 (stop_tracing_bkpt): New.
6651 (flush_trace_buffer_bkpt): New.
6652 (read_inferior_integer): New.
6653 (read_inferior_uinteger): New.
6654 (read_inferior_data_pointer): New.
6655 (write_inferior_data_pointer): New.
6656 (write_inferior_integer): New.
6657 (write_inferior_uinteger): New.
6658 (struct collect_static_trace_data_action): Delete.
6659 (enum tracepoint_type): New.
6660 (struct tracepoint) <type>: New field `type'.
6661 <actions_str, step_actions, step_actions_str>: Only include in
6663 <orig_size, obj_addr_on_target, adjusted_insn_addr>
6664 <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
6665 (tracepoints): Use IP_AGENT_EXPORT.
6666 (last_tracepoint): Don't include in the IPA.
6667 (stopping_tracepoint): Use IP_AGENT_EXPORT.
6668 (trace_buffer_is_full): Use IP_AGENT_EXPORT.
6669 (alloced_trace_state_variables): New.
6670 (trace_state_variables): Use IP_AGENT_EXPORT.
6671 (traceframe_t): Delete unused variable.
6672 (circular_trace_buffer): Don't include in the IPA.
6673 (trace_buffer_start): Delete.
6674 (struct trace_buffer_control): New.
6675 (trace_buffer_free): Delete.
6676 (struct ipa_trace_buffer_control): New.
6677 (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
6678 (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
6680 (trace_buffer_ctrl): New.
6681 (TRACE_BUFFER_CTRL_CURR): New.
6682 (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
6683 Reimplement as macros.
6684 (trace_buffer_wrap): Delete.
6685 (traceframe_write_count, traceframe_read_count)
6686 (traceframes_created, tracing): Use IP_AGENT_EXPORT.
6687 (struct tracepoint_hit_ctx) <type>: New field.
6688 (struct fast_tracepoint_ctx): New.
6689 (memory_barrier): New.
6691 (record_tracepoint_error): Update atomically in the IPA.
6692 (clear_inferior_trace_buffer): New.
6693 (about_to_request_buffer_space): New.
6694 (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
6695 updating the same buffer.
6696 (add_tracepoint): Default the tracepoint's type to trap
6697 tracepoint, and orig_size to -1.
6698 (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
6700 (create_trace_state_variable): New parameter `gdb'. Handle it.
6701 (clear_installed_tracepoints): Clear fast tracepoint jumps.
6702 (cmd_qtdp): Handle fast tracepoints.
6704 (max_jump_pad_size): New.
6705 (gdb_jump_pad_head): New.
6706 (get_jump_space_head): New.
6707 (claim_jump_space): New.
6708 (sort_tracepoints): New.
6709 (MAX_JUMP_SIZE): New.
6710 (cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the
6712 (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
6713 support. Upload fast traceframes, and delete internal IPA
6715 (stop_tracing_handler): New.
6716 (flush_trace_buffer_handler): New.
6717 (cmd_qtstop): Upload fast tracepoints.
6718 (response_tracepoint): Handle fast tracepoints.
6719 (tracepoint_finished_step): Upload fast traceframes. Set the
6720 tracepoint hit context's tracepoint type.
6721 (handle_tracepoint_bkpts): New.
6722 (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
6723 type. Add comment about fast tracepoints.
6724 (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
6725 non-existing action_str field.
6726 (get_context_regcache): Handle fast tracepoints.
6727 (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
6729 (fast_tracepoint_from_jump_pad_address): New.
6730 (fast_tracepoint_from_ipa_tpoint_address): New.
6731 (collecting_t): New.
6732 (force_unlock_trace_buffer): New.
6733 (fast_tracepoint_collecting): New.
6736 (write_inferior_data_ptr): New.
6737 (target_tp_heap): New.
6738 (target_malloc): New.
6739 (download_agent_expr): New.
6741 (download_tracepoints): New.
6742 (download_trace_state_variables): New.
6743 (upload_fast_traceframes): New.
6744 (IPA_FIRST_TRACEFRAME): New.
6745 (IPA_NEXT_TRACEFRAME_1): New.
6746 (IPA_NEXT_TRACEFRAME): New.
6747 [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
6748 [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
6749 (gdb_jump_pad_buffer_end): New.
6750 [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
6751 (initialize_tracepoint): Adjust.
6752 [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
6753 buffer. Initialize the low module.
6754 * utils.c (PREFIX, TOOLNAME): New.
6755 (malloc_failure): Use PREFIX.
6756 (error): In the IPA, an error causes an exit.
6757 (fatal, warning): Use PREFIX.
6758 (internal_error): Use TOOLNAME.
6759 (NUMCELLS): Increase to 10.
6760 * configure, config.in: Regenerate.
6764 * server.c (handle_query) <qSupported>: Do two passes over the
6765 qSupported string to avoid nesting strtok.
6769 * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
6771 * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also
6773 * configure: Regenerate.
6774 * proc-service.list: New.
6778 * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
6783 * gdbreplay.c (remote_open): Check error return from socket() call by
6784 its equality to -1 not by it being negative.
6785 * remote-utils.c (remote_open): Likewise.
6789 * config.h: Regenerate.
6793 * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
6794 doesn't provide PTRACE_GET_THREAD_AREA.
6798 * linux-m68k-low.c: Include <asm/ptrace.h>
6799 (ps_get_thread_area): Implement.
6803 * event-loop.c (struct callback_event): New struct.
6804 (callback_list): New global.
6805 (append_callback_event, delete_callback_event): New functions.
6806 (process_callback): New function.
6807 (start_event_loop): Call it.
6808 * remote-utils.c (NOT_SCHEDULED): Define.
6809 (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
6810 moved out of readchar.
6811 (readchar): Rewrite. Call reschedule before returning.
6812 (reset_readchar): New function.
6813 (remote_close): Call it.
6814 (process_remaining, reschedule): New functions.
6815 * server.h (callback_handler_func): New typedef.
6816 (append_callback_event, delete_callback_event): Declare.
6820 * proc-service.c (ps_pglobal_lookup): Use
6821 thread_db_look_up_one_symbol.
6822 * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
6823 parameter. Use it instead of all_symbols_looked_up.
6824 * server.h (struct process_info) <all_symbols_looked_up>: Delete
6826 (all_symbols_looked_up): Don't declare.
6827 (look_up_one_symbol): Add new `may_ask_gdb' parameter.
6828 * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
6830 (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
6831 Set all_symbols_looked_up here.
6832 (thread_db_look_up_one_symbol): New.
6833 (thread_db_get_tls_address): Adjust.
6834 (thread_db_load_search, try_thread_db_load_1): Always allocate the
6835 thread_db object on the heap, and tentatively set it in the
6837 (thread_db_init): Don't set all_symbols_looked_up here.
6838 * linux-low.h (thread_db_look_up_one_symbol): Declare.
6842 * linux-low.c (linux_kill, linux_detach): Adjust.
6843 (status_pending_p_callback): Remove redundant statement. Check
6844 for !TARGET_WAITIKIND_IGNORE, instead of
6845 TARGET_WAITKIND_STOPPED.
6846 (handle_tracepoints): Make sure LWP is locked. Adjust.
6847 (linux_wait_for_event_1): Adjust.
6848 (linux_cancel_breakpoints): New.
6849 (unsuspend_one_lwp): New.
6850 (unsuspend_all_lwps): New.
6851 (linux_wait_1): If finishing a step-over, unsuspend all lwps.
6852 (send_sigstop_callback): Change return type to int, add new
6853 `except' parameter and handle it.
6854 (suspend_and_send_sigstop_callback): New.
6855 (stop_all_lwps): Add new `suspend' and `expect' parameters, and
6856 pass them down. If SUSPEND, also increment the lwp's suspend
6858 (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
6859 (need_step_over_p): Don't consider suspended LWPs.
6860 (start_step_over): Adjust.
6861 (proceed_one_lwp): Change return type to int, add new `except'
6862 parameter and handle it.
6863 (unsuspend_and_proceed_one_lwp): New.
6864 (proceed_all_lwps): Use find_inferior instead of
6866 (unstop_all_lwps): Add `unsuspend' parameter. If UNSUSPEND, them
6867 also decrement the suspend count of LWPs. Pass `except' down,
6868 instead of hacking its suspend count.
6869 (linux_pause_all): Add `freeze' parameter. Adjust.
6870 (linux_unpause_all): New.
6871 (linux_target_ops): Install linux_unpause_all.
6872 * server.c (handle_status): Adjust.
6873 * target.h (struct target_ops): New fields `unpause_all' and
6874 `cancel_breakpoints'. Add new parameter to `pause_all'.
6875 (pause_all): Add new `freeze' parameter.
6877 (cancel_breakpoints): New.
6878 * tracepoint.c (clear_installed_tracepoints): Pause threads, and
6880 (cmd_qtstart): Pause threads.
6881 (stop_tracing): Pause threads, and cancel breakpoints.
6882 * win32-low.c (win32_target_ops): Adjust.
6886 * linux-low.c (linux_wait_for_event_1): Move passing the signal to
6887 the inferior right away from here...
6888 (linux_wait_1): ... to here, and adjust to check the thread's
6889 last_resume_kind instead of the lwp's step or stop_expected flags.
6893 * README: Use consistent `GDB' and `GDBserver' spellings.
6897 * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
6898 (linux_kill): Stop all lwps here. Don't delete the main lwp here.
6899 (linux_detach_one_lwp): Assume the lwp is stopped.
6900 (any_thread_of): Delete.
6901 (linux_detach): Stop all lwps here. Don't blindly delete all
6903 (delete_lwp_callback): New.
6904 (linux_mourn): Delete all lwps of the process that is gone.
6905 (linux_wait_1): Don't delete the last lwp of the process here.
6906 * mem-break.h (mark_breakpoints_out): Declare.
6907 * mem-break.c (mark_breakpoints_out): New.
6908 (free_all_breakpoints): Use it.
6909 * server.c (handle_target_event): If the process is gone, mark
6911 * thread-db.c (struct thread_db) <create_bp>: New field.
6912 (thread_db_enable_reporting): Fix prototype. Store a thread event
6913 breakpoint reference in the thread_db struct.
6914 (thread_db_load_search): Clear the thread_db object.
6915 (try_thread_db_load_1): Ditto.
6916 (switch_to_process): New.
6917 (disable_thread_event_reporting): Use it.
6918 (remove_thread_event_breakpoints): New.
6919 (thread_db_detach, thread_db_mourn): Use it.
6923 * linux-low.c (linux_enable_event_reporting): New.
6924 (linux_wait_for_event_1, handle_extended_wait): Use it.
6928 * linux-low.c (linux_kill_one_lwp, linux_kill)
6929 (linux_detach_one_lwp): Adjust to send_sigstop interface change.
6930 (send_sigstop): Take an lwp_info as parameter instead. Queue a
6931 SIGSTOP even if the LWP is stopped.
6932 (send_sigstop_callback): New.
6933 (stop_all_lwps): Use send_sigstop_callback instead.
6934 (linux_resume_one_thread): Adjust.
6935 (proceed_one_lwp): Still proceed an LWP that the client has
6936 requested to stop, if we haven't reported it as stopped yet. Make
6937 sure that LWPs the client want stopped, have a pending SIGSTOP.
6941 * server.c (handle_general_set): Make static.
6943 * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
6944 Print received char after testing for error/eof instead of before.
6945 (input_interrupt): Tweak comment.
6949 * server.c (start_inferior): Print inferior argv if --debug.
6953 * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
6954 * nto-x86-low.c: Include server.h
6958 * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
6959 be consistent with other sources of this directory.
6960 (init_registers_amd64): Correct name of source file of this function
6965 * configure.srv (x86_64-*-mingw*): New configuration for Windows
6970 * win32-i386-low.c: Add 64-bit support.
6971 (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
6972 (init_registers_amd64): Declare.
6973 (mappings): Add 64-bit version of array.
6974 (init_windows_x86): New function.
6975 (the_low_target): Change init_arch field to init_windows_x86.
6979 * win32-low.c: Adapt to support also 64-bit architecture.
6980 (child_xfer_memory): Use uintptr_t type for local variable `addr'.
6981 (get_image_name): Use SIZE_T type for local variable `done'.
6982 (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
6983 (toolhelp_get_dll_name): Idem.
6984 (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
6985 Use uintptr_t typecast to avoid warning.
6986 (handle_unload_dll): Use uintptr_t typecast to avoid warning.
6987 (handle_exception): Use phex_nz to avoid warning.
6988 (win32_wait): Remove unused local variable `process'.
6992 * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
6997 * configure.ac: Use `ws2_32' library for srv_mingw.
6998 * configure: Regenerate.
6999 * gdbreplay.c: Include winsock2.h instead of winsock.h.
7000 * remote-utils.c: Likewise.
7004 * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
7005 if __x86_64__ is defined.
7009 * configure: Regenerate.
7013 * server.c (handle_query): Handle 'qGetTIBAddr' query.
7014 * target.h (target_ops): New get_tib_address field.
7015 * win32-low.h (win32_thread_info): Add thread_local_base field.
7016 * win32-low.c (child_add_thread): Add tlb argument.
7017 Set thread_local_base field to TLB.
7018 (get_child_debug_event): Adapt to child_add_thread change.
7019 (win32_get_tib_address): New function.
7020 (win32_target_ops): Set get_tib_address field to
7021 win32_get_tib_address.
7022 * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
7026 * linux-low.c (linux_mourn): Also remove the process.
7027 * server.c (handle_target_event): Don't remove the process here.
7028 * nto-low.c (nto_mourn): New.
7029 (nto_target_ops): Install it.
7030 * spu-low.c (spu_mourn): New.
7031 (spu_target_ops): Install it.
7032 * win32-low.c (win32_mourn): New.
7033 (win32_target_ops): Install it.
7037 * server.h (buffer_xml_printf): Remove redundant `;'.
7041 * regcache.c (set_register_cache): Invalidate regcaches before
7042 changing the register cache layout.
7043 (regcache_invalidate_one): Allow a NULL regcache.
7044 * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
7045 regcaches before changing the register cache layout or the target
7050 * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
7051 variable warning on Linux/x86-64.
7055 GDBserver disconnected tracing support.
7057 * linux-low.c (linux_remove_process): Delete.
7058 (add_lwp): Don't set last_resume_kind here.
7059 (linux_kill): Use `mourn'.
7060 (linux_detach): Use `thread_db_detach', and `mourn'.
7062 (linux_attach_lwp_1): Adjust comment.
7063 (linux_attach): last_resume_kind moved the thread_info; adjust.
7064 (status_pending_p_callback): Adjust.
7065 (linux_wait_for_event_1): Adjust.
7066 (count_events_callback, select_singlestep_lwp_callback)
7067 (select_event_lwp_callback, cancel_breakpoints_callback)
7068 (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
7069 (proceed_one_lwp): Adjust.
7070 (linux_async): Add debug output.
7071 (linux_thread_stopped): New.
7072 (linux_pause_all): New.
7073 (linux_target_ops): Install linux_mourn, linux_thread_stopped and
7075 * linux-low.h (struct lwp_info): Delete last_resume_kind field.
7076 (thread_db_free): Delete declaration.
7077 (thread_db_detach, thread_db_mourn): Declare.
7078 * thread-db.c (thread_db_init): Use thread_db_mourn.
7079 (thread_db_free): Delete, split in two.
7080 (disable_thread_event_reporting): New.
7081 (thread_db_detach): New.
7082 (thread_db_mourn): New.
7084 * server.h (struct thread_info) <last_resume_kind>: New field.
7085 <attached>: Add comment.
7086 <gdb_detached>: New field.
7087 (handler_func): Change return type to int.
7088 (handle_serial_event, handle_target_event): Ditto.
7089 (gdb_connected): Declare.
7091 (disconnected_tracing): Declare.
7092 (stop_tracing): Declare.
7094 * server.c (handle_query) <qSupported>: Report support for
7095 disconnected tracing.
7096 (queue_stop_reply_callback): Account for running threads.
7097 (gdb_wants_thread_stopped): New.
7098 (gdb_wants_all_threads_stopped): New.
7099 (gdb_reattached_process): New.
7100 (handle_status): Clear the `gdb_detached' flag of all processes.
7101 In all-stop, stop all threads.
7102 (main): Be sure to leave tfind mode. Handle disconnected tracing.
7103 (process_serial_event): If the remote connection breaks, or if an
7104 exit was forced with "monitor exit", force an event loop exit.
7105 Handle disconnected tracing on detach.
7106 (handle_serial_event): Adjust.
7107 (handle_target_event): If GDB isn't connected, forward events back
7108 to the inferior, unless the last process exited, in which case,
7109 exit gdbserver. Adjust interface.
7111 * remote-utils.c (remote_open): Don't block in accept. Instead
7112 register an event loop source on the listen socket file
7113 descriptor. Refactor bits into ...
7114 (listen_desc): ... this new global.
7115 (gdb_connected): ... this new function.
7116 (enable_async_notification): ... this new function.
7117 (handle_accept_event): ... this new function.
7118 (remote_close): Clear remote_desc.
7120 * inferiors.c (add_thread): Set the new thread's last_resume_kind.
7122 * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
7124 (mourn_inferior): Define.
7125 (target_process_qsupported): Avoid the dangling else problem.
7126 (thread_stopped): Define.
7127 (pause_all): Define.
7128 (target_waitstatus_to_string): Declare.
7129 * target.c (target_waitstatus_to_string): New.
7131 * tracepoint.c (tracing): Make extern.
7132 (disconnected_tracing): New.
7133 (stop_tracing): Make extern. Handle tracing stops due to GDB
7135 (cmd_qtdisconnected): New.
7136 (cmd_qtstatus): Report disconnected tracing status in trace reply.
7137 (handle_tracepoint_general_set): Handle QTDisconnected.
7139 * event-loop.c (event_handler_func): Change return type to int.
7140 (process_event): Bail out if the event handler wants the event
7142 (handle_file_event): Ditto.
7143 (start_event_loop): Bail out if the event handler wants the event
7146 * nto-low.c (nto_target_ops): Adjust.
7147 * spu-low.c (spu_wait): Don't remove the process here.
7148 (spu_target_ops): Adjust.
7149 * win32-low.c (win32_wait): Don't remove the process here.
7150 (win32_target_ops): Adjust.
7154 * regcache.c (realloc_register_cache): Invalidate inferior's
7155 regcache before recreating it.
7159 * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
7164 * server.h (LONGEST): New.
7165 (struct thread_info) <while_stepping>: New field.
7166 (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
7168 (initialize_tracepoint, handle_tracepoint_general_set)
7169 (handle_tracepoint_query, tracepoint_finished_step)
7170 (tracepoint_was_hit, release_while_stepping_state_list):
7171 (current_traceframe): Declare.
7172 * server.c (handle_general_set): Handle tracepoint packets.
7174 (write_memory): New.
7175 (handle_search_memory_1): Use read_memory.
7176 (handle_query): Report support for conditional tracepoints, trace
7177 state variables, and tracepoint sources. Handle tracepoint
7179 (main): Initialize the tracepoints module.
7180 (process_serial_event): Handle traceframe reads/writes.
7182 * linux-low.c (handle_tracepoints): New.
7183 (linux_wait_1): Call it.
7184 (linux_resume_one_lwp): Handle while-stepping.
7185 (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
7186 (linux_target_ops): Install them.
7187 * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
7189 * linux-x86-low.c (x86_supports_tracepoints): New.
7190 (the_low_target). Install it.
7192 * mem-break.h (delete_breakpoint): Declare.
7193 * mem-break.c (delete_breakpoint): Make external.
7195 * target.h (struct target_ops): Add `supports_tracepoints',
7196 `read_pc', and `write_pc' fields.
7197 (target_supports_tracepoints): Define.
7198 * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
7201 * regcache.h (struct regcache) <registers_owned>: New field.
7202 (init_register_cache, regcache_cpy): Declare.
7203 (regcache_read_pc, regcache_write_pc): Declare.
7204 (register_cache_size): Declare.
7205 (supply_regblock): Declare.
7206 * regcache.c (init_register_cache): New.
7207 (new_register_cache): Use it.
7208 (regcache_cpy): New.
7209 (register_cache_size): New.
7210 (supply_regblock): New.
7211 (regcache_read_pc, regcache_write_pc): New.
7213 * tracepoint.c: New.
7215 * Makefile.in (OBS): Add tracepoint.o.
7216 (tracepoint.o): New rule.
7220 * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
7222 (i386-mmx.c): Likewise.
7223 (i386-mmx-linux.o): Likewise.
7224 (i386-mmx-linux.c): Likewise.
7226 * configure.srv (srv_i386_regobj): Add i386-mmx.o.
7227 (srv_i386_linux_regobj): Add i386-mmx-linux.o.
7228 (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
7229 (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
7231 * linux-x86-low.c (init_registers_i386_mmx_linux): New.
7232 (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
7233 and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
7237 * Makefile.in (clean): Updated.
7239 (i386-avx.c): Likewise.
7240 (i386-avx-linux.o): Likewise.
7241 (i386-avx-linux.c): Likewise.
7242 (amd64-avx.o): Likewise.
7243 (amd64-avx.c): Likewise.
7244 (amd64-avx-linux.o): Likewise.
7245 (amd64-avx-linux.c): Likewise.
7247 * configure.srv (srv_i386_regobj): Add i386-avx.o.
7248 (srv_i386_linux_regobj): Add i386-avx-linux.o.
7249 (srv_amd64_regobj): Add amd64-avx.o.
7250 (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
7251 (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
7252 (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
7253 (srv_i386_xmlfiles): Add i386/i386-avx.xml.
7254 (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
7255 (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
7256 (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
7258 * i387-fp.c: Include "i386-xstate.h".
7260 (i387_cache_to_xsave): Likewise.
7261 (i387_xsave_to_cache): Likewise.
7262 (x86_xcr0): Likewise.
7264 * i387-fp.h (i387_cache_to_xsave): Likewise.
7265 (i387_xsave_to_cache): Likewise.
7266 (x86_xcr0): Likewise.
7268 * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
7269 * linux-crisv32-low.c (target_regsets): Likewise.
7270 * linux-m68k-low.c (target_regsets): Likewise.
7271 * linux-mips-low.c (target_regsets): Likewise.
7272 * linux-ppc-low.c (target_regsets): Likewise.
7273 * linux-s390-low.c (target_regsets): Likewise.
7274 * linux-sh-low.c (target_regsets): Likewise.
7275 * linux-sparc-low.c (target_regsets): Likewise.
7276 * linux-xtensa-low.c (target_regsets): Likewise.
7278 * linux-low.c: Include <sys/uio.h>.
7279 (regsets_fetch_inferior_registers): Support nt_type.
7280 (regsets_store_inferior_registers): Likewise.
7281 (linux_process_qsupported): New.
7282 (linux_target_ops): Add linux_process_qsupported.
7284 * linux-low.h (regset_info): Add nt_type.
7285 (linux_target_ops): Add process_qsupported.
7287 * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
7289 (init_registers_i386_avx_linux): New.
7290 (init_registers_amd64_avx_linux): Likewise.
7291 (xmltarget_i386_linux_no_xml): Likewise.
7292 (xmltarget_amd64_linux_no_xml): Likewise.
7293 (PTRACE_GETREGSET): Likewise.
7294 (PTRACE_SETREGSET): Likewise.
7295 (x86_fill_xstateregset): Likewise.
7296 (x86_store_xstateregset): Likewise.
7297 (use_xml): Likewise.
7298 (x86_linux_update_xmltarget): Likewise.
7299 (x86_linux_process_qsupported): Likewise.
7300 (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
7301 (x86_arch_setup): Don't call init_registers_amd64_linux nor
7302 init_registers_i386_linux here. Call
7303 x86_linux_update_xmltarget.
7304 (the_low_target): Add x86_linux_process_qsupported.
7306 * server.c (handle_query): Call target_process_qsupported.
7308 * target.h (target_ops): Add process_qsupported.
7309 (target_process_qsupported): New.
7313 * inferiors.c (add_thread): Set last_status kind to
7314 TARGET_WAITKIND_IGNORE.
7315 * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
7316 fetch. Use ptid_of. Avoid unnecessary get_lwp_thread calls.
7317 (linux_wait_1): Move `thread' local definition to block that uses
7318 it. Don't NULL initialize `event_child'.
7319 (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
7320 Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
7321 * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
7325 * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
7326 an extended waitstatus, or by a watchpoint.
7327 (cancel_breakpoints_callback): Don't cancel a breakpoint if the
7328 thread was stepping or has been stopped by a watchpoint.
7332 * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
7333 (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
7334 of another, then delete the previous, and validate all
7336 (validate_inserted_breakpoint): New.
7337 (delete_disabled_breakpoints): New.
7338 (validate_breakpoints): New.
7339 (check_mem_read): Validate breakpoints before trusting their
7340 shadow. Delete disabled breakpoints.
7341 (check_mem_write): Validate breakpoints before trusting they
7342 should be inserted. Delete disabled breakpoints.
7343 * mem-break.h (validate_breakpoints):
7344 * server.c (handle_query): Validate breakpoints when we see a
7349 * linux-low.c (linux_wait_1): Avoid setting need_step_over is
7350 there's a GDB breakpoint at stop_pc. Always report a trap to GDB
7351 if we could tell there's a GDB breakpoint at stop_pc.
7352 (need_step_over_p): Don't do a step over if we find a GDB
7353 breakpoint at the resume PC.
7355 * mem-break.c (struct raw_breakpoint): New.
7356 (enum bkpt_type): New type `gdb_breakpoint'.
7357 (struct breakpoint): Delete the `PC', `old_data' and `inserted'
7358 fields. New field `raw'.
7359 (find_raw_breakpoint_at): New.
7360 (set_raw_breakpoint_at): Handle refcounting. Create a raw
7362 (set_breakpoint_at): Adjust.
7363 (delete_raw_breakpoint): New.
7364 (release_breakpoint): New.
7365 (delete_breakpoint): Rename to...
7366 (delete_breakpoint_1): ... this. Add proc parameter. Use
7367 release_breakpoint. Return ENOENT.
7368 (delete_breakpoint): Reimplement.
7369 (find_breakpoint_at): Delete.
7370 (find_gdb_breakpoint_at): New.
7371 (delete_breakpoint_at): Delete.
7372 (set_gdb_breakpoint_at): New.
7373 (delete_gdb_breakpoint_at): New.
7374 (gdb_breakpoint_here): New.
7375 (set_reinsert_breakpoint): Use release_breakpoint.
7376 (uninsert_breakpoint): Rename to ...
7377 (uninsert_raw_breakpoint): ... this.
7378 (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
7379 (reinsert_raw_breakpoint): Change parameter type to
7381 (reinsert_breakpoints_at): Adjust to handle raw breakpoints
7383 (check_breakpoints): Adjust. Use release_breakpoint.
7384 (breakpoint_here): Rewrite using find_raw_breakpoint_at.
7385 (breakpoint_inserted_here): Ditto.
7386 (check_mem_read): Adjust to iterate over raw breakpoints instead.
7387 Don't trust the breakpoint's shadow if it is not inserted.
7388 (check_mem_write): Adjust to iterate over raw breakpoints instead.
7389 (delete_all_breakpoints): Adjust.
7390 (free_all_breakpoints): Mark all breakpoints as uninserted, and
7391 use delete_breakpoint_1.
7393 * mem-break.h (breakpoints_supported): Delete declaration.
7394 (set_gdb_breakpoint_at): Declare.
7395 (gdb_breakpoint_here): Declare.
7396 (delete_breakpoint_at): Delete.
7397 (delete_gdb_breakpoint_at): Declare.
7399 * server.h (struct raw_breakpoint): Forward declare.
7400 (struct process_info): New field `raw_breakpoints'.
7402 * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
7407 * linux-low.c (status_pending_p_callback): Fix comment.
7408 (linux_wait_for_event_1): Move most of the internal breakpoint
7409 handling from here...
7410 (linux_wait_1): ... to here.
7411 (count_events_callback): New.
7412 (select_singlestep_lwp_callback): New.
7413 (select_event_lwp_callback): New.
7414 (cancel_breakpoints_callback): New.
7415 (select_event_lwp): New.
7416 (linux_wait_1): Simplify internal breakpoint handling. Give equal
7417 priority to all LWPs that have had events that should be reported
7418 to the client. Cancel breakpoints when about to reporting the
7419 event to the client, not while stopping lwps. No longer cancel
7420 finished single-steps here.
7421 (cancel_finished_single_step): Delete.
7422 (cancel_finished_single_steps): Delete.
7426 * mem-break.c (enum bkpt_type): New.
7427 (struct breakpoint): New field `type'.
7428 (set_breakpoint_at): Change return type to struct breakpoint
7429 pointer. Set type to `other_breakpoint' by default.
7430 (delete_breakpoint): Rewrite, supporting more than one breakpoint
7431 in the breakpoint list.
7432 (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
7433 (reinsert_breakpoint): Rename to ...
7434 (reinsert_raw_breakpoint): ... this.
7435 (reinsert_breakpoints_at): Adjust.
7436 * mem-break.h (struct breakpoint): Declare.
7437 (set_breakpoint_at): Change return type to struct breakpoint
7442 * server.c (handle_query): Assign, not compare.
7446 Teach linux gdbserver to step-over-breakpoints.
7448 * linux-low.c (can_hardware_single_step): New.
7449 (supports_breakpoints): New.
7450 (handle_extended_wait): If stopping threads, read the stop pc of
7453 (get_stop_pc): Add `lwp' parameter. Handle it. Bail out if the
7454 low target doesn't support retrieving the PC.
7455 (add_lwp): Set last_resume_kind to resume_continue.
7456 (linux_attach_lwp_1): Adjust comments. Always set stop_expected.
7457 (linux_attach): Don't clear stop_expected. Set the lwp's
7458 last_resume_kind to resume_stop.
7459 (linux_detach_one_lwp): Don't check for removed breakpoints.
7460 (check_removed_breakpoint): Delete.
7461 (status_pending_p): Rename to ...
7462 (status_pending_p_callback): ... this. Don't check for removed
7463 breakpoints. Don't consider threads that are stopped from GDB's
7465 (linux_wait_for_lwp): Always read the stop_pc here.
7466 (cancel_breakpoint): New.
7467 (step_over_bkpt): New global.
7468 (linux_wait_for_event_1): Implement stepping over breakpoints.
7469 (gdb_wants_lwp_stopped): New.
7470 (gdb_wants_all_stopped): New.
7471 (linux_wait_1): Tag threads as gdb-wants-stopped. Cancel finished
7472 single-step traps here. Store the thread's last reported target
7474 (send_sigstop): Don't clear stop_expected. Always set it,
7476 (mark_lwp_dead): Remove reference to pending_is_breakpoint.
7477 (cancel_finished_single_step): New.
7478 (cancel_finished_single_steps): New.
7479 (wait_for_sigstop): Don't cancel finished single-step traps here.
7480 (linux_resume_one_lwp): Don't check for removed breakpoints.
7481 Don't set `step' on non-hardware step archs.
7482 (linux_set_resume_request): Ignore resume_stop requests if already
7483 stopping or stopped. Set the lwp's last_resume_kind.
7484 (resume_status_pending_p): Don't check for removed breakpoints.
7485 (need_step_over_p): New.
7486 (start_step_over): New.
7487 (finish_step_over): New.
7488 (linux_resume_one_thread): Always queue a sigstop for resume_stop
7489 requests. Clear the thread's last reported target waitstatus.
7490 Don't use the `suspended' flag. Don't consider pending breakpoints.
7491 (linux_resume): Start a step-over if necessary.
7492 (proceed_one_lwp): New.
7493 (proceed_all_lwps): New.
7494 (unstop_all_lwps): New.
7495 * linux-low.h (struct lwp_info): Rewrite comment for the
7496 `suspended' flag. Add the `stop_pc' field. Delete the
7497 `pending_stop_pc' field. Tweak the `stepping' flag's comment.
7498 Add `'last_resume_kind' and `need_step_over' fields.
7499 * inferiors.c (struct thread_info): Delete, moved elsewhere.
7500 * mem-break.c (struct breakpoint): Delete `reinserting' flag.
7501 Delete `breakpoint_to_reinsert' field. New flag `inserted'.
7502 (set_raw_breakpoint_at): New.
7503 (set_breakpoint_at): Rewrite to use it.
7504 (reinsert_breakpoint_handler): Delete.
7505 (set_reinsert_breakpoint): New.
7506 (reinsert_breakpoint_by_bp): Delete.
7507 (delete_reinsert_breakpoints): New.
7508 (uninsert_breakpoint): Rewrite.
7509 (uninsert_breakpoints_at): New.
7510 (reinsert_breakpoint): Rewrite.
7511 (reinsert_breakpoints_at): New.
7512 (check_breakpoints): Rewrite.
7513 (breakpoint_here): New.
7514 (breakpoint_inserted_here): New.
7515 (check_mem_read): Adjust.
7516 * mem-break.h (breakpoints_supported, breakpoint_here)
7517 (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
7518 (reinsert_breakpoint_by_bp): Delete declaration.
7519 (delete_reinsert_breakpoints): Declare.
7520 (reinsert_breakpoint): Delete declaration.
7521 (reinsert_breakpoints_at): Declare.
7522 (uninsert_breakpoint): Delete declaration.
7523 (uninsert_breakpoints_at): Declare.
7524 (check_breakpoints): Adjust prototype.
7525 * server.h: Adjust include order.
7526 (struct thread_info): Declare here. Add a `last_status' field.
7530 * server.c (crc32): New function.
7531 (handle_query): Add handling for 'qCRC:' request.
7535 * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
7536 lwp had been stopped by a watchpoint.
7540 * server.h (internal_error): Declare.
7541 (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
7542 * utils.c (internal_error): New function.
7546 * configure.srv: Fix typo setting srv_regobj.
7550 * linux-low.c (fetch_register): Avoid passing a non string literal
7552 (usr_store_inferior_registers): Ditto.
7556 * linux-low.c (linux_write_memory): Bail out early if peeking
7561 * linux-low.h (struct lwp_info): New fields
7562 `stopped_by_watchpoint' and `stopped_data_address'.
7563 * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
7564 here, and cache them in the lwp object.
7565 (wait_for_sigstop): Check stopped_by_watchpoint lwp field
7567 (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
7569 (linux_stopped_by_watchpoint): Rewrite.
7570 (linux_stopped_data_address): Rewrite.
7574 * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
7575 switching the current inferior, not before.
7579 * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
7580 reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
7581 i386-linux.c and amd64-linux.c.
7582 (reg-i386.o): Removed.
7583 (reg-i386.c): Likewise.
7584 (reg-i386-linux.o): Likewise.
7585 (reg-i386-linux.c): Likewise.
7586 (reg-x86-64.o): Likewise.
7587 (reg-x86-64.c): Likewise.
7588 (reg-x86-64-linux.o): Likewise.
7589 (reg-x86-64-linux.c): Likewise.
7592 (i386-linux.o): Likewise.
7593 (i386-linux.c): Likewise.
7594 (amd64.o): Likewise.
7595 (amd64.c): Likewise.
7596 (amd64-linux.o): Likewise.
7597 (amd64-linux.c): Likewise.
7599 * configure.srv (srv_i386_regobj): New.
7600 (srv_i386_linux_regobj): Likewise.
7601 (srv_amd64_regobj): Likewise.
7602 (srv_amd64_linux_regobj): Likewise.
7603 (srv_i386_32bit_xmlfiles): Likewise.
7604 (srv_i386_64bit_xmlfiles): Likewise.
7605 (srv_i386_xmlfiles): Likewise.
7606 (srv_amd64_xmlfiles): Likewise.
7607 (srv_i386_linux_xmlfiles): Likewise.
7608 (srv_amd64_linux_xmlfiles): Likewise.
7609 (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set
7610 srv_xmlfiles to $srv_i386_xmlfiles.
7611 (i[34567]86-*-mingw32ce*): Likewise.
7612 (i[34567]86-*-mingw*): Likewise.
7613 (i[34567]86-*-nto*): Likewise.
7614 (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
7615 and $srv_amd64_linux_regobj. Set srv_xmlfiles to
7616 $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
7617 (x86_64-*-linux*): Likewise.
7619 * linux-x86-low.c (init_registers_x86_64_linux): Removed.
7620 (init_registers_amd64_linux): New.
7621 (x86_arch_setup): Replace init_registers_x86_64_linux with
7622 init_registers_amd64_linux.
7626 * configure.ac: Check for libdl. If it is not available link against
7627 static libthread_db.
7628 * configure: Regenerate.
7634 * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
7635 handing a read watchpoint.
7636 (i386_low_insert_watchpoint): Read watchpoints aren't supported.
7640 * linux-low.c (linux_supports_tracefork_flag): Document.
7641 (linux_look_up_symbols): Add comment.
7645 * regcache.c (supply_register): Clear regcache if buf is NULL.
7650 * inferiors.c (find_inferior): Add function documentation.
7651 (unloaded_dll): Handle the case where the unloaded dll has not
7652 been previously registered in the dll list.
7656 * linux-arm-low.c (thumb_breakpoint_len): Delete.
7657 (thumb2_breakpoint): New.
7658 (arm_breakpoint_at): Check for Thumb-2 breakpoints.
7662 * linux-low.c (get_stop_pc): Check for SIGTRAP.
7663 (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
7668 * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
7672 * linux-s390-low.c (s390_collect_ptrace_register)
7673 (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
7677 * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
7678 (PTRACE_ARG4_TYPE): New macro.
7679 (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
7680 (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
7681 (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
7682 (usr_store_inferior_registers): Ditto.
7683 (linux_read_memory, linux_write_memory): Ditto.
7684 (linux_test_for_tracefork): Ditto.
7686 * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
7687 Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
7691 * proc-service.c (ps_lgetregs): Don't refetch registers from the
7696 * spu-low.c (spu_fetch_registers, spu_store_registers): Change
7697 prototype to take a regcache. Adjust.
7701 * regcache.h (struct thread_info): Forward declare.
7702 (struct regcache): New.
7703 (new_register_cache): Adjust prototype.
7704 (get_thread_regcache): Declare.
7705 (free_register_cache): Adjust prototype.
7706 (registers_to_string, registers_from_string): Ditto.
7707 (supply_register, supply_register_by_name, collect_register)
7708 (collect_register_as_string, collect_register_by_name): Ditto.
7709 * regcache.c (struct inferior_regcache_data): Delete.
7710 (get_regcache): Rename to ...
7711 (get_thread_regcache): ... this. Adjust. Switch inferior before
7713 (regcache_invalidate_one): Adjust.
7714 (regcache_invalidate): Fix prototype.
7715 (new_register_cache): Return the new register cache.
7716 (free_register_cache): Change prototype.
7717 (realloc_register_cache): Adjust.
7718 (registers_to_string): Change prototype to take a regcache. Adjust.
7719 (registers_from_string): Ditto.
7720 (register_data): Ditto.
7721 (supply_register): Ditto.
7722 (supply_register_by_name): Ditto.
7723 (collect_register): Ditto.
7724 (collect_register_as_string): Ditto.
7725 (collect_register_by_name): Ditto.
7726 * server.c (process_serial_event): Adjust.
7727 * linux-low.h (regset_fill_func, regset_store_func): Change
7729 (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
7731 * linux-low.c (get_stop_pc): Adjust.
7732 (check_removed_breakpoint): Adjust.
7733 (linux_wait_for_event): Adjust.
7734 (linux_resume_one_lwp): Adjust.
7735 (fetch_register): Add regcache parameter. Adjust.
7736 (usr_store_inferior_registers): Ditto.
7737 (regsets_fetch_inferior_registers): Ditto.
7738 (regsets_store_inferior_registers): Ditto.
7739 (linux_fetch_registers, linux_store_registers): Ditto.
7740 * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
7742 (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
7744 * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
7745 prototype to take a regcache.
7746 (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
7747 * remote-utils.c (convert_ascii_to_int, outreg)
7748 (prepare_resume_reply): Change prototype to take a regcache.
7750 * target.h (struct target_ops) <fetch_registers, store_registers>:
7751 Change prototype to take a regcache.
7752 (fetch_inferior_registers, store_inferior_registers): Change
7753 prototype to take a regcache. Adjust.
7754 * proc-service.c (ps_lgetregs): Adjust.
7755 * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
7756 (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
7757 (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
7758 take a regcache. Adjust.
7759 * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
7760 (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
7761 (arm_store_vfpregset, arm_get_pc, arm_set_pc):
7762 (arm_breakpoint_at): Change prototype to take a regcache. Adjust.
7763 * linux-cris-low.c (cris_get_pc, cris_set_pc)
7764 (cris_cannot_fetch_register):
7765 (cris_breakpoint_at): Change prototype to take a regcache.
7767 * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
7768 cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
7769 to take a regcache. Adjust.
7770 (cris_breakpoint_at, cris_insert_point, cris_remove_point):
7772 * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
7773 take a regcache. Adjust.
7774 * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
7775 (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
7776 (m68k_set_pc): Change prototype to take a regcache. Adjust.
7777 * linux-mips-low.c (mips_get_pc):
7778 (mips_set_pc): Change prototype to take a regcache. Adjust.
7779 (mips_reinsert_addr): Adjust.
7780 (mips_collect_register): Change prototype to take a regcache.
7782 (mips_supply_register):
7783 (mips_collect_register_32bit, mips_supply_register_32bit)
7784 (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
7785 (mips_store_fpregset): Ditto.
7786 * linux-ppc-low.c (ppc_supply_ptrace_register)
7787 (ppc_supply_ptrace_register): Ditto.
7788 (parse_spufs_run): Adjust.
7789 (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
7790 (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
7791 (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
7792 take a regcache. Adjust.
7793 * linux-s390-low.c (s390_collect_ptrace_register)
7794 (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
7795 (s390_set_pc): Change prototype to take a regcache. Adjust.
7796 (s390_arch_setup): Adjust.
7797 * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
7798 (sh_fill_gregset): Change prototype to take a regcache. Adjust.
7799 * linux-sparc-low.c (sparc_fill_gregset_to_stack)
7800 (sparc_fill_gregset, sparc_store_gregset_from_stack)
7801 (sparc_store_gregset, sparc_get_pc): Change prototype to take a
7803 (sparc_breakpoint_at): Adjust.
7804 * linux-xtensa-low.c (xtensa_fill_gregset):
7805 (xtensa_store_gregset):
7806 (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
7807 (xtensa_set_pc): Change prototype to take a regcache. Adjust.
7808 * nto-low.c (nto_fetch_registers, nto_store_registers): Change
7809 prototype to take a regcache. Adjust.
7810 * win32-arm-low.c (arm_fetch_inferior_register)
7811 (arm_store_inferior_register): Change prototype to take a
7813 * win32-i386-low.c (i386_fetch_inferior_register)
7814 (i386_store_inferior_register): Change prototype to take a
7816 * win32-low.c (child_fetch_inferior_registers)
7817 (child_store_inferior_registers): Change prototype to take a
7819 (win32_wait): Adjust.
7820 (win32_fetch_inferior_registers): Change prototype to take a
7822 (win32_store_inferior_registers): Adjust.
7823 * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
7824 store_inferior_register>: Change prototype to take a regcache.
7828 * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
7830 (linux_wait_for_event1, linux_init_signals): Ditto.
7831 (W_STOPCODE): Provide definition if missing.
7835 * linux-low.c (linux_core_of_thread): New.
7836 (compare_ints, show_process, list_threads): New.
7837 (linux_qxfer_osdata): Report threads and cores.
7838 (linux_target_op): Register linux_core_of_thread.
7839 * remote-utils.c (prepare_resume_reply): Report the core.
7840 (buffer_xml_printf): Support %d specifier.
7841 * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
7843 (handle_query): Handle qXfer:threads. Announce availability
7845 * target.h (struct target_ops): New field core_of_thread.
7849 * Makefile.in (clean): Remove new generated files.
7850 (reg-s390.o, reg-s390.c): Remove rules.
7851 (reg-s390x.o, reg-s390x.c): Likewise.
7852 (s390-linux32.o, s390-linux32.c): Add rules.
7853 (s390-linux64.o, s390-linux64.c): Likewise.
7854 (s390x-linux64.o, s390x-linux64.c): Likewise.
7855 * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
7856 * linux-s390-low.c: Include <elf.h>.
7857 (HWCAP_S390_HIGH_GPRS): Define if undefined.
7858 (init_registers_s390): Remove prototype.
7859 (init_registers_s390x): Likewise.
7860 (init_registers_s390_linux32): Add prototype.
7861 (init_registers_s390_linux64): Likewise.
7862 (init_registers_s390x_linux64): Likewise.
7863 (s390_num_regs_3264): New define.
7864 (s390_regmap_3264): New global variable.
7865 (s390_cannot_fetch_register): Remove obsolete check.
7866 (s390_cannot_store_register): Likewise.
7867 (s390_collect_ptrace_register): Handle upper/lower register halves.
7868 (s390_supply_ptrace_register): Likewise.
7869 (s390_fill_gregset): Update to register number changes.
7870 (s390_get_hwcap): New routine.
7871 (s390_arch_setup): Detect 32-bit process running on 64-bit system.
7872 Install appropriate regmap and register set.
7876 * server.c (gdbserver_version): Update copyright year to 2010.
7877 * gdbreplay.c (gdbreplay_version): Likewise.
7881 * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
7882 elf/external.h. Include <elf.h> instead but only if necessary.
7886 * linux-low.c (linux_remove_process): Remove `detaching'
7887 parameter. Don't release/detach from thread_db here.
7888 (linux_kill): Release/detach from thread_db here, ...
7889 (linux_detach): ... and here, before actually detaching.
7890 (linux_wait_1): ... and here, when a process exits.
7891 * thread-db.c (any_thread_of): New.
7892 (thread_db_free): Switch the current inferior to a thread of the
7897 * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
7899 * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
7900 Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
7901 warning ifndef __NR_tkill. Move setting of errno there too.
7902 Delete unnecessary resetting of errno after syscall.
7903 Minor comment changes to match gdb/linux-nat.c:kill_lwp.
7905 * configure.ac: Check for dladdr.
7906 * config.in: Regenerate.
7907 * configure: Regenerate.
7908 * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
7909 (try_thread_db_load): Update.
7911 * linux-low.c (my_waitpid): Delete unnecessary prototype.
7915 * event-loop.c: Include unistd.h if it exists.
7917 * linux-low.c (my_waitpid): Move definition away from being in
7918 between linux_tracefork_child/linux_test_for_tracefork.
7920 * gdb_proc_service.h (psaddr_t): Fix type.
7921 * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
7922 signature to match glibc.
7926 * linux-low.c (linux_read_memory): Fix argument to read.
7930 * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
7931 events, don't leave current_inferior pointing at null.
7935 * win32-low.c (LOG): Delete.
7936 (OUTMSG): Output to stderr.
7937 (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
7938 on compile time LOG macro.
7939 (win32_wait): Fix debug output.
7943 * win32-low.c (win32_add_one_solib): If the dll name is
7944 "ntdll.dll", prepend the system directory to the dll path.
7948 * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
7953 * Makefile.in (reg-cf.o, reg-cf.c): New targets.
7954 * configure.ac: Check for __mcoldfire__ and set
7955 gdb_cv_m68k_is_coldfire.
7956 * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
7957 reg-cf.o and reg-m68k.o.
7958 * configure: Regenerated.
7962 * linux-low.c (linux_remove_process): Add `detaching' parameter.
7963 Pass it to thread_db_free.
7964 (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
7965 proper `detaching' argument to linux_remove_process.
7966 * linux-low.h (thread_db_free): Add `detaching' parameter.
7967 * thread-db.c (thread_db_init): Pass false as `detaching' argument
7969 (thread_db_free): Add `detaching' parameter. Only
7970 call td_ta_clear_event if detaching from process.
7974 * thread-db.c (thread_db_free): Fix typo.
7979 * thread-db.c (thread_db_free): Call td_ta_clear_event.
7983 * configure.ac (i[34567]86-*): Check if we're targetting x86-64
7984 with an i686 compiler.
7985 * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
7987 * configure: Rebuilt.
7993 * server.c (handle_search_memory_1): Correct read_addr initialization
7994 in loop for searching subsequent chunks.
7998 * configure.ac: New --with-libthread-db option.
7999 * thread-db.c: Allow direct dependence on libthread_db.
8000 (thread_db_free): Adjust.
8001 * config.in: Regenerate.
8002 * configure: Likewise.
8007 * thread-db.c (attach_thread): New function.
8008 (maybe_attach_thread): Return success/failure.
8009 (find_new_threads_callback): Adjust.
8010 (thread_db_find_new_threads): Loop until no new threads.
8014 * proc-service.c (ps_lgetregs): Formatting.
8018 * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
8019 * configure.ac: Adjust.
8020 * linux-low.h (struct process_info_private): Move members to struct
8022 (thread_db_free, thread_db_handle_monitor_command): New prototype.
8023 * linux-low.c (linux_remove_process): Adjust.
8024 (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
8025 * server.c (handle_query): Move code ...
8026 (handle_monitor_command): ... here. New function.
8027 * target.h (struct target_ops): New member.
8028 * thread-db.c (struct thread_db): New.
8029 (libthread_db_search_path): New variable.
8030 (thread_db_create_event, thread_db_enable_reporting)
8031 (find_one_thread, maybe_attach_thread, find_new_threads_callback)
8032 (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
8033 (try_thread_db_load_1, dladdr_to_soname): New functions.
8034 (try_thread_db_load, thread_db_load_search): New functions.
8035 (thread_db_init): Search for libthread_db.
8036 (thread_db_free): New function.
8037 (thread_db_handle_monitor_command): Likewise.
8038 * config.in: Regenerate.
8039 * configure: Regenerate.
8043 * spu-low.c (spu_kill): Wait for inferior to terminate.
8044 Call clear_inferiors.
8045 (spu_detach): Call clear_inferiors.
8049 * aclocal.m4: Regenerate.
8050 * config.in: Likewise.
8051 * configure: Likewise.
8055 * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
8056 (parse_spufs_run): New function.
8057 (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
8058 (ppc_breakpoint_at): Handle SPU breakpoints.
8062 * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
8063 (SPUFS_MAGIC): Define.
8064 (spu_enumerate_spu_ids): New function.
8065 (linux_qxfer_spu): New function.
8066 (linux_target_ops): Install linux_qxfer_spu.
8070 * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
8071 and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml
8072 and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
8073 * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
8074 (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
8075 (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
8076 * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
8077 (init_registers_powerpc_cell32l): Add prototype.
8078 (init_registers_powerpc_cell64l): Likewise.
8079 (ppc_arch_setup): Detect Cell/B.E. architecture.
8083 * Makefile.in (datarootdir): New variable.
8087 * linux-low.c (linux_write_memory): Update debugging output.
8088 * Makefile.in (clean): Add new descriptions.
8089 (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
8090 (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
8091 * configure.srv: Add new files for arm*-*-linux*.
8092 * linux-arm-low.c: Add new declarations.
8093 (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
8094 (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
8095 (HWCAP_VFPv3D16): New.
8096 (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
8097 instead of __IWMMXT__.
8098 (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
8099 (arm_arch_setup): New.
8100 (target_regsets): Remove #ifdef. Add VFP regset.
8101 (the_low_target): Use arm_arch_setup.
8105 * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
8106 the main thread again.
8110 Adding Neutrino gdbserver.
8111 * configure: Regenerated.
8112 * configure.ac: Add case for srv_qnx and set LIBS accordingly.
8113 * configure.srv (i[34567]86-*-nto*): New target.
8114 * nto-low.c, nto-low.h, nto-x86-low.c: New files.
8115 * remote-utils.c [__QNX__]: Include sys/iomgr.h
8116 (nto_comctrl) [__QNX__]: New function.
8117 (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
8121 * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
8127 * win32-i386-low.c (i386_get_thread_context): Handle systems that
8128 don't support CONTEXT_EXTENDED_REGISTERS.
8129 (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
8130 (the_low_target): Install them.
8131 * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
8132 failing with ERROR_PIPE_NOT_CONNECTED.
8137 Add h/w watchpoint support to x86-linux, win32-i386.
8138 * Makefile.in (SFILES): Add i386-low.c
8139 (i386_low_h): Define.
8140 (i386-low.o): Add dependencies.
8141 (linux-x86-low.o): Add i386-low.h dependency.
8142 (win32-i386-low.o): Ditto.
8143 * i386-low.c: New file.
8144 * i386-low.h: New file.
8145 * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
8146 (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
8147 * linux-low.c (linux_add_process): Initialize arch_private.
8148 (linux_remove_process): Free arch_private.
8149 (add_lwp): Initialize arch_private.
8150 (delete_lwp): Free arch_private.
8151 (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
8153 * linux-low.h (process_info_private): New member arch_private.
8154 (lwp_info): New member arch_private.
8155 (linux_target_ops): New members new_process, new_thread,
8157 (ptid_of): New macro.
8158 * linux-x86-low.c: Include stddef.h, i386-low.h.
8159 (arch_process_info): New struct.
8160 (arch_lwp_info): New struct.
8161 (x86_linux_dr_get, x86_linux_dr_set): New functions.
8162 (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
8163 (i386_dr_low_get_status): New function.
8164 (x86_insert_point, x86_remove_point): New functions.
8165 (x86_stopped_by_watchpoint): New function.
8166 (x86_stopped_data_address): New function.
8167 (x86_linux_new_process, x86_linux_new_thread): New functions.
8168 (x86_linux_prepare_to_resume): New function.
8169 (the_low_target): Add entries for insert_point, remove_point,
8170 stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
8172 * server.c (debug_hw_points): New global.
8173 (monitor_show_help): Document set debug-hw-points.
8174 (handle_query): Process "set debug-hw-points".
8175 * server.h (debug_hw_points): Declare.
8176 (paddress): Declare.
8177 * utils.c (NUMCELLS, CELLSIZE): New macros.
8178 (get_sell, xsnprintf, paddress): New functions.
8179 * win32-arm-low.c (the_low_target): Add entries for insert_point,
8180 remove_point, stopped_by_watchpoint, stopped_data_address.
8181 * win32-i386-low.c: Include i386-low.h.
8182 (debug_reg_state): Replaces dr.
8183 (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
8184 (i386_dr_low_get_status): New function.
8185 (i386_insert_point, i386_remove_point): New functions.
8186 (i386_stopped_by_watchpoint): New function.
8187 (i386_stopped_data_address): New function.
8188 (i386_initial_stuff): Update.
8189 (get_thread_context,set_thread_context,i386_thread_added): Update.
8190 (the_low_target): Add entries for insert_point,
8191 remove_point, stopped_by_watchpoint, stopped_data_address.
8192 * win32-low.c (win32_insert_watchpoint): New function.
8193 (win32_remove_watchpoint): New function.
8194 (win32_stopped_by_watchpoint): New function.
8195 (win32_stopped_data_address): New function.
8196 (win32_target_ops): Add entries for insert_watchpoint,
8197 remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
8198 * win32-low.h (win32_target_ops): New members insert_point,
8199 remove_point, stopped_by_watchpoint, stopped_data_address.
8203 * server.c (process_serial_event): Re-return unsupported, not
8204 error, if the type isn't recognized. Re-allow supporting only
8205 insert or remove packets. Also call require_running for
8206 breakpoints. Add missing break statement to default case. Tidy.
8207 * target.h (struct target_ops): Rename insert_watchpoint to
8208 insert_point, and remove_watchpoint to remove_point.
8210 * linux-low.h (struct linux_target_ops): Likewise.
8211 * linux-low.c (linux_insert_watchpoint): Rename to ...
8212 (linux_insert_point): ... this. Adjust.
8213 (linux_remove_watchpoint): Rename to ...
8214 (linux_remove_point): ... this. Adjust.
8215 (linux_target_ops): Adjust.
8216 * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
8217 (cris_insert_point): ... this.
8218 (cris_remove_watchpoint): Rename to ...
8219 (cris_remove_point): ... this.
8220 (the_low_target): Adjust.
8224 * server.c (handle_v_kill): Pass signal_pid to
8225 kill_inferior if multi_process is zero.
8229 * server.c (process_serial_event): Add support for Z0 and Z1 packet.
8230 * target.h (target_ops): Comment for *_watchpoint to make it clear
8231 the functions can get types '0' and '1'.
8235 * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
8236 * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
8237 * regcache.c (get_regcache): Likewise.
8238 * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
8239 * win32-low.c (child_fetch_inferior_registers): Remove check for
8245 * target.h (struct target_ops) <supports_multi_process>: New
8247 (target_supports_multi_process): New.
8248 * server.c (handle_query): Even if GDB reports support, only
8249 enable multi-process if the target also supports it. Report
8250 multi-process support only if the target backend supports it.
8251 * linux-low.c (linux_supports_multi_process): New function.
8252 (linux_target_ops): Install it as target_supports_multi_process
8257 Global renaming of find_thread_pid to find_thread_ptid.
8258 * server.h (find_thread_ptid): Renamed from find_thread_pid.
8259 * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
8260 All callers updated.
8262 * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
8263 to resume the newly created thread, don't call ptrace (PTRACE_CONT)
8266 * linux-low.c (get_stop_pc): Print pc if debug_threads.
8267 (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
8268 (linux_resume_one_lwp): Ditto.
8272 * linux-low.c (linux_resume_one_lwp): Change type of first arg
8273 from struct inferior_list_entry * to struct lwp_info *.
8274 All callers updated.
8278 * linux-x86-low.c: Don't include assert.h.
8279 (x86_siginfo_fixup): Use fatal, not assert.
8280 (x86_arch_setup): Fix comment.
8284 Biarch support for i386/amd64 gdbserver.
8285 * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
8286 Add linux-x86-low.c.
8287 (linux-i386-low.o, linux-x86-64-low.o): Delete.
8288 (linux-x86-low.o): Add.
8289 * linux-x86-64-low.c: Delete.
8290 * linux-i386-low.c: Delete.
8291 * linux-x86-low.c: New file.
8292 * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
8294 (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
8296 (x86_64-linux srv_regobj): Add reg-i386-linux.o.
8297 * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
8298 (linux_child_pid_to_exec_file): New function.
8299 (elf_64_header_p, elf_64_file_p): New functions.
8300 (siginfo_fixup): New function.
8301 (linux_xfer_siginfo): New local inf_siginfo. Call siginfo_fixup to
8302 give target a chance to convert layout.
8303 * linux-low.h (linux_target_ops): New member siginfo_fixup.
8304 (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
8308 * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
8309 (regsets_store_inferior_registers): Ditto.
8315 * linux-low.c (must_set_ptrace_flags): Delete.
8316 (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
8318 (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here. Set
8319 `lwp->must_set_ptrace_flags' instead.
8320 (linux_wait_for_event_1): Set ptrace options here.
8321 (linux_wait_1): ... not here.
8325 * inferiors.c (started_inferior_callback): New function.
8326 (attached_inferior_callback): New function.
8327 (have_started_inferiors_p, have_attached_inferiors_p): New functions.
8328 * server.c (print_started_pid, print_attached_pid): New functions.
8329 (detach_or_kill_for_exit): New function.
8330 (main): Call it instead of for_each_inferior (kill_inferior_callback).
8331 * server.h (have_started_inferiors_p): Declare.
8332 (have_attached_inferiors_p): Declare.
8334 * inferiors.c (remove_process): Fix memory leak, free process.
8335 * linux-low.c (linux_remove_process): New function.
8336 (linux_kill): Call it instead of remove_process.
8337 (linux_detach, linux_wait_1): Ditto.
8341 * configure.srv: Add x86 Windows CE target.
8345 * inferiors.c (get_thread_process): Make global.
8346 * server.h (get_thread_process): Add prototype.
8347 * thread-db.c (find_one_thread): Use get_thread_process
8348 instead of current_process.
8349 (thread_db_get_tls_address): Do not crash if called when
8350 thread layer is not yet initialized.
8354 * remote-utils.c (prepare_resume_reply): Null-terminate packet.
8355 * spu-low.c (current_tid): Rename to ...
8356 (current_ptid): ... this.
8357 (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
8358 spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
8359 ptid_get_lwp (current_ptid) instead of current_tid.
8360 (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
8361 instead of current_tid. Use find_process_pid to verify pid
8362 argument is valid. Pass proper argument to remove_process.
8363 (spu_thread_alive): Compare current_ptid instead of current_tid.
8364 (spu_resume): Likewise.
8368 * linux-low.c (usr_store_inferior_registers): Declare local `pid'
8373 Implement the multiprocess extensions, and add linux multiprocess
8376 * server.h (ULONGEST): Declare.
8377 (struct ptid, ptid_t): New.
8378 (minus_one_ptid, null_ptid): Declare.
8379 (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
8380 (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
8381 (struct inferior_list_entry): Change `id' type from unsigned from
8383 (struct sym_cache, struct breakpoint, struct
8384 process_info_private): Forward declare.
8385 (struct process_info): Declare.
8386 (current_process): Declare.
8387 (all_processes): Declare.
8388 (initialize_inferiors): Declare.
8389 (add_thread): Adjust to use ptid_t.
8390 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
8391 (add_process, remove_process, find_thread_pid): Declare.
8392 (find_inferior_id): Adjust to use ptid_t.
8393 (cont_thread, general_thread, step_thread): Change type to ptid_t.
8394 (multi_process): Declare.
8395 (push_event): Adjust to use ptid_t.
8396 (read_ptid, write_ptid): Declare.
8397 (prepare_resume_reply): Adjust to use ptid_t.
8398 (clear_symbol_cache): Declare.
8399 * inferiors.c (all_processes): New.
8400 (null_ptid, minus_one_ptid): New.
8401 (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
8402 (ptid_get_tid, ptid_equal, ptid_is_pid): New.
8403 (add_thread): Change unsigned long to ptid. Remove gdb_id
8405 (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
8406 (gdb_id_to_thread): Rename to ...
8407 (find_thread_pid): ... this. Change unsigned long to ptid.
8408 (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
8409 (loaded_dll, pull_pid_from_list): Adjust.
8410 (add_process, remove_process, find_process_pid)
8411 (get_thread_process, current_process, initialize_inferiors): New.
8412 * target.h (struct thread_resume) <thread>: Change type to ptid_t.
8413 (struct target_waitstatus) <related_pid>: Ditto.
8414 (struct target_ops) <kill, detach>: Add `pid' argument. Change
8416 (struct target_ops) <join>: Add `pid' argument.
8417 (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
8418 (struct target_ops) <wait>: Add `ptid' field. Change return type
8420 (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
8421 (mywait): Add `ptid' argument. Change return type to ptid_t.
8422 (target_pid_to_str): Declare.
8423 * target.c (set_desired_inferior): Adjust to use ptids.
8424 (mywait): Add new `ptid' argument. Adjust.
8425 (target_pid_to_str): New.
8426 * mem-break.h (free_all_breakpoints): Declare.
8427 * mem-break.c (breakpoints): Delelete.
8428 (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
8429 (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
8430 to use per-process breakpoint list.
8431 (free_all_breakpoints): New.
8432 * remote-utils.c (struct sym_cache) <name>: Drop `const'.
8433 (symbol_cache, all_symbols_looked_up): Delete.
8435 (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
8437 (prepare_resume_reply): Change ptid argument's type from unsigned
8438 long to ptid_t. Adjust. Implement W;process and X;process.
8439 (free_sym_cache, clear_symbol_cache): New.
8440 (look_up_one_symbol): Adjust to per-process symbol cache. *
8441 * server.c (cont_thread, general_thread, step_thread): Change type
8444 (multi_process): New.
8445 (last_ptid): Change type to ptid_t.
8446 (struct vstop_notif) <ptid>: Change type to ptid_t.
8447 (queue_stop_reply, push_event): Change `ptid' argument's type to
8449 (discard_queued_stop_replies): Add `pid' argument.
8450 (start_inferior): Adjust to use ptids. Adjust to mywait interface
8451 changes. Don't reference the `attached' global.
8452 (attach_inferior): Adjust to mywait interface changes.
8453 (handle_query): Adjust to use ptids. Parse GDB's qSupported
8454 features. Handle and report "multiprocess+". Handle
8456 (handle_v_cont): Adjust to use ptids. Adjust to mywait interface
8458 (handle_v_kill): New.
8459 (handle_v_stopped): Adjust to use target_pid_to_str.
8460 (handle_v_requests): Allow multiple attaches and runs when
8461 multiprocess extensions are in effect. Handle "vKill".
8462 (myresume): Adjust to use ptids.
8463 (queue_stop_reply_callback): Add `arg' parameter. Handle it.
8464 (handle_status): Adjust to discard_queued_stop_replies interface
8466 (first_thread_of, kill_inferior_callback)
8467 (detach_or_kill_inferior_callback, join_inferiors_callback): New.
8468 (main): Call initialize_inferiors. Adjust to use ptids, killing
8469 and detaching from all inferiors. Handle multiprocess packet
8471 * linux-low.h: Include gdb_proc_service.h.
8472 (struct process_info_private): New.
8473 (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
8474 <lwpid_of>: Use ptid_get_lwp.
8475 (get_lwp_thread): Adjust.
8476 (struct lwp_info): Add `dead' member.
8477 (find_lwp_pid): Declare.
8478 * linux-low.c (thread_db_active): Delete.
8479 (new_inferior): Adjust comment.
8480 (inferior_pid): Delete.
8481 (linux_add_process): New.
8482 (handle_extended_wait): Adjust.
8483 (add_lwp): Change unsigned long to ptid.
8484 (linux_create_inferior): Add process to processes table. Adjust
8485 to use ptids. Don't set new_inferior here.
8486 (linux_attach_lwp): Rename to ...
8487 (linux_attach_lwp_1): ... this. Add `initial' argument. Handle
8488 it. Adjust to use ptids.
8489 (linux_attach_lwp): New.
8490 (linux_attach): Add process to processes table. Don't set
8492 (struct counter): New.
8493 (second_thread_of_pid_p, last_thread_of_process_p): New.
8494 (linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to
8496 (linux_kill): Add `pid' argument. Handle it. Adjust to multiple
8497 processes. Remove process from process table.
8498 (linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust
8499 to multiple processes.
8500 (any_thread_of): New.
8501 (linux_detach): Add `pid' argument, and handle it. Remove process
8502 from processes table.
8503 (linux_join): Add `pid' argument. Handle it.
8504 (linux_thread_alive): Change unsighed long argument to ptid_t.
8505 Consider dead lwps as not being alive.
8506 (status_pending_p): Rename `dummy' argument to `arg'. Filter out
8507 threads we're not interested in.
8508 (same_lwp, find_lwp_pid): New.
8509 (linux_wait_for_lwp): Change `pid' argument's type from int to
8511 (linux_wait_for_event): Rename to ...
8512 (linux_wait_for_event_1): ... this. Change `pid' argument's type
8513 from int to ptid_t. Adjust.
8514 (linux_wait_for_event): New.
8515 (linux_wait_1): Add `ptid' argument. Change return type to
8516 ptid_t. Adjust. Use last_thread_of_process_p. Remove processes
8517 that exit from the process table.
8518 (linux_wait): Add `ptid' argument. Change return type to ptid_t.
8520 (mark_lwp_dead): New.
8521 (wait_for_sigstop): Adjust to use ptids. If a process exits while
8522 stopping all threads, mark its main lwp as dead.
8523 (linux_set_resume_request, linux_resume_one_thread): Adjust to use
8525 (fetch_register, usr_store_inferior_registers)
8526 (regsets_fetch_inferior_registers)
8527 (regsets_store_inferior_registers, linux_read_memory)
8528 (linux_write_memory): Inline `inferior_pid'.
8529 (linux_look_up_symbols): Adjust to use per-process
8531 (linux_request_interrupt): Adjust to use ptids.
8532 (linux_read_auxv): Inline `inferior_pid'.
8533 (initialize_low): Don't reference thread_db_active.
8534 * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
8535 * proc-service.c (ps_lgetregs): Use find_lwp_pid.
8536 (ps_getpid): Return the pid of the current inferior.
8537 * thread-db.c (proc_handle, thread_agent): Delete.
8538 (thread_db_create_event, thread_db_enable_reporting): Adjust to
8540 (find_one_thread): Change argument type to ptid_t. Adjust to
8542 (maybe_attach_thread): Adjust to per-process data and ptids.
8543 (thread_db_find_new_threads): Ditto.
8544 (thread_db_init): Ditto.
8545 * spu-low.c (spu_create_inferior, spu_attach): Add process to
8546 processes table. Adjust to use ptids.
8547 (spu_kill, spu_detach): Adjust interface. Remove process from
8549 (spu_join, spu_thread_alive): Adjust interface.
8550 (spu_wait): Adjust interface. Remove process from processes
8551 table. Adjust to use ptids.
8552 * win32-low.c (current_inferior_tid): Delete.
8553 (current_inferior_ptid): New.
8554 (debug_event_ptid): New.
8555 (thread_rec): Take a ptid. Adjust.
8556 (child_add_thread): Add `pid' argument. Adjust to use ptids.
8557 (child_delete_thread): Ditto.
8558 (do_initial_child_stuff): Add `attached' argument. Add process to
8560 (child_fetch_inferior_registers, child_store_inferior_registers):
8562 (win32_create_inferior): Pass 0 to do_initial_child_stuff.
8563 (win32_attach): Pass 1 to do_initial_child_stuff.
8564 (win32_kill): Adjust interface. Remove process from processes
8566 (win32_detach): Ditto.
8567 (win32_join): Adjust interface.
8568 (win32_thread_alive): Take a ptid.
8569 (win32_resume): Adjust to use ptids.
8570 (get_child_debug_event): Ditto.
8571 (win32_wait): Adjust interface. Remove exiting process from
8576 Non-stop mode support.
8578 * server.h (non_stop): Declare.
8579 (gdb_client_data, handler_func): Declare.
8580 (delete_file_handler, add_file_handler, start_event_loop):
8582 (handle_serial_event, handle_target_event, push_event)
8583 (putpkt_notif): Declare.
8584 * target.h (enum resume_kind): New.
8585 (struct thread_resume): Replace `step' field by `kind' field.
8586 (TARGET_WNOHANG): Define.
8587 (struct target_ops) <wait>: Add `options' argument.
8588 <supports_non_stop, async, start_non_stop>: New fields.
8589 (target_supports_non_stop, target_async): New.
8590 (start_non_stop): Declare.
8591 (mywait): Add `options' argument.
8592 * target.c (mywait): Add `options' argument. Print child exit
8594 (start_non_stop): New.
8595 * server.c (non_stop, own_buf, mem_buf): New globals.
8596 (struct vstop_notif): New.
8597 (notif_queue): New global.
8598 (queue_stop_reply, push_event, discard_queued_stop_replies)
8599 (send_next_stop_reply): New.
8600 (start_inferior): Adjust to use resume_kind. Adjust to mywait
8602 (attach_inferior): In non-stop mode, don't wait for the target
8604 (handle_general_set): Handle QNonStop.
8605 (handle_query): When handling qC, return the current general
8606 thread, instead of the first thread of the list.
8607 (handle_query): If the backend supports non-stop mode, include
8608 QNonStop+ in the qSupported query response.
8609 (handle_v_cont): Adjust to use resume_kind. Handle resume_stop
8611 (handle_v_attach, handle_v_run): Handle non-stop mode.
8612 (handle_v_stopped): New.
8613 (handle_v_requests): Report support for vCont;t. Handle vStopped.
8614 (myresume): Adjust to use resume_kind. Handle non-stop.
8615 (queue_stop_reply_callback): New.
8616 (handle_status): Handle non-stop mode.
8617 (main): Clear non_stop flag on reconnection. Use the event-loop.
8618 Refactor serial protocol handling from here ...
8619 (process_serial_event): ... to this new function. When GDB
8620 selects any thread, select one here. In non-stop mode, wait until
8621 GDB acks all pending events before exiting.
8622 (handle_serial_event, handle_target_event): New.
8623 * remote-utils.c (remote_open): Install remote_desc in the event
8625 (remote_close): Remove remote_desc from the event loop.
8626 (putpkt_binary): Rename to...
8627 (putpkt_binary_1): ... this. Add `is_notic' argument. Handle it.
8628 (putpkt_binary): New as wrapper around putpkt_binary_1.
8629 (putpkt_notif): New.
8630 (prepare_resume_reply): In non-stop mode, don't change the
8632 * event-loop.c: New.
8633 * Makefile.in (OBJ): Add event-loop.o.
8634 (event-loop.o): New rule.
8636 * linux-low.h (pid_of): Moved here.
8638 (get_lwp_thread): Use lwpid_of.
8639 (struct lwp_info): Delete `lwpid' field. Add `suspended' field.
8640 * linux-low.c (pid_of): Delete.
8641 (inferior_pid): Use lwpid_of.
8642 (linux_event_pipe): New.
8643 (target_is_async_p): New.
8645 (handle_extended_wait): Use lwpid_of.
8646 (add_lwp): Don't set lwpid field.
8647 (linux_attach_lwp): Adjust debug output. Use lwpid_of.
8648 (linux_kill_one_lwp): If killing a running lwp, stop it first.
8649 Use lwpid_of. Adjust to linux_wait_for_event interface changes.
8650 (linux_detach_one_lwp): If detaching from a running lwp, stop it
8651 first. Adjust to linux_wait_for_event interface changes. Use
8653 (linux_detach): Don't delete the main lwp here.
8654 (linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of.
8655 (status_pending_p): Don't consider explicitly suspended lwps.
8656 (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
8657 pointer. Add OPTIONS argument. Change return type to int. Use
8658 my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of.
8659 (linux_wait_for_event): Take an integer pid instead of a lwp_info
8660 pointer. Add status pointer argument. Return a pid instead of a
8661 status. Use lwpid_of. Adjust to linux_wait_for_lwp interface
8662 changes. In non-stop mode, don't switch to a random thread.
8663 (linux_wait): Rename to...
8664 (linux_wait_1): ... this. Add target_options argument, and handle
8665 it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode,
8666 don't handle the continue thread. Handle TARGET_WNOHANG. Merge
8667 clean exit and signal exit code. Don't stop all threads in
8668 non-stop mode. In all-stop mode, only stop all threads when
8669 reporting a stop to GDB. Handle explicit thread stop requests.
8670 (async_file_flush, async_file_mark): New.
8672 (send_sigstop): Use lwpid_of.
8673 (wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event
8674 interface changes. In non-stop mode, don't switch to a random
8676 (linux_resume_one_lwp): Use lwpid_of.
8677 (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
8678 (linux_resume_one_thread): ... this. Handle resume_stop. In
8679 non-stop mode, don't look for pending flag in all threads.
8680 (resume_status_pending_p): Don't consider explicitly suspended
8682 (my_waitpid): Reimplement. Emulate __WALL.
8683 (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
8685 (sigchld_handler, linux_supports_non_stop, linux_async)
8686 (linux_start_non_stop): New.
8687 (linux_target_ops): Register linux_supports_non_stop, linux_async
8688 and linux_start_non_stop.
8689 (initialize_low): Install SIGCHLD handler.
8690 * thread-db.c (thread_db_create_event, find_one_thread)
8691 (thread_db_get_tls_address): Use lwpid_of.
8692 * win32-low.c (win32_detach): Adjust to use resume_kind.
8693 (win32_wait): Add `options' argument.
8694 * spu-low.c (spu_resume): Adjust to use resume_kind.
8695 (spu_wait): Add `options' argument.
8699 Decouple target code from remote protocol.
8701 * target.h (enum target_waitkind): New.
8702 (struct target_waitstatus): New.
8703 (struct target_ops) <wait>: Return an unsigned long. Take a
8704 target_waitstatus pointer instead of a char pointer.
8706 * target.c (mywait): Change prototype to return an unsigned long.
8707 Take a target_waitstatus pointer instead of a char pointer. Adjust.
8708 * server.h (thread_from_wait, old_thread_from_wait): Delete
8710 (prepare_resume_reply): Change prototype to take a
8712 * server.c (thread_from_wait, old_thread_from_wait): Delete.
8713 (last_status, last_ptid): New.
8714 (start_inferior): Remove "statusptr" argument. Adjust. Return a
8715 pid instead of a signal.
8716 (attach_inferior): Remove "status" and "signal" parameters.
8718 (handle_query): For qGetTLSAddr, parse the thread id with strtol,
8720 (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
8721 (handle_v_requests, myresume): Remove "status" and "signal"
8723 (handle_status): New.
8724 (main): Delete local `status'. Adjust.
8725 * remote-utils.c: Include target.h.
8726 (prepare_resume_reply): Change prototype to take a
8727 target_waitstatus. Adjust.
8729 * linux-low.c (linux_wait): Adjust to new target_ops->wait
8731 * spu-low.c (spu_wait): Adjust.
8732 * win32-low.c (enum target_waitkind, struct target_waitstatus):
8734 (win32_wait): Adjust.
8738 * target.h (struct thread_resume): Delete leave_stopped member.
8739 (struct target_ops): Add a `n' argument to the `resume' callback.
8740 * server.c (start_inferior): Adjust.
8741 (handle_v_cont, myresume): Adjust.
8742 * linux-low.c (check_removed_breakpoint): Adjust to resume
8743 interface change, and to removed leave_stopped field.
8744 (resume_ptr): Delete.
8745 (struct thread_resume_array): New.
8746 (linux_set_resume_request): Add new `arg' parameter. Adjust to
8747 resume interface change.
8748 (linux_continue_one_thread, linux_queue_one_thread)
8749 (resume_status_pending_p): Check if the resume field is NULL
8750 instead of checking the leave_stopped member.
8751 (linux_resume): Adjust to the target resume interface change.
8752 * spu-low.c (spu_resume): Adjust to the target resume interface
8754 * win32-low.c (win32_detach, win32_resume): Ditto.
8758 * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
8760 (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
8762 (linux_continue_one_thread): Only preserve the stepping flag if
8763 there's a pending breakpoint.
8767 * server.c (main): After the inferior having exited, call
8768 remote_close before exiting gdbserver.
8772 Fix size of FPSCR in Power 7 processors.
8773 * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
8774 (PPC_FEATURE_HAS_DFP): New #define.
8775 (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
8780 * server.c (handle_query) Whitespace and formatting.
8784 * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
8785 linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
8786 linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
8787 linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
8788 regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
8789 thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
8790 Makefile.in, configure.ac: Fix whitespace throughout.
8791 * configure: Regenerate.
8795 * inferiors.c (find_inferior): Make it safe for the callback
8796 function to delete the currently iterated inferior.
8800 * Makefile.in (linuw_low_h): Move higher.
8801 (thread-db.o): Depend on $(linux_low_h).
8805 Rename "process" to "lwp" throughout.
8807 * linux-low.c (all_processes): Rename to...
8808 (all_lwps): ... this.
8809 (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
8810 (add_process): Rename to ...
8811 (add_lwp): ... this. Adjust.
8812 (linux_create_inferior): Adjust.
8813 (linux_attach_lwp): Adjust.
8814 (linux_attach): Adjust.
8815 (linux_kill_one_process): Rename to ...
8816 (linux_kill_one_lwp): ... this. Adjust.
8817 (linux_kill): Adjust.
8818 (linux_detach_one_process): Rename to ...
8819 (linux_detach_one_lwp): ... this. Adjust.
8820 (linux_detach): Adjust.
8821 (check_removed_breakpoint): Adjust.
8822 (status_pending_p): Adjust.
8823 (linux_wait_for_process): Rename to ...
8824 (linux_wait_for_lwp): ... this. Adjust.
8825 (linux_wait_for_event): Adjust.
8826 (send_sigstop): Adjust.
8827 (wait_for_sigstop): Adjust.
8828 (stop_all_processes): Rename to ...
8829 (stop_all_lwps): ... this.
8830 (linux_resume_one_process): Rename to ...
8831 (linux_resume_one_lwp): ... this. Adjust.
8832 (linux_set_resume_request, linux_continue_one_thread)
8833 (linux_queue_one_thread, resume_status_pending_p)
8834 (usr_store_inferior_registers, regsets_store_inferior_registers)
8835 (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
8837 * linux-low.h (get_process): Rename to ...
8838 (get_lwp): ... this. Adjust.
8839 (get_thread_process): Rename to ...
8840 (get_thread_lwp): ... this. Adjust.
8841 (get_process_thread): Rename to ...
8842 (get_lwp_thread): ... this. Adjust.
8843 (struct process_info): Rename to ...
8844 (struct lwp_info): ... this.
8845 (all_processes): Rename to ...
8846 (all_lwps): ... this.
8847 * proc-service.c (ps_lgetregs): Adjust.
8848 * thread-db.c (thread_db_create_event, find_one_thread)
8849 (maybe_attach_thread, thread_db_get_tls_address): Adjust.
8853 * server.c (handle_query): Handle "qAttached".
8857 * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
8858 GPLv3, update license URL.
8862 * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
8863 (server_h): Add gdb_signals.h.
8864 (signals.o): Update.
8865 * server.h (target_signal_from_host,target_signal_to_host_p)
8866 (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
8870 * remote-utils.c (getpkt): Also generate remote-debug
8871 information if noack_mode is set.
8875 * server.c (handle_query): Report qXfer:siginfo:read and
8876 qXfer:siginfo:write as supported and handle them.
8877 * target.h (struct target_ops) <qxfer_siginfo>: New field.
8878 * linux-low.c (linux_xfer_siginfo): New.
8879 (linux_target_ops): Set it.
8883 * server.c (gdbserver_usage): Mention --remote-debug.
8884 (main): Accept '--remote-debug' switch.
8888 * regcache.c (new_register_cache): No need to check result of xcalloc.
8889 * server.c (handle_search_memory): Back out calls to xmalloc,
8890 result is checked and error is returned to user upon failure.
8891 (handle_query): Ditto. Add more checks for result of malloc.
8892 (handle_v_cont): Check result of malloc, report error back to
8894 (handle_v_run): Ditto. Call freeargv.
8895 * server.h (freeargv): Declare.
8896 * utils.c (freeargv): New fn.
8900 * gdbreplay.c (perror_with_name): Make arg const char *.
8901 * server.h (target_signal_to_name): Make return type const char *.
8902 * thread-db.c (thread_db_err_str): Make return type const char *.
8903 * utils.c (perror_with_name): Make arg const char *.
8907 * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
8908 when handling a EXIT_PROCESS_DEBUG_EVENT.
8912 * gdbreplay.c (gdbreplay_version): Update copyright year.
8913 * server.c (gdbserver_version): Likewise.
8917 * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
8918 (handle_extended_wait): Improve comment.
8922 * utils.c (xmalloc,xcalloc,xstrdup): New fns.
8923 * server.h (ATTR_MALLOC): New macro.
8924 (xmalloc,xcalloc,xstrdup): Declare.
8925 * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
8926 * inferiors.c: Ditto.
8927 * linux-low.c: Ditto.
8928 * mem-break.c: Ditto.
8929 * regcache.c: Ditto.
8930 * remote-utils.c: Ditto.
8933 * win32-low.c: Ditto.
8937 * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
8938 in debugging printf.
8940 * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
8944 * linux-low.h (struct process_info): Delete member tid, unused.
8945 * thread-db.c (find_one_thread): Update.
8946 (maybe_attach_thread): Update.
8950 * target.h (struct target_ops): Add qxfer_osdata member.
8951 * linux-low.c: Include ctype.h and pwd.h and sys/types.h
8953 (linux_qxfer_osdata): New functions.
8954 (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
8956 * server.c (handle_query): Handle "qXfer:osdata:read:".
8957 * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
8958 (buffer_xml_printf): New functions.
8959 * server.h (struct buffer): New.
8960 (buffer_grow_str, buffer_grow_str0): New macros.
8961 (buffer_grow, buffer_free, buffer_init, buffer_finish)
8962 (buffer_xml_printf): Declare.
8966 * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
8970 * server.c (handle_v_run): Always use the supplied argument list.
8974 * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
8975 (xtensa_regmap_table): Add entry for scompare1.
8979 * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
8980 powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
8981 powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
8982 powerpc-isa205-64l.o, powerpc-isa205-64l.c,
8983 powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
8984 powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
8985 * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
8986 XML target descriptions.
8987 * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
8988 when inferior is running on an ISA 2.05 or later processor. Add
8989 special case to return offset for full 64-bit slot of FPSCR when
8994 * Makefile.in (SFILES, clean): Added sparc64 files.
8995 (reg-sparc64.o, reg-sparc64.c): New.
8996 * configure.srv (sparc*-*-linux*): New configuration.
8997 * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
8998 syscall arguments for SPARC.
8999 (regsets_store_inferior_registers): Likewise.
9000 * linux-sparc-low.c: New file.
9004 * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
9005 (READLINE_DIR,READLINE_DEP): Delete.
9006 (INTERNAL_CFLAGS): Update.
9007 (LINTFLAGS): Update.
9011 * server.c (handle_v_run): If GDB didn't specify an argv, use the
9012 whole argv from the last run, not just argv[0].
9016 * regcache.c (new_register_cache): Return NULL if the register
9017 cache size isn't known yet.
9018 (free_register_cache): Avoid dereferencing a NULL regcache.
9022 * configure.srv: Merge MIPS and MIPS64.
9026 * Makefile.in (uninstall): Apply $(EXEEXT) too.
9030 * Makefile.in: Add required vsx dependencies.
9032 * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
9033 Declare init_registers_powerpc_vsx32l.
9034 Declare init_registers_powerpc_vsx64l.
9035 Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
9036 (ppc_arch_setup): Check for VSX in hwcap.
9037 (ppc_fill_vsxregset): New function.
9038 (ppc_store_vsxregset): New function.
9039 Add new VSX entry in regset_info target_regsets.
9041 * configure.srv: Add new VSX dependencies.
9045 * remote-utils.c (noack_mode, transport_is_reliable): New globals.
9046 (remote_open): Set or clear transport_is_reliable.
9047 (putpkt_binary): Don't expect acks in noack mode.
9048 (getpkt): Don't send ack/nac in noack mode.
9049 * server.c (handle_general_set): Handle QStartNoAckMode.
9050 (handle_query): If connected by tcp pass QStartNoAckMode+ in
9052 (main): Reset noack_mode on every connection.
9053 * server.h (noack_mode): Declare.
9057 * Makefile.in (GDBREPLAY_OBS): New variable.
9058 (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
9063 * linux-low.c (linux_resume_one_process): Ignore ESRCH.
9064 (usr_store_inferior_registers): Likewise.
9065 (regsets_store_inferior_registers): Likewise.
9070 * configure.ac: Check for memmem declaration.
9071 * server.c [HAVE_MALLOC_H]: Include malloc.h.
9072 (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
9073 (disable_packet_qfThreadInfo): Unconditionally compile.
9074 * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
9075 * configure, config.in: Regenerate.
9079 * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
9080 (linux_write_memory): Remove declaration of errno.
9084 * linux-low.c (handle_extended_wait): Do not use "status"
9085 variable uninitialized.
9089 * server.c (handle_v_attach): Inhibit reporting dll changes.
9093 * remote-utils.c (prepare_resume_reply): If requested, don't
9094 output "thread:TID" in the T stop reply.
9096 * server.c (disable_packet_vCont, disable_packet_Tthread)
9097 (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
9098 (handle_query): If requested, disable support for qC, qfThreadInfo
9100 (handle_v_requests): If requested, disable support for vCont.
9101 (gdbserver_show_disableable): New.
9102 (main): Handle --disable-packet and --disable-packet=LIST.
9104 * server.h (disable_packet_vCont, disable_packet_Tthread)
9105 (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
9109 * server.c (gdbserver_usage): Mention --version.
9113 * Makefile.in (gdbreplay.o): New rule.
9117 * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
9118 message, not gdbserver.
9124 * acinclude.m4: Include ../../config/acx.m4.
9125 * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
9126 * configure, config.in: Regenerate.
9127 * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
9128 * server.c (gdbserver_version): Print PKGVERSION.
9129 (gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO.
9130 (main): Adjust gdbserver_usage calls.
9131 * gdbreplay.c (version, host_name): Add declarations.
9132 (gdbreplay_version, gdbreplay_usage): New.
9133 (main): Accept --version and --help options.
9137 * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
9138 (arm_breakpoint_at): Handle Thumb.
9139 (the_low_target): Add comment.
9143 * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
9147 * server.h (decode_search_memory_packet): Declare.
9148 * remote-utils.c (decode_search_memory_packet): New fn.
9149 * server.c (handle_search_memory_1): New fn.
9150 (handle_search_memory): New fn.
9151 (handle_query): Process qSearch:memory packets.
9155 * regcache.c (registers_length): Remove.
9156 (set_register_cache): Verify that PBUFSIZ is large enough to hold a
9157 full register packet.
9158 * regcache.h (registers_length): Remove prototype.
9159 * server.h (PBUFSIZ): Define to 16384.
9163 * configure.srv (powerpc*-*-linux*): Set srv_regobj to
9164 powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
9165 powerpc-64l.o, and powerpc-altivec64l.o.
9166 Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
9167 rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
9168 rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
9169 rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
9170 rs6000/power-linux.xml, and rs6000/power64-linux.xml
9173 * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
9174 (powerpc-32l.o, powerpc-32l.c): ... these new rules.
9175 (powerpc-32.o, powerpc-32.c): Remove, replace by ...
9176 (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
9177 (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
9178 (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
9179 (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
9180 (powerpc-64l.o, powerpc-64l.c): ... these new rules.
9181 (powerpc-64.o, powerpc-64.c): Remove, replace by ...
9182 (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
9185 * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
9186 (init_registers_powerpc_32l): ... this new prototype.
9187 (init_registers_powerpc_32): Remove, replace by ...
9188 (init_registers_powerpc_altivec32l): ... this new prototype.
9189 (init_registers_powerpc_e500): Remove, replace by ...
9190 (init_registers_powerpc_e500l): ... this new prototype.
9191 (init_registers_ppc64): Remove, replace by ...
9192 (init_registers_powerpc_64l): ... this new prototype.
9193 (init_registers_powerpc_64): Remove, replace by ...
9194 (init_registers_powerpc_altivec64l): ... this new prototype.
9195 (ppc_num_regs): Set to 73.
9196 (PT_ORIG_R3, PT_TRAP): Define if necessary.
9197 (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
9198 (ppc_cannot_store_register): Handle orig_r3 and trap.
9199 (ppc_arch_setup): Update init_registers_... calls.
9200 (ppc_fill_gregset): Handle orig_r3 and trap.
9202 * inferiors.c (clear_inferiors): Reset current_inferior.
9206 * acinclude.m4: Add override.m4.
9207 * configure: Regenerate.
9211 * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
9212 initial call to init_register_ppc64.
9216 * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
9217 single powerpc*-*-linux* case.
9218 (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
9222 * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
9223 srv_regobj. Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
9225 * linux-ppc-low.c: Include <elf.h>.
9226 (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
9227 (ppc_hwcap): New global variable.
9228 (ppc_regmap): Remove __SPE__ #ifdef sections.
9229 (ppc_regmap_e500): New global variable.
9230 (ppc_cannot_store_register): Update __SPE__ special case.
9231 (ppc_get_hwcap): New function.
9232 (ppc_arch_setup): Use it to determine whether inferior supports
9233 AltiVec or SPE registers. Set the_low_target.regmap if appropriate.
9234 (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
9235 Do not access registers if target does not support AltiVec.
9236 (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
9237 Do not access registers if target does not support SPE.
9238 (target_regsets): Unconditionally include AltiVec and SPE regsets.
9242 * linux-low.c (disabled_regsets, num_regsets): New.
9243 (use_regsets_p): Delete.
9244 (linux_wait_for_process): Clear disabled_regsets.
9245 (regsets_fetch_inferior_registers): Check and set it.
9246 (regsets_store_inferior_registers): Likewise.
9247 (linux_fetch_registers, linux_store_registers): Do not use
9249 (initialize_low): Allocate disabled_regsets.
9253 * Makefile.in (LIBOBJS): New.
9255 (memmem.o): New rule.
9256 * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
9257 * configure: Regenerated.
9261 * server.c (handle_query): Never return "unsupported" for
9262 qXfer:features:read queries.
9266 * server.c (get_features_xml): Fix inverted condition.
9267 (handle_query): Always support qXfer:feature:read.
9271 * server.c (wrapper_argv): New.
9272 (start_inferior): Handle wrapper_argv. If set, expect an extra
9274 (gdbserver_usage): Document --wrapper.
9275 (main): Parse --wrapper.
9279 * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
9280 powerpc-*-linux* to srv_regobj and reg_xmlfiles.
9281 * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
9282 (ppc_set_pc): Likewise.
9283 (ppc_arch_setup): New function.
9284 (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
9285 of collect_register.
9286 (the_low_target): Use ppc_arch_setup as arch_setup initializer.
9290 * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
9291 instead of linux-ppc64-low.o.
9292 * linux-ppc64-low.c: Remove file.
9293 * Makefile.in (SFILES): Remove linux-ppc64-low.c.
9294 (linux-ppc64-low.o): Remove rule.
9296 * linux-ppc-low.c (init_registers_ppc64): Add prototype.
9297 (init_registers_powerpc_64): Likewise.
9298 (ppc_regmap): Conditionally define depending on __powerpc64__.
9299 (ppc_cannot_store_register): Do not special-case "fpscr" when
9300 compiled on __powerpc64__.
9301 (ppc_collect_ptrace_register): New function.
9302 (ppc_supply_ptrace_register): New function.
9303 (ppc_breakpoint): Change type to "unsigned int".
9304 (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
9305 (the_low_target): Conditionally provide initializers for the
9306 arch_setup member depending on __powerpc64__. Install
9307 collect_ptrace_register and supply_ptrace_register members.
9311 * regcache.h (gdbserver_xmltarget): Add extern declaration.
9312 * server.c (gdbserver_xmltarget): Define.
9313 (get_features_xml): Use it to replace "target.xml" and arch_string.
9315 * configure.srv: Remove srv_xmltarget. Add XML files that were
9316 mentioned there to srv_xmlfiles instead. Remove conditional tests
9317 on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
9318 srv_xmlfiles and srv_regobj to include all possible choices.
9319 * configure.ac (srv_xmltarget): Remove.
9320 (srv_xmlfiles): Do not add "target.xml".
9321 (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
9322 checks for supplementary target information.
9323 * configure: Regenerate.
9324 * Makefile.in (XML_TARGET): Remove.
9325 (target.xml): Remove rule.
9326 (clean): Do not clean up target.xml.
9327 (.PRECIOUS): Do not mention target.xml.
9329 * target.h (struct target_ops): Remove arch_string member.
9330 * linux-low.c (linux_arch_string): Remove.
9331 (linux_target_ops): Remove arch_string initializer.
9332 * linux-low.h (struct linux_target_ops): Remove arch_string member.
9333 * linux-i386-low.c (the_low_target): Remove arch_string initializer.
9334 * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
9335 * spu-low.c (spu_arch_string): Remove.
9336 (spu_target_ops): Remove arch_string initializer.
9337 * win32-low.c (win32_arch_string): Remove.
9338 (win32_target_ops): Remove arch_string initializer.
9339 * win32-low.h (struct win32_target_ops): Remove arch_string member.
9340 * win32-arm-low.c (the_low_target): Remove arch_string initializer.
9341 * win32-i368-low.c (the_low_target): Remove arch_string initializer.
9345 * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
9346 by collect_ptrace_register and supply_ptrace_register hooks.
9347 * linux-low.c (fetch_register): Use supply_ptrace_register callback
9348 instead of checking for the_low_target.left_pad_xfer.
9349 (usr_store_inferior_registers): Use collect_ptrace_register callback
9350 instead of checking for the_low_target.left_pad_xfer.
9352 * linux-s390-low.c (s390_collect_ptrace_register): New function.
9353 (s390_supply_ptrace_register): Likewise.
9354 (s390_fill_gregset): Call s390_collect_ptrace_register.
9355 (the_low_target): Update.
9357 * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
9358 (ppc_supply_ptrace_register): Likewise.
9359 (the_low_target): Update.
9361 * linux-i386-low.c (the_low_target): Update.
9362 * linux-x86-64-low.c (the_low_target): Update.
9366 * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
9367 reg-s390.o and reg-s390x.o.
9369 * linux-low.c (new_inferior): New global variable.
9370 (linux_create_inferior, linux_attach): Set it.
9371 (linux_wait_for_process): Call the_low_target.arch_setup after the
9372 target has stopped for the first time.
9373 (initialize_low): Do not call the_low_target.arch_setup.
9375 * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
9376 (s390_set_pc): Likewise.
9377 (s390_arch_setup): New function.
9378 (the_low_target): Use s390_arch_setup as arch_setup routine.
9380 * regcache.c (realloc_register_cache): New function.
9381 (set_register_cache): Call it for each existing regcache.
9385 * server.h (init_registers): Remove prototype.
9387 * linux-low.h (struct linux_target_ops): Add arch_setup field.
9388 * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
9389 instead of init_registers ().
9390 * linux-arm-low.c (init_registers_arm): Add prototype.
9391 (init_registers_arm_with_iwmmxt): Likewise.
9392 (the_low_target): Add initializer for arch_setup field.
9393 * linux-cris-low.c (init_registers_cris): Add prototype.
9394 (the_low_target): Add initializer for arch_setup field.
9395 * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
9396 (the_low_target): Add initializer for arch_setup field.
9397 * linux-i386-low.c (init_registers_i386_linux): Add prototype.
9398 (the_low_target): Add initializer for arch_setup field.
9399 * linux-ia64-low.c (init_registers_ia64): Add prototype.
9400 (the_low_target): Add initializer for arch_setup field.
9401 * linux-m32r-low.c (init_registers_m32r): Add prototype.
9402 (the_low_target): Add initializer for arch_setup field.
9403 * linux-m68k-low.c (init_registers_m68k): Add prototype.
9404 (the_low_target): Add initializer for arch_setup field.
9405 * linux-mips-low.c (init_registers_mips_linux): Add prototype.
9406 (init_registers_mips64_linux): Likewise.
9407 (the_low_target): Add initializer for arch_setup field.
9408 * linux-ppc-low.c (init_registers_ppc): Add prototype.
9409 (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
9410 (the_low_target): Add initializer for arch_setup field.
9411 * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
9412 (init_registers_powerpc_64): Likewise.
9413 (the_low_target): Add initializer for arch_setup field.
9414 * linux-s390-low.c (init_registers_s390): Add prototype.
9415 (init_registers_s390x): Likewise.
9416 (the_low_target): Add initializer for arch_setup field.
9417 * linux-sh-low.c (init_registers_sh): Add prototype.
9418 (the_low_target): Add initializer for arch_setup field.
9419 * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
9420 (the_low_target): Add initializer for arch_setup field.
9421 * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
9422 (the_low_target): Add initializer for arch_setup field.
9424 * win32-low.h (struct win32_target_ops): Add arch_setup field.
9425 * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
9426 instead of init_registers ().
9427 * win32-arm-low.c (init_registers_arm): Add prototype.
9428 (the_low_target): Add initializer for arch_setup field.
9429 * win32-i386-low.c (init_registers_i386): Add prototype.
9430 (the_low_target): Add initializer for arch_setup field.
9432 * spu-low.c (init_registers_spu): Add prototype.
9433 (initialize_low): Call initialie_registers_spu () instead of
9434 initialize_registers ().
9438 * server.c (handle_v_requests): When handling the vRun and vAttach
9439 packets, if already debugging a process, don't kill it. Return an
9444 * server.c (handle_query): Correct length check.
9448 * win32-low.c (do_initial_child_stuff): Add process handle
9449 parameter. Set current_process_handle and current_process_id from the
9450 parameters. Clear globals.
9451 (win32_create_inferior): Don't set current_process_handle and
9452 current_process_id here. Instead pass them on the call to
9453 do_initial_child_stuff.
9454 (win32_attach): Likewise.
9455 (win32_clear_inferiors): New.
9456 (win32_kill): Don't close the current process handle or the
9457 current thread handle here. Instead call win32_clear_inferiors.
9458 (win32_detach): Don't open a new handle to the process. Call
9459 win32_clear_inferiors.
9460 (win32_join): Don't rely on current_process_handle; open a new
9461 handle using the process id.
9462 (win32_wait): Call win32_clear_inferiors when the inferior process
9467 * server.c (monitor_show_help): Add "exit".
9471 * Makefile.in (SFILES): Add linux-xtensa-low.c.
9472 (clean): Add reg-xtensa.c.
9473 (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
9474 * configure.srv (xtensa*-*-linux*) New target.
9475 * linux-xtensa-low.c: New.
9476 * xtensa-xtregs.c: New.
9480 * hostio.c: Don't include errno.h.
9481 (errno_to_fileio_errno): Move to hostio-errno.
9482 * hostio.c: (hostio_error): Remove the error parameter. Defer the
9483 error number outputting to the target->hostio_last_error callback.
9484 (hostio_packet_error): Use FILEIO_EINVAL directly.
9485 (handle_open, handle_pread, hostio_error, handle_unlink): Update
9486 calls to hostio_error.
9487 * hostio-errno.c: New.
9488 * server.h (hostio_last_error_from_errno): Declare.
9489 * target.h (target_ops): Add hostio_last_error member.
9490 * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
9491 as hostio_last_error handler.
9492 * spu-low.c (spu_target_ops): Likewise.
9493 * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
9494 (wince_hostio_last_error): New functions.
9495 (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
9496 as hostio_last_error handler.
9497 (win32_target_ops) [!_WIN32_WCE]: Register
9498 hostio_last_error_from_errno as hostio_last_error handler.
9499 * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
9500 (hostio-errno.o): New rule.
9501 * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
9502 * configure.srv (srv_hostio_err_objs): New variable. Default to
9504 (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
9505 * configure: Regenerate.
9509 * linux-low.c (linux_attach_lwp): Do not _exit after errors.
9510 (linux_kill, linux_detach): Clean up the process list.
9511 * remote-utils.c (remote_open): Improve port number parsing.
9512 (putpkt_binary, input_interrupt): Only send interrupts if the target
9514 * server.c (extended_protocol): Make static.
9515 (attached): Define earlier.
9516 (exit_requested, response_needed, program_argv): New variables.
9517 (target_running): New.
9518 (start_inferior): Clear attached here.
9519 (attach_inferior): Set attached here.
9520 (require_running): Define.
9521 (handle_query): Use require_running and target_running. Implement
9523 (handle_v_attach, handle_v_run): New.
9524 (handle_v_requests): Use require_running. Handle vAttach and vRun.
9525 (gdbserver_usage): Update.
9526 (main): Redo argument parsing. Handle --debug and --multi. Handle
9527 --attach along with other options or after the port. Save
9528 program_argv. Support no initial program. Resynchronize
9529 communication with GDB after an error. Handle "monitor exit".
9530 Use require_running and target_running. Always allow the extended
9531 protocol. Do not error out for Hc0 or Hc-1. Do not automatically
9532 restart in extended mode.
9533 * README: Refer to the GDB manual. Update --attach usage.
9537 * linux-low.c (STACK_SIZE): Define.
9538 (linux_tracefork_child): Use it. Use __clone2 on ia64.
9539 (linux_test_for_tracefork): Likewise.
9543 * linux-low.c (linux_wait_for_event): Update messages. Do not
9544 reinsert auto-delete breakpoints.
9545 * mem-break.c (struct breakpoint): Change return type of handler to
9547 (set_breakpoint_at): Update handler type.
9548 (reinsert_breakpoint_handler): Return 1 instead of calling
9550 (reinsert_breakpoint_by_bp): Check for the original breakpoint before
9552 (check_breakpoints): Delete auto-delete breakpoints and return 2.
9553 * mem-break.h (set_breakpoint_at): Update handler type.
9554 * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
9555 * win32-low.c (auto_delete_breakpoint): New.
9556 (get_child_debug_event): Use it.
9560 * configure.ac: Check for pread and pwrite.
9561 * hostio.c (handle_pread): Fall back to lseek and read.
9562 (handle_pwrite): Fall back to lseek and write.
9563 * config.in, configure: Regenerated.
9567 * server.c (myresume): Add own_buf argument.
9568 (main): Update calls.
9572 * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
9573 * remote-utils.c (remote_open): Do not call disable_async_io.
9574 (block_async_io): Delete.
9575 (unblock_async_io): Make static.
9576 (initialize_async_io): New.
9577 * server.c (handle_v_cont): Handle async I/O here.
9578 (myresume): Likewise. Move other common resume tasks here...
9579 (main): ... from here. Call initialize_async_io. Disable async
9580 I/O before the main loop.
9581 * server.h (initialize_async_io): Declare.
9582 (block_async_io, unblock_async_io): Delete prototypes.
9583 * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
9587 * remote-utils.c (readchar): Allow binary data in received messages.
9591 * win32-low.c (attaching): New global.
9592 (win32_create_inferior): Clear the `attaching' global.
9593 (win32_attach): Set the `attaching' global.
9594 (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
9595 attaching. Only set a breakpoint at the entry point if not
9600 * server.c (main): Don't report dll events on the initial
9601 connection on attaches.
9605 * server.c (main): Relax numerical bases supported for the pid of
9606 the --attach command line argument.
9610 * win32-low.c (win32_attach): Call OpenProcess before
9611 DebugActiveProcess, not after. Add last error output to error
9616 * win32-low.c (win32_get_thread_context)
9617 (win32_set_thread_context): New functions.
9618 (thread_rec): Use win32_get_thread_context.
9619 (continue_one_thread, win32_resume): Use win32_set_thread_context.
9620 * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
9623 2007-12-03 Leo Zayas
9626 * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
9628 (child_add_thread): Minor cleanup.
9629 (child_continue): Resume artificially suspended threads before
9630 calling ContinueDebugEvent.
9631 (suspend_one_thread): New.
9632 (fake_breakpoint_event): New.
9633 (get_child_debug_event): Change return type to int. Check here if
9634 gdb sent an interrupt request. If a soft interrupt was requested,
9635 fake a breakpoint event. Return 0 if there is no event to handle,
9637 (win32_wait): Don't check here if gdb sent an interrupt request.
9638 Ensure there is a valid event to handle.
9639 (win32_request_interrupt): Add soft interruption method as last
9642 2007-12-03 Leo Zayas
9645 * win32-low.h (win32_thread_info): Add descriptions to the
9646 structure members. Replace `suspend_count' counter by a
9648 * win32-low.c (thread_rec): Update condition of when to get the
9649 context from the inferior. Rely on ContextFlags being set if it
9650 has already been retrieved. Only suspend the inferior thread if
9651 we haven't already. Warn if that fails.
9652 (continue_one_thread): s/suspend_count/suspended/. Only call
9653 ResumeThread once. Warn if that fails.
9657 * win32-low.c (win32_wait): Don't read from the inferior when it
9662 * Makefile.in (win32_low_h): New variable.
9663 (win32-low.o): Add dependency on $(win32_low_h).
9664 (win32-arm-low.o, win32-i386-low.o): New rules.
9668 * hostio.c: Correct copyright year.
9672 * Makefile.in (OBS): Add hostio.o.
9673 (hostio.o): New rule.
9674 * server.h (handle_vFile): Declare.
9675 * hostio.c: New file.
9676 * server.c (handle_v_requests): Take packet_len and new_packet_len
9677 for binary packets. Call handle_vFile.
9678 (main): Update call to handle_v_requests.
9682 * linux-low.c: Include <sched.h>.
9686 * linux-low.c (linux_tracefork_grandchild): New.
9687 (linux_tracefork_child): Use clone.
9688 (linux_test_for_tracefork): Use clone; allocate and free a stack.
9692 * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
9696 * linux-low.c (handle_extended_wait): Handle unexpected signals.
9700 * inferiors.c (change_inferior_id): Delete.
9701 (add_pid_to_list, pull_pid_from_list): New.
9702 * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
9703 (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
9704 (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
9705 (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
9706 (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
9707 (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
9708 (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
9709 (using_threads): Always set to 1.
9710 (handle_extended_wait): New.
9711 (add_process): Do not set TID.
9712 (linux_create_inferior): Set must_set_ptrace_flags.
9713 (linux_attach_lwp): Remove TID argument. Do not check using_threads.
9714 Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers.
9715 (linux_thread_alive): Rename TID argument to LWPID.
9716 (linux_wait_for_process): Handle unknown processes. Do not use TID.
9717 (linux_wait_for_event): Do not use TID or check using_threads. Update
9718 call to dead_thread_notify. Call handle_extended_wait.
9719 (linux_create_inferior): Use PTRACE_SETOPTIONS.
9720 (send_sigstop): Delete sigstop_sent.
9721 (wait_for_sigstop): Avoid TID.
9722 (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
9723 (linux_test_for_tracefork): New.
9724 (linux_lookup_signals): Use thread_db_active and
9725 linux_supports_tracefork_flag.
9726 (initialize_low): Use thread_db_active and linux_test_for_tracefork.
9727 * linux-low.h (get_process_thread): Avoid TID.
9728 (struct process_ifo): Move thread_known and tid to the end. Remove
9730 (linux_attach_lwp, thread_db_init): Update prototypes.
9731 * server.h (change_inferior_id): Delete prototype.
9732 (add_pid_to_list, pull_pid_from_list): New prototypes.
9733 * thread-db.c (thread_db_use_events): New.
9734 (find_first_thread): Rename to...
9735 (find_one_thread): ...this. Update callers and messages. Do not
9736 call fatal. Check thread_db_use_events. Do not call
9737 change_inferior_id or new_thread_notify.
9738 (maybe_attach_thread): Update. Do not call new_thread_notify.
9739 (thread_db_init): Set thread_db_use_events. Check use_events.
9740 * utils.c (fatal, warning): Correct message prefix.
9744 * Makefile.in (clean): Remove new files.
9745 (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
9746 (powerpc-64.o, powerpc-64.c): New rules.
9747 * configure.srv: Use alternate register sets for powerpc64-*-linux*
9748 with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
9750 * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
9752 (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
9753 (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
9754 (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
9755 (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
9756 (target_regsets): Add AltiVec and SPE register sets.
9757 * configure.ac: Check for AltiVec and SPE.
9758 * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
9759 (ppc_fill_vrregset, ppc_store_vrregset): New.
9760 (target_regsets): Add AltiVec register set.
9761 * configure: Regenerated.
9765 * linux-low.c (O_LARGEFILE): Define.
9766 (linux_read_memory): Use /proc/PID/mem.
9767 * configure.ac: Use AC_GNU_SOURCE. Check for pread64.
9768 * configure, config.in: Regenerated.
9772 * linux-low.c (linux_wait_for_event): Do not pass signals while
9777 * win32-low.c (create_process): New.
9778 (win32_create_inferior): Use create_process instead of
9779 CreateProcess. If create_process failed retry appending an ".exe"
9780 suffix. Store the GetLastError result immediatelly after
9781 create_process calls and use it on the call to error.
9785 * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
9789 * configure.ac: Switch license to GPLv3.
9793 * remote-utils.c (putpkt_binary): Memory leak, free buf2.
9797 * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
9799 (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
9800 (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL. Get
9801 CloseToolhelp32Snapshot.
9802 (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
9803 CloseToolhelp32Snapshot.
9807 * server.c (main): Check for inferior exit before main loop.
9811 * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
9812 instead of on tmp_desc.
9817 * inferiors.c (all_dlls, dlls_changed, get_dll): New.
9818 (add_thread): Minor cleanups.
9819 (clear_inferiors): Move lower in the file. Clear the DLL
9821 (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
9822 * remote-utils.c (prepare_resume_reply): Check dlls_changed.
9823 (xml_escape_text): New.
9824 * server.c (handle_query): Handle qXfer:libraries:read. Report it
9826 (handle_v_cont): Report errors.
9827 (gdbserver_version): Update.
9828 (main): Correct size of own_buf. Do not report initial DLL events.
9829 * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
9830 (unloaded_dll, xml_escape_text): New.
9831 * win32-low.c (enum target_waitkind): Update comments.
9832 (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
9833 (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
9834 (win32_EnumProcessModules, win32_GetModuleInformation)
9835 (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
9836 (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
9837 (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
9838 (win32_Module32First, win32_Module32Next, load_toolhelp)
9839 (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
9840 (get_child_debug_event): Handle DLL events.
9841 (win32_wait): Likewise.
9845 * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
9846 * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
9850 * win32-low.c (handle_output_debug_string): Ignore event if not
9855 * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
9859 * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
9863 * inferiors.c (change_inferior_id): Add comment.
9864 * linux-low.c (check_removed_breakpoint): Add an early
9865 prototype. Improve debug output.
9866 (linux_attach): Doc update.
9867 (linux_detach_one_process, linux_detach): Clean up before releasing
9869 (send_sigstop, wait_for_sigstop): Improve comments and debug output.
9870 * linux-low.h (struct process_info): Doc improvement.
9871 * mem-break.c (delete_all_breakpoints): New.
9872 * mem-break.h (delete_all_breakpoints): New prototype.
9873 * thread-db.c (find_first_thread): New.
9874 (thread_db_create_event): Call it instead of
9875 thread_db_find_new_threads. Clean up unused variables.
9876 (maybe_attach_thread): Remove first thread handling.
9877 (thread_db_find_new_threads): Use find_first_thread.
9878 (thread_db_get_tls_address): Likewise.
9882 * thread-db.c (thread_db_find_new_threads): Add prototype.
9883 (thread_db_create_event): Check for the main thread before adding
9885 (maybe_attach_thread): Only enable event reporting if TID == 0.
9886 (thread_db_get_tls_address): Check for new threads.
9890 * linux-low.c (linux_create_inferior): Try execv before execvp.
9891 * spu-low.c (spu_create_inferior): Likewise.
9895 * linux-low.c (linux_create_inferior): Change execv to execvp.
9896 * spu-low.c (spu_create_inferior): Likewies.
9900 * Makefile.in (clean): Clean new files instead of deleted ones.
9901 (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
9902 (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
9904 * configure.srv: Specify XML files and new regformats for MIPS and
9906 * linux-mips-low.c (mips_num_regs): Set to only used registers.
9907 (mips_regmap): Do not fetch $0. Remove unused registers. Add
9908 an entry for the restart register.
9909 (mips_cannot_fetch_register, mips_cannot_store_register)
9910 (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
9911 register names to match the XML descriptions.
9912 (mips_fill_gregset, mips_store_gregset): Likewise. Handle the
9913 restart register instead of $0.
9918 * remote-utils.c (decode_xfer_write): New function.
9919 * server.h (decode_xfer_write): Add prototype.
9920 * server.c (handle_query): Add PACKET_LEN argument. Support
9921 qXfer:spu:read and qXfer:spu:write packets.
9922 (main): Pass packet_len to handle_query.
9923 * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
9924 * target.h (target_ops): Add qxfer_spu.
9928 * spu-low.c (spu_proc_xfer_spu): Do not return failure when
9929 accessing non-seekable spufs files.
9933 * server.c (handle_query): Add reply for qC packet.
9936 Leo Zayas <lerele@champenstudios@com>
9938 * server.h (check_remote_input_interrupt_request): New function.
9939 * remote_utils.c (INVALID_DESCRIPTOR): New define.
9940 (remote_desc): Initialize with INVALID_DESCRIPTOR.
9941 (input_interrupt): Expose on USE_WIN32API too. Fix whitespace.
9942 (check_remote_input_interrupt_request): New function.
9943 * server.h (check_remote_input_interrupt_request): Declare.
9944 * win32-low.c (winapi_DebugBreakProcess,
9945 winapi_GenerateConsoleCtrlEvent): New typedefs.
9946 (get_child_debug_event): Lower Win32 debug event polling from 1 sec
9948 (win32_wait): Check for remote interrupt request
9949 with check_remote_input_interrupt_request.
9950 (win32_request_interrupt): New function.
9951 (win32_target_op): Set request_interrupt to win32_request_interrupt.
9955 * win32-low.c (debug_registers_changed,
9956 debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
9957 CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
9958 CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
9959 (thread_rec): Get context using the low target.
9960 (child_add_thread): Call thread_added on the low target,
9961 which does the same thing.
9963 (do_initial_child_stuff): Remove debug registers references.
9964 Set context using the low target. Resume threads after
9965 setting the contexts.
9966 (child_continue): Remove dead variable. Remove debug
9967 registers references.
9968 (child_fetch_inferior_registers): Go through the low target.
9969 (do_child_store_inferior_registers): Remove.
9970 (child_store_inferior_registers): Go through the low target.
9971 (win32_resume): Remove debug registers references.
9972 Set context using the low target.
9973 (handle_exception): Change return type to void. Don't record
9974 context here. Set status to TARGET_WAITKIND_SPURIOUS on a
9975 first chance exception.
9976 (get_child_debug_event): Change return type to void. Remove
9977 goto loop. Always return after waiting for debug event.
9978 (win32_wait): Convert to switch statement. Handle spurious
9981 * win32-i386-low.c (debug_registers_changed,
9982 debug_registers_used): New.
9983 (initial_stuff): Rename to ...
9984 (i386_initial_stuff): ... this. Clear debug registers
9986 (store_debug_registers): Delete.
9987 (i386_get_thread_context): New.
9988 (load_debug_registers): Delete.
9989 (i386_set_thread_context): New.
9990 (i386_thread_added): New.
9991 (single_step): Rename to ...
9992 (i386_single_step): ... this.
9993 (do_fetch_inferior_registers): Rename to ...
9994 (i386_fetch_inferior_register): ... this.
9995 (i386_store_inferior_register): New.
9996 (the_low_target): Adapt to new interface.
9998 * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
9999 (arm_get_thread_context): New.
10000 (arm_set_thread_context): New.
10002 (do_fetch_inferior_registers): Rename to ...
10003 (arm_fetch_inferior_register): ... this.
10004 (arm_store_inferior_register): New.
10005 (arm_wince_breakpoint): Reimplement as unsigned long.
10006 (arm_wince_breakpoint_len): Define.
10007 (the_low_target): Adapt to new interface.
10009 * win32-low.h (target_ops): Remove regmap, store_debug_registers and
10010 load_debug_registers. Add get_thread_context, set_thread_context,
10011 thread_added and store_inferior_register. Rename
10012 fetch_inferior_registers to fetch_inferior_register.
10013 (regptr): Remove declaration.
10017 * linux-low.c (linux_detach): Change return type to int. Return 0.
10018 * spu-low.c (spu_detach): Likewise.
10022 * target.h (target_ops): Change return type of detach to int.
10024 (join_inferior): New.
10025 * server.c (main): Don't skip detach support on mingw32.
10026 If the inferior doesn't support detaching return error.
10027 Call join_inferior instead of using waitpid.
10028 * linux-low.c (linux_join): New.
10029 (linux_target_op): Add linux_join.
10030 * spu-low.c (spu_join): New.
10031 (spu_target_ops): Add spu_join.
10032 * win32-low.c (win32_detach): Adapt to new interface.
10033 Reopen current_process_handle before detaching. Issue a child
10034 resume before detaching.
10036 (win32_target_op): Add win32_join.
10040 * win32-low.c (win32-attach): Fix return value.
10041 * target.h (target_ops): Describe ATTACH return values.
10045 * win32-low.c (GETPROCADDRESS): Define.
10046 (winapi_DebugActiveProcessStop): Add WINAPI. typedef as pointer.
10047 (winapi_DebugSetProcessKillOnExit): Likewise.
10048 (win32_create_inferior): Force usage of ansi CreateProcessA.
10049 (win32_attach): Use GETPROCADDRESS.
10050 (win32_detach): Likewise.
10054 * win32-low.c (win32_wait): Don't use WSTOPSIG.
10058 * win32-low.c: Commit leftover changes from 2007-03-29.
10062 * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
10063 fields short instead of int. Add explicit padding.
10064 (i387_cache_to_fsave): Remove unnecessary casts.
10065 (i387_fsave_to_cache): Doc fix.
10066 (i387_cache_to_fxsave): Remove unnecessary casts and masking.
10070 * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
10071 (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
10075 * configure.srv (arm*-*-mingw32ce*): Move near the other
10080 * configure.ac: Add errno checking.
10081 (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
10082 sys/file.h and malloc.h.
10083 (AC_CHECK_DECLS): Add perror.
10084 (srv_mingwce): Handle.
10085 * configure.srv (i[34567]86-*-cygwin*): Add
10086 win32-i386-low.o to srv_tgtobj.
10087 (i[34567]86-*-mingw*): Likewise.
10088 (arm*-*-mingw32ce*): Add case.
10089 * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
10090 HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
10091 [__MINGW32CE__] (strerror): New function.
10092 [__MINGW32CE__] (errno): Define to GetLastError.
10093 [__MINGW32CE__] (COUNTOF): New macro.
10094 (remote_open): Remove extra close call.
10095 * mem-break.c (delete_breakpoint_at): New function.
10096 * mem-break.h (delete_breakpoint_at): Declare.
10097 * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
10098 HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
10099 [USE_WIN32API] (read, write): Add char* casts.
10100 * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
10101 * server.h: Include wincecompat.h on Windows CE.
10102 [HAVE_ERRNO_H]: Check.
10103 (perror): Declare if not declared.
10104 * utils.c: Add stdlib.h, errno.h and malloc.h includes.
10105 (perror_with_name): Remove errno declaration.
10106 * wincecompat.h: New.
10107 * wincecompat.c: New.
10108 * win32-low.h: New.
10109 * win32-arm-low.c: New.
10110 * win32-i386-low.c: New.
10111 (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
10112 (OUTMSG2): Make it safe.
10114 (COUNTOF): New macro.
10115 (NUM_REGS): Get it from the low target.
10116 (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
10117 CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
10118 (thread_rec): Let low target handle debug registers.
10119 (child_add_thread): Likewise.
10120 (child_init_thread_list): Likewise.
10121 (continue_one_thread): Likewise.
10123 (do_child_fetch_inferior_registers): Move to ...
10124 * win32-i386-low.c: ... here, and rename to ...
10125 (do_fetch_inferior_registers): ... this.
10126 * win32-low.c (child_fetch_inferior_registers):
10127 Go through the low target.
10128 (do_child_store_inferior_registers): Use regptr.
10129 (strwinerror): New function.
10130 (win32_create_inferior): Handle Windows CE.
10131 Use strwinerror instead of strerror on Windows error
10132 codes. Add program to the error output.
10133 Don't close the main thread handle on Windows CE.
10134 (win32_attach): Use coredll.dll on Windows CE.
10135 (win32_kill): Close current process and current
10137 (win32_detach): Use coredll.dll on Windows CE.
10138 (win32_resume): Let low target handle debug registers, and
10140 (handle_exception): Add/Remove initial breakpoint. Avoid
10141 non-existant WSTOPSIG on Windows CE.
10142 (win32_read_inferior_memory): Cast to remove warning.
10143 (win32_arch_string): Go through the low target.
10144 (initialize_low): Call set_breakpoint_data with the low
10145 target's breakpoint.
10146 * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
10147 FOP_REGNUM, mappings): Move to ...
10148 * win32-i386-low.c: ... here.
10149 * win32-low.c (win32_thread_info): Move to ...
10150 * win32-low.h: ... here.
10151 * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
10152 win32-arm-low.c and wincecompat.c.
10153 (all:): Add $EXEEXT.
10154 (install-only:): Likewise.
10155 (gdbserver:): Likewise.
10156 (gdbreplay:): Likewise.
10157 * config.in: Regenerate.
10158 * configure: Regenerate.
10162 * win32-low.c: Rename typedef thread_info to
10163 win32_thread_info throughout.
10167 * win32-i386-low.c: Rename to ...
10168 * win32-low.c: ... this.
10169 * configure.srv: Replace win32-i386-low.o with win32-low.o.
10170 * Makefile.in: Likewise.
10174 * remote-utils.c (monitor_output): Constify msg parameter.
10175 * server.h (monitor_output): Likewise.
10176 * win32-i386-low.c (handle_output_debug_string): New.
10177 (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
10178 handle_output_debug_string.
10179 (get_child_debug_event): Likewise.
10183 * server.c (main): Correct strtoul check.
10187 * linux-low.c: Check __ARCH_HAS_MMU__ also.
10191 * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
10195 * terminal.h: Check HAVE_SGTTY_H.
10199 * remote-utils.c (remote_open): Print out the assigned port number.
10203 * remote-utils.c (monitor_output): New function.
10204 * server.c (debug_threads): Define here.
10205 (monitor_show_help): New function.
10206 (handle_query): Handle qRcmd.
10207 (main): Do not handle 'd' packet.
10208 * server.h (debug_threads, remote_debug, monitor_output): Declare.
10209 * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
10214 * Makefile.in (EXEEXT): New.
10215 (clean): Use $(EXEEXT).
10219 * target.h (target_ops): Rename send_signal to request_interrupt,
10220 and remove enum target_signal parameter.
10221 * linux-low.c (linux_request_interrupt): Rename from
10222 linux_send_signal, and always send SIGINT.
10223 * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
10224 and always send SIGINT.
10225 * remote-utils.c (putpkt_binary): Call request_interrupt, instead
10227 (input_interrupt): Likewise.
10231 * server.c (get_features_xml): Check if target implemented
10233 * win32-i386-low.c (win32_arch_string): New.
10234 (win32_target_ops): Add win32_arch_string as arch_string member.
10238 * spu-low.c (spu_arch_string): New.
10239 (spu_target_ops): Add spu_arch_string.
10243 * remote-utils.c: Remove HAVE_TERMINAL_H check.
10244 * configure.ac: Do not check for terminal.h.
10245 * configure, config.in: Regenerated.
10249 * Makefile.in (OBS): Add $(XML_BUILTIN).
10250 (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
10252 (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
10253 (arm-with-iwmmxt.c): New.
10254 * config.in, configure: Regenerate.
10255 * configure.ac: Check for iWMMXt. Handle srv_xmltarget,
10256 srv_xmlbuiltin, and srv_xmlfiles. Define USE_XML.
10257 * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
10258 (arm*-*-linux*): Add iWMMXt and regset support.
10259 * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
10260 (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
10261 (arm_store_wmmxregset, target_regsets): New.
10262 * server.c (get_features_xml): Take annex argument. Check builtin
10264 (handle_query): Handle multiple annexes.
10268 * remote-utils.c [USE_WIN32API] (read, write): Define.
10269 (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
10274 * linux-i386-low.c (the_low_target): Set arch_string.
10275 * linux-x86-64-low.c (the_low_target): Likewise.
10276 * linux-low.c (linux_arch_string): New.
10277 (linux_target_ops): Add it.
10278 * linux-low.h (struct linux_target_ops): Add arch_string.
10279 * server.c (write_qxfer_response): Use const void * for DATA.
10280 (get_features_xml): New.
10281 (handle_query): Handle qXfer:features:read. Report it for qSupported.
10282 * target.h (struct target_ops): Add arch_string method.
10287 * linux-low.c (linux_kill): Handle being called with no threads.
10288 * win32-i386-low.c (win32_kill): Likewise.
10289 (get_child_debug_event): Clear current_process_handle.
10294 * remote-utils.c (remote_open): Check the type of specified
10295 serial port devices before opening them.
10296 * server.c (main): Kill the inferior if an error occurs during
10297 the first remote_open.
10301 * README: Update supported targets.
10305 * Makefile.in (clean): Remove reg-mips64.c.
10306 (reg-mips64.c, reg-mips64.o): New rules.
10307 * configure.srv: Handle mips64. Include regset support for mips.
10308 * linux-mips-low.c (union mips_register): New.
10309 (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
10310 (mips_breakpoint, mips_breakpoint_at): Use int.
10311 (mips_collect_register, mips_supply_register)
10312 (mips_collect_register_32bit, mips_supply_register_32bit)
10313 (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
10314 (mips_store_fpregset, target_regsets): New.
10315 * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
10319 * configure.srv: Add target "spu*-*-*".
10320 * Makefile.in (clean): Remove reg-spu.c.
10321 (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
10322 * spu-low.c: New file.
10326 * configure.ac: Correct td_thr_tls_get_addr test.
10327 * configure: Regenerated.
10331 * linux-low.c (linux_wait_for_event): Reformat. Use the
10332 pass_signals array.
10333 * remote-utils.c (decode_address_to_semicolon): New.
10334 * server.c (pass_signals, handle_general_set): New.
10335 (handle_query): Mention QPassSignals for qSupported.
10336 (main): Call handle_general_set.
10337 * server.h (pass_signals, decode_address_to_semicolon): New.
10341 * server.c (handle_query): Correct error handling for read_auxv.
10345 * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
10346 and srv_linux_thread_db to yes.
10347 * linux-s390-low.c (s390_fill_gregset): New function.
10348 (target_regsets): Define data structure.
10352 * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
10353 * configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR.
10354 * config.in, configure: Regenerated.
10355 * inferiors.c (gdb_id_to_thread): New function.
10356 (gdb_id_to_thread_id): Use it.
10357 * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
10358 * linux-low.h (struct process_info): Add th member.
10359 (thread_db_get_tls_address): New prototype.
10360 * remote-utils.c (decode_address): Make non-static.
10361 * server.c (handle_query): Handle qGetTLSAddr.
10362 * server.h (gdb_id_to_thread, decode_address): New prototypes.
10363 * target.h (struct target_ops): Add get_tls_address.
10364 * thread-db.c (maybe_attach_thread): Save the thread handle.
10365 (thread_db_get_tls_address): New.
10369 * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
10370 (linux_resume_one_process): Take a siginfo_t *. Update all
10371 callers. Queue it if necessary. Use PTRACE_SETSIGINFO.
10372 (struct pending_signals): Add a siginfo_t.
10373 (linux_wait_for_process): Always set last_status.
10374 (linux_wait_for_event): Use PTRACE_GETSIGINFO.
10375 (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
10376 * linux-low.h (struct process_info): Add last_status.
10380 * remote-utils.c (try_rle): New function.
10381 (putpkt_binary): Use it.
10385 * Makefile.in (clean): Clean reg-x86-64-linux.c.
10386 (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
10387 * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
10388 * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
10389 (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
10394 * server.c (terminal_fd): New variable.
10395 (old_foreground_pgrp): Likewise.
10396 (restore_old_foreground_pgrp): New function.
10397 (start_inferior): Record the terminal file descriptor in terminal_fd
10398 and its original foreground group in old_foreground_pgrp. Register
10399 restore_old_foreground_pgrp with atexit().
10403 * server.c (handle_query): Correct qPart to qXfer.
10407 * configure.ac: Check for more headers which are missing on
10408 Windows. Automatically supply -lwsock32 and USE_WIN32API.
10409 * configure.srv: Add Cygwin and mingw32.
10410 * remote-utils.c: Don't include headers unconditionally which
10411 are missing on mingw32. Include <winsock.h> for mingw32.
10412 (remote_open): Adjust for mingw32 support. Flush
10413 standard error after writing to it.
10414 (remote_close, putpkt_binary, input_interrupt, block_async_io)
10415 (unblock_async_io, enable_async_io, disable_async_io)
10416 (readchar, getpkt): Update for Winsock support.
10417 (prepare_resume_reply): Expect a protocol signal number.
10418 * server.c: Disable <sys/wait.h> on mingw32.
10419 (start_inferior): Adjust for mingw32 support. Flush
10420 standard error after writing to it.
10421 (attach_inferior): Likewise. Use protocol signal
10423 (main): Skip 'D' packet on mingw32. Use protocol signal numbers
10425 * win32-i386-low.c: New file.
10426 * Makefile.in (XM_CLIBS): Set.
10427 (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
10428 (win32-i386-low.o): New dependency rule.
10429 * linux-low.c (linux_wait): Use target signal numbers.
10430 * target.h (struct target_ops): Doc fix.
10431 * server.h (target_signal_to_name): New prototype.
10432 * gdbreplay.c: Don't include headers unconditionally which
10433 are missing on mingw32. Include <winsock.h> for mingw32.
10434 (remote_close, remote_open): Adjust for Winsock support.
10435 * configure, config.in: Regenerated.
10439 * server.c (decode_xfer_read, write_qxfer_response): New.
10440 (handle_query): Take a packet length argument. Handle
10441 qXfer:auxv:read instead of qPart:auxv:read. Mention it in
10442 the qSupported response.
10443 (main): Update call to handle_query.
10447 * remote-utils.c (remote_escape_output, remote_unescape_input): New.
10448 (putpkt_binary): Renamed from putpkt and adjusted for binary
10450 (putpkt): New wrapper for putpkt_binary.
10451 (readchar): Don't mask off the high bit.
10452 (decode_X_packet): New function.
10453 * server.c (main): Call putpkt_binary if a handler sets the packet
10454 length. Save the length of the incoming packet. Handle 'X'.
10455 * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
10459 * server.c (handle_query): Handle qSupported.
10463 * remote-utils.c (all_symbols_looked_up): New variable.
10464 (look_up_one_symbol): Check it.
10465 * server.h (look_up_one_symbol): New declaration.
10466 * thread-db.c (thread_db_init): Set all_symbols_looked_up.
10470 * Makefile.in (linux-arm-low.o): Update dependencies.
10471 * linux-arm-low.c: Include "gdb_proc_service.h".
10472 (PTRACE_GET_THREAD_AREA): Define.
10473 (ps_get_thread_area): New function.
10477 * configure.srv (m68k*-*-uclinux*): New target.
10478 * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
10479 (linux_resume_one_process): Remove extraneous cast.
10480 (linux_read_offsets): New.
10481 (linux_target_op): Add linux_read_offsets on mmuless systems.
10482 * server.c (handle_query): Add qOffsets logic.
10483 * target.h (struct target_ops): Add read_offsets.
10487 * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
10488 (PTRACE_GET_THREAD_AREA): Define.
10489 (ps_get_thread_area): New function.
10490 * Makefile.in (linux-i386-low.o, linux-mips-low.o)
10491 (linux-x86-64-low.o): Update.
10495 * configure.ac: Remove checks for prfpregset_t.
10496 * gdb_proc_service.h: New file.
10497 * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
10498 new "gdb_proc_service.h".
10499 * proc-service.c: Likewise.
10500 (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
10501 (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
10502 * Makefile.in (gdb_proc_service_h): Updated.
10503 * configure, config.in: Regenerated.
10507 * remote-utils.c (prepare_resume_reply): Move declaration
10508 of gdb_id_from_wait to the top of the block.
10512 * linux-low.c (regsets_store_inferior_registers): Read the regset
10513 from the target before filling it.
10517 * server.c (attach_inferior): Return SIGTRAP for a successful
10522 * Makefile.in (OBS): Add version.o.
10523 (STAGESTUFF): Delete.
10524 (version.o): Add dependencies.
10525 (version.c): Replace rule.
10526 (clean): Remove version.c.
10527 * server.c (gdbserver_version): New.
10528 (gdbserver_usage): Use printf.
10529 (main): Handle --version and --help.
10530 * server.h (version, host_name): Add declarations.
10544 * linux-x86-64-low.c:
10546 * linux-s390-low.c:
10547 * linux-ppc64-low.c:
10549 * linux-mips-low.c:
10550 * linux-m68k-low.c:
10551 * linux-m32r-low.c:
10554 * linux-ia64-low.c:
10555 * linux-i386-low.c:
10556 * linux-crisv32-low.c:
10568 * gdbserver.1: Add (C) after Copyright. Update the FSF
10573 * linux-arm-low.c (arm_eabi_breakpoint): New variable.
10574 (arm_breakpoint_at): Recognize both breakpoints.
10575 (the_low_target): Use the correct breakpoint instruction.
10579 * configure.srv (x86_64-*-linux*): Turn on thread_db support.
10580 * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
10581 (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
10582 (the_low_target): Update.
10586 * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
10588 * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
10589 (ia64_num_regs): Reduce to 462.
10593 * acinclude.m4: Correct quoting.
10594 * aclocal.m4: Regenerated.
10597 * thread-db.c (thread_db_err_str): Handle TD_VERSION.
10598 (thread_db_init): Call thread_db_err_str.
10599 * configure.ac: Check for TD_VERSION.
10600 * config.in, configure: Regenerated.
10604 * server.h (error, fatal, warning): Add ATTR_FORMAT.
10608 * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
10609 is not available. Define HAVE_PTRACE_GETREGS if it is.
10610 * config.in, configure: Regenerated.
10611 * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
10612 * linux-i386-low.c, linux-m68k-low.c: Update to use
10613 HAVE_PTRACE_GETREGS.
10614 * linux-low.c (regsets_fetch_inferior_registers)
10615 (regsets_store_inferior_registers): Only return 0 if we processed
10617 * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
10618 * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
10622 * inferiors.c (struct thread_info): Add gdb_id.
10623 (add_thread): Add gdb_id argument.
10624 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
10625 * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
10626 calls to add_thread.
10627 * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
10628 * server.c (handle_query): Use thread_to_gdb_id.
10629 (handle_v_cont, main): Use gdb_id_to_thread_id.
10630 * server.h (add_thread): Update prototype.
10631 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
10636 * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
10637 left-padded registers.
10638 * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
10639 * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
10643 * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
10644 * configure: Regenerate.
10645 * config.in: Regenerate.
10646 * server.h (NEED_DECLARATION_STRERROR):
10647 Replace with !HAVE_DECL_STRERROR.
10651 * linux-low.c (linux_wait, linux_send_signal): Don't test
10652 an unsigned long variable for > 0 if it could be MAX_ULONG.
10653 * server.c (myresume): Likewise.
10654 * target.c (set_desired_inferior): Likewise.
10658 * configure.ac: Simplify and improve check for socklen_t.
10659 * configure, config.in: Regenerate.
10663 * acconfig.h: Remove.
10664 * configure.ac: Add a test for socklen_t. Use three-argument
10665 AC_DEFINE throughout.
10666 * config.in: Regenerated using autoheader 2.59.
10667 * configure: Regenerated.
10669 * gdbreplay.c (socklen_t): Provide a default.
10670 (remote_open): Use socklen_t.
10671 * remote-utils.c (socklen_t): Provide a default.
10672 (remote_open): Use socklen_t.
10673 (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
10676 * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
10678 * linux-low.c (linux_read_memory, linux_write_memory)
10679 (linux_read_auxv): Likewise.
10680 * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
10681 (check_mem_write): Likewise.
10682 * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
10684 * regcache.c (struct inferior_rgcache_data, registers_to_string)
10685 (registers_from_string, register_data): Likewise.
10686 * server.c (handle_query, main): Likewise.
10687 * server.h (convert_ascii_to_int, convert_int_to_ascii)
10688 (decode_M_packet): Likewise.
10689 * target.c (read_inferior_memory, write_inferior_memory): Likewise.
10690 * target.h (struct target_ops): Update read_memory, write_memory,
10692 (read_inferior_memory, write_inferior_memory): Update.
10693 * linux-low.h (struct linux_target_ops): Change type of breakpoint
10694 to unsigned char *.
10695 * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
10696 linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
10697 linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
10698 linux-s390-low.c, linux-sh-low.c: Update for changes in
10699 read_inferior_memory and the_low_target->breakpoint.
10703 * Makefile.in (SFILES): Add linux-ppc64-low.c.
10704 (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
10705 * configure.srv: Add powerpc64-*-linux*.
10706 * linux-ppc64-low.c: New file.
10710 * linux-cris-low.c: New file with support for CRIS.
10711 * linux-crisv32-low.c: Ditto for CRISv32.
10712 * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
10713 (clean): Add reg-cris.c and reg-crisv32.c.
10714 Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
10715 reg-crisv32.o, and reg-crisv32.c to make rules.
10716 * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
10717 recognized targets.
10721 * linux-low.c (fetch_register): Ensure buffer size is a multiple
10722 of sizeof (PTRACE_XFER_TYPE).
10723 (usr_store_inferior_registers): Likewise. Zero out excess bytes.
10727 * target.h (struct target_ops): Add insert_watchpoint,
10728 remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
10729 pointers for hardware watchpoint support.
10730 * linux-low.h (struct linux_target_ops): Ditto.
10731 * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
10732 (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add
10733 to linux_target_ops.
10734 * remote-utils.c (prepare_resume_reply): Add watchpoint information to
10736 * server.c (main): Recognize 'Z' and 'z' packets.
10740 * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
10741 (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
10742 (the_low_target): Add new members.
10746 * proc-service.c (ps_lgetregs): Search all_processes instead of
10751 * server.c (start_inferior): Change return type to int.
10752 (attach_inferior): Change sigptr to int *.
10753 (handle_v_cont, handle_v_requests): Change signal to int *.
10754 (main): Change signal to int.
10758 * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
10759 * configure.srv: Add m32r*-*-linux*.
10760 * linux-m32r-low.c: New file.
10764 * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
10768 * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
10769 Take unsigned long arguments for PIDs.
10770 * linux-low.c (add_process, linux_attach_lwp, linux_attach)
10771 (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
10772 (wait_for_sigstop, linux_resume_one_process)
10773 (regsets_fetch_inferior_registers, linux_send_signal)
10774 (linux_read_auxv): Likewise. Update the types of variables holding
10775 PIDs. Update format string specifiers.
10776 * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
10777 * remote-utils.c (prepare_resume_reply): Likewise.
10778 * server.c (cont_thread, general_thread, step_thread)
10779 (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
10781 (handle_query): Update format specifiers.
10782 (handle_v_cont, main): Use strtoul for thread IDs.
10783 * server.h (struct inferior_list_entry): Use unsigned long for ID.
10784 (add_thread, find_inferior_id, change_inferior_id, cont_thread)
10785 (general_thread, step_thread, thread_from_wait)
10786 (old_thread_from_wait): Update.
10787 * target.h (struct thread_resume): Use unsigned long for THREAD.
10788 (struct target_ops): Use unsigned long for arguments to attach and
10793 * acinclude.m4: Include bfd/bfd.m4 directly.
10794 * configure.ac: Use AC_ARG_PROGRAM. Suggested by Aron Griffis
10796 * aclocal.m4, configure: Regenerated.
10800 * configure.ac: Rename configure.in, require autoconf 2.59.
10801 * configure: Re-generate.
10805 * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset
10806 LIBS when finished.
10807 * aclocal.m4: Regenerated.
10808 * configure: Regenerated.
10812 * linux-m68k-low.c (m68k_num_gregs): Define.
10813 (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
10814 (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
10815 (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
10816 (m68k_breakpoint_at): New. Add to the_low_target.
10818 * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
10819 srv_linux_thread_db to yes.
10823 * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
10824 (ARCH_SET_FS): Likewise.
10825 (ARCH_GET_FS): Likewise.
10826 (ARCH_GET_GS): Likewise.
10830 * linux-i386-low.c (ps_get_thread_area): New.
10831 * linux-x86-64-low.c (ps_get_thread_area): New.
10832 * linux-low.c: Include <sys/syscall.h>.
10833 (linux_kill_one_process): Don't kill the first thread here.
10834 (linux_kill): Kill the first thread here.
10835 (kill_lwp): New function.
10836 (send_sigstop, linux_send_signal): Use it.
10837 * proc-service.c: Clean up #ifdefs.
10838 (fpregset_info): Delete.
10839 (ps_lgetregs): Update and enable implementation.
10840 (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
10842 * remote-utils.c (struct sym_cache, symbol_cache): New.
10843 (input_interrupt): Print a clearer message.
10844 (async_io_enabled): New variable.
10845 (enable_async_io, disable_async_io): Use it. Update comments.
10846 (look_up_one_symbol): Use the symbol cache.
10847 * thread-db.c (thread_db_look_up_symbols): New function.
10848 (thread_db_init): Update comments. Call thread_db_look_up_symbols.
10852 * configure.in: Test for -rdynamic.
10853 * configure: Regenerated.
10854 * Makefile (INTERNAL_LDFLAGS): New.
10855 (gdbserver, gdbreplay): Use it.
10859 * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
10863 * linux-low.c (linux_wait): Clear all_processes list also.
10867 * linux-low.c: Include <errno.h>. Remove extern declaration of
10872 * gdbreplay.c, server.h, utils.c: Update copyright years.
10876 * server.c (main): Print child status or termination signal from
10877 variable 'signal', not 'sig'.
10881 * linux-low.c (linux_read_memory): Change return type to
10882 int. Check for and return error from ptrace().
10883 * target.c (read_inferior_memory): Change return type to int. Pass
10884 back return status from the_target->read_memory().
10885 * target.h (struct target_ops): Adapt *read_memory() prototype.
10887 (read_inferior_memory): Adapt prototype.
10888 * server.c (main): Return an error packet if
10889 read_inferior_memory() returns an error.
10893 * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
10894 Unify with other clean targets.
10898 * server.c (handle_v_cont): Call set_desired_inferior.
10902 * remote-utils.c (prepare_resume_reply): Always supply "thread:".
10906 * linux-low.c (linux_wait): Unblock async I/O.
10907 (linux_resume): Block and enable async I/O.
10908 * remote-utils.c (block_async_io, unblock_async_io): New functions.
10909 * server.h (block_async_io, unblock_async_io): Add prototypes.
10913 * remote-utils.c (remote_open): Print a status notice after
10914 opening a TCP port.
10915 * server.c (attach_inferior): Print a status notice after
10920 * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
10924 * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
10926 * server.c, target.h: Update copyright years.
10930 * target.h (struct target_ops): New member `read_auxv'.
10931 * server.c (handle_query): Handle qPart:auxv:read: query using that.
10932 * linux-low.c (linux_read_auxv): New function.
10933 (linux_target_ops): Initialize `read_auxv' member to that.
10939 * linux-s390-low.c (s390_num_regs): Update.
10940 (s390_regmap): Remove control registers. Use __s390x__ predefine
10941 instead of GPR_SIZE to distiguish s390 and s390x targets.
10945 * linux-low.c: Update copyright year.
10946 (check_removed_breakpoint): Clear pending_is_breakpoint.
10947 (linux_set_resume_request, linux_queue_one_thread)
10948 (resume_status_pending_p): New functions.
10949 (linux_continue_one_thread): Use process->resume.
10950 (linux_resume): Only resume threads if there are no pending events.
10951 * linux-low.h (struct process_info): Add resume request
10956 * regcache.c (new_register_cache): Clear the allocated register
10961 * linux-low.c (linux_resume): Take a struct thread_resume *
10963 (linux_wait): Update call.
10964 (resume_ptr): New static variable.
10965 (linux_continue_one_thread): Renamed from
10966 linux_continue_one_process. Use resume_ptr.
10967 (linux_resume): Use linux_continue_one_thread.
10968 * server.c (handle_v_cont, handle_v_requests): New functions.
10969 (myresume): New function.
10970 (main): Handle 'v' case.
10971 * target.h (struct thread_resume): New type.
10972 (struct target_ops): Change argument of "resume" to struct
10974 (myresume): Delete macro.
10978 * Makefile.in (install-only): Create dest dir. Support DESTDIR.
10979 (uninstall): Support DESTDIR.
10983 * configure.srv: Add xscale*linux copy of arm*linux entry.
10987 * linux-arm-low.c (arm_reinsert_addr): New function.
10988 (the_low_target): Add arm_reinsert_addr.
10992 * mem-break.c: Remove whitespace at end of file.
10996 * configure.in: Check whether we need to prototype strerror.
10997 * server.h: Optionally prototype strerror.
10998 * gdbreplay.c (perror_with_name): Use strerror.
10999 * linux-low.c (linux_attach_lwp): Use strerror.
11000 * utils.c (perror_with_name): Use strerror.
11001 * config.in, configure: Regenerated.
11005 * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
11010 * Makefile.in (SFILES): Update.
11011 * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
11012 low-sun3.c: Remove files.
11016 * linux-low.c: Move comment to linux_thread_alive where it belonged.
11017 (linux_detach_one_process, linux_detach): New functions.
11018 (linux_target_ops): Add linux_detach.
11019 * server.c (main): Handle 'D' packet.
11020 * target.h (struct target_ops): Add "detach" member.
11021 (detach_inferior): Define.
11026 * configure.srv: Accept i[34567]86 variants.
11030 * linux-low.c (linux_wait_for_event): Correct comment typos.
11031 (linux_resume_one_process): Call check_removed_breakpoint.
11032 (linux_send_signal): New function.
11033 (linux_target_ops): Add linux_send_signal.
11034 * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
11036 * target.h (struct target_ops): Add send_signal.
11040 * linux-low.c (usr_store_inferior_registers): Transfer buf in
11041 PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise,
11042 if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
11043 away part of the register's value.
11047 * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
11048 (linux_wait_for_event, linux_init_signals): Likewise.
11052 * configure.in: Check for stdlib.h.
11053 * configure: Regenerated.
11054 * config.in: Regenerated.
11058 * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
11062 * Makefile.in: Remove obsolete code.
11066 * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
11067 defined(PT_FPR0_HI).
11071 * linux-arm-low.c (arm_num_regs): Increase.
11072 (arm_regmap): Include status register.
11076 * linux-low.c (register_addr): Remove incorrect -1 check.
11080 * linux-low.c (linux_create_inferior): Call setpgid. Return
11082 (unstopped_p, linux_signal_pid): Remove.
11083 (linux_target_ops): Remove linux_signal_pid.
11084 * remote-utils.c (putpkt, input_interrupt): Use signal_pid
11085 global instead of target method.
11086 * target.h (struct target_ops): Remove signal_pid. Update comment
11087 for create_inferior.
11088 * server.c (signal_pid): New variable.
11089 (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in
11090 gdbserver. Set the child to be the foreground process group.
11091 (attach_inferior): Set signal_pid.
11095 * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
11099 * Makefile.in (LDFLAGS): Allow the configure script to establish a
11104 * Makefile.in: Make chill references obsolete.
11108 * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
11109 * configure: Regenerate.
11110 * config.in: Regenerate.
11114 * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
11115 (perror_with_name, remote_close, remote_open, expect, play): Static.
11119 * linux-x86-64-low.c (x86_64_regmap): Make it an array of
11120 byte offsets instead of an array of indexes.
11121 (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
11125 * regcache.c: Add comment.
11129 * thread-db.c: New file.
11130 * proc-service.c: New file.
11131 * acinclude.m4: New file.
11132 * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
11133 proc-service.o, and thread-db.o.
11134 (linux-low.o): Add USE_THREAD_DB.
11135 * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
11136 HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
11137 * aclocal.m4: Regenerated.
11138 * config.in: Regenerated.
11139 * configure: Regenerated.
11140 * configure.in: Check for proc_service.h, sys/procfs.h,
11141 thread_db.h, and linux/elf.h headrs.
11142 Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
11143 PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB.
11144 Check for -lthread_db and thread support.
11145 * configure.srv: Enable thread_db support for ARM, i386, MIPS,
11146 PowerPC, and SuperH.
11147 * i387-fp.c: Constify arguments.
11148 * i387-fp.h: Likewise.
11149 * inferiors.c: (struct thread_info): Renamed from
11150 `struct inferior_info'. Remove PID member. Use generic inferior
11151 list header. All uses updated.
11152 (inferiors, signal_pid): Removed.
11153 (all_threads): New variable.
11154 (get_thread): Define.
11155 (add_inferior_to_list): New function.
11156 (for_each_inferior): New function.
11157 (change_inferior_id): New function.
11158 (add_inferior): Removed.
11159 (remove_inferior): New function.
11160 (add_thread): New function.
11161 (free_one_thread): New function.
11162 (remove_thread): New function.
11163 (clear_inferiors): Use for_each_inferior and free_one_thread.
11164 (find_inferior): New function.
11165 (find_inferior_id): New function.
11166 (inferior_target_data): Update argument type.
11167 (set_inferior_target_data): Likewise.
11168 (inferior_regcache_data): Likewise.
11169 (set_inferior_regcache_data): Likewise.
11170 * linux-low.c (linux_bp_reinsert): Remove.
11171 (all_processes, stopping_threads, using_thrads)
11172 (struct pending_signals, debug_threads, pid_of): New.
11173 (inferior_pid): Replace with macro.
11174 (struct inferior_linux_data): Remove.
11175 (get_stop_pc, add_process): New functions.
11176 (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
11177 Use add_process and add_thread.
11178 (linux_attach_lwp): New function, based on old linux_attach. Use
11179 add_process and add_thread. Set stop_expected for new threads.
11180 (linux_attach): New function.
11181 (linux_kill_one_process): New function.
11182 (linux_kill): Kill all LWPs.
11183 (linux_thread_alive): Use find_inferior_id.
11184 (check_removed_breakpoints, status_pending_p): New functions.
11185 (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
11186 Update. Use WNOHANG. Wait for cloned processes also. Update process
11187 struct for the found process.
11188 (linux_wait_for_event): New function.
11189 (linux_wait): Use it. Support LWPs.
11190 (send_sigstop, wait_for_sigstop, stop_all_processes)
11191 (linux_resume_one_process, linux_continue_one_process): New functions.
11192 (linux_resume): Support LWPs.
11193 (REGISTER_RAW_SIZE): Remove.
11194 (fetch_register): Use register_size instead. Call supply_register.
11195 (usr_store_inferior_registers): Likewise. Call collect_register.
11196 Fix recursive case.
11197 (regsets_fetch_inferior_registers): Improve error message.
11198 (regsets_store_inferior_registers): Add debugging.
11199 (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
11200 (unstopped_p, linux_signal_pid): New functions.
11201 (linux_target_ops): Add linux_signal_pid.
11202 (linux_init_signals): New function.
11203 (initialize_low): Call it. Initialize using_threads.
11204 * regcache.c (inferior_regcache_data): Add valid
11206 (get_regcache): Fetch registers lazily. Add fetch argument
11207 and update all callers.
11208 (regcache_invalidate_one, regcache_invalidate): New
11210 (new_register_cache): Renamed from create_register_cache.
11211 Return the new regcache.
11212 (free_register_cache): Change argument to a void *.
11213 (registers_to_string, registers_from_string): Call get_regcache
11214 with fetch flag set.
11215 (register_data): Make static. Pass fetch flag to get_regcache.
11216 (supply_register): Call get_regcache with fetch flag clear.
11217 (collect_register): Call get_regcache with fetch flag set.
11218 (collect_register_as_string): New function.
11219 * regcache.h: Update.
11220 * remote-utils.c (putpkt): Flush after debug output and use
11222 Handle input interrupts while waiting for an ACK.
11223 (input_interrupt): Use signal_pid method.
11224 (getpkt): Flush after debug output and use stderr.
11225 (outreg): Use collect_register_as_string.
11226 (new_thread_notify, dead_thread_notify): New functions.
11227 (prepare_resume_reply): Check using_threads. Set thread_from_wait
11228 and general_thread.
11229 (look_up_one_symbol): Flush after debug output.
11230 * server.c (step_thread, server_waiting): New variables.
11231 (start_inferior): Don't use signal_pid. Update call to mywait.
11232 (attach_inferior): Update call to mywait.
11233 (handle_query): Handle qfThreadInfo and qsThreadInfo.
11234 (main): Don't fetch/store registers explicitly. Use
11235 set_desired_inferior. Support proposed ``Hs'' packet. Update
11237 * server.h: Update.
11238 (struct inferior_list, struct_inferior_list_entry): New.
11239 * target.c (set_desired_inferior): New.
11240 (write_inferior_memory): Constify.
11241 (mywait): New function.
11242 * target.h: Update.
11243 (struct target_ops): New signal_pid method.
11244 (mywait): Removed macro, added prototype.
11246 * linux-low.h (regset_func): Removed.
11247 (regset_fill_func, regset_store_func): New.
11248 (enum regset_type): New.
11249 (struct regset_info): Add type field. Use new operation types.
11250 (struct linux_target_ops): stop_pc renamed to get_pc.
11251 Add decr_pc_after_break and breakpoint_at.
11252 (get_process, get_thread_proess, get_process_thread)
11253 (strut process_info, all_processes, linux_attach_lwp)
11254 (thread_db_init): New.
11256 * linux-arm-low.c (arm_get_pc, arm_set_pc,
11257 arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
11258 (the_low_target): Add new members.
11259 * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
11260 (i386_store_fpxregset): Constify.
11261 (target_regsets): Add new kind identifier.
11262 (i386_get_pc): Renamed from i386_stop_pc. Simplify.
11263 (i386_set_pc): Add debugging.
11264 (i386_breakpoint_at): New function.
11265 (the_low_target): Add new members.
11266 * linux-mips-low.c (mips_get_pc, mips_set_pc)
11267 (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
11268 (mips_breakpoint_at): New.
11269 (the_low_target): Add new members.
11270 * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
11271 (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
11272 (the_low_target): Add new members.
11273 * linux-sh-low.c (sh_get_pc, sh_set_pc)
11274 (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
11275 (the_low_target): Add new members.
11276 * linux-x86-64-low.c (target_regsets): Add new kind
11282 * server.c (gdbserver_usage): New function.
11287 * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
11288 stop_at -> stop_pc.
11292 * Makefile.in: Remove obsolete code.
11296 * linux-low.c (regsets_fetch_inferior_registers),
11297 (regsets_store_inferior_registers): Removed cast to int from
11299 * regcache.h: Added declaration of struct inferior_info.
11303 * inferiors.c (struct inferior_info): Add regcache_data.
11304 (add_inferior): Call create_register_cache.
11305 (clear_inferiors): Call free_register_cache.
11306 (inferior_regcache_data, set_inferior_regcache_data): New functions.
11307 * regcache.c (struct inferior_regcache_data): New.
11308 (registers): Remove.
11309 (get_regcache): New function.
11310 (create_register_cache, free_register_cache): New functions.
11311 (set_register_cache): Don't initialize the register cache here.
11312 (registers_to_string, registers_from_string, register_data): Call
11314 * regcache.h: Add prototypes.
11315 * server.h: Likewise.
11319 * mem-break.c: New file.
11320 * mem-break.h: New file.
11321 * Makefile.in: Add mem-break.o rule; update server.h
11323 * inferiors.c (struct inferior_info): Add target_data
11325 (clear_inferiors): Free target_data member if set.
11326 (inferior_target_data, set_inferior_target_data): New functions.
11327 * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
11328 (i386_stop_pc, i386_set_pc): New. Add to the_low_target.
11329 * linux-low.c (linux_bp_reinsert): New variable.
11330 (struct inferior_linux_data): New.
11331 (linux_create_inferior): Use set_inferior_target_data.
11332 (linux_attach): Likewise. Call add_inferior.
11333 (linux_wait_for_one_inferior): New function.
11334 (linux_wait): Call it.
11335 (linux_write_memory): Add const.
11336 (initialize_low): Call set_breakpoint_data.
11337 * linux-low.h (struct linux_target_ops): Add breakpoint
11339 * server.c (attach_inferior): Remove extra add_inferior
11341 * server.h: Include mem-break.h. Update inferior.c
11343 * target.c (read_inferior_memory)
11344 (write_inferior_memory): New functions.
11345 * target.h (read_inferior_memory)
11346 (write_inferior_memory): Change macros to prototypes.
11347 (struct target_ops): Update comments. Add const to write_memory
11352 * linux-low.c (usr_store_inferior_registers): Support
11353 registers which are allowed to fail to store.
11354 * linux-low.h (linux_target_ops): Likewise.
11355 * linux-ppc-low.c (ppc_regmap): Support FPSCR.
11356 (ppc_cannot_store_register): FPSCR may not be storable.
11360 * server.h: Include <string.h> if HAVE_STRING_H.
11361 * ChangeLog: Correct paths in last ChangeLog entry.
11365 * linux-low.h: Remove obsolete prototypes.
11366 (struct linux_target_ops): New.
11367 (extern the_low_target): New.
11368 * linux-low.c (num_regs, regmap): Remove declarations.
11369 (register_addr): Use the_low_target explicitly.
11370 (fetch_register): Likewise.
11371 (usr_fetch_inferior_registers): Likewise.
11372 (usr_store_inferior_registers): Likewise.
11373 * linux-arm-low.c (num_regs): Remove.
11374 (arm_num_regs): Define.
11375 (arm_regmap): Renamed from regmap, made static.
11376 (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
11378 (arm_cannot_store_register): Renamed from cannot_store_register,
11380 (the_low_target): New.
11381 * linux-i386-low.c (num_regs): Remove.
11382 (i386_num_regs): Define.
11383 (i386_regmap): Renamed from regmap, made static.
11384 (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
11386 (i386_cannot_store_register): Renamed from cannot_store_register,
11388 (the_low_target): New.
11389 * linux-ia64-low.c (num_regs): Remove.
11390 (ia64_num_regs): Define.
11391 (ia64_regmap): Renamed from regmap, made static.
11392 (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
11394 (ia64_cannot_store_register): Renamed from cannot_store_register,
11396 (the_low_target): New.
11397 * linux-m68k-low.c (num_regs): Remove.
11398 (m68k_num_regs): Define.
11399 (m68k_regmap): Renamed from regmap, made static.
11400 (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
11402 (m68k_cannot_store_register): Renamed from cannot_store_register,
11404 (the_low_target): New.
11405 * linux-mips-low.c (num_regs): Remove.
11406 (mips_num_regs): Define.
11407 (mips_regmap): Renamed from regmap, made static.
11408 (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
11410 (mips_cannot_store_register): Renamed from cannot_store_register,
11412 (the_low_target): New.
11413 * linux-ppc-low.c (num_regs): Remove.
11414 (ppc_num_regs): Define.
11415 (ppc_regmap): Renamed from regmap, made static.
11416 (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
11418 (ppc_cannot_store_register): Renamed from cannot_store_register,
11420 (the_low_target): New.
11421 * linux-s390-low.c (num_regs): Remove.
11422 (s390_num_regs): Define.
11423 (s390_regmap): Renamed from regmap, made static.
11424 (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
11426 (s390_cannot_store_register): Renamed from cannot_store_register,
11428 (the_low_target): New.
11429 * linux-sh-low.c (num_regs): Remove.
11430 (sh_num_regs): Define.
11431 (sh_regmap): Renamed from regmap, made static.
11432 (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
11434 (sh_cannot_store_register): Renamed from cannot_store_register,
11436 (the_low_target): New.
11437 * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
11438 (the_low_target): New.
11442 * Makefile.in: Add stamp-h target.
11443 * configure.in: Create stamp-h.
11444 * configure: Regenerated.
11448 * inferiors.c: New file.
11449 * target.c: New file.
11450 * target.h: New file.
11451 * Makefile.in: Add target.o and inferiors.o. Update
11453 * linux-low.c (inferior_pid): New static variable,
11454 moved from server.c.
11455 (linux_create_inferior): Renamed from create_inferior.
11456 Call add_inferior. Return 0 on success instead of a PID.
11457 (linux_attach): Renamed from myattach.
11458 (linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
11459 (linux_thread_alive): Renamed from mythread_alive.
11460 (linux_wait): Renamed from mywait. Call clear_inferiors () if the
11462 (linux_resume): Renamed from myresume. Add missing ``return 0''.
11463 (regsets_store_inferior_registers): Correct error message.
11464 Add missing ``return 0''.
11465 (linux_fetch_registers): Renamed from fetch_inferior_registers.
11466 (linux_store_registers): Renamed from store_inferior_registers.
11467 (linux_read_memory): Renamed from read_inferior_memory.
11468 (linux_write_memory): Renamed from write_inferior_memory.
11469 (linux_target_ops): New structure.
11470 (initialize_low): Call set_target_ops ().
11471 * remote-utils.c (unhexify): New function.
11472 (hexify): New function.
11473 (input_interrupt): Send signals to ``signal_pid''.
11474 * server.c (inferior_pid): Remove.
11475 (start_inferior): Update create_inferior call.
11476 (attach_inferior): Call add_inferior.
11477 (handle_query): New function.
11478 (main): Call handle_query for `q' packets.
11479 * server.h: Include "target.h". Remove obsolete prototypes.
11480 Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
11484 * Makefile.in: Add WARN_CFLAGS. Update configury
11486 * configure.in: Check for <string.h>
11487 * configure: Regenerate.
11488 * config.in: Regenerate.
11489 * gdbreplay.c: Include needed system headers.
11490 (remote_open): Remove strchr prototype.
11491 * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
11492 * regcache.c (supply_register): Change buf argument to const void *.
11493 (supply_register_by_name): Likewise.
11494 (collect_register): Change buf argument to void *.
11495 (collect_register_by_name): Likewise.
11496 * regcache.h: Add missing prototypes.
11497 * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
11498 * server.c (handle_query): New function.
11499 (attached): New static variable, moved out of main.
11500 (main): Quiet longjmp clobber warnings.
11501 * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
11502 * utils.c (error): Remove NORETURN.