4 * regcache.h: Include common-regcache.h.
5 (regcache_read_pc): Don't declare.
6 * regcache.c (get_thread_regcache_for_ptid): New function.
12 * Makefile.in (SFILES): Add symbol.c.
17 * target.c (target_stop_ptid, target_continue_ptid): New
23 * target.h: Include target/target.h.
24 * target.c (target_read_memory, target_read_uint32)
25 (target_write_memory): New functions.
29 * server.h (debug_hw_points): Don't declare.
30 * server.c (debug_hw_points): Don't define. Replace all uses
32 * linux-aarch64-low.c (debug_hw_points): Don't define. Replace
33 all uses with show_debug_regs.
37 * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
38 endianness into account.
39 (ppc_supply_ptrace_register): Likewise.
43 * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
44 to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
48 * linux-x86-low.c (x86_linux_prepare_to_resume): Use
49 ALL_DEBUG_ADDRESS_REGISTERS.
53 * i386-low.h: Renamed as...
54 * x86-low.h: New file. All type, function and variable name
55 prefixes changed from "i386_" to "x86_". All references updated.
56 * i386-low.c: Renamed as...
57 * x86-low.c: New file. All type, function and variable name
58 prefixes changed from "i386_" to "x86_". All references updated.
62 * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
63 (x86_linux_new_thread): Likewise.
67 * server.h (setjmp.h): Do not include.
68 (toplevel): Do not declare.
69 (common-exceptions.h): Include.
70 (cleanups.h): Likewise.
71 * server.c (toplevel): Do not define.
72 (exit_code): New static global.
73 (detach_or_kill_for_exit_cleanup): New function.
74 (main): New function. Original main renamed to...
75 (captured_main): New function.
76 * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
80 * Makefile.in (SFILES): Add common/common-exceptions.c.
81 (OBS): Add common-exceptions.o.
82 (common-exceptions.o): New rule.
83 * utils.c (prepare_to_throw_exception): New function.
87 * config.in: Regenerate.
88 * configure: Likewise.
92 * Makefile.in (SFILES): Add common/cleanups.c.
94 (cleanups.o): New rule.
98 * utils.c (internal_vwarning): New function.
102 * utils.h (fatal): Remove declaration.
103 * utils.c (fatal): Remove function.
107 * tracepoint.c (gdb_agent_init): Replace fatal with
109 (initialize_tracepoint): Likewise.
113 * remote-utils.c (remote_prepare): Replace fatal with error.
117 * linux-low.c (linux_async): Replace fatal with warning.
119 (linux_start_non_stop): Return -1 if linux_async failed.
123 * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
125 (i386_dr_low_get_addr): Remove vague comment.
126 * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
131 * inferiors.c (get_thread_process): Replace check with gdb_assert.
132 * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
134 (linux_resume_one_lwp): Likewise.
135 * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
137 * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
139 * regcache.c (get_thread_regcache): Replace check with gdb_assert.
140 (init_register_cache): Replace fatal with gdb_assert_not_reached.
141 (find_register_by_name): Replace fatal with internal_error.
142 (find_regno): Likewise.
143 * tdesc.c (init_target_desc): Replace check with gdb_assert.
144 * thread-db.c (thread_db_create_event): Likewise.
145 (thread_db_load_search): Likewise.
146 (try_thread_db_load_1): Likewise.
147 * tracepoint.c (get_jump_space_head): Replace fatal with
149 (claim_trampoline_space): Likewise.
150 (have_fast_tracepoint_trampoline_buffer): Likewise.
151 (cmd_qtstart): Likewise.
152 (stop_tracing): Likewise.
153 (fast_tracepoint_collecting): Likewise.
154 (target_malloc): Likewise.
155 (download_tracepoint): Likewise.
156 (download_trace_state_variables): Replace check with gdb_assert.
157 (upload_fast_traceframes): Replace fatal with internal_error.
162 * Makefile.in (SFILES): Add common/common-debug.c.
163 (OBS): Add common-debug.o.
164 (common-debug.o): New rule.
165 * debug.h (debug_printf): Don't declare.
166 * debug.c (debug_printf): Renamed and rewritten as...
167 (debug_vprintf): New function.
171 * utils.h: Do not include print-utils.h.
176 * server.h: Add static assertion.
177 (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
182 * Makefile.in (SFILES): Add common/errors.c.
184 (IPA_OBS): Add errors-ipa.o.
185 (errors.o): New rule.
186 (errors-ipa.o): Likewise.
187 * utils.h (perror_with_name, error, warning): Don't declare.
188 * utils.c (warning): Renamed and rewritten as...
189 (vwarning): New function.
190 (error): Renamed and rewritten as...
191 (verror): New function.
192 (internal_error): Renamed and rewritten as...
193 (internal_verror): New function.
197 * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
198 * configure: Regenerate.
199 * config.in: Likewise.
200 * server.h: Do not include errno.h.
201 * event-loop.c: Likewise.
202 * hostio-errno.c: Likewise.
203 * linux-low.c: Likewise.
204 * remote-utils.c: Likewise.
205 * spu-low.c: Likewise.
207 * gdbreplay.c: Unconditionally include errno.h.
211 * server.h: Do not include string.h.
212 * event-loop.c: Likewise.
213 * linux-low.c: Likewise.
214 * regcache.c: Likewise.
215 * remote-utils.c: Likewise.
216 * spu-low.c: Likewise.
221 * server.h: Do not include gdb_assert.h.
225 * server.h: Do not include common-utils.h.
229 * server.h: Do not include ptid.h.
234 * server.h: Do not include gdb_locale.h.
238 * server.h: Do not include gdb/signals.h.
239 * win32-low.c: Likewise.
243 * server.h: Do not include pathmax.h.
247 * server.h: Do not include libiberty.h.
248 * linux-bfin-low.c: Likewise.
252 * server.h: Do not include ansidecl.h.
256 * linux-x86-low.c: Do not include stddef.h.
257 * lynx-ppc-low.c: Likewise.
258 * tracepoint.c: Likewise.
262 * server.h: Do not include stdarg.h.
263 * nto-low.c: Likewise.
267 * server.h: Do not include stdlib.h.
268 * inferiors.c: Likewise.
269 * linux-low.c: Likewise.
270 * regcache.c: Likewise.
271 * spu-low.c: Likewise.
272 * tracepoint.c: Likewise.
277 * server.h: Do not include stdio.h.
278 * linux-low.c: Likewise.
279 * remote-utils.c: Likewise.
280 * spu-low.c: Likewise.
282 * wincecompat.c: Likewise.
286 * regcache.c (init_register_cache): Move conditionals inside if.
290 * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
294 * ax.h: Do not include server.h.
295 * gdbthread.h: Likewise.
296 * lynx-low.h: Likewise.
301 * server.h: Include common-defs.h.
302 Do not include config.h or build-gnulib-gdbserver/config.h.
306 * hostio-errno.c: Move server.h to top of includes list.
307 * inferiors.c: Likewise.
308 * linux-x86-low.c: Likewise.
309 * notif.c: Include server.h.
314 * server.h (CORE_ADDR): Now unsigned.
318 * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
322 * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
327 * linux-low.c (kill_wait_lwp): New function, based on
328 kill_one_lwp_callback, but use my_waitpid directly.
329 (kill_one_lwp_callback, linux_kill): Use it.
333 * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
334 before setting DR0..DR3.
338 * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
339 * configure: Regenerated.
340 * config.in: Likewise.
344 * Makefile.in (SFILES): Update locations for files moved
346 (object file files): Reordered.
350 * i386-low.h (i386_dr_low_can_set_addr): Removed.
351 (i386_dr_low_set_addr): Likewise.
352 (i386_dr_low_get_addr): Likewise.
353 (i386_dr_low_can_set_control): Likewise.
354 (i386_dr_low_set_control): Likewise.
355 (i386_dr_low_get_control): Likewise.
356 (i386_dr_low_get_status): Likewise.
357 (i386_get_debug_register_length): Likewise.
358 * linux-x86-low.c (i386_dr_low_set_addr):
359 Changed signature. Made static.
360 (i386_dr_low_get_addr): Likewise.
361 (i386_dr_low_set_control): Likewise.
362 (i386_dr_low_get_control): Likewise.
363 (i386_dr_low_get_status): Likewise.
364 (i386_dr_low): New global variable.
365 * win32-i386-low.c (i386_dr_low_set_addr):
366 Changed signature. Made static.
367 (i386_dr_low_get_addr): Likewise.
368 (i386_dr_low_set_control): Likewise.
369 (i386_dr_low_get_control): Likewise.
370 (i386_dr_low_get_status): Likewise.
371 (i386_dr_low): New global variable.
375 * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
376 * Makefile.in (AR, AR_FLAGS): Define.
377 * configure: Regenerate.
381 * Makefile.in (i386-dregs.o): New rule.
382 * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
383 * i386-low.c (target.h): Remove include.
384 (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
385 (DR_CONTROL_SHIFT): Likewise.
386 (DR_CONTROL_SIZE): Likewise.
387 (DR_RW_EXECUTE): Likewise.
388 (DR_RW_WRITE): Likewise.
389 (DR_RW_READ): Likewise.
390 (DR_RW_IORW): Likewise.
391 (DR_LEN_1): Likewise.
392 (DR_LEN_2): Likewise.
393 (DR_LEN_4): Likewise.
394 (DR_LEN_8): Likewise.
395 (DR_LOCAL_ENABLE_SHIFT): Likewise.
396 (DR_GLOBAL_ENABLE_SHIFT): Likewise.
397 (DR_ENABLE_SIZE): Likewise.
398 (DR_LOCAL_SLOWDOWN): Likewise.
399 (DR_GLOBAL_SLOWDOWN): Likewise.
400 (DR_CONTROL_RESERVED): Likewise.
401 (I386_DR_CONTROL_MASK): Likewise.
402 (I386_DR_VACANT): Likewise.
403 (I386_DR_LOCAL_ENABLE): Likewise.
404 (I386_DR_GLOBAL_ENABLE): Likewise.
405 (I386_DR_DISABLE): Likewise.
406 (I386_DR_SET_RW_LEN): Likewise.
407 (I386_DR_GET_RW_LEN): Likewise.
408 (I386_DR_WATCH_HIT): Likewise.
409 (i386_wp_op_t): Likewise.
410 (i386_show_dr): Likewise.
411 (i386_length_and_rw_bits): Likewise.
412 (i386_insert_aligned_watchpoint): Likewise.
413 (i386_remove_aligned_watchpoint): Likewise.
414 (i386_handle_nonaligned_watchpoint): Likewise.
415 i386_update_inferior_debug_regs(): Likewise.
416 (i386_dr_insert_watchpoint): Likewise.
417 (i386_dr_remove_watchpoint): Likewise.
418 (i386_dr_region_ok_for_watchpoint): Likewise.
419 (i386_dr_stopped_data_address): Likewise.
420 (i386_dr_stopped_by_watchpoint): Likewise.
424 * i386-low.c (i386_dr_show): Renamed to
425 i386_show_dr and made static. All uses updated.
426 (i386_dr_length_and_rw_bits): Renamed to
427 i386_length_and_rw_bits and made static.
429 (i386_dr_insert_aligned_watchpoint): Renamed to
430 i386_insert_aligned_watchpoint and made static.
432 (i386_dr_remove_aligned_watchpoint): Renamed to
433 i386_remove_aligned_watchpoint and made static.
435 (i386_dr_update_inferior_debug_regs): Renamed to
436 i386_update_inferior_debug_regs and made static.
441 * i386-low.h (i386_dr_low_can_set_addr): New macro.
442 (i386_dr_low_can_set_control): Likewise.
443 (i386_get_debug_register_length): Likewise.
444 * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
445 (i386_dr_low_can_set_control): Likewise.
446 (i386_get_debug_register_length): Likewise.
450 * i386-low.h (i386-dregs.h): New include.
451 (DR_FIRSTADDR): Now in i386-dregs.h.
452 (DR_LASTADDR): Likewise.
453 (DR_NADDR): Likewise.
454 (DR_STATUS): Likewise.
455 (DR_CONTROL): Likewise.
456 (i386_debug_reg_state): Likewise.
457 (i386_dr_insert_watchpoint): Likewise.
458 (i386_dr_remove_watchpoint): Likewise.
459 (i386_dr_region_ok_for_watchpoint): Likewise.
460 (i386_dr_stopped_data_address): Likewise.
461 (i386_dr_stopped_by_watchpoint): Likewise.
462 * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
466 * i386-low.h (i386_low_insert_watchpoint): Renamed to
467 i386_dr_insert_watchpoint.
468 (i386_low_remove_watchpoint): Renamed to
469 i386_dr_remove_watchpoint.
470 (i386_low_region_ok_for_watchpoint): Renamed to
471 i386_dr_region_ok_for_watchpoint.
472 (i386_low_stopped_data_address): Renamed to
473 i386_dr_stopped_data_address.
474 (i386_low_stopped_by_watchpoint): Renamed to
475 i386_dr_stopped_by_watchpoint.
476 * i386-low.c (i386_show_dr): Renamed to
477 i386_dr_show and made nonstatic. All uses updated.
478 (i386_length_and_rw_bits): Renamed to
479 i386_dr_length_and_rw_bits and made nonstatic.
481 (i386_insert_aligned_watchpoint): Renamed to
482 i386_dr_insert_aligned_watchpoint and made nonstatic.
484 (i386_remove_aligned_watchpoint): Renamed to
485 i386_dr_remove_aligned_watchpoint and made nonstatic.
487 (i386_update_inferior_debug_regs): Renamed to
488 i386_dr_update_inferior_debug_regs and made nonstatic.
490 (i386_low_insert_watchpoint): Renamed to
491 i386_dr_insert_watchpoint. All uses updated.
492 (i386_low_remove_watchpoint): Renamed to
493 i386_dr_remove_watchpoint. All uses updated.
494 (i386_low_region_ok_for_watchpoint): Renamed to
495 i386_dr_region_ok_for_watchpoint. All uses updated.
496 (i386_low_stopped_data_address): Renamed to
497 i386_dr_stopped_data_address. All uses updated.
498 (i386_low_stopped_by_watchpoint): Renamed to
499 i386_dr_stopped_by_watchpoint. All uses updated.
503 * i386-low.c (i386_dr_low_can_set_addr): New macro.
504 (i386_dr_low_can_set_control): Likewise.
505 (i386_insert_aligned_watchpoint): New check.
509 * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
514 * i386-low.c (i386_length_and_rw_bits): Use internal_error
515 instead of fatal and error.
516 (i386_handle_nonaligned_watchpoint): Likewise.
520 * i386-low.c (i386_get_debug_register_length): New macro.
521 (TARGET_HAS_DR_LEN_8): Remove conditional. Use above macro.
522 (i386_show_dr): Use debug_printf instead of fprintf. Use
523 phex to format values.
527 * i386-low.h: Comment changes.
528 * i386-low.c: Likewise.
532 * i386-low.c: Whitespace changes.
536 * utils.c (freeargv): Remove.
540 * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
541 * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
542 (parse_debug_format_options): Likewise.
543 (gdbserver_usage): Likewise.
544 * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
545 (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
546 (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
548 ($(LIBGNU)): Depend on libiberty.
549 (all-lib): Recurse into all subdirs.
550 (install-only): Invoke "install" target in subdirs.
551 (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
553 * configure: Rebuild.
554 * configure.ac: Add ACX_CONFIGURE_DIR for libiberty. Don't check
555 for vasprintf, vsnprintf, or gettimeofday.
556 * configure.srv: Don't add safe-ctype.o or lbasename.o to
561 * development.sh: Delete.
562 * Makefile.in (config.status): Adjust dependency on development.sh.
563 * configure.ac: Adjust development.sh source call.
564 * configure: Regenerate.
568 * ax.c (gdb_free_agent_expr): New function.
569 * ax.h (gdb_free_agent_expr): New declaration.
570 * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
572 (clear_breakpoint_conditions, clear_breakpoint_commands): Make
574 (clear_breakpoint_conditions_and_commands): New function.
575 * mem-break.h (clear_breakpoint_conditions): Delete declaration.
576 (clear_breakpoint_conditions_and_commands): New declaration.
580 * linux-aarch64-low.c (asm/ptrace.h): Include.
584 Fix TLS access for -static -pthread.
585 * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
586 (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
587 (thread_db_load_search, try_thread_db_load_1): Initialize it.
591 * linux-aarch64-low.c (aarch64_insert_point)
592 (aarch64_remove_point): No longer check whether the type is
593 supported here. Adjust to new interface.
594 (the_low_target): Install aarch64_supports_z_point_type as
595 supports_z_point_type method.
596 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
597 (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
598 instead of a Z packet char. Adjust.
599 (arm_supports_z_point_type): New function.
600 (arm_insert_point, arm_remove_point): Adjust to new interface.
601 (the_low_target): Install arm_supports_z_point_type.
602 * linux-crisv32-low.c (cris_supports_z_point_type): New function.
603 (cris_insert_point, cris_remove_point): Adjust to new interface.
604 Don't check whether the type is supported here.
605 (the_low_target): Install cris_supports_z_point_type.
606 * linux-low.c (linux_supports_z_point_type): New function.
607 (linux_insert_point, linux_remove_point): Adjust to new interface.
608 * linux-low.h (struct linux_target_ops) <insert_point,
609 remove_point>: Take an enum raw_bkpt_type instead of a char. Add
610 raw_breakpoint pointer parameter.
611 <supports_z_point_type>: New method.
612 * linux-mips-low.c (mips_supports_z_point_type): New function.
613 (mips_insert_point, mips_remove_point): Adjust to new interface.
614 Use mips_supports_z_point_type.
615 (the_low_target): Install mips_supports_z_point_type.
616 * linux-ppc-low.c (the_low_target): Install NULL as
617 supports_z_point_type method.
618 * linux-s390-low.c (the_low_target): Install NULL as
619 supports_z_point_type method.
620 * linux-sparc-low.c (the_low_target): Install NULL as
621 supports_z_point_type method.
622 * linux-x86-low.c (x86_supports_z_point_type): New function.
623 (x86_insert_point): Adjust to new insert_point interface. Use
624 insert_memory_breakpoint. Adjust to new
625 i386_low_insert_watchpoint interface.
626 (x86_remove_point): Adjust to remove_point interface. Use
627 remove_memory_breakpoint. Adjust to new
628 i386_low_remove_watchpoint interface.
629 (the_low_target): Install x86_supports_z_point_type.
630 * lynx-low.c (lynx_target_ops): Install NULL as
631 supports_z_point_type callback.
632 * nto-low.c (nto_supports_z_point_type): New.
633 (nto_insert_point, nto_remove_point): Adjust to new interface.
634 (nto_target_ops): Install nto_supports_z_point_type.
635 * mem-break.c: Adjust intro comment.
636 (struct raw_breakpoint) <raw_type, size>: New fields.
637 <inserted>: Update comment.
638 <shlib_disabled>: Delete field.
639 (enum bkpt_type) <gdb_breakpoint>: Delete value.
640 <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
641 gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
642 (raw_bkpt_type_to_target_hw_bp_type): New function.
643 (find_enabled_raw_code_breakpoint_at): New function.
644 (find_raw_breakpoint_at): New type and size parameters. Use them.
645 (insert_memory_breakpoint): New function, based off
646 set_raw_breakpoint_at.
647 (remove_memory_breakpoint): New function.
648 (set_raw_breakpoint_at): Reimplement.
649 (set_breakpoint): New, based on set_breakpoint_at.
650 (set_breakpoint_at): Reimplement.
651 (delete_raw_breakpoint): Go through the_target->remove_point
652 instead of assuming memory breakpoints.
653 (find_gdb_breakpoint_at): Delete.
654 (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
655 (find_gdb_breakpoint): New function.
656 (set_gdb_breakpoint_at): Delete.
657 (z_type_supported): New function.
658 (set_gdb_breakpoint_1): New function, loosely based off
659 set_gdb_breakpoint_at.
660 (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
661 (delete_gdb_breakpoint_at): Delete.
662 (delete_gdb_breakpoint_1): New function, loosely based off
663 delete_gdb_breakpoint_at.
664 (delete_gdb_breakpoint): New function.
665 (clear_gdb_breakpoint_conditions): Rename to ...
666 (clear_breakpoint_conditions): ... this. Don't handle a NULL
668 (add_condition_to_breakpoint): Make static.
669 (add_breakpoint_condition): Take a struct breakpoint pointer
670 instead of an address. Adjust.
671 (gdb_condition_true_at_breakpoint): Rename to ...
672 (gdb_condition_true_at_breakpoint_z_type): ... this, and add
674 (gdb_condition_true_at_breakpoint): Reimplement.
675 (add_breakpoint_commands): Take a struct breakpoint pointer
676 instead of an address. Adjust.
677 (gdb_no_commands_at_breakpoint): Rename to ...
678 (gdb_no_commands_at_breakpoint_z_type): ... this. Add z_type
679 parameter. Return true if no breakpoint was found. Change debug
681 (gdb_no_commands_at_breakpoint): Reimplement.
682 (run_breakpoint_commands): Rename to ...
683 (run_breakpoint_commands_z_type): ... this. Add z_type parameter,
684 and change return type to boolean.
685 (run_breakpoint_commands): New function.
686 (gdb_breakpoint_here): Also check for Z1 breakpoints.
687 (uninsert_raw_breakpoint): Don't try to reinsert a disabled
688 breakpoint. Go through the_target->remove_point instead of
689 assuming memory breakpoint.
690 (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
691 software and hardware breakpoints.
692 (reinsert_raw_breakpoint): Go through the_target->insert_point
693 instead of assuming memory breakpoint.
694 (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
695 software and hardware breakpoints.
696 (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
697 Check both software and hardware breakpoints.
698 (validate_inserted_breakpoint): Assert the breakpoint is a
699 software breakpoint. Set the inserted flag to -1 instead of
700 setting shlib_disabled.
701 (delete_disabled_breakpoints): Adjust.
702 (validate_breakpoints): Only validate software breakpoints.
703 Adjust to inserted flag change.
704 (check_mem_read, check_mem_write): Skip breakpoint types other
705 than software breakpoints. Adjust to inserted flag change.
706 * mem-break.h (enum raw_bkpt_type): New enum.
707 (raw_breakpoint, struct process_info): Forward declare.
708 (Z_packet_to_target_hw_bp_type): Delete declaration.
709 (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
710 (set_gdb_breakpoint, delete_gdb_breakpoint)
711 (clear_breakpoint_conditions): New declarations.
712 (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
713 (breakpoint_inserted_here): Update comment.
714 (add_breakpoint_condition, add_breakpoint_commands): Replace
715 address parameter with a breakpoint pointer parameter.
716 (gdb_breakpoint_here): Update comment.
717 (delete_gdb_breakpoint_at): Delete.
718 (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
719 * server.c (process_point_options): Take a struct breakpoint
720 pointer instead of an address. Adjust.
721 (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
722 delete_gdb_breakpoint.
723 * spu-low.c (spu_target_ops): Install NULL as
724 supports_z_point_type method.
725 * target.h: Include mem-break.h.
726 (struct target_ops) <prepare_to_access_memory>: Update comment.
727 <supports_z_point_type>: New field.
728 <insert_point, remove_point>: Take an enum raw_bkpt_type argument
729 instead of a char. Also take a raw breakpoint pointer.
730 * win32-arm-low.c (the_low_target): Install NULL as
731 supports_z_point_type.
732 * win32-i386-low.c (i386_supports_z_point_type): New function.
733 (i386_insert_point, i386_remove_point): Adjust to new interface.
734 (the_low_target): Install i386_supports_z_point_type.
735 * win32-low.c (win32_supports_z_point_type): New function.
736 (win32_insert_point, win32_remove_point): Adjust to new interface.
737 (win32_target_ops): Install win32_supports_z_point_type.
738 * win32-low.h (struct win32_target_ops):
739 <supports_z_point_type>: New method.
740 <insert_point, remove_point>: Take an enum raw_bkpt_type argument
741 instead of a char. Also take a raw breakpoint pointer.
745 * mem-break.h: Include break-common.h.
746 (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
747 (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
748 (Z_packet_to_target_hw_bp_type): New declaration.
749 * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
750 * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
751 (Z_PACKET_ACCESS_WP): Delete macros.
752 (Z_packet_to_hw_type): Delete function.
753 * i386-low.h: Don't include break-common.h here.
754 (Z_packet_to_hw_type): Delete declaration.
755 * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
756 Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
757 * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
758 Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
759 * linux-aarch64-low.c: Don't include break-common.h here.
760 (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
761 (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
762 (Z_packet_to_target_hw_bp_type): Delete function.
763 * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
765 (mips_insert_point, mips_remove_point): Use
766 Z_packet_to_target_hw_bp_type.
770 * linux-aarch64-low.c: Include break-common.h.
771 (enum target_point_type): Delete.
772 (Z_packet_to_point_type): Rename to ...
773 (Z_packet_to_target_hw_bp_type): ... this, and return a
774 target_hw_bp_type instead.
775 (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
776 instead of an enum target_point_type.
777 (aarch64_point_encode_ctrl_reg): Likewise. Compute type mask from
779 (aarch64_dr_state_insert_one_point)
780 (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
781 (aarch64_handle_aligned_watchpoint)
782 (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
783 Take an enum target_hw_bp_type instead of an enum
785 (aarch64_supports_z_point_type): New function.
786 (aarch64_insert_point, aarch64_remove_point): Use it. Adjust to
787 use Z_packet_to_target_hw_bp_type.
791 * configure.ac: Only use -Werror by default when DEVELOPMENT
793 * configure: Regenerate.
797 Fix gdbserver qGetTLSAddr for x86_64 -m32.
798 * linux-x86-low.c (X86_64_USER_REGS): New.
799 (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
803 * Makefile.in (i386-avx512.c): Fix the typo of generated file
809 * linux-low.c (linux_attach_fail_reason_string): New function.
810 (linux_attach_lwp): Delete.
811 (linux_attach_lwp_1): Rename to ...
812 (linux_attach_lwp): ... this. Take a ptid instead of a pid as
813 argument. Remove "initial" parameter. Return int instead of
814 void. Don't error or warn here.
815 (linux_attach): Adjust to call linux_attach_lwp. Call error on
816 failure to attach to the tgid. Call warning when failing to
818 * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
819 argument. Remove "initial" parameter. Return int instead of
820 void. Don't error or warn here.
821 (linux_attach_fail_reason_string): New declaration.
822 * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
823 interface change. Use linux_attach_fail_reason_string.
828 * Makefile.in: Added rules to handle new files
829 i386-avx512.c i386-avx512-linux.c amd64-avx512.c
830 amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
831 * configure.srv (srv_i386_regobj): Add i386-avx512.o.
832 (srv_i386_linux_regobj): Add i386-avx512-linux.o.
833 (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
834 (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
836 (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
837 (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
838 (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
840 (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
841 (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
842 i386/x32-avx512-linux.xml.
843 * i387-fp.c (num_avx512_k_registers): New constant for number
845 (num_avx512_zmmh_low_registers): New constant for number of
846 lower ZMM registers (0-15).
847 (num_avx512_zmmh_high_registers): New constant for number of
848 higher ZMM registers (16-31).
849 (num_avx512_ymmh_registers): New contant for number of higher
850 YMM registers (ymm16-31 added by avx521 on x86_64).
851 (num_avx512_xmm_registers): New constant for number of higher
852 XMM registers (xmm16-31 added by AVX512 on x86_64).
853 (struct i387_xsave): Add space for AVX512 registers.
854 (i387_cache_to_xsave): Change raw buffer size to 64 characters.
855 Add code to handle AVX512 registers.
856 (i387_xsave_to_cache): Add code to handle AVX512 registers.
857 * linux-x86-low.c (init_registers_amd64_avx512_linux): New
858 prototypei from generated file.
859 (tdesc_amd64_avx512_linux): Likewise.
860 (init_registers_x32_avx512_linux): Likewise.
861 (tdesc_x32_avx512_linux): Likewise.
862 (init_registers_i386_avx512_linux): Likewise.
863 (tdesc_i386_avx512_linux): Likewise.
864 (x86_64_regmap): Add AVX512 registers.
865 (x86_linux_read_description): Add code to handle AVX512 XSTATE
867 (initialize_low_arch): Add code to initialize AVX512 registers.
871 * mem-break.c (find_gdb_breakpoint_at): Make static.
872 * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
876 * i386-low.c: Don't include break-common.h here.
877 (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
878 prototype to take target_hw_bp_type as argument instead of a Z
880 * i386-low.h: Include break-common.h here.
881 (Z_packet_to_hw_type): Declare.
882 (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
884 * linux-x86-low.c (x86_insert_point): Convert the packet number to
885 a target_hw_bp_type before calling i386_low_insert_watchpoint.
886 (x86_remove_point): Convert the packet number to a
887 target_hw_bp_type before calling i386_low_remove_watchpoint.
888 * win32-i386-low.c (i386_insert_point): Convert the packet number
889 to a target_hw_bp_type before calling i386_low_insert_watchpoint.
890 (i386_remove_point): Convert the packet number to a
891 target_hw_bp_type before calling i386_low_remove_watchpoint.
895 * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
899 * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
900 Check if the condition or command is NULL before checking if the
901 breakpoint is known. On success, return true.
902 * mem-break.h (add_breakpoint_condition): Document return.
903 (add_breakpoint_commands): Add describing comment.
904 * server.c (skip_to_semicolon): New function.
905 (process_point_options): Use it.
909 * linux-low.c (linux_read_loadmap): Pass current_inferior directly
915 * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
917 * linux-low.c (delete_lwp, handle_extended_wait): Add debug
919 (last_thread_of_process_p): Take a PID argument instead of a
921 (linux_wait_for_lwp): Delete.
922 (num_lwps, check_zombie_leaders, not_stopped_callback): New
924 (linux_low_filter_event): New function, party factored out from
925 linux_wait_for_event.
926 (linux_wait_for_event): Rename to ...
927 (linux_wait_for_event_filtered): ... this. Add new filter ptid
928 argument. Partly rewrite. Always use waitpid(-1, WNOHANG) and
929 sigsuspend. Check for zombie leaders.
930 (linux_wait_for_event): Reimplement as wrapper around
931 linux_wait_for_event_filtered.
932 (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED. Assume that if
933 a normal or signal exit is seen, it's the whole process exiting.
934 (wait_for_sigstop): No longer a for_each_inferior callback.
935 Rewrite on top of linux_wait_for_event_filtered.
936 (stop_all_lwps): Call wait_for_sigstop directly.
937 * server.c (resume, handle_target_event): Handle
938 TARGET_WAITKIND_NO_RESUMED.
942 * win32-low.c (psapi_get_dll_name,
943 * win32_CreateToolhelp32Snapshot): Delete.
944 (win32_CreateToolhelp32Snapshot, win32_Module32First)
945 (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
947 (handle_load_dll): Add function description.
948 Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
952 * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
954 (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
955 base address when calling win32_add_one_solib.
956 (handle_load_dll): Delete local variable load_addr.
957 Remove 0x1000 offset applied to DLL base address when calling
959 (handle_unload_dll): Add comment.
963 * win32-low.c (win32_add_all_dlls): Renames
964 win32_ensure_ntdll_loaded. Rewrite function documentation.
965 Adjust implementation to always load all DLLs.
966 Add 0x1000 offset to DLL base address when calling
968 (child_initialization_done): New static global.
969 (do_initial_child_stuff): Set child_initialization_done to
970 zero during child initialization, and 1 after. Replace call
971 to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
973 (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
974 (handle_unload_dll): Add function documentation.
975 (get_child_debug_event): Ignore load and unload DLL events
976 during child initialization.
980 Remove global all_lwps.
981 * inferiors.h (ptid_of): Move here from linux-low.h.
982 (pid_of, lwpid_of): Ditto.
983 * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
984 parameter is a struct thread_info * now.
985 (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
986 directly. Pass &all_threads to find_inferior instead of &all_lwps.
987 (aarch64_stopped_data_address): Fetch lwpid from current_inferior
989 (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
990 (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
991 * linux-arm-low.c (update_registers_callback): Update, "entry"
992 parameter is a struct thread_info * now.
993 Fetch lwpid from current_inferior directly.
994 (arm_insert_point): Pass &all_threads to find_inferior instead of
996 (arm_remove_point): Ditto.
997 (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
998 (arm_prepare_to_resume): Fetch pid from thread.
999 (arm_read_description): Fetch lwpid from current_inferior directly.
1000 * linux-low.c (all_lwps): Delete.
1001 (delete_lwp): Delete call to remove_inferior.
1002 (handle_extended_wait): Fetch lwpid from thread.
1003 (add_lwp): Don't set lwp->entry.id. Remove call to
1004 add_inferior_to_list.
1005 (linux_attach_lwp_1): Fetch pid from current_inferior directly.
1006 (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
1007 (kill_one_lwp_callback): Ditto.
1008 (linux_kill): Don't dereference NULL pointer.
1009 Fetch ptid,lwpid from thread.
1010 (get_detach_signal): Fetch ptid from thread.
1011 (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
1012 Simplify call to regcache_invalidate_thread.
1013 (delete_lwp_callback): Update, "entry" parameter is a
1014 struct thread_info * now. Fetch pid from thread.
1015 (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
1016 (status_pending_p_callback): Update, "entry" parameter is a
1017 struct thread_info * now. Fetch ptid from thread.
1018 (find_lwp_pid): Update, "entry" parameter is a
1019 struct thread_info * now.
1020 (linux_wait_for_lwp): Fetch pid from thread.
1021 (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
1022 (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
1023 (enqueue_one_deferred_signal): Fetch lwpid from thread.
1024 (dequeue_one_deferred_signal): Ditto.
1025 (cancel_breakpoint): Fetch ptid from current_inferior.
1026 (linux_wait_for_event): Pass &all_threads to find_inferior,
1027 not &all_lwps. Fetch ptid, lwpid from thread.
1028 (count_events_callback): Update, "entry" parameter is a
1029 struct thread_info * now.
1030 (select_singlestep_lwp_callback): Ditto.
1031 (select_event_lwp_callback): Ditto.
1032 (cancel_breakpoints_callback): Ditto.
1033 (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
1035 (select_event_lwp): Ditto. Fetch ptid from event_thread.
1036 (unsuspend_one_lwp): Update, "entry" parameter is a
1037 struct thread_info * now.
1038 (unsuspend_all_lwps): Pass &all_threads to find_inferior,
1040 (linux_stabilize_threads): Ditto. And for for_each_inferior.
1041 Fetch lwpid from thread, not lwp.
1042 (linux_wait_1): Fetch ptid, lwpid from current_inferior.
1043 Pass &all_threads to find_inferior, not &all_lwps.
1044 (send_sigstop): Fetch lwpid from thread, not lwp.
1045 (send_sigstop_callback): Update, "entry" parameter is a
1046 struct thread_info * now.
1047 (suspend_and_send_sigstop_callback): Ditto.
1048 (wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp.
1049 (stuck_in_jump_pad_callback): Update, "entry" parameter is a
1050 struct thread_info * now.
1051 (move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid
1053 (lwp_running): Update, "entry" parameter is a
1054 struct thread_info * now.
1055 (stop_all_lwps): Fetch ptid from thread.
1056 Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
1057 (linux_resume_one_lwp): Fetch lwpid from thread.
1058 (linux_set_resume_request): Update, "entry" parameter is a
1059 struct thread_info * now. Fetch pid, lwpid from thread.
1060 (resume_status_pending_p): Update, "entry" parameter is a
1061 struct thread_info * now.
1062 (need_step_over_p): Ditto. Fetch lwpid from thread.
1063 (start_step_over): Fetch lwpid from thread.
1064 (linux_resume_one_thread): Update, "entry" parameter is a
1065 struct thread_info * now. Fetch lwpid from thread.
1066 (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
1067 (proceed_one_lwp): Update, "entry" parameter is a
1068 struct thread_info * now. Fetch lwpid from thread.
1069 (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
1070 struct thread_info * now.
1071 (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
1072 (unstop_all_lwps): Ditto. Fetch lwpid from thread.
1073 (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
1075 (regsets_store_inferior_registers): Ditto.
1076 (fetch_register, store_register): Ditto.
1077 (linux_read_memory, linux_write_memory): Ditto.
1078 (linux_request_interrupt): Ditto.
1079 (linux_read_auxv): Ditto.
1080 (linux_xfer_siginfo): Ditto.
1081 (linux_qxfer_spu): Ditto.
1082 (linux_qxfer_libraries_svr4): Ditto.
1083 * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
1084 moved to inferiors.h.
1086 (get_thread_lwp): Update.
1087 (struct lwp_info): Delete member "entry". Simplify comment for
1090 * linux-mips-low.c (mips_read_description): Fetch lwpid from
1091 current_inferior directly.
1092 (update_watch_registers_callback): Update, "entry" parameter is a
1093 struct thread_info * now. Fetch pid from thread.
1094 (mips_linux_prepare_to_resume): Fetch ptid from thread.
1095 (mips_insert_point): Fetch lwpid from current_inferior.
1096 Pass &all_threads to find_inferior, not &all_lwps.
1097 (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
1098 (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
1100 (mips_stopped_data_address): Ditto.
1101 * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
1103 * linux-tile-low.c (tile_arch_setup): Ditto.
1104 * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
1105 (update_debug_registers_callback): Update, "entry" parameter is a
1106 struct thread_info * now. Fetch pid from thread.
1107 (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
1108 Pass &all_threads to find_inferior, not &all_lwps.
1109 (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
1110 (i386_dr_low_set_control): Fetch pid from current_inferior directly.
1111 Pass &all_threads to find_inferior, not &all_lwps.
1112 (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
1113 (i386_dr_low_get_status): Ditto.
1114 (x86_linux_prepare_to_resume): Fetch ptid from thread.
1115 (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
1116 (x86_linux_read_description): Ditto.
1117 * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
1121 * inferiors.c (get_first_inferior): Fix buglet.
1125 * gdbthread.h (add_thread): Change result type to struct thread_info *.
1126 * inferiors.c (add_thread): Change result type to struct thread_info *.
1127 All callers updated.
1128 (add_lwp): Call add_thread here instead of in callers.
1129 All callers updated.
1130 * linux-low.h (get_lwp_thread): Rewrite.
1131 (struct lwp_info): New member "thread".
1135 * linux-low.c (add_lwp): Change result to struct lwp_info *.
1136 All callers updated.
1140 * inferiors.c (add_thread): Fix whitespace.
1144 * dll.c (clear_dlls): Replace accessing list implemention details
1146 * gdbthread.h (get_first_thread): Declare.
1147 * inferiors.c (for_each_inferior_with_data): New function.
1148 (get_first_thread): New function.
1149 (find_thread_ptid): Simplify.
1150 (get_first_inferior): New function.
1151 (clear_list): Delete.
1152 (one_inferior_p): New function.
1153 (clear_inferior_list): New function.
1154 (clear_inferiors): Update.
1155 * inferiors.h (for_each_inferior_with_data): Declare.
1156 (clear_inferior_list): Declare.
1157 (one_inferior_p): Declare.
1158 (get_first_inferior): Declare.
1159 * linux-low.c (linux_wait_for_event): Replace accessing list
1160 implemention details with API function.
1161 * server.c (target_running): Ditto.
1162 (accumulate_file_name_length): New function.
1163 (emit_dll_description): New function.
1164 (handle_qxfer_libraries): Replace accessing list implemention
1165 details with API function.
1166 (handle_qxfer_threads_worker): New function.
1167 (handle_qxfer_threads_proper): Replace accessing list implemention
1168 details with API function.
1169 (handle_query): Ditto.
1170 (visit_actioned_threads_callback_ftype): New typedef.
1171 (visit_actioned_threads_data): New struct.
1172 (visit_actioned_threads): Rewrite to be find_inferior callback.
1173 (resume): Call find_inferior.
1174 (handle_status): Replace accessing list implemention
1175 details with API function.
1176 (process_serial_event): Replace accessing list implemention details
1178 * target.c (set_desired_inferior): Replace accessing list implemention
1179 details with API function.
1180 * tracepoint.c (same_process_p): New function.
1181 (gdb_agent_about_to_close): Replace accessing list implemention
1182 details with API function.
1183 * win32-low.c (child_delete_thread): Replace accessing list
1184 implemention details with API function.
1185 (match_dll_by_basename): New function.
1186 (dll_is_loaded_by_basename): New function.
1187 (win32_ensure_ntdll_loaded): Replace accessing list implemention
1188 details call to dll_is_loaded_by_basename.
1192 * dll.h (struct dll_info): Add comment.
1193 * gdbthread.h (struct thread_info): Add comment.
1194 (current_ptid): Simplify.
1195 * inferiors.c (add_process): Update.
1196 (remove_process): Update.
1197 * inferiors.h (struct process_info): Rename member "head" to "entry".
1198 * linux-low.c (delete_lwp): Update.
1200 (last_thread_of_process_p): Update.
1201 (kill_one_lwp_callback, linux_kill): Update.
1202 (status_pending_p_callback): Update.
1203 (wait_for_sigstop): Update. Simplify read of ptid.
1204 (start_step_over): Update.
1205 * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
1206 (get_lwp_thread): Update.
1207 (struct lwp_info): Rename member "head" to "entry".
1208 * regcache.h (inferior_list_entry): Delete.
1209 * server.c (kill_inferior_callback): Update.
1210 (detach_or_kill_inferior_callback): Update.
1211 (print_started_pid): Update.
1212 (print_attached_pid): Update.
1213 (process_serial_event): Simplify read of ptid.
1214 * thread-db.c (thread_db_create_event): Update.
1215 (thread_db_get_tls_address): Update.
1216 * win32-low.c (current_inferior_ptid): Simplify.
1220 * target.h (struct target_ops) <supports_btrace>: Add target_ops
1222 (target_supports_btrace): Update.
1226 * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
1227 (rsp-low-ipa.o): New target.
1231 * ax.c (gdb_parse_agent_expr): Use hex2bin, not
1232 convert_ascii_to_int.
1233 * regcache.c (registers_to_string): Likewise.
1234 * remote-utils.c (decode_M_packet): Likewise.
1235 * server.c (process_serial_event): Likewise.
1239 * server.c (handle_query, handle_v_run): Use hex2bin, not
1241 * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
1245 * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
1246 convert_int_to_ascii.
1247 * regcache.c (registers_to_string, collect_register_as_string):
1249 * remote-utils.c (look_up_one_symbol, relocate_instruction):
1251 * server.c (process_serial_event): Likewise.
1252 * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
1253 (cmd_qtbuffer, cstr_to_hexstr): Likewise.
1257 * remote-utils.c (look_up_one_symbol, monitor_output): Use
1258 bin2hex, not hexify.
1259 * tracepoint.c (cmd_qtstatus): Likewise.
1263 * remote-utils.c (monitor_output): Pass explicit length to
1268 * tracepoint.c: Include rsp-low.h.
1269 * server.c: Include rsp-low.h.
1270 * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
1271 (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
1273 * remote-utils.c: Include rsp-low.h.
1274 (fromhex, hexchars, ishex, unhexify, tohex, hexify)
1275 (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
1276 (convert_int_to_ascii, convert_ascii_to_int): Move to
1278 * regcache.c: Include rsp-low.h.
1279 * ax.c: Include rsp-low.h.
1280 * Makefile.in (SFILES): Add common/rsp-low.c.
1281 (OBS): Add rsp-low.o.
1282 (rsp-low.o): New target.
1286 * utils.h (pulongest, plongest, phex_nz): Don't declare.
1287 Include print-utils.h.
1288 * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
1289 (plongest, thirty_two, phex_nz): Remove.
1290 * Makefile.in (SFILES): Add common/print-utils.c.
1291 (OBS): Add print-utils.o.
1292 (print-utils-ipa.o): New target.
1293 (print-utils.o): New target.
1294 (IPA_OBJS): Add print-utils-ipa.o.
1298 * Makefile.in (SFILES): Fix indentation.
1302 * linux-low.c (linux_wait_for_event): Improve comment.
1303 (linux_wait_1): Keep current_inferior in sync with event_child.
1307 * gdbthread.h (gdb_id_to_thread): Delete, unused.
1311 * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
1312 * configure: Regenerate.
1313 * config.in: Regenerate.
1314 * Makefile.in (SFILES): Add debug.c.
1316 * debug.c: New file.
1317 * debug.h: New file.
1318 * linux-aarch64-low.c (*): Update all debugging printfs to use
1319 debug_printf instead of fprintf.
1320 * linux-arm-low.c (*): Ditto.
1321 * linux-cris-low.c (*): Ditto.
1322 * linux-crisv32-low.c (*): Ditto.
1323 * linux-m32r-low.c (*): Ditto.
1324 * linux-sparc-low.c (*): Ditto.
1325 * linux-x86.c (*): Ditto.
1326 * linux-low.c (*): Ditto.
1327 (linux_wait_1): Add calls to debug_enter, debug_exit.
1328 (linux_wait): Remove redundant debugging printf.
1329 (stop_all_lwps): Add calls to debug_enter, debug_exit.
1330 (linux_resume, unstop_all_lwps): Ditto.
1331 * mem-break.c (*): Update all debugging printfs to use
1332 debug_printf instead of fprintf.
1333 * remote-utils.c (*): Ditto.
1334 * thread-db.c (*): Ditto.
1335 * server.c #include <ctype.h>, "gdb_vecs.h".
1336 (debug_threads): Moved to debug.c.
1337 (*): Update all debugging printfs to use debug_printf instead of
1339 (start_inferior): Replace call to fflush with call to debug_flush.
1340 (monitor_show_help): Mention set debug-format.
1341 (parse_debug_format_options): New function.
1342 (handle_monitor_command): Handle "monitor set debug-format".
1343 (gdbserver_usage): Mention --debug-format.
1344 (main): Parse --debug-format.
1345 * server.h (debug_threads): Declaration moved to debug.h.
1347 * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
1348 trace_debug_1 that uses debug_printf.
1349 (tracepoint_look_up_symbols): Update all debugging printfs to use
1350 debug_printf instead of fprintf.
1354 * linux-xtensa-low.c: Include asm/ptrace.h instead of
1360 * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
1361 defined after including gdb_proc_service.h.
1365 * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
1366 (match_dll): Use it.
1370 * target.h (target_ops) <read_btrace>: Change parameters and
1371 return type to allow error reporting.
1372 * server.c (handle_qxfer_btrace): Support delta reads. Pass
1373 trace reading errors on.
1374 * linux-low.c (linux_low_read_btrace): Pass trace reading
1376 (linux_low_disable_btrace): New.
1380 * inferiors.c (thread_id_to_gdb_id): Delete.
1381 * inferiors.h (thread_id_to_gdb_id): Delete.
1385 * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
1386 "-I$(srcdir)/../". Fixes MinGW compilation errors with old GCC
1391 * server.c (handle_status): Don't discard previous queued stop
1392 replies or thread's pending status here.
1393 (main) <disconnection>: Do it here instead.
1397 * gdbthread.h (struct thread_info) <status_pending_p>: New field.
1398 * server.c (visit_actioned_threads, handle_pending_status): New
1400 (handle_v_cont): Factor out parts to ...
1401 (resume): ... this new function. If in all-stop, and a thread
1402 being resumed has a pending status, report it without actually
1404 (myresume): Adjust to use the new 'resume' function.
1405 (clear_pending_status_callback, set_pending_status_callback)
1406 (find_status_pending_thread_callback): New functions.
1407 (handle_status): Handle the case of multiple threads having
1408 interesting statuses to report. Report threads' real last signal
1409 instead of always reporting GDB_SIGNAL_TRAP. Look for a thread
1410 with an interesting thread to report the status for, instead of
1411 always reporting the status of the first thread.
1415 * gdbserver.c (gdbserver_version): Set copyright year to 2014.
1416 * gdbreplay.c (gdbreplay_version): Likewise.
1420 * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
1421 iov.iov_len with the real length in use.
1425 * Makefile.in (safe-ctype.o, lbasename.o): New rules.
1426 * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
1427 for all targets that use win32-low.c.
1428 * win32-low.c (win32_ensure_ntdll_loaded): New function.
1429 (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
1433 * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
1434 if equal to TARGET_WAITKIND_LOADED.
1435 * win32-low.c (cached_status): New static global.
1436 (win32_wait): Add declaration.
1437 (do_initial_child_stuff): Flush all initial pending debug events
1438 up to the initial breakpoint.
1439 (win32_wait): If CACHED_STATUS was set, return that instead
1440 of doing a real wait. Remove the code resuming the execution
1441 of the inferior after receiving a TARGET_WAITKIND_LOADED event
1442 during the initial phase. Also remove the code changing
1443 OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
1444 TARGET_WAITKIND_STOPPED.
1448 * notif.c (handle_notif_ack): Return 0 if no notification
1453 * linux-low.c (linux_set_resume_request): Fix comment.
1457 * linux-low.c (resume_status_pending_p): Tweak comment.
1461 * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
1462 amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
1463 * configure.srv (srv_i386_regobj): Add i386-mpx.o.
1464 (srv_i386_linux_regobj): Add i386-mpx-linux.o.
1465 (srv_amd64_regobj): Add amd64-mpx.o.
1466 (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
1467 (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
1468 (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
1469 * i387-fp.c (num_pl_bnd_register) Added constant.
1470 (num_pl_bnd_cfg_registers) Added constant.
1471 (struct i387_xsave) Added reserved area and MPX fields.
1472 (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
1473 * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
1475 (tdesc_i386_mpx_linux): Add MPX amd64 target.
1476 (init_registers_amd64_mpx_linux): Declare new function.
1477 (tdesc_amd64_mpx_linux): Add MPX amd64 target.
1478 (x86_64_regmap): Add MPX registers.
1479 (x86_linux_read_description): Add MPX case.
1480 (initialize_low_arch): Initialize MPX targets.
1484 * configure: Rebuild.
1485 * configure.ac: Don't check for stdlib.h.
1486 * gdbreplay.c: Unconditionally include stdlib.h.
1490 * config.in: Rebuild.
1491 * configure: Rebuild.
1492 * configure.ac: Don't use AC_HEADER_DIRENT.
1496 * server.h: Don't check HAVE_STRING_H.
1497 * gdbreplay.c: Don't check HAVE_STRING_H.
1498 * configure: Rebuild.
1502 * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
1507 * configure, config.in: Rebuild.
1508 * configure.ac: Remove unused configury.
1512 * acinclude.m4: Include common.m4, codeset.m4.
1513 * configure, config.in: Rebuild.
1514 * configure.ac: Use GDB_AC_COMMON.
1518 * linux-s390-low.c (HWCAP_S390_TE): New define.
1519 (s390_arch_setup): Consider the TE field in the HWCAP for
1520 determining 'have_regset_tdb'.
1525 * tracepoint.c (download_tracepoint_1): Remove unnecessary double
1530 * server.c (process_serial_event): Don't output "GDBserver
1531 exiting" if GDB is connected through stdio.
1532 * target.c (mywait): Likewise, be silent if GDB is connected
1537 * lynx-low.c (lynx_add_threads_after_attach): New function.
1538 (lynx_attach): Remove call to add_thread. Add call to
1539 lynx_add_threads_after_attach instead.
1543 * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
1544 * config.in, configure: Regenerated.
1549 * server.c (start_inferior): Clear 'resume_info'.
1553 * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
1558 * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
1559 linux-tile-low.o to srv_tgtobj.
1563 * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
1568 * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
1569 (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
1570 (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
1571 (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
1572 (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
1573 (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
1577 * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
1578 explicit header dependencies and use $COMPILE/$POSTCOMPILE.
1582 * linux-amd64-ipa.c: Include tracepoint.h.
1583 * linux-i386-ipa.c: Include tracepoint.h.
1587 * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
1588 (ps_get_thread_area): New function.
1592 * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
1593 (initialize_low_arch): Call init_registers_crisv32 rather than
1594 init_register_crisv32.
1598 * server.h (handle_vFile, hostio_last_error_from_errno): Move
1600 * hostio.h: ... this new file.
1601 * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
1602 win32-low.c: Include hostio.h.
1606 * server.h (gdb_client_data, handler_func, callback_handler_func)
1607 (delete_file_handler, add_file_handler, append_callback_event)
1608 (delete_callback_event, start_event_loop, initialize_event_loop):
1609 Move to event-loop.h and include it.
1610 * event-loop.h: New file.
1614 * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
1615 * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
1616 (loaded_dll, unloaded_dll): Move to ...
1617 * dll.h: ... this new file.
1618 * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
1622 * server.h (current_process, get_thread_process, all_processes)
1623 (add_inferior_to_list, for_each_inferior, current_inferior)
1624 (remove_inferior, add_process, remove_process, find_process_pid)
1625 (have_started_inferiors_p, have_attached_inferiors_p)
1626 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
1627 (clear_inferiors, find_inferior, find_inferior_id)
1628 (inferior_target_data, set_inferior_target_data)
1629 (inferior_regcache_data, set_inferior_regcache_data): Move to
1630 inferiors.h, and include it.
1631 * inferiors.h: New file.
1635 * server.h (struct emit_ops, current_insn_ptr, emit_error):
1641 * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
1643 * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
1644 (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
1645 (handle_tracepoint_general_set, handle_tracepoint_query)
1646 (tracepoint_finished_step, tracepoint_was_hit)
1647 (release_while_stepping_state_list, current_traceframe)
1648 (in_readonly_region, traceframe_read_mem)
1649 (fetch_traceframe_registers, traceframe_read_sdata)
1650 (traceframe_read_info, struct fast_tpoint_collect_status)
1651 (fast_tracepoint_collecting, force_unlock_trace_buffer)
1652 (handle_tracepoit_bkpts, initialize_low_tracepoint)
1653 (supply_fast_tracepoint_registers)
1654 (supply_static_tracepoint_registers, set_trampoline_buffer_space)
1655 (ipa_tdesc, claim_trampoline_space)
1656 (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
1657 (agent_mem_read, agent_get_trace_state_variable_value)
1658 (agent_set_trace_state_variable_value, agent_tsv_read)
1659 (agent_mem_read_string, get_raw_reg_func_addr)
1660 (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
1661 * tracepoint.h: ... this new file.
1665 * server.h (perror_with_name, error, fatal, warning, paddress)
1666 (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
1668 * utils.h: New file.
1672 * server.h (remote_debug, noack_mode, transport_is_reliable)
1673 (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
1674 (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
1675 (getpkt, remote_prepare, remote_open, remote_close, write_ok)
1676 (write_enn, initialize_async_io, enable_async_io)
1677 (disable_async_io, check_remote_input_interrupt_request)
1678 (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
1679 (dead_thread_notify, prepare_resume_reply)
1680 (decode_address_to_semicolon, decode_address, decode_m_packet)
1681 (decode_M_packet, decode_X_packet, decode_xfer_write)
1682 (decode_search_memory_packet, unhexify, hexify)
1683 (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
1684 (look_up_one_symbol, relocate_instruction)
1685 (monitor_output): Move to remote-utils.h, and include it.
1686 * remote-utils.h: New file.
1690 * server.h (_): Delete.
1694 * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
1695 (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
1697 (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
1701 * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
1702 or WriteProcessMemory complete successfully and handle
1703 ERROR_PARTIAL_COPY error.
1707 * server.c (gdb_read_memory): Return -1 on traceframe memory read
1708 error instead of EIO.
1713 * linux-low.c: Include filestuff.h.
1714 (linux_create_inferior) <pid == 0>: Call close_most_fds.
1715 * lynx-low.c: Include filestuff.h.
1716 (lynx_create_inferior) <pid == 0>: Call close_most_fds.
1717 * server.c: Include filestuff.h.
1718 (main): Call notice_open_fds.
1719 * spu-low.c: Include filestuff.h.
1720 (spu_create_inferior) <pid == 0>: Call close_most_fds.
1724 * Makefile.in: Explain why ../target and ../nat are not
1725 listed as include file search paths.
1726 (linux-waitpid.o): New object file rule.
1727 * configure.srv (srv_native_linux_obj): New variable.
1728 Replace all occurrences of linux native object files with
1729 $srv_native_linux_obj.
1730 * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
1731 (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
1732 (linux_enable_event_reporting): Remove declaration.
1733 (my_waitpid): Moved to common/linux-waitpid.c.
1734 (linux_wait_for_event): Pass ptid when calling
1735 linux_enable_event_reporting.
1736 (linux_supports_tracefork_flag): Remove.
1737 (linux_enable_event_reporting): Likewise.
1738 (linux_tracefork_grandchild): Remove.
1739 (STACK_SIZE): Moved to common/linux-ptrace.c.
1740 (linux_tracefork_child): Remove.
1741 (linux_test_for_tracefork): Remove.
1742 (linux_look_up_symbols): Call linux_supports_traceclone.
1743 (initialize_low): Remove call to linux_test_for_tracefork.
1744 * linux-low.h (PTRACE_TYPE_ARG3): Move to
1745 common/linux-ptrace.h.
1746 (PTRACE_TYPE_ARG4): Likewise.
1747 Include linux-ptrace.h.
1751 * config.in: Renegerate.
1755 * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
1756 (SFILES): Remove $(srcdir)/common/target-common.c and
1757 add $(srcdir)/target/waitstatus.c.
1758 (OBS): Remove target-common.o and add waitstatus.o.
1759 (server_h): Remove $(srcdir)/../common/target-common.h and
1760 add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
1761 and $(srcdir)/../target/waitstatus.h.
1762 (target-common.o): Remove.
1763 (waitstatus.o): New target object file.
1764 * target.h: Do not include target-common.h and
1765 include target/resume.h, target/wait.h and
1766 target/waitstatus.h.
1770 * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
1771 to PTRACE_TYPE_ARG3.
1772 * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
1773 to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
1775 * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
1776 (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
1782 * Makefile.in (SFILES): Add common/mips-linux-watch.c.
1783 (mips-linux-watch.o): New rule.
1784 (mips_linux_watch_h): New variable.
1785 * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
1787 * linux-mips-low.c: Include mips-linux-watch.h.
1788 (struct arch_process_info, struct arch_lwp_info): New.
1789 (update_watch_registers_callback): New function.
1790 (mips_linux_new_process, mips_linux_new_thread) New functions.
1791 (mips_linux_prepare_to_resume, mips_insert_point): New
1793 (mips_remove_point, mips_stopped_by_watchpoint): New
1795 (rsp_bp_type_to_target_hw_bp_type): New function.
1796 (mips_stopped_data_address): New function.
1797 (the_low_target): Add watchpoint support functions.
1801 * i386-low.c: Include break-common.h.
1802 (enum target_hw_bp_type): Remove.
1806 * Makefile.in (SFILES): /common/target-common.c.
1807 (OBS): Add target-common.o.
1808 (server_h): Add $(srcdir)/../common/target-common.h.
1809 (target-common.o): New target.
1810 * server.c (queue_stop_reply_callback): Free
1811 status string after use.
1812 * target.c (target_waitstatus_to_string): Remove.
1813 * target.h: Include target-common.h.
1814 (resume_kind): Likewise.
1815 (target_waitkind): Likewise.
1816 (target_waitstatus): Likewise.
1817 (TARGET_WNOHANG): Likewise.
1821 * Makefile.in (host_alias): Use @host_noncanonical@.
1822 (target_alias): Use @target_noncanonical@.
1823 * configure.ac: Use ACX_NONCANONICAL_TARGET and
1824 ACX_NONCANONICAL_HOST.
1825 * configure: Regenerated.
1830 * configure.ac (version_host, version_target): Set and AC_SUBST them.
1831 * configure: Rebuild.
1832 * Makefile.in (version_host, version_target): Get from configure.
1833 (version.c): Use $(version_host) and $(version_target).
1837 * Makefile.in (config.status): Depend on development.sh.
1838 * acinclude.m4: Include libmcheck.m4.
1839 * configure: Regenerate.
1843 * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
1844 attribute inside the parentheses.
1845 (winapi_DebugSetProcessKillOnExit): Ditto.
1846 (winapi_DebugBreakProcess): Ditto.
1847 (winapi_GenerateConsoleCtrlEvent): Ditto.
1851 * notif.h (notif_event): Add a dummy member to avoid compiler
1856 * hostio.c (HOSTIO_PATH_MAX): Define.
1857 (require_filename, handle_open, handle_unlink, handle_readlink):
1862 * server.h: Include "pathmax.h".
1863 * linux-low.c: Don't include sys/param.h.
1864 (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
1866 * win32-low.c: Don't include sys/param.h.
1867 (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
1871 * event-loop.c: Don't check HAVE_UNISTD_H before including
1873 * gdbreplay.c: Likewise.
1874 * remote-utils.c: Likewise.
1875 * server.c: Likewise.
1876 * configure.ac: Don't check for unistd.h.
1877 * configure: Regenerate.
1881 * Makefile.in (version.c): Use version.in, not
1886 * configure.ac (version_host, version_target): Set and AC_SUBST them.
1887 * configure: Rebuild.
1888 * Makefile.in (version_host, version_target): Get from configure.
1889 (version.c): Use $(version_host) and $(version_target).
1893 Fix trace-status to output user name without trailing colon.
1894 * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
1898 Fix trace-status to output proper start-time and stop-time.
1899 * tracepoint.c (cmd_qtstatus): Modify trace-status output to
1900 output start time and stop time in hex as gdb expects.
1904 * tracepoint.c (build_traceframe_info_xml): Output trace state
1905 variables present in the trace buffer.
1909 * Makefile.in (version.c): Use bfd/version.h, common/version.in,
1911 (version.o): Remove.
1912 * gdbreplay.c: Include version.h.
1913 (version, host_name): Don't declare.
1914 * server.h: Include version.h.
1915 (version, host_name): Don't declare.
1919 * linux-x86-low.c (linux_is_elf64): Delete global.
1920 (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
1921 with local linux_pid_exe_is_elf_64_file use.
1925 * linux-low.c (regset_disabled, disable_regset): New functions.
1926 (regsets_fetch_inferior_registers)
1927 (regsets_store_inferior_registers): Use them.
1928 (initialize_regsets_info); Don't allocate the disabled_regsets
1930 * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
1935 * linux-low.c (initialize_regsets_info): Use xcalloc instead of
1940 * linux-x86-low.c (initialize_low_arch): Call
1941 init_registers_x32_avx_linux.
1945 Fix compatibility with Android Bionic.
1946 * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
1952 * Makefile.in (OBS): Add tdesc.o.
1953 (IPA_OBJS): Add tdesc-ipa.o.
1954 (tdesc-ipa.o): New rule.
1955 * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
1957 * linux-low.c (new_inferior): Delete.
1958 (disabled_regsets, num_regsets): Delete.
1959 (linux_add_process): Adjust to set the new per-process
1961 (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
1962 (linux_wait_for_lwp): Adjust. Only call arch_setup if the event
1963 was a stop. When calling arch_setup, switch the current inferior
1964 to the thread that got an event.
1965 (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
1966 (regsets_fetch_inferior_registers)
1967 (regsets_store_inferior_registers): New regsets_info parameter.
1969 (linux_register_in_regsets): New regs_info parameter. Adjust to
1971 (register_addr, fetch_register, store_register): New usrregs_info
1972 parameter. Adjust to use it.
1973 (usr_fetch_inferior_registers, usr_store_inferior_registers): New
1974 parameter regs_info. Adjust to use it.
1975 (linux_fetch_registers): Get the current inferior's regs_info, and
1977 (linux_store_registers): Ditto.
1978 [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
1979 (initialize_low): Don't initialize the target_regsets here. Call
1980 initialize_low_arch.
1981 * linux-low.h (target_regsets): Delete declaration.
1982 (struct regsets_info): New.
1983 (struct usrregs_info): New.
1984 (struct regs_info): New.
1985 (struct process_info_private) <new_inferior>: New field.
1986 (struct linux_target_ops): Delete the num_regs, regmap, and
1987 regset_bitmap fields. New field regs_info.
1988 [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
1989 * i387-fp.c (num_xmm_registers): Delete.
1990 (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
1991 calls to new interface.
1992 (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
1993 (i387_xsave_to_cache): Adjust find_regno calls to new interface.
1994 Infer the number of xmm registers from the regcache's target
1996 * i387-fp.h (num_xmm_registers): Delete.
1997 * inferiors.c (add_thread): Don't install the thread's regcache
1999 * proc-service.c (gregset_info): Fetch the current inferior's
2000 regs_info. Adjust to use it.
2001 * regcache.c: Include tdesc.h.
2002 (register_bytes, reg_defs, num_registers)
2003 (gdbserver_expedite_regs): Delete.
2004 (get_thread_regcache): If the thread doesn't have a regcache yet,
2005 create one, instead of aborting gdbserver.
2006 (regcache_invalidate_one): Rename to ...
2007 (regcache_invalidate_thread): ... this.
2008 (regcache_invalidate_one): New.
2009 (regcache_invalidate): Only invalidate registers of the current
2011 (init_register_cache): Add target_desc parameter, and use it.
2012 (new_register_cache): Ditto. Assert the target description has a
2013 non zero registers_size.
2014 (regcache_cpy): Add assertions. Adjust.
2015 (realloc_register_cache, set_register_cache): Delete.
2016 (registers_to_string, registers_from_string): Adjust.
2017 (find_register_by_name, find_regno, find_register_by_number)
2018 (register_cache_size): Add target_desc parameter, and use it.
2019 (free_register_cache_thread, free_register_cache_thread_one)
2020 (regcache_release, register_cache_size): New.
2021 (register_size): Add target_desc parameter, and use it.
2022 (register_data, supply_register, supply_register_zeroed)
2023 (supply_regblock, supply_register_by_name, collect_register)
2024 (collect_register_as_string, collect_register_by_name): Adjust.
2025 * regcache.h (struct target_desc): Forward declare.
2026 (struct regcache) <tdesc>: New field.
2027 (init_register_cache, new_register_cache): Add target_desc
2029 (regcache_invalidate_thread): Declare.
2030 (regcache_invalidate_one): Delete declaration.
2031 (regcache_release): Declare.
2032 (find_register_by_number, register_cache_size, register_size)
2033 (find_regno): Add target_desc parameter.
2034 (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
2036 * remote-utils.c: Include tdesc.h.
2037 (outreg, prepare_resume_reply): Adjust.
2038 * server.c: Include tdesc.h.
2039 (gdbserver_xmltarget): Delete declaration.
2040 (get_features_xml, process_serial_event): Adjust.
2041 * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
2043 (struct process_info) <tdesc>: New field.
2044 (ipa_tdesc): Declare.
2045 * tdesc.c: New file.
2046 * tdesc.h: New file.
2047 * tracepoint.c: Include tdesc.h.
2048 [IN_PROCESS_AGENT] (ipa_tdesc): Define.
2049 (get_context_regcache): Adjust to pass ipa_tdesc down.
2050 (do_action_at_tracepoint): Adjust to get the register cache size
2051 from the context regcache's description.
2052 (traceframe_walk_blocks): Adjust to get the register cache size
2053 from the current trace frame's description.
2054 (traceframe_get_pc): Adjust to get current trace frame's
2055 description and pass it down.
2056 (gdb_collect): Adjust to get the register cache size from the
2058 * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
2059 (gdbserver_xmltarget): Delete.
2060 (initialize_low_tracepoint): Set the ipa's target description.
2061 * linux-i386-ipa.c (tdesc_i386_linux): Declare.
2062 (initialize_low_tracepoint): Set the ipa's target description.
2063 * linux-x86-low.c: Include tdesc.h.
2064 [__x86_64__] (is_64bit_tdesc): New.
2065 (ps_get_thread_area, x86_get_thread_area): Use it.
2066 (i386_cannot_store_register): Rename to ...
2067 (x86_cannot_store_register): ... this. Use is_64bit_tdesc.
2068 (i386_cannot_fetch_register): Rename to ...
2069 (x86_cannot_fetch_register): ... this. Use is_64bit_tdesc.
2070 (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
2072 (target_regsets): Rename to ...
2073 (x86_regsets): ... this.
2074 (x86_get_pc, x86_set_pc): Adjust register_size calls to new
2076 (x86_siginfo_fixup): Use is_64bit_tdesc.
2077 [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
2078 (tdesc_x32_avx_linux, tdesc_x32_linux)
2079 (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
2081 (x86_linux_update_xmltarget): Delete.
2082 (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
2083 (have_ptrace_getfpxregs, have_ptrace_getregset): New.
2084 (AMD64_LINUX_USER64_CS): New.
2085 (x86_linux_read_description): New, based on
2086 x86_linux_update_xmltarget.
2087 (same_process_callback): New.
2088 (x86_arch_setup_process_callback): New.
2089 (x86_linux_update_xmltarget): New.
2090 (x86_regsets_info): New.
2091 (amd64_linux_regs_info): New.
2092 (i386_linux_usrregs_info): New.
2093 (i386_linux_regs_info): New.
2094 (x86_linux_regs_info): New.
2095 (x86_arch_setup): Reimplement.
2096 (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
2097 (x86_emit_ops): Ditto.
2098 (the_low_target): Adjust. Install x86_linux_regs_info,
2099 x86_cannot_fetch_register, and x86_cannot_store_register.
2100 (initialize_low_arch): New.
2101 * linux-ia64-low.c (tdesc_ia64): Declare.
2102 (ia64_fetch_register): Adjust.
2103 (ia64_usrregs_info, regs_info): New globals.
2104 (ia64_regs_info): New function.
2105 (the_low_target): Adjust.
2106 (initialize_low_arch): New function.
2107 * linux-sparc-low.c (tdesc_sparc64): Declare.
2108 (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
2110 (sparc_arch_setup): New function.
2111 (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
2112 (the_low_target): Adjust.
2113 (initialize_low_arch): New function.
2114 * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
2115 (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
2116 (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
2117 (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
2118 (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
2119 (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
2120 (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
2121 (tdesc_powerpc_isa205_vsx64l): Declare.
2122 (ppc_cannot_store_register, ppc_collect_ptrace_register)
2123 (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
2124 (ppc_set_pc, ppc_get_hwcap): Adjust.
2125 (ppc_usrregs_info): Forward declare.
2126 (!__powerpc64__) ppc_regmap_adjusted: New global.
2127 (ppc_arch_setup): Adjust to the current process'es target
2129 (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
2130 (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
2131 (ppc_store_evrregset): Adjust.
2132 (target_regsets): Rename to ...
2133 (ppc_regsets): ... this, and make static.
2134 (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
2135 (ppc_regs_info): New function.
2136 (the_low_target): Adjust.
2137 (initialize_low_arch): New function.
2138 * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
2139 (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
2140 (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
2141 (tdesc_s390x_linux64v2): Declare.
2142 (s390_collect_ptrace_register, s390_supply_ptrace_register)
2143 (s390_fill_gregset, s390_store_last_break): Adjust.
2144 (target_regsets): Rename to ...
2145 (s390_regsets): ... this, and make static.
2146 (s390_get_pc, s390_set_pc): Adjust.
2147 (s390_get_hwcap): New target_desc parameter, and use it.
2148 [__s390x__] (have_hwcap_s390_high_gprs): New global.
2149 (s390_arch_setup): Adjust to set the current process'es target
2150 description. Don't adjust the regmap.
2151 (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
2152 [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
2153 (regs_info_3264): New globals.
2154 (s390_regs_info): New function.
2155 (the_low_target): Adjust.
2156 (initialize_low_arch): New function.
2157 * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
2158 (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
2159 [__mips64] (init_registers_mips_linux)
2160 (init_registers_mips_dsp_linux): Delete defines.
2161 [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
2162 (have_dsp): New global.
2163 (mips_read_description): New, based on mips_arch_setup.
2164 (mips_arch_setup): Reimplement.
2165 (get_usrregs_info): New function.
2166 (mips_cannot_fetch_register, mips_cannot_store_register)
2167 (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
2168 (mips_fill_fpregset, mips_store_fpregset): Adjust.
2169 (target_regsets): Rename to ...
2170 (mips_regsets): ... this, and make static.
2171 (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
2172 (dsp_regs_info, regs_info): New globals.
2173 (mips_regs_info): New function.
2174 (the_low_target): Adjust.
2175 (initialize_low_arch): New function.
2176 * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
2177 (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
2179 (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
2180 (arm_read_description): New, with bits factored from
2182 (arm_arch_setup): Reimplement.
2183 (target_regsets): Rename to ...
2184 (arm_regsets): ... this, and make static.
2185 (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
2186 (arm_regs_info): New function.
2187 (the_low_target): Adjust.
2188 (initialize_low_arch): New function.
2189 * linux-m68k-low.c (tdesc_m68k): Declare.
2190 (target_regsets): Rename to ...
2191 (m68k_regsets): ... this, and make static.
2192 (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
2193 (m68k_regs_info): New function.
2194 (m68k_arch_setup): New function.
2195 (the_low_target): Adjust.
2196 (initialize_low_arch): New function.
2197 * linux-sh-low.c (tdesc_sharch): Declare.
2198 (target_regsets): Rename to ...
2199 (sh_regsets): ... this, and make static.
2200 (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
2201 (sh_regs_info, sh_arch_setup): New functions.
2202 (the_low_target): Adjust.
2203 (initialize_low_arch): New function.
2204 * linux-bfin-low.c (tdesc_bfin): Declare.
2205 (bfin_arch_setup): New function.
2206 (bfin_usrregs_info, regs_info): New globals.
2207 (bfin_regs_info): New function.
2208 (the_low_target): Adjust.
2209 (initialize_low_arch): New function.
2210 * linux-cris-low.c (tdesc_cris): Declare.
2211 (cris_arch_setup): New function.
2212 (cris_usrregs_info, regs_info): New globals.
2213 (cris_regs_info): New function.
2214 (the_low_target): Adjust.
2215 (initialize_low_arch): New function.
2216 * linux-cris-low.c (tdesc_crisv32): Declare.
2217 (cris_arch_setup): New function.
2218 (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
2219 (cris_regs_info): New function.
2220 (the_low_target): Adjust.
2221 (initialize_low_arch): New function.
2222 * linux-m32r-low.c (tdesc_m32r): Declare.
2223 (m32r_arch_setup): New function.
2224 (m32r_usrregs_info, regs_info): New globals.
2225 (m32r_regs_info): Adjust.
2226 (initialize_low_arch): New function.
2227 * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
2228 (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
2229 (tic6x_usrregs_info): Forward declare.
2230 (tic6x_read_description): New function, based on ...
2231 (tic6x_arch_setup): ... this. Reimplement.
2232 (target_regsets): Rename to ...
2233 (tic6x_regsets): ... this, and make static.
2234 (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
2235 (tic6x_regs_info): New function.
2236 (the_low_target): Adjust.
2237 (initialize_low_arch): New function.
2238 * linux-xtensa-low.c (tdesc_xtensa): Declare.
2239 (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
2240 (target_regsets): Rename to ...
2241 (xtensa_regsets): ... this, and make static.
2242 (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
2244 (xtensa_arch_setup, xtensa_regs_info): New functions.
2245 (the_low_target): Adjust.
2246 (initialize_low_arch): New function.
2247 * linux-nios2-low.c (tdesc_nios2_linux): Declare.
2248 (nios2_arch_setup): Set the current process'es tdesc.
2249 (target_regsets): Rename to ...
2250 (nios2_regsets): ... this.
2251 (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
2252 (nios2_regs_info): New function.
2253 (the_low_target): Adjust.
2254 (initialize_low_arch): New function.
2255 * linux-aarch64-low.c (tdesc_aarch64): Declare.
2256 (aarch64_arch_setup): Set the current process'es tdesc.
2257 (target_regsets): Rename to ...
2258 (aarch64_regsets): ... this.
2259 (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
2260 (aarch64_regs_info): New function.
2261 (the_low_target): Adjust.
2262 (initialize_low_arch): New function.
2263 * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
2265 (target_regsets): Rename to ...
2266 (tile_regsets): ... this.
2267 (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
2268 (tile_regs_info): New function.
2269 (tile_arch_setup): Set the current process'es tdesc.
2270 (the_low_target): Adjust.
2271 (initialize_low_arch): New function.
2272 * spu-low.c (tdesc_spu): Declare.
2273 (spu_create_inferior, spu_attach): Set the new process'es tdesc.
2274 * win32-arm-low.c (tdesc_arm): Declare.
2275 (arm_arch_setup): New function.
2276 (the_low_target): Install arm_arch_setup instead of
2278 * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
2279 (init_windows_x86): Rename to ...
2280 (i386_arch_setup): ... this. Set `win32_tdesc'.
2281 (the_low_target): Adjust.
2282 * win32-low.c (win32_tdesc): New global.
2283 (child_add_thread): Don't create the thread cache here.
2284 (do_initial_child_stuff): Set the new process'es tdesc.
2285 * win32-low.h (struct target_desc): Forward declare.
2286 (win32_tdesc): Declare.
2287 * lynx-i386-low.c (tdesc_i386): Declare global.
2288 (lynx_i386_arch_setup): Set `lynx_tdesc'.
2289 * lynx-low.c (lynx_tdesc): New global.
2290 (lynx_add_process): Set the new process'es tdesc.
2291 * lynx-low.h (struct target_desc): Forward declare.
2292 (lynx_tdesc): Declare global.
2293 * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
2294 (lynx_ppc_arch_setup): Set `lynx_tdesc'.
2295 * nto-low.c (nto_tdesc): New global.
2296 (do_attach): Set the new process'es tdesc.
2297 * nto-low.h (struct target_desc): Forward declare.
2298 (nto_tdesc): Declare.
2299 * nto-x86-low.c (tdesc_i386): Declare.
2300 (nto_x86_arch_setup): Set `nto_tdesc'.
2304 * server.c (handle_query): Add "augmented-libraries-svr4-read+"
2305 to qSupported response when appropriate.
2306 (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
2307 with nonzero-length annex.
2308 * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
2309 arguments supplied in annex.
2314 * linux-x86-low.c (ps_get_thread_area): Properly extend address to
2315 64 bits in 64-cross-32 environment.
2319 * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
2320 (aarch64-without-fpu.c): Delete rule.
2321 * configure.srv (aarch64*-*-linux*): Remove references to
2322 aarch64-without-fpu.o and aarch64-without-fpu.xml.
2323 * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
2328 * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
2329 instead of strchr/decode_address. Error if the range isn't split
2330 with a ','. Don't assume there's be a ':' in the action.
2335 * linux-low.c (lwp_in_step_range): New function.
2336 (linux_wait_1): If the thread was range stepping and stopped
2337 outside the stepping range, report the stop to GDB. Otherwise,
2338 continue stepping. Add range stepping debug output.
2339 (linux_set_resume_request): Copy the step range from the resume
2341 (linux_supports_range_stepping): New.
2342 (linux_target_ops) <supports_range_stepping>: Set to
2343 linux_supports_range_stepping.
2344 * linux-low.h (struct linux_target_ops)
2345 <supports_range_stepping>: New field.
2346 (struct lwp_info) <step_range_start, step_range_end>: New fields.
2347 * linux-x86-low.c (x86_supports_range_stepping): New.
2348 (the_low_target) <supports_range_stepping>: Set to
2349 x86_supports_range_stepping.
2350 * server.c (handle_v_cont): Handle 'r' action.
2351 (handle_v_requests): Append ";r" if the target supports range
2353 * target.h (struct thread_resume) <step_range_start,
2354 step_range_end>: New fields.
2355 (struct target_ops) <supports_range_stepping>:
2357 (target_supports_range_stepping): New macro.
2361 * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
2362 confusion in comment.
2366 * lynx-low.c (struct process_info_private): New type.
2367 (lynx_add_process): New function.
2368 (lynx_create_inferior, lynx_attach): Replace calls to
2369 add_process by calls to lynx_add_process.
2370 (lynx_resume): If PTID is null, then try using
2371 current_process()->private->last_wait_event_ptid.
2373 (lynx_clear_inferiors): Delete. The contents of that function
2374 has been inlined in lynx_mourn;
2375 (lynx_wait_1): Save the ptid in the process's private data.
2376 (lynx_mourn): Free the process' private data. Replace call
2377 to lynx_clear_inferiors by call to clear_inferiors.
2381 * i386-low.c (i386_length_and_rw_bits): Move the comment to
2386 * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
2387 PT_DATA_ADDR and PT_TEXT_END_ADDR. Update comments.
2388 (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
2389 PT_TEXT_END_ADDR guards. Update comments.
2390 (linux_target_op) <read_offsets>: Conditionally define to
2391 linux_read_offsets if the target is UCLIBC and if it defines
2392 PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
2397 * Makefile.in (SFILES): Add linux-nios2-low.c.
2398 (clean): Add action to delete nios2-linux.c.
2399 (nios2-linux.c): New rule.
2400 * configure.srv: Add nios2*-*-linux*.
2401 * linux-nios2-low.c: New.
2405 * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
2410 * ax.c (ax_printf): Add fflush.
2414 * Makefile.in (SFILES): Add filestuff.c.
2415 (OBS): Add filestuff.o.
2416 (filestuff.o): New target.
2417 * config.in, configure: Rebuild.
2418 * configure.ac: Check for fdwalk, pipe2.
2422 * configure.ac (USE_THREAD_DB): Delete variable.
2423 (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
2424 Don't AC_SUBST USE_THREAD_DB.
2425 * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
2426 * config.in, configure: Regenerate.
2430 * linux-low.h (struct lwp_info) <thread_known>: Move under
2431 the USE_THREAD_DB #ifdef.
2435 * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
2436 (linux-low.o): Delete rule.
2437 * linux-low.h: Always include "gdb_thread_db.h" instead of
2438 conditionally including thread_db.h.
2439 (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
2444 * Makefile.in (install-only): Fix make install regression.
2448 Convert man pages to texinfo, new gdbinit.5 texinfo page.
2449 * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
2451 * gdbserver.1: Remove.
2455 * linux-low.c (handle_extended_wait): Don't call
2456 linux_enable_event_reporting.
2461 * Makefile.in (SHELL): Use @SHELL@.
2465 * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
2470 * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
2471 Remove extraneous NULL element.
2475 * tracepoint.c (traceframe_read_tsv): Look for the last matched
2476 'V' block in trace frame.
2480 * target.h (struct target_ops): Add btrace ops.
2481 (target_supports_btrace): New macro.
2482 (target_enable_btrace): New macro.
2483 (target_disable_btrace): New macro.
2484 (target_read_btrace): New macro.
2485 * gdbthread.h (struct thread_info): Add btrace field.
2486 * server.c: Include btrace-common.h.
2487 (handle_btrace_general_set): New function.
2488 (handle_btrace_enable): New function.
2489 (handle_btrace_disable): New function.
2490 (handle_general_set): Call handle_btrace_general_set.
2491 (handle_qxfer_btrace): New function.
2492 (struct qxfer qxfer_packets[]): Add btrace entry.
2493 * inferiors.c (remove_thread): Disable btrace.
2494 * linux-low: Include linux-btrace.h.
2495 (linux_low_enable_btrace): New function.
2496 (linux_low_read_btrace): New function.
2497 (linux_target_ops): Add btrace ops.
2498 * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
2499 Add srv_linux_btrace=yes.
2500 (x86_64-*-linux*): Add linux-btrace.o.
2501 Add srv_linux_btrace=yes.
2502 * configure.ac: Define HAVE_LINUX_BTRACE.
2503 * config.in: Regenerated.
2504 * configure: Regenerated.
2508 * server.c (handle_qxfer): Preserve error message if -3 is
2510 (qxfer): Document the -3 return value.
2514 * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
2515 (linux_btrace_h): New variable.
2516 (linux-btrace.o): New rule.
2521 * tracepoint.c (trace_buffer_size): New global.
2522 (DEFAULT_TRACE_BUFFER_SIZE): New define.
2523 (init_trace_buffer): Change to one-argument function. Allocate
2524 trace buffer memory.
2525 (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
2526 handle QTBuffer:size packet.
2527 (cmd_bigqtbuffer_size): New function.
2528 (initialize_tracepoint): Call init_trace_buffer with
2529 DEFAULT_TRACE_BUFFER_SIZE.
2530 * server.c (handle_query): Add QTBuffer:size in the
2535 * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
2536 (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
2538 (cmd_qtsp): Adjust condition. Do post increment.
2539 Set cur_action and cur_step_action back to 0.
2544 * linux-low.c (linux_write_memory): Return early success if LEN is
2549 * configure.srv: Add x86_64-*-cygwin* as target.
2553 * configure.ac: Invoke AC_SYS_LARGEFILE.
2554 * configure, config.in: Rebuild.
2558 * win32-low.c: Throughout, fix format strings and casts of
2559 printf-like functions to avoid type related warnings on all
2561 (get_child_debug_event): Print dwDebugEventCode as hex since
2562 that's how it's usually documented.
2566 * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
2571 * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
2572 (reg-tilegx32.c): New rule.
2573 * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
2574 * linux-tile-low.c (tile_arch_setup): New function. Invoke
2575 different register info initializer according to elf class.
2576 (init_registers_tilgx32): New function. The tilegx32 register info
2578 (tile_fill_gregset): Use "uint_reg_t" to represent register size.
2579 (tile_store_gregset): Likewise.
2583 * server.c (process_point_options): Print debug message when
2584 debug_threads is true.
2588 * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
2595 * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
2596 instead of strtoul to extract address from packet.
2597 (process_serial_event) <'z'>: Likewise.
2601 * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
2607 * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
2608 TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
2612 * tracepoint.c (cmd_qtdpsrc): Use savestring.
2616 * tracepoint.c (save_string): Delete.
2617 (add_tracepoint_action): Use savestring instead of save_string.
2621 * linux-xtensa-low.c: Ditto.
2622 * xtensa-xtregs.c: Ditto.
2626 * thread-db.c (thread_db_get_tls_address): NULL pointer check
2631 * linux-aarch64-low.c (aarch64_arch_setup): Clamp
2632 aarch64_num_wp_regs and aarch64_num_bp_regs to
2633 AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
2637 * linux-aarch64-low.c (ps_get_thread_area): Replace
2638 PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
2645 * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
2646 (aarch64.c, aarch64-without-fpu.c): New targets.
2647 * configure.srv (aarch64*-*-linux*): New.
2648 * linux-aarch64-low.c: New file.
2652 * linux-low.c (handle_extended_wait, linux_create_inferior)
2653 (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
2654 (dequeue_one_deferred_signal, linux_resume_one_thread)
2655 (fetch_register, linux_write_memory, linux_enable_event_reporting)
2656 (linux_tracefork_grandchild, linux_test_for_tracefork)
2657 (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
2658 PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
2659 where the argument is 0.
2663 * event-loop.c: Include "queue.h".
2664 (gdb_event_p): New typedef.
2665 (struct gdb_event) <next_event>: Remove.
2666 (event_queue): Change to QUEUE(gdb_event_p).
2667 (async_queue_event): Remove.
2668 (gdb_event_xfree): New.
2669 (initialize_event_loop): New.
2670 (process_event): Use API from QUEUE.
2671 (wait_for_event): Likewise.
2672 * server.c (main): Call initialize_event_loop.
2673 * server.h (initialize_event_loop): Declare.
2677 * ax.h (struct eval_agent_expr_context): New.
2678 (gdb_eval_agent_expr): Update declaration.
2679 * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
2680 TFRAME. Add new argument CTX.
2681 * server.h (struct eval_agent_expr_context): Declare.
2682 (agent_mem_read, agent_tsv_read): Update declaration.
2683 (agent_mem_read_string): Likewise.
2684 * tracepoint.c (eval_tracepoint_agent_expr): Remove.
2685 (add_traceframe_block): Add new argument TPOINT.
2686 Increase TPOINT->traceframe_usage.
2687 (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
2688 eval_tracepoint_agent_expr.
2689 (condition_true_at_tracepoint): Likewise.
2690 (agent_mem_read): Remove argument TFRAME. Add argument CTX.
2691 (agent_mem_read_string, agent_tsv_read): Likewise.
2695 * linux-low.c (linux_resume_one_lwp): Don't check
2696 'lwp->bp_reinsert != 0'.
2701 * lynx-low.c (ptrace_request_to_str): Define a temporary
2702 macro and use it to simplify this function's implementation.
2706 * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
2711 * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
2715 * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
2719 * lynx-low.c (lynx_resume): Use the resume_info parameter
2720 to determine the ptid for the lynx_ptrace call, unless
2721 it is equal to minus_one_ptid, in which case we use the
2722 ptid of the current_inferior.
2723 (lynx_wait_1): After having received a thread create/exit
2724 event, resume the inferior's execution using the signaling
2725 thread's ptid, rather than the old ptid.
2729 * lynx-low.c (lynx_resume): Delete variable ret.
2733 * gdbreplay.c (gdbreplay_version): Update copyright year.
2734 * server.c (gdbserver_version): Likewise.
2738 * lynx-low.c (lynx_wait_1): Add debug trace before adding
2743 * lynx-low.c (ptrace_request_to_str): Add handling for
2748 * lynx-low.c (lynx_attach): Delete variable new_process.
2752 * lynx-low.c (lynx_create_inferior): Delete variable
2757 * lynx-low.c (ptrace_request_to_str): Do not handle
2758 PTRACE_GETTHREADLIST if this macro does not exist.
2762 * Makefile.in (OBS): Add notif.o.
2763 * notif.c, notif.h: New.
2764 * server.c: Include "notif.h".
2765 (struct vstop_notif) <next>: Remove.
2767 (queue_stop_reply): Update.
2768 (push_event, send_next_stop_reply): Remove.
2769 (discard_queued_stop_replies): Update.
2770 (notif_stop): New variable.
2771 (handle_v_stopped): Remove.
2772 (handle_v_requests): Don't call handle_v_stopped. Call
2773 handle_ack_notif instead.
2774 (queue_stop_reply_callback): Call notif_event_enque instead
2775 of queue_stop_reply.
2776 (handle_status): Don't call send_next_stop_reply, call
2777 notif_write_event instead.
2778 (kill_inferior_callback): Likewise.
2779 (detach_or_kill_inferior_callback): Likewise.
2780 (main): Call initialize_notif.
2781 (process_serial_event): Call QUEUE_is_empty.
2782 (handle_target_event): Call notif_push instead of push event.
2783 * server.h (push_event): Remove declaration.
2787 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
2788 (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
2791 (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
2792 (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
2793 (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
2794 (amd64-linux-ipa.o, ax.o): Rewrite.
2795 (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
2796 (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
2797 (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
2798 (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
2799 (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
2800 (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
2801 (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
2802 (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
2803 (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
2804 (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
2805 (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
2806 (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
2807 (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
2808 (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
2809 (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
2810 (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
2811 (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
2812 (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
2813 (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
2814 (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
2815 (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
2816 (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
2817 (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
2818 (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
2819 (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
2820 (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
2821 (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
2822 (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
2823 (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
2824 (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
2825 (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
2826 (reg-tilegx.o): Remove.
2827 (all_object_files): New macro.
2828 Include .deps files.
2829 * aclocal.m4, configure: Rebuild.
2830 * acinclude.m4: Include depstand.m4, lead-dot.m4.
2831 * configure.ac: Invoke ZW_CREATE_DEPDIR,
2832 ZW_PROG_COMPILER_DEPENDENCIES. Compute GMAKE condition.
2837 * server.h (current_insn_ptr, emit_error): Declare 'extern'.
2841 * configure.ac: Check for linux/perf_event.h.
2842 * config.in: Regenerated.
2843 * configure: Regenerated.
2847 * hostio.c (handle_readlink): Decrease buffer size
2848 parameter passed to readlink by one byte.
2852 * configure.ac (build_warnings): Append '-Wempty-body'.
2853 * configure: Regenerated.
2854 * linux-low.c (linux_create_inferior): Use braces for empty 'if'
2859 * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
2860 * config.in: Regenerate.
2861 * configure: Regenerate.
2862 * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
2863 Use "gdb_wait.h" header instead of <sys/wait.h> header.
2864 * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
2865 * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
2867 * server.c: Remove HAVE_WAIT_H conditional. Use "gdb_wait.h" header
2868 instead of <sys/wait.h> header.
2869 * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
2873 * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
2874 (various make rules): Remove -DGDBSERVER
2878 * spu-low.c (current_ptid): Move it to ..
2879 * gdbthread.h: ... here. New.
2880 * remote-utils.c (read_ptid): Use macro 'current_ptid'.
2881 * server.c (myresume, process_serial_event): Likewise.
2882 * thread-db.c (thread_db_find_new_threads): Likewise.
2883 * tracepoint.c (run_inferior_command): Likewise.
2887 * server.c (handle_search_memory_1): Include access length in
2892 * linux-crisv32-low.c: Fix compile errors.
2896 * tracepoint.c (cmd_qtsv): Adjust debug message.
2897 Don't check CUR_TPOINT.
2901 * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
2902 * server.h: Include 'libiberty.h' and 'ansidecl.h'.
2903 (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
2904 Remove declarations of xmalloc, xreallloc, xstrdup and
2906 * Makefile.in (libiberty_h): New.
2907 (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
2908 (linux-bfin-low.o): Append dependency 'libiberty.h'.
2912 * server.h: Remove declaration of 'xsnprintf'.
2916 * server.h: Include build-gnulib-gbserver/config.h.
2917 * gdbreplay.c: Likewise.
2921 * Makefile.in (SFILES): Add gdb_vecs.c.
2922 (OBS): Add gdb_vecs.o.
2923 (gdb_vecs_h, host_defs_h): New variables.
2924 (thread-db.o): Add $(gdb_vecs_h) dependency.
2925 (gdb_vecs.o): New rule.
2926 * thread-db.c: #include "gdb_vecs.h".
2927 (thread_db_load_search): Use a vector to iterate over path elements.
2928 Handle text appearing after "$pdir".
2930 * configure.ac: Add check for strstr.
2931 * config.in: Regenerate.
2932 * configure: Regenerate.
2936 * hostio.c (handle_pread): If pread fails, fall back to attempting
2938 (handle_pwrite): Likewise for pwrite.
2942 * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
2943 between unsupported TYPE and unimplementable ADDR/LEN combination.
2944 (arm_insert_point): Act on new return value.
2948 * server.c (process_point_options): Only skip tokens if we find
2949 one that is unrecognized. Don't treat 'X' specially while
2950 skipping unrecognized tokens.
2954 * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
2955 to 4-byte-align HW breakpoint addresses for Thumb.
2961 * server.h: Declare gdb_agent_about_to_close.
2962 * target.c (kill_inferior): Include "agent.h".
2963 New. Send command 'kill'.
2964 * target.h (kill_inferior): Removed macro.
2965 * tracepoint.c (gdb_agent_about_to_close): New.
2966 (gdb_agent_helper_thread): Handle command 'close'.
2967 Wait endlessly until the inferior stops.
2968 Install gdb_agent_remove_socket to atexit hook.
2969 (agent_socket_name): New static variable.
2970 (gdb_agent_socket_init): Replace local variable 'name' with
2971 'agent_socket_name'.
2972 (gdb_agent_remove_socket): New.
2976 * server.c (process_point_options): Stop at 'X' when parsing.
2980 * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
2982 * linux-x86-low.c (x86_insert_point, x86_remove_point):
2983 Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
2984 hardware breakpoint.
2988 * gdbserver/linux-low.c (initialize_low): Call
2989 linux_ptrace_init_warnings.
2993 * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
2998 * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
2999 (ax.o): Add it to build rule.
3001 (OBS): Add format.o.
3002 (IPA_OBS): Add format.o.
3003 * server.c (handle_query): Claim support for breakpoint commands.
3004 (process_point_options): Add command case.
3005 (process_serial_event): Leave running if there are printfs in
3007 * mem-break.h (any_persistent_commands): Declare.
3008 (add_breakpoint_commands): Declare.
3009 (gdb_no_commands_at_breakpoint): Declare.
3010 (run_breakpoint_commands): Declare.
3011 * mem-break.c (struct point_command_list): New struct.
3012 (struct breakpoint): New field command_list.
3013 (any_persistent_commands): New function.
3014 (add_commands_to_breakpoint): New function.
3015 (add_breakpoint_commands): New function.
3016 (gdb_no_commands_at_breakpoint): New function.
3017 (run_breakpoint_commands): New function.
3018 * linux-low.c (linux_wait_1): Test for and run breakpoint commands
3020 * ax.c: Include format.h.
3021 (ax_printf): New function.
3022 (gdb_eval_agent_expr): Add printf opcode.
3026 * server.c (start_inferior): Remove duplicated writes to fields
3027 'last_resume_kind' and 'last_status' of 'current_inferior'.
3032 * linux-low.c (linux_set_resume_request): Simplify predicate. Add
3034 * server.c (handle_v_cont): Extend comment.
3038 * linux-low.c (linux_attach): Add 'static'.
3042 * ax.c (gdb_eval_agent_expr): Print `top' in hex.
3046 Fix gcc -flto compilation warning.
3047 * server.c (main): Make variable multi_mode and attach volatile.
3051 * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
3052 if the platform doesn't know about it.
3056 * Makefile.in (SFILES): Add linux-tile-low.c.
3057 (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
3058 * configure.srv: Handle tilegx-*-linux*.
3059 * linux-tile-low.c: New file.
3063 * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
3069 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
3075 Replace target_signal with gdb_signal throughout.
3079 * linux-low.c (linux_store_registers): Avoid the copying sequence
3080 when no data has been retrieved by ptrace.
3084 * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
3085 Include asm/ptrace.h.
3086 (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
3091 * linux-low.c (linux_store_registers): Don't re-retrieve data
3092 with ptrace that has already been obtained from /proc. Always
3093 copy any data retrieved with ptrace to the buffer supplied.
3098 * linux-low.c (enum stopping_threads_kind): New.
3099 (stopping_threads): Change type to `enum stopping_threads_kind'.
3100 (handle_extended_wait): If stopping and suspending threads, leave
3101 the new_lwp suspended too.
3102 (linux_wait_for_event): Adjust.
3103 (stop_all_lwps): Set `stopping_threads' to
3104 STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
3105 whether we're suspending threads or just stopping them. Assert no
3110 * server.h: Move some code to ...
3111 * gdbthread.h: ... here. New.
3112 * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
3113 (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
3114 (nto-low.o, win32-low.o): Likewise.
3115 * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
3116 * regcache.c, remote-utils.c, server.c: Likewise.
3117 * target.c, tracepoint.c, win32-low.c: Likewise.
3121 * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
3122 (PTRACE_ARG4_TYPE): Likewise.
3123 (PTRACE_XFER_TYPE): Likewise.
3124 * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
3125 ptrace to PTRACE_ARG3_TYPE.
3126 * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
3127 (PTRACE_ARG4_TYPE): Likewise.
3128 (PTRACE_XFER_TYPE): Likewise.
3129 (linux_detach_one_lwp): Cast fourth argument of
3130 ptrace to long then PTRACE_ARG4_TYPE.
3131 (regsets_fetch_inferior_registers): Cast third argument of
3132 ptrace to long then PTRACE_ARG3_TYPE.
3133 (regsets_store_inferior_registers): Likewise.
3137 * configure: Regenerate.
3141 * Makefile.in (GNULIB_BUILDDIR): New.
3142 (LIBGNU, INCGNU, GNULIB_H): Adjust.
3143 (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
3144 (all, install-only, uninstall, clean-info, all-lib, clean): No
3145 longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do.
3146 (maintainer-clean realclean distclean): Use subdir_do.
3148 (gnulib/import/Makefile): Adjust. Replace gnulib/import with
3149 $(GNULIB_BUILDDIR). Don't pass argument to config.status.
3150 * acinclude.m4: Include acx_configure_dir.m4.
3151 * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
3152 calls. Call AC_PROG_RANLIB. Configure gnulib using
3155 (GNULIB_STDINT_H): Adjust.
3156 (AC_OUTPUT): Don't output gnulib/Makefile anymore.
3157 * gdbreplay.c: Include build-gnulib/config.h.
3158 * server.h: Likewise.
3159 * aclocal.m4: Regenerate.
3160 * config.in: Regenerate.
3161 * configure: Regenerate.
3165 * Makefile.in (LIBGNU, INCGNU): Adjust.
3166 (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
3167 (all, install-only, uninstall, clean-info, all-lib, clean)
3168 (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
3169 * configure.ac: Adjust AC_OUTPUT output.
3170 * aclocal.m4: Regenerate.
3171 * configure: Regenerate.
3175 * Makefile.in (generated_files): New.
3176 (server_h): Remove the explicit dependency on config.h, and depend
3177 on $generated_files.
3181 * Makefile.in (INCGNU): Add -Ignulib.
3185 * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
3186 (INCGNU): ... this, and spell out -I here.
3187 (GNULIB_LIB): Rename to ...
3189 (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
3193 * config.in: Regenerate.
3197 * configure.ac: Remove AC_CHECK_DECLS check for memmem.
3198 * server.h (memmem): Remove declaration.
3199 * config.in: Regenerate.
3200 * configure: Regenerate.
3204 * Makefile.in (SFILES): Add common/vec.c.
3210 * remote-utils.c (prepare_resume_reply): Replace with macro
3211 target_core_of_thread.
3212 * server.c (handle_qxfer_threads_proper): Likewise.
3213 * target.h (traget_core_of_thread): New macro.
3217 * aclocal.m4: Regenerate.
3218 * configure: Regenerate.
3222 * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
3223 duplicated on address.
3227 * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
3228 (struct tracepoint_action_ops) <send>: New field.
3229 (m_tracepoint_action_send, r_tracepoint_action_send): New.
3230 (agent_expr_send, x_tracepoint_action_send): New.
3231 (l_tracepoint_action_send): New.
3232 (cmd_qtdp): Download and install tracepoint
3233 according to `use_agent'.
3234 (run_inferior_command): Add one more parameter `len'.
3236 (tracepoint_send_agent): New.
3237 (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
3241 * tracepoint.c (download_tracepoints): Moved to ...
3242 (cmd_qtstart): ... here.
3246 * tracepoint.c: Include inttypes.h.
3247 (struct collect_memory_action): Use sized types.
3248 (struct tracepoint): Likewise.
3249 (cmd_qtdp, stop_tracing): Update print specifiers.
3250 (cmd_qtp, response_tracepoint): Likewise.
3251 (collect_data_at_tracepoint): Likewise.
3252 (collect_data_at_step): Likewise.
3256 Import gnulib module inttypes.
3257 * aclocal.m4, config.in, configure: Regenerated.
3261 * Makefile.in (maintainer-clean, realclean, distclean): Remove
3262 Makefile and config.status at last.
3266 * tracepoint.c: Include stdint.h unconditionally.
3270 * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
3271 on BFD_HAVE_SYS_PROCFS_TYPE.
3272 * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
3273 * configure: Regenerate.
3274 * config.in: Likewise.
3278 * Makefile.in (clean): Also remove x32.c x32-linux.c
3279 x32-avx.c x32-avx-linux.c.
3280 (x32.o): New target.
3282 (x32-linux.o): Likewise.
3283 (x32-linux.c): Likewise.
3284 (x32-avx.o): Likewise.
3285 (x32-avx.c): Likewise.
3286 (x32-avx-linux.o): Likewise.
3287 (x32-avx-linux.c): Likewise.
3289 * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
3290 (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
3291 (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
3292 (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
3293 (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
3294 i386/x32-avx-linux.xml.
3296 * linux-x86-low.c (init_registers_x32_linux): New prototype.
3297 (init_registers_x32_avx_linux): Likwise.
3298 (x86_linux_update_xmltarget): Call init_registers_x32_linux
3299 or init_registers_x32_avx_linux if linux_is_elf64 is false.
3303 * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
3304 (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
3305 (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
3306 (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
3311 * linux-x86-low.c (compat_x32_clock_t): New.
3312 (compat_x32_siginfo_t): Likewise.
3313 (compat_x32_siginfo_from_siginfo): Likewise.
3314 (siginfo_from_compat_x32_siginfo): Likewise.
3315 (linux_is_elf64): Likewise.
3316 (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
3317 and siginfo_from_compat_x32_siginfo for x32.
3318 (x86_arch_setup): Set linux_is_elf64.
3323 * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
3325 (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
3326 * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
3327 * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
3328 compatible with process.
3332 * Makefile.in: Define abs_top_srcdir and abs_srcdir.
3333 (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
3334 (install-only, install-info, clean): Handle sub dir gnulib.
3335 (all-lib, am--refresh): New targets.
3336 (memmem.o): Remove target.
3337 * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
3338 Invoke gl_EARLY. Invoke AC_CHECK_PROGS for make.
3339 (AC_REPLACE_FUNCS): Remove memmem.
3340 Invoke gl_INIT and AM_INIT_AUTOMAKE.
3341 (AC_OUTPUT): Generate Makefile in gnulib/.
3342 * aclocal.m4, config.in, configure: Regenerated.
3346 * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
3350 -Werror=strict-aliasing
3352 * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
3357 * linux-sparc-low.c (sparc_fill_gregset_to_stack)
3358 (sparc_store_gregset_from_stack, sparc_store_gregset)
3359 (sparc_breakpoint_at): Fix formatting.
3363 * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
3365 * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
3366 [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
3367 * config.in: Regenerate.
3368 * configure: Likewise.
3372 * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
3373 Correct ptrace arguments.
3377 * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
3378 (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
3379 (IA64_FR1_REGNUM): New defines.
3380 (ia64_fetch_register): New.
3381 (the_low_target): Install it.
3382 * linux-low.h (struct linux_target_ops) <fetch_register>: New
3384 * linux-low.c (linux_fetch_registers): Try the
3385 the_low_target.fetch_register hook first.
3387 * linux-arm-low.c (the_low_target): Adjust.
3388 * linux-bfin-low.c (the_low_target): Adjust.
3389 * linux-cris-low.c (the_low_target): Adjust.
3390 * linux-crisv32-low.c (the_low_target): Adjust.
3391 * linux-m32r-low.c (the_low_target): Adjust.
3392 * linux-m68k-low.c (the_low_target): Adjust.
3393 * linux-mips-low.c (the_low_target): Adjust.
3394 * linux-ppc-low.c (the_low_target): Adjust.
3395 * linux-s390-low.c (the_low_target): Adjust.
3396 * linux-sh-low.c (the_low_target): Adjust.
3397 * linux-sparc-low.c (the_low_target): Adjust.
3398 * linux-tic6x-low.c (the_low_target): Adjust.
3399 * linux-x86-low.c (the_low_target): Adjust.
3400 * linux-xtensa-low.c (the_low_target): Adjust.
3404 * server.c (handle_qxfer_libraries): Don't bail early if
3405 the_target->qxfer_libraries_svr4 is not NULL.
3409 * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
3413 * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
3414 "library-list-svr4" element's start tag when the the DSO list is
3419 * linux-low.c (read_one_ptr): Read the inferior's pointer through
3420 a variable whose type size is the same as the inferior's pointer
3425 * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
3427 * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
3428 * linux-x86-low.c (x86_siginfo_fixup): Likewise.
3429 * linux-low.h: Include <signal.h>.
3430 (struct siginfo): Remove forward declaration.
3431 (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
3436 * .gitignore: Ignore more files.
3441 * server.c (cont_thread, general_thread): Add describing comments.
3442 (start_inferior): Clear `cont_thread'.
3443 (handle_v_cont): Don't set `cont_thread' if resuming all threads
3448 * tracepoint.c (install_tracepoint): Move duplicated tracepoint
3450 (cmd_qtdp): ... here.
3454 * tracepoint.c (struct tracepoint_action_ops): New.
3455 (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
3456 (m_tracepoint_action_download): New.
3457 (r_tracepoint_action_download): New.
3458 (x_tracepoint_action_download): New.
3459 (l_tracepoint_action_download): New.
3460 (add_tracepoint_action): Install `action->ops' according type.
3461 (download_tracepoint_1): Move code `download' function pointer
3462 of various tracepoint_action_ops.
3466 * linux-low.c (linux_attach_lwp_1): New variable buffer. Call
3467 linux_ptrace_attach_warnings.
3471 * Makefile.in (linux-ptrace.o): New.
3472 * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
3473 (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
3474 (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
3475 (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
3476 (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
3478 * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
3483 Fix PR server/13392.
3484 * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
3486 * tracepoint.c (remove_tracepoint): New.
3487 (cmd_qtdp): Call remove_tracepoint when failed to install.
3491 * linux-low.c (get_detach_signal): New.
3492 (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
3493 Pass on pending signals to PTRACE_DETACH. Check the result of the
3495 * server.c (program_signals, program_signals_p): New.
3496 (handle_general_set): Handle QProgramSignals.
3497 * server.h (program_signals, program_signals_p): Declare.
3502 * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
3507 * tracepoint.c (tracepoint_look_up_symbols): Update call to
3508 agent_look_up_symbols.
3512 * Makefile.in (linux-low.o): Keep dependence on agent.h.
3513 (linux-x86-low.o): Likewise.
3514 * server.h: Remove in_process_agent_loaded.
3515 * tracepoint.c (in_process_agent_loaded): Removed. Moved it
3521 * tracepoint.c (gdb_agent_capability): New global.
3522 (in_process_agent_loaded_ust): Renamed to
3523 `in_process_agent_supports_ust'.
3525 (in_process_agent_supports_ust): Call agent_capability_check.
3526 (clear_installed_tracepoints): Assert that agent supports
3531 * linux-low.c (linux_supports_agent): New.
3532 (linux_target_ops): Initialize field `supports_agent' with
3533 linux_supports_agent.
3534 * target.h (struct target_ops) <supports_agent>: New.
3535 (target_supports_agent): New macro.
3536 * server.c (handle_general_set): Handle packet 'QAgent'.
3537 (handle_query): Send `QAgent+'.
3538 * Makefile.in (server.o): Depends on agent.h.
3542 * Makefile.in (OBS): Add agent.o.
3543 Add new rule for agent.o.
3544 Track dependence of tracepoint.c on agent.h.
3545 * tracepoint.c (run_inferior_command_1):
3546 (run_inferior_command): Call agent_run_command.
3547 (gdb_ust_connect_sync_socket): Deleted. Move it to
3549 (resume_thread, stop_thread): Likewise.
3550 (gdb_ust_socket_init): Renamed to ...
3551 (gdb_agent_socket_init): ... New.
3552 (gdb_ust_thread): Renamed to ...
3553 (gdb_agent_helper_thread): ... New.
3554 (gdb_ust_init): Move some code to ...
3555 (gdb_agent_init): ... here. New.
3556 [HAVE_UST]: Call gdb_ust_init.
3557 (initialize_tracepoint_ftlib): Call gdb_agent_init.
3558 * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
3559 * config.in, configure: Regenerated.
3563 * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
3564 * linux-low.c (struct simple_pid_list): New.
3565 (stopped_pids): New a struct simple_pid_list pointer.
3566 (add_to_pid_list, pull_pid_from_list): New.
3567 (handle_extended_wait): Don't assume the first signal new children
3568 report is SIGSTOP. Adjust call to pull_pid_from_list.
3569 (linux_wait_for_lwp): Adjust.
3573 * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
3578 * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
3579 `stop_pc' and `tpoint'. Update caller.
3583 * linux-low.h (linux_target_ops): Add regset_bitmap member.
3584 * linux-low.c (use_linux_regsets): New macro.
3585 [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
3586 [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
3587 (linux_register_in_regsets): New function.
3588 (usr_fetch_inferior_registers): Skip registers covered by
3590 (usr_store_inferior_registers): Likewise.
3591 (usr_fetch_inferior_registers): New macro.
3592 (usr_store_inferior_registers): Likewise.
3593 (linux_fetch_registers): Handle mixed regset/non-regset targets.
3594 (linux_store_registers): Likewise.
3595 * linux-mips-low.c (init_registers_mips_dsp_linux): New
3597 (init_registers_mips64_dsp_linux): Likewise.
3598 (init_registers_mips_linux): New macro.
3599 (init_registers_mips_dsp_linux): Likewise.
3600 (mips_dsp_num_regs): Likewise.
3601 (DSP_BASE, DSP_CONTROL): New fallback macros.
3602 (mips_base_regs): New macro.
3603 (mips_regmap): Use it. Fix the size.
3604 (mips_dsp_regmap): New variable.
3605 (mips_dsp_regset_bitmap): Likewise.
3606 (mips_arch_setup): New function.
3607 (mips_cannot_fetch_register): Use the_low_target.regmap rather
3609 (mips_cannot_store_register): Likewise.
3610 (the_low_target): Update .arch_setup, .num_regs and .regmap
3611 initializers. Add .regset_bitmap initializer.
3612 * linux-arm-low.c (the_low_target): Add .regset_bitmap
3614 * linux-bfin-low.c (the_low_target): Likewise.
3615 * linux-cris-low.c (the_low_target): Likewise.
3616 * linux-crisv32-low.c (the_low_target): Likewise.
3617 * linux-ia64-low.c (the_low_target): Likewise.
3618 * linux-m32r-low.c (the_low_target): Likewise.
3619 * linux-m68k-low.c (the_low_target): Likewise.
3620 * linux-ppc-low.c (the_low_target): Likewise.
3621 * linux-s390-low.c (the_low_target): Likewise.
3622 * linux-sh-low.c (the_low_target): Likewise.
3623 * linux-sparc-low.c (the_low_target): Likewise.
3624 * linux-tic6x-low.c (the_low_target): Likewise.
3625 * linux-x86-low.c (the_low_target): Likewise.
3626 * linux-xtensa-low.c (the_low_target): Likewise.
3627 * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
3628 mips64-dsp-linux.o to srv_regobj. Add mips-dsp-linux.xml,
3629 mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
3631 * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
3632 (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
3637 * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
3638 `step_over_finished' is true.
3642 * linux-low.c (pid_is_stopped): Delete, moved to common/.
3643 (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
3648 * linux-low.c (pid_is_stopped): New.
3649 (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
3653 * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
3658 * linux-mips-low.c (mips_regmap): Correct the index of $f9.
3660 2012-02-24 Luis Machado <lgustavo@codesourcery>
3662 * server.c (handle_query): Advertise support for target-side
3663 breakpoint condition evaluation.
3664 (process_point_options): New function.
3665 (process_serial_event): When inserting a breakpoint, check for
3666 a target-side condition that should be evaluated.
3668 * mem-break.c: Include regcache.h and ax.h.
3669 (point_cond_list_t): New data structure.
3670 (breakpoint) <cond_list>: New field.
3671 (find_gdb_breakpoint_at): Make non-static.
3672 (delete_gdb_breakpoint_at): Clear any target-side
3674 (clear_gdb_breakpoint_conditions): New function.
3675 (add_condition_to_breakpoint): Likewise.
3676 (add_breakpoint_condition): Likewise.
3677 (gdb_condition_true_at_breakpoint): Likewise.
3678 (gdb_breakpoint_here): Return result directly instead
3679 of going through a local variable.
3681 * mem-break.h (find_gdb_breakpoint_at): New prototype.
3682 (clear_gdb_breakpoint_conditions): Likewise.
3683 (add_breakpoint_condition): Likewise.
3684 (gdb_condition_true_at_breakpoint): Likewise.
3686 * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
3687 (need_step_over_p): Take target-side breakpoint condition into
3690 2012-02-24 Luis Machado <lgustavo@codesourcery>
3692 * server.h: Include tracepoint.h.
3693 (agent_mem_read, agent_get_trace_state_variable_value,
3694 agent_set_trace_state_variable_value,
3695 agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
3696 get_set_tsv_func_addr): New prototypes.
3698 * ax.h: New include file.
3699 * ax.c: New source file.
3701 * tracepoint.c: Include ax.h.
3702 (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
3703 agent_expr, eval_result_type): Move to ax.h.
3704 (parse_agent_expr): Rename to ...
3705 (gdb_parse_agent_expr): ... this, make it non-static and move
3707 (unparse_agent_expr) Rename to ...
3708 (gdb_unparse_agent_expr): ... this, make it non-static and move
3710 (eval_agent_expr): Rename to ...
3711 (eval_tracepoint_agent_expr): ... this.
3712 (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
3713 forward declarations.
3714 (add_tracepoint_action): Call gdb_parse_agent_expr (...).
3715 (agent_get_trace_state_variable_value): New function.
3716 (agent_set_trace_state_variable_value): New function.
3717 (cmd_qtdp): Call gdb_parse_agent_expr (...).
3718 (response_tracepoint): Call gdb_unparse_agent_expr (...).
3719 (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
3720 (condition_true_at_tracepoint): Likewise.
3721 (parse_agent_expr): Rename to ...
3722 (gdb_parse_agent_expr): ... this and move to ax.c.
3723 (unparse_agent_expr): Rename to ...
3724 (gdb_unparse_agent_expr): ... this and move to ax.c.
3725 (gdb_agent_op_name): Move to ax.c.
3726 (eval_agent_expr): Rename to ...
3727 (gdb_eval_agent_expr): ... this, use regcache passed as parameter
3729 (eval_tracepoint_agent_expr): New function.
3730 (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
3732 (current_insn_ptr, emit_error, struct bytecode_address): Move to
3734 (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
3735 emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
3736 emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
3737 emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
3738 emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
3739 emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
3740 emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
3741 emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
3742 (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
3743 (compile_bytecodes): Remove forward declaration.
3744 (is_goto_target): Move to ax.c.
3745 (compile_bytecodes): Move to ax.c and call
3746 agent_get_trace_state_variable_value (...) and
3747 agent_set_trace_state_variable_value (...).
3749 * Makefile.in: Update ax.c and IPA dependencies.
3753 * tracepoint.c (cmd_bigqtbuffer): Rename as ...
3754 (cmd_bigqtbuffer_circular): ... this. Only handle
3755 'QTBuffer:circular:'.
3756 (handle_tracepoint_general_set): Adjust.
3760 * inferiors.c: Move code to ...
3761 * dll.c: .... here. New.
3762 * server.h: Declare clear_dlls.
3763 * Makefile.in (SFILES): Add dll.c.
3769 * server.c: (handle_monitor_command): Add a new parameter
3771 (handle_query): Update caller.
3775 * configure.ac: Add readlink to AC_CHECK_FUNCS list.
3776 * configure, config.in: Regenerate.
3777 * hostio.c: Provide an alternate implementation if HAVE_READLINK
3782 Try SIGKILL first, then PTRACE_KILL.
3783 * linux-low.c (linux_kill_one_lwp): New.
3784 (linux_kill_one_lwp): Rename to ...
3785 (kill_one_lwp_callback): ... this. Use the new
3790 * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
3795 * linux-low.c (linux_child_pid_to_exec_file): Delete.
3796 (elf_64_file_p): Make static.
3797 (linux_pid_exe_is_elf_64_file): New.
3798 * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
3799 Delete declarations.
3800 (linux_pid_exe_is_elf_64_file): Declare.
3801 * linux-x86-low.c (x86_arch_setup): Use
3802 linux_pid_exe_is_elf_64_file.
3806 * linux-low.c (linux_wait_for_event_1): Rename to ...
3807 (linux_wait_for_event): ... here and merge it with former
3808 linux_wait_for_event - new variable wait_ptid, use it.
3809 (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
3813 * server.c (main): Avoid yet another case of infinite loop while
3814 detaching/killing after a longjmp.
3819 * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
3823 * hostio.c (handle_readlink): New function.
3824 (handle_vFile): Call it to handle "vFile:readlink" packets.
3829 * server.c (handle_v_requests): Only support vAttach and vRun to
3830 start multiple processes when in extended protocol mode.
3834 * tracepoint.c (initialize_tracepoint): Use mmap instead of
3835 memalign plus mprotect to allocate the scratch buffer.
3839 * server.c (attach_inferior): Clear `cont_thread'.
3843 * server.c (main): Avoid infinite loop while detaching/killing
3848 * server.c (start_inferior): Set last_ptid in --wrapper case.
3852 * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
3854 [IN_PROCESS_AGENT] (debug_agent): New global variable.
3858 * tracepoint.c (cmd_qtdp): Print debug message
3859 for static tracepoint.
3863 * tracepoint.c (trace_vdebug): Differentiate debug message
3864 between gdbserver and IPA.
3868 * tracepoint.c (tracepoint_was_hit): Don't collect for
3873 * terminal.h: Reformat copyright header.
3877 * server.c (gdbserver_version): Update copyright year.
3878 * gdbreplay.c (gdbreplay_version): Likewise.
3882 * linux-low.c (linux_create_inferior): Put empty if clause for write.
3886 * linux-low.c (linux_create_inferior): Save return value to ret.
3890 * linux-low.c (linux_create_inferior): Save return value to ret.
3894 * linux-low.c (linux_create_inferior): If stdio connection,
3895 redirect stdin from /dev/null, stdout to stderr.
3896 * remote-utils.c (remote_is_stdio): New static global.
3897 (remote_connection_is_stdio): New function.
3898 (remote_prepare): Handle stdio connection.
3899 (remote_open): Ditto.
3900 (remote_close): Don't close stdin for stdio connections.
3901 (read_prim,write_prim): New functions. Replace all calls to
3902 read/write to these.
3903 * server.c (main): Watch for "-" argument. Move call to
3904 remote_prepare before start_inferior.
3905 * server.h (STDIO_CONNECTION_NAME): New macro.
3906 (remote_connection_is_stdio): Declare.
3908 * remote-utils.c (prepare_resume_reply): Remove extraneous \n
3909 in debugging output.
3913 * tracepoint.c: Include sys/syscall.h.
3914 (gdb_ust_thread): Remove preprocessor conditional.
3918 * linux-low.c (linux_detach_one_lwp): Call
3919 the_low_target.prepare_to_resume before detaching.
3923 * tracepoint.c (gdb_ust_thread): Don't ignore return value
3928 * i386-low.c (i386_low_stopped_data_address): Initialize local
3935 * i386-low.c (i386_low_stopped_data_address): Avoid fetching
3936 DR_CONTROL unless necessary. Extend comments.
3937 * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
3938 DR0-3 if not used. If any watchpoint was set, clear DR_STATUS.
3942 * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
3944 (upload_fast_traceframes, upload_fast_traceframes): Likewise.
3948 * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
3949 Print new debug message for such case.
3953 Fix overlapping memcpy.
3954 * mem-break.c (set_raw_breakpoint_at): New variable buf. Use it for
3955 the read_inferior_memory transfer.
3956 (delete_fast_tracepoint_jump): New variable buf. Use it for the
3957 write_inferior_memory transfer.
3958 (set_fast_tracepoint_jump): New variable buf. Use it for the
3959 read_inferior_memory and write_inferior_memory transfers.
3960 (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
3961 (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
3962 Use it for the write_inferior_memory transfer.
3963 (check_mem_read, check_mem_write): New gdb_asserts for overlapping
3968 * linux-low.c (fetch_register, store_register): Make code
3969 consistent, fix formatting.
3973 * linux-low.c (usr_store_inferior_registers): Factor out code
3974 to handle individual registers into...
3975 (store_register): ... this new function.
3979 * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
3980 (s390-linux32v2.o, s390-linux32v2.c): Likewise.
3981 (s390-linux64v1.o, s390-linux64v1.c): Likewise.
3982 (s390-linux64v2.o, s390-linux64v2.c): Likewise.
3983 (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
3984 (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
3985 * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
3986 (srv_xmlfiles): Add new XML files.
3988 * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
3990 (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
3991 (init_registers_s390_linux32v1): Add prototype.
3992 (init_registers_s390_linux32v2): Likewise.
3993 (init_registers_s390_linux64v1): Likewise.
3994 (init_registers_s390_linux64v2): Likewise.
3995 (init_registers_s390x_linux64v1): Likewise.
3996 (init_registers_s390x_linux64v2): Likewise.
3997 (s390_num_regs): Increment to 52.
3998 (s390_regmap): Add orig_r2 register.
3999 (s390_num_regs_3264): Increment to 68.
4000 (s390_regmap_3264): Add orig_r2 register.
4001 (s390_collect_ptrace_register): Handle orig_r2 register.
4002 (s390_supply_ptrace_register): Likewise.
4003 (s390_fill_last_break): New function.
4004 (s390_store_last_break): Likewise.
4005 (s390_fill_system_call): New function.
4006 (s390_store_system_call): Likewise.
4007 (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
4009 (s390_check_regset): New function.
4010 (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
4011 NT_S390_SYSTEM_CALL regsets and use appropriate description.
4012 Update target_regsets for available register sets.
4017 * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
4018 (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
4020 (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
4021 * linux-low.h (struct process_info_private): New member r_debug.
4022 * server.c (handle_qxfer_libraries): Call
4023 the_target->qxfer_libraries_svr4.
4024 (handle_qxfer_libraries_svr4): New function.
4025 (qxfer_packets): New entry "libraries-svr4".
4026 (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
4027 * target.h (struct target_ops): New member qxfer_libraries_svr4.
4028 * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
4029 PACKET_qXfer_libraries_svr4.
4033 * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
4034 PSW address/mask between 8-byte and 16-byte formats.
4035 (s390_supply_ptrace_register): Likewise.
4036 (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
4037 basic addressing mode bit.
4041 * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
4045 * tracepoint.c (struct tracepoint): New field traceframe_usage.
4046 (tracing_start_time): New global.
4047 (tracing_stop_time): New global.
4048 (tracing_user_name): New global.
4049 (tracing_notes): New global.
4050 (tracing_stop_note): New global.
4051 (cmd_qtstart): Set traceframe_usage, start_time.
4052 (stop_tracing): Set stop_time.
4053 (cmd_qtstatus): Report additional status.
4054 (cmd_qtp): New function.
4055 (handle_tracepoint_query): Call it.
4056 (cmd_qtnotes): New function.
4057 (handle_tracepoint_general_set): Call it.
4058 (get_timestamp): Rename from tsv_get_timestamp.
4063 * linux-x86-low.c (small_jump_insn): New.
4064 (i386_install_fast_tracepoint_jump_pad): Add arguments for
4065 trampoline and error message, build a trampoline and issue a small
4066 jump instruction to it.
4067 (x86_install_fast_tracepoint_jump_pad): Add arguments for
4068 trampoline and error message.
4069 (x86_get_min_fast_tracepoint_insn_len): New.
4070 (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
4071 * linux-low.h (struct linux_target_ops): Add arguments to
4072 install_fast_tracepoint_jump_pad operation, add new operation.
4073 * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
4075 (linux_get_min_fast_tracepoint_insn_len): New function.
4076 (linux_target_op): Add new operation.
4077 * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
4078 (gdb_trampoline_buffer_end): Ditto.
4079 (gdb_trampoline_buffer_error): Ditto.
4080 (struct ipa_sym_addresses): Add fields for new IPA variables.
4081 (symbol_list): Add entries for new IPA variables.
4082 (struct tracepoint): Add fields to hold the address range of the
4083 trampoline used by the tracepoint.
4084 (trampoline_buffer_head): New static variable.
4085 (trampoline_buffer_tail): Ditto.
4086 (claim_trampoline_space): New function.
4087 (have_fast_tracepoint_trampoline_buffer): New function.
4088 (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
4090 (install_fast_tracepoint): Ditto, also add error buffer argument.
4091 (cmd_qtminftpilen): New function.
4092 (handle_tracepoint_query): Add response to qTMinFTPILen packet.
4093 (fast_tracepoint_from_trampoline_address): New function.
4094 (fast_tracepoint_collecting): Handle trampoline as part of jump
4096 (set_trampoline_buffer_space): New function.
4097 (initialize_tracepoint): Initialize new IPA variables.
4098 * target.h (struct target_ops): Add arguments to
4099 install_fast_tracepoint_jump_pad operation, add new
4100 get_min_fast_tracepoint_insn_len operation.
4101 (target_get_min_fast_tracepoint_insn_len): New.
4102 (install_fast_tracepoint_jump_pad): Add arguments.
4103 * server.h (IPA_BUFSIZ): Define.
4104 * linux-i386-ipa.c: Include extra header files.
4105 (initialize_fast_tracepoint_trampoline_buffer): New function.
4106 (initialize_low_tracepoint): Call it.
4107 * server.h (set_trampoline_buffer_space): Declare.
4108 (claim_trampoline_space): Ditto.
4109 (have_fast_tracepoint_trampoline_buffer): Ditto.
4113 * server.c (handle_query): Handle InstallInTrace for qSupported.
4114 * tracepoint.c (add_tracepoint): Sort list.
4115 (install_tracepoint, download_tracepoint): New.
4116 (cmd_qtdp): Call them to install and download tracepoints.
4117 (sort_tracepoints): Removed.
4118 (cmd_qtstart): Update.
4122 * mem-break.c (inc_ref_fast_tracepoint_jump): New.
4123 * mem-break.h: Declare.
4124 * tracepoint.c (cmd_qtstart): Move some code to ...
4125 (clone_fast_tracepoint, install_fast_tracepoint): ... here.
4127 (download_tracepoints): Move some code to ...
4128 (download_tracepoint_1): ... here. New.
4132 * remote-utils.c (relocate_instruction): A comment fix.
4136 * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
4137 (i386_dr_low_get_control, i386_dr_low_get_status): Use
4138 dr_status_mirror and dr_control_mirror from debug_reg_state.
4139 (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
4140 (i386_initial_stuff): Remove use of deleted globals.
4141 (i386_get_thread_context, i386_set_thread_context,
4142 i386_thread_added): Use dr_status_mirror and dr_control_mirror
4143 from debug_reg_state.
4147 * tracepoint.c (gdb_collect): Loop over tracepoints of same
4148 address as TPOINT's.
4152 * tracepoint.c (agent_mem_read_string): New function.
4153 (eval_agent_expr): Call it for tracenz.
4154 * server.c (handle_query): Report support for tracenz.
4158 * tracepoint.c (cmd_qtstart): Remove unused local variables.
4162 * target.h: Fix a typo in comment.
4166 * mem-break.c (check_mem_write): Add `myaddr' parameter. Don't
4167 clobber the breakpoints' shadows with fast tracepoint jumps.
4168 * mem-break.h (check_mem_write): Add `myaddr' parameter.
4169 * target.c (write_inferior_memory): Also pass MYADDR down to
4174 * configure.ac: Check support for personality routine.
4175 * configure: Regenerate.
4176 * config.in: Likewise.
4177 * linux-low.c: Include <sys/personality.h>.
4178 Define ADDR_NO_RANDOMIZE if necessary.
4179 (linux_create_inferior): Disable address space randomization when
4180 forking inferior, if requested.
4181 (linux_supports_disable_randomization): New function.
4182 (linux_target_ops): Install it.
4183 * server.h (disable_randomization): Declare.
4184 * server.c (disable_randomization): New global variable.
4185 (handle_general_set): Handle QDisableRandomization.
4186 (handle_query): Likewise for qSupported.
4187 (main): Support --disable-randomization and --no-disable-randomization
4188 command line arguments.
4189 * target.h (struct target_ops): Add supports_disable_randomization.
4190 (target_supports_disable_randomization): New macro.
4194 * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
4196 [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
4197 [!PT_GETDSBT] (target_loadmap): New definition.
4198 (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
4199 (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
4200 LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
4201 and PT_GETDSBT to LINUX_LOADMAP.
4202 [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
4203 (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
4207 * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
4208 (arm_linux_hwbp_cap): New static variable.
4209 (arm_linux_get_hwbp_cap): Replace by ...
4210 (arm_linux_init_hwbp_cap): ... this new function.
4211 (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
4212 (arm_linux_get_hw_watchpoint_count): Likewise.
4213 (arm_linux_get_hw_watchpoint_max_length): Likewise.
4214 (arm_arch_setup): Call arm_linux_init_hwbp_cap.
4215 (arm_prepare_to_resume): Use perror_with_name instead of error.
4219 * linux-arm-low.c: Include <signal.h>.
4220 (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
4221 (struct arm_linux_hwbp_cap): New data type.
4222 (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
4223 (struct arm_linux_hw_breakpoint): New data type.
4224 (MAX_BPTS, MAX_WPTS): Define.
4225 (struct arch_process_info, struct arch_lwp_info): New data types.
4226 (arm_linux_get_hwbp_cap): New function.
4227 (arm_linux_get_hw_breakpoint_count): Likewise.
4228 (arm_linux_get_hw_watchpoint_count): Likewise.
4229 (arm_linux_get_hw_watchpoint_max_length): Likewise.
4230 (arm_hwbp_control_initialize): Likewise.
4231 (arm_hwbp_control_is_enabled): Likewise.
4232 (arm_hwbp_control_is_initialized): Likewise.
4233 (arm_hwbp_control_disable): Likewise.
4234 (arm_linux_hw_breakpoint_equal): Likewise.
4235 (arm_linux_hw_point_initialize): Likewise.
4236 (struct update_registers_data): New data structure.
4237 (update_registers_callback: New function.
4238 (arm_insert_point): Likewise.
4239 (arm_remove_point): Likewise.
4240 (arm_stopped_by_watchpoint): Likewise.
4241 (arm_stopped_data_address): Likewise.
4242 (arm_new_process): Likewise.
4243 (arm_new_thread): Likewise.
4244 (arm_prepare_to_resume): Likewise.
4245 (the_low_target): Register arm_insert_point, arm_remove_point,
4246 arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
4247 arm_new_thread, and arm_prepare_to_resume.
4251 * server.h (struct emit_ops): Add compare-goto fields.
4252 * tracepoint.c (gdb_agent_op_sizes): New table.
4253 (emit_eq_goto): New function.
4254 (emit_ne_goto): New function.
4255 (emit_lt_goto): New function.
4256 (emit_le_goto): New function.
4257 (emit_gt_goto): New function.
4258 (emit_ge_goto): New function.
4259 (is_goto_target): New function.
4260 (compile_bytecodes): Recognize special cases of compare-goto
4261 combinations and call specialized emitters for them.
4262 * linux-x86-low.c (amd64_emit_eq_goto): New function.
4263 (amd64_emit_ne_goto): New function.
4264 (amd64_emit_lt_goto): New function.
4265 (amd64_emit_le_goto): New function.
4266 (amd64_emit_gt_goto): New function.
4267 (amd64_emit_ge_goto): New function.
4268 (amd64_emit_ops): Add the new functions.
4269 (i386_emit_eq_goto): New function.
4270 (i386_emit_ne_goto): New function.
4271 (i386_emit_lt_goto): New function.
4272 (i386_emit_le_goto): New function.
4273 (i386_emit_gt_goto): New function.
4274 (i386_emit_ge_goto): New function.
4275 (i386_emit_ops): Add the new functions.
4279 * linux-x86-low.c (i386_emit_prologue): Save %ebx.
4280 (i386_emit_epilogue): Restore %ebx.
4284 * server.c (step_thread): Remove definition.
4285 (process_serial_event): Don't handle Hs.
4286 * server.h (step_thread): Remove declaration.
4287 * target.c (set_desired_inferior): Remove use of step_thread.
4291 * linux-low.c: Include linux-procfs.h.
4292 (linux_attach_lwp_1): Update comments.
4293 (linux_attach): Scan for existing threads when attaching to a
4294 process that is the tgid.
4295 * Makefile.in: Update dependencies.
4299 * configure.srv: Add linux-procfs.o dependencies.
4303 * target.h (struct target_ops): Fix indent.
4304 * win32-low.c (win32_target_ops): Fix comment.
4309 * Makefile.in (clean): Remove tic6x-*.c files.
4310 (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
4311 (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
4312 (tic6x-c64xp-linux.c): Likewise.
4313 * configure.srv: Add support for tic6x-*-uclinux.
4314 * linux-tic6x-low.c: New.
4315 * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
4320 * target.h (struct target_ops): Add read_loadmap.
4321 * linux-low.c (struct target_loadseg): New type.
4322 (struct target_loadmap): New type.
4323 (linux_read_loadmap): New function.
4324 (linux_target_ops): Add linux_read_loadmap.
4325 * server.c (handle_query): Support qXfer:fdpic:read packet.
4326 * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
4331 * win32-low.c: Include <stdint.h>.
4335 * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
4336 to the inferior here.
4337 (i386_remove_aligned_watchpoint): Ditto.
4338 (i386_handle_nonaligned_watchpoint): Return immediate on fail to
4339 fit part of the watchpoint in the debug registers.
4340 (i386_update_inferior_debug_regs): New.
4341 (i386_low_insert_watchpoint): Work on a local mirror of the debug
4342 registers, and only update the inferior on success.
4343 (i386_low_remove_watchpoint): Ditto.
4347 * linux-low.c (compare_ints, unique, list_threads, show_process,
4348 linux_core_of_thread): Delete.
4349 (linux_target_ops): Change linux_core_of_thread to
4350 linux_common_core_of_thread.
4351 (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
4352 * utils.c (malloc_failure): Change type of argument.
4353 (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
4354 * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
4355 common/linux-osdata.c, common/ptid.c and common/buffer.c.
4356 (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
4357 (IPA_OBJS): Add common-utils-ipa.o.
4358 (ptid_h, linux_osdata_h): New macros.
4359 (server_h): Add common/common-utils.h, common/xml-utils.h,
4360 common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
4362 (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
4363 ptid.o, buffer.o): New rules.
4364 (linux-low.o): Add common/linux-osdata.h as a dependency.
4365 * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
4366 * configure.ac: Add AC_HEADER_DIRENT check.
4367 * config.in: Regenerate.
4368 * configure: Regenerate.
4369 * remote-utils.c (xml_escape_text): Delete.
4370 (buffer_grow, buffer_free, buffer_init, buffer_finish,
4371 buffer_xml_printf): Move to common/buffer.c.
4372 * server.c (main): Remove call to initialize_inferiors.
4373 * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
4374 ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
4375 ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
4376 internal_error, gdb_assert, gdb_assert_fail): Delete.
4377 (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
4378 buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
4380 * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
4381 ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
4382 initialize_inferiors): Delete.
4386 * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
4391 * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
4393 * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
4397 * Makefile.in (thread-db.o): Track dependence to
4398 common/gdb_thread_db.h.
4399 * thread-db.c: include gdb_thread_db.h from right place.
4403 * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
4404 __FILE__ and __LINE__ to internal_error.
4408 * thread-db.c (try_thread_db_load_from_sdir): New function.
4409 (try_thread_db_load_from_dir): New function.
4410 (thread_db_load_search): Handle $sdir, ignore $pdir.
4411 Remove trying of system directories if search of
4412 libthread-db-search-path fails, that is now done via $sdir.
4416 * server.c (handle_query): Add EnableDisableTracepoints to the list
4417 of supported features.
4418 * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
4420 (cmd_qtenable_disable): New.
4421 (cmd_qtstart): Install tracepoints even if disabled.
4422 (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
4423 receiving a QTEnable or QTDisable packet.
4424 (gdb_collect): Skip data collection if fast tracepoint is disabled.
4425 (ust_marker_to_static_tracepoint): Do not ignore disabled static
4427 (gdb_probe): Skip data collection if static tracepoint is disabled.
4431 * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
4435 * linux-low.c (linux_join): Skip process lookup.
4436 * spu-low.c (spu_join): Ditto.
4437 * server.c (join_inferiors_callback): Delete.
4438 (process_serial_event): For 'D' packet (detach) call join_inferior
4443 * README: Don't mention xscale*-*-linux*.
4444 * configure.srv (xscale*-*-linux*): Don't handle target.
4448 * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
4450 (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
4451 (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
4452 (i386_emit_void_call_2): Likewise.
4456 * linux-low.c: Move common macros to linux-ptrace.h.
4457 Include linux-ptrace.h.
4458 * Makefile.in (linux_ptrace_h): New.
4459 (linux-low.o): Depends on linux-ptrace.h.
4463 * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
4464 RUN_ONCE. Comment for the LISTEN_DESC delete_file_handler call.
4465 (remote_prepare): New function with most of the TCP code from ...
4466 (remote_open): ... here. Detect PORT here unconditionally. Move also
4467 setting transport_is_reliable.
4468 * server.c (run_once): New variable.
4469 (gdbserver_usage): Document it.
4470 (main): Set run_once for `--once'. Call remote_prepare. Exit after
4471 the first run if RUN_ONCE.
4472 * server.h (run_once, remote_prepare): New declarations.
4476 * win32-low.c (handle_load_dll): Remove duplicate "the".
4480 Remove support for old Cygwin 1.5 versions.
4481 * win32-low.c (win32_create_inferior): Use new cygwin_path_list
4482 function to avoid warning.
4483 (win32_add_one_solib): Use cygwin_conv_path function to avoid
4488 * gdbserver/server.h (Macro _): Define it if not available.
4492 * hostio.c (handle_close): Remove unnecessary null test.
4496 * Makefile.in (maintainer-clean realclean distclean): Remove
4497 "make ... subdir_do" command.
4501 * tracepoint.c (tracepoint_finish_step): Fix loop variable.
4503 * server.c (handle_v_run): Free alloced buffer on early return.
4510 * Makefile.in: Remove GNU make feature --directory.
4514 * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
4515 (subdir_do): New make target. Copied from gdb/Makefile.
4516 (maintainer-clean, realclean, distclean, clean): Call corresponding
4517 make targets in common/Makefile.
4521 * configure.ac: Call AC_PROG_RANLIB.
4522 * Makefile.in: Remove signals.o from OBS. Link libcommon.a.
4523 * configure: Regenerate.
4527 * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
4531 * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
4535 * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
4536 (subdir_do): New make target. Copied from gdb/Makefile.
4537 (maintainer-clean, realclean, distclean, clean): Call corresponding
4538 make targets in common/Makefile.
4542 * Makefile.in: Remove GNU make feature --directory.
4546 * server.c (queue_stop_reply): Call xmalloc not malloc.
4550 * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
4554 * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
4555 (cmd_qtframe): Ditto.
4556 (cmd_qtbuffer): Ditto.
4557 (cmd_bigqtbuffer): Ditto.
4559 * utils.c (decimal2str): Initialize 'width' to nine, then
4564 * hostio.c (require_data): Free *data, not data.
4568 * hostio.c (require_data): Use free, not xfree.
4572 * server.c (handle_query): Discard unused value.
4574 * hostio.c (require_data): Free malloc memory before returning
4579 * linux-low.c (list_threads): Call closedir for dirent.
4583 * i386-low.c (i386-length_and_rw_bits): Comment the fact that
4584 a case statement falls through.
4586 * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
4588 * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
4593 * utils.c (decimal2str): Eliminate dead code and dead param.
4594 (pulongest): Drop dead param from call to decimal2str.
4599 Revert the following patch (not approved yet):
4601 * tracepoint.c (tp_printf): New function.
4602 (eval_agent_expr): Handle gdb_agent_op_printf.
4606 * tracepoint.c (tp_printf): New function.
4607 (eval_agent_expr): Handle gdb_agent_op_printf.
4611 * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
4612 (tracepoint.o): Likewise.
4613 * tracepoint.c (enum gdb_agent_op): Use ax.def.
4614 (gdb_agent_op_names): Likewise.
4618 * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
4619 gdb_agent_op_rot>: New constants.
4620 (gdb_agent_op_names): Add pick and roll.
4621 (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
4626 * aclocal.m4: Regenerated with aclocal-1.11.1.
4630 * server.c (handle_qxfer_traceframe_info): New.
4631 (qxfer_packets): Register "traceframe-info".
4632 (handle_query): Report support for qXfer:traceframe-info:read+.
4633 * tracepoint.c (match_blocktype): New.
4634 (traceframe_find_block_type): Rename to ...
4635 (traceframe_walk_blocks): ... this. Add callback filter argument,
4637 (traceframe_find_block_type): New, reimplemented on top of
4638 traceframe_walk_blocks.
4639 (build_traceframe_info_xml): New.
4640 (traceframe_read_info): New.
4641 * server.h (traceframe_read_info): Declare.
4645 * configure.ac: Call AC_PROG_RANLIB.
4646 * Makefile.in: Remove signals.o from OBS. Link libcommon.a.
4647 * configure: Regenerate.
4651 * server.c (gdb_read_memory): Change return semantics to allow
4653 (handle_search_memory_1): Adjust.
4654 (process_serial_event) <'m' packet>: Handle partial transfers.
4655 * tracepoint.c (traceframe_read_mem): Handle partial transfers.
4659 * regcache.c (init_register_cache): Initialize
4660 regcache->register_status.
4661 (free_register_cache): Release regcache->register_status.
4662 (regcache_cpy): Copy register_status.
4663 (registers_to_string): Print 'x's for unavailable registers.
4664 (supply_register): Mark the register's status valid or
4665 unavailable, depending on whether a buffer was passed in or not.
4666 (supply_register_zeroed): New.
4667 (supply_regblock): Mark the registers' status valid or
4668 unavailable, depending on whether a buffer was passed in or not.
4669 * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
4670 (struct regcache): New `register_status' field.
4671 (supply_register_zeroed): Declare.
4672 * i387-fp.c (i387_xsave_to_cache): Zero out registers using
4673 supply_register_zeroed, rather than passing a NULL buffer to
4675 * tracepoint.c (fetch_traceframe_registers): Update comment.
4679 * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
4684 * server.h (decode_xfer_write): Change prototype.
4685 * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
4686 and don't extract the annex here.
4687 * server.c (decode_xfer_read): Remove `annex' parameter,
4688 and don't extract the annex here.
4690 (struct qxfer): New.
4691 (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
4692 (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
4693 (handle_qxfer_statictrace): New functions, abstracted out from
4694 handle_query, and made to use the struct qxfer interface.
4695 (handle_threads_qxfer_proper): Rename to ...
4696 (handle_qxfer_threads_proper): ... this.
4697 (handle_threads_qxfer): Rename to ...
4698 (handle_qxfer_threads): ... this. Adjust.
4699 (qxfer_packets): New array.
4700 (handle_qxfer): New function.
4701 (handle_query): Use handle_qxfer.
4705 * gdbreplay.c: Shorten lines of >= 80 columns.
4706 * linux-low.c: Ditto.
4707 * linux-ppc-low.c: Ditto.
4708 * linux-s390-low.c: Ditto.
4709 * linux-sparc-low.c: Ditto.
4710 * linux-x86-low.c: Ditto.
4711 * linux-xtensa-low.c: Ditto.
4712 * mem-break.c: Ditto.
4714 * regcache.h: Ditto.
4715 * remote-utils.c: Ditto.
4718 * thread-db.c: Ditto.
4719 * tracepoint.c: Ditto.
4721 * win32-low.h: Ditto.
4725 * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
4730 * server.c (gdbserver_version): Update copyright year in version
4732 * gdbreplay.c (gdbreplay_version): Ditto.
4736 * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
4737 * linux-bfin-low.c: New file.
4738 * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
4739 PT_DATA_ADDR for BFIN targets.
4740 * Makefile.in (SFILES): Add linux-bfin-low.c.
4741 (clean): Remove reg-bfin.c.
4742 (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
4743 * README: Mention supported Blackfin targets.
4747 * .gitignore: New file.
4751 * linux-low.c (linux_tracefork_child): Add char* cast to arg.
4755 * Makefile.in: Add FLAGS_TO_PASS variable.
4756 (install): Remove dependency of install-only and recursively
4757 invoke make for install-only.
4761 * Makefile.in (uninstall): Use $(DESTDIR).
4767 * linux-x86-low.c (compat_siginfo_from_siginfo)
4768 (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
4769 si_code is < 0. Check for si_code == SI_TIMER before checking for
4774 * lynx-i386-low.c: New file.
4775 * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
4779 * lynx-low.c (ptrace_request_to_str): Remove handling for
4780 request values that have been removed in LynxOS 5.x.
4784 * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
4789 * configure.ac: Add --enable-inprocess-agent option.
4790 * configure: Rebuilt.
4794 * linux-low.c (linux_kill): Remove unused variable.
4795 (linux_stabilize_threads): Likewise.
4796 * server.c (start_inferior): Likewise.
4797 (queue_stop_reply_callback): Likewise.
4798 * tracepoint.c (do_action_at_tracepoint): Likewise.
4802 * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
4807 * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
4811 * Makefile.in (install-only): Replace $IPA_DEPFILES with
4816 * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
4817 gdbserver/lynx-ppc-low.c: New files.
4818 * Makefile.in (lynx_low_h): New variable.
4819 (lynx-low.o, lynx-ppc-low.o): New rules.
4820 * configure.ac: On LynxOS, link with -lnetinet.
4821 * configure.srv: Add handling of powerpc-*-lynxos* targets.
4822 * configure: regenerate.
4826 * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
4827 * configure.ac: Add check for vasprintf and vsnprintf.
4828 * configure, config.in: Regenerate.
4829 * server.h (vasprintf, vsnprintf): Add conditional declarations.
4833 * gdbreplay.c: Move include of alloca.h up, next to include of
4835 * server.h: Add include of malloc.h.
4836 * mem-break.c: Remove include of malloc.h.
4837 * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
4841 * Makefile.in (memmem.o): Build with -Wno-error.
4845 * utils.c (xsnprintf): Make non-static.
4846 * server.h: Add xsnprintf declaration.
4847 * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
4848 replace calls to snprintf by calls to xsnprintf throughout.
4852 * configure.ac: Add configure check for alloca.
4853 * configure, config.in: Regenerate.
4854 * server.h: Include alloca.h if it exists.
4855 * gdbreplay.c: Include alloca.h if it exists.
4859 * linux-low.c (__SIGRTMIN): Define if not already defined.
4860 (linux_create_inferior): Check for __ANDROID__ rather than
4862 (enqueue_one_deferred_signal): Don't requeue non-RT signals that
4863 are already deferred.
4864 (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
4865 (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
4866 stopped and already has a pending signal to report.
4867 (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
4868 a pending signal to report or is moving out of a jump pad.
4869 (linux_init_signals): Check for __ANDROID__ rather than
4874 * linux-low.c (linux_stabilize_threads): Wrap debug output in a
4875 debug_threads check. Avoid a linear search when not doing debug
4880 * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
4881 (struct gdb_event) <fd>: Change type to gdb_fildes_t.
4882 (struct file_handler) <fd>: Change type to gdb_fildes_t.
4883 (process_event): Change local fd's type to gdb_fildes_t.
4884 (create_file_handler): Adjust prototype.
4885 (delete_file_handler): Adjust prototype.
4886 (handle_file_event): Adjust prototype. Use pfildes.
4887 (create_file_event): Adjsut prototype.
4888 * remote-utils.c (remote_desc, listen_desc): Change type to
4890 * server.h: New gdb_fildes_t typedef.
4891 [USE_WIN32API]: Include winsock2.h.
4892 (delete_file_handler, add_file_handler): Adjust prototypes.
4894 * utils.c (pfildes): New.
4898 * configure.ac (build_warnings): Add -Wno-char-subscripts.
4899 * configure: Regenerate.
4903 * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
4904 (linux_done_accessing_memory): ... this.
4905 (linux_target_ops): Adjust.
4906 * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
4907 * nto-low.c (nto_target_ops): Adjust comment.
4908 * server.c (gdb_read_memory, gdb_write_memory): Adjust.
4909 * spu-low.c (spu_target_ops): Adjust comment.
4910 * target.h (target_ops): Rename unprepare_to_access_memory field
4911 to done_accessing_memory.
4912 (unprepare_to_access_memory): Rename to ...
4913 (done_accessing_memory): ... this.
4917 * linux-low.c (linux_prepare_to_access_memory): New.
4918 (linux_unprepare_to_access_memory): New.
4919 (linux_target_ops): Install them.
4920 * server.c (read_memory): Rename to ...
4921 (gdb_read_memory): ... this. Use
4922 prepare_to_access_memory/prepare_to_access_memory.
4923 (write_memory): Rename to ...
4924 (gdb_write_memory): ... this. Use
4925 prepare_to_access_memory/prepare_to_access_memory.
4926 (handle_search_memory_1): Adjust.
4927 (process_serial_event): Adjust.
4928 * target.h (struct target_ops): New fields
4929 prepare_to_access_memory and unprepare_to_access_memory.
4930 (prepare_to_access_memory, unprepare_to_access_memory): New.
4931 * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
4932 prepare_to_access_memory/prepare_to_access_memory.
4933 * nto-low.c (nto_target_ops): Adjust.
4934 * spu-low.c (spu_target_ops): Adjust.
4935 * win32-low.c (win32_target_ops): Adjust.
4939 * Makefile.in (WARN_CFLAGS): Get it from configure.
4940 (WERROR_CFLAGS): New.
4941 (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
4942 * configure.ac: Introduce --enable-werror, which adds -Werror to
4943 the compiler command line. Enabled by default. Disable with
4944 --disable-werror. Add -Wdeclaration-after-statement
4945 Wpointer-arith and -Wformat-nonliteral to warning flags.
4946 * configure: Regenerate.
4950 * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
4954 * gdbreplay.c (remote_error): New.
4956 (expect): Use gdbchar. Check for error reading from GDB.
4957 Clarify sync error output.
4958 (play): Check for errors writing to GDB.
4959 * linux-low.c (sigchld_handler): Really ignore `write' errors.
4960 * remote-utils.c (getpkt): Check for errors writing to the remote
4965 * linux-low.c (linux_wait_1): Move non-debugging code out of
4966 `debug_threads' control.
4970 * linux-low.c (linux_wait_1): Don't set last_status here.
4971 * server.c (push_event, queue_stop_reply_callback): Assert we're
4972 not pushing a TARGET_WAITKIND_IGNORE event.
4973 (start_inferior, start_inferior, attach_inferior, handle_v_cont)
4974 (myresume, handle_target_event): Set the thread's last_resume_kind
4975 and last_status from the target returned status.
4981 * linux-x86-low.c (update_debug_registers_callback): New.
4982 (i386_dr_low_set_addr): Use it.
4983 (i386_dr_low_get_addr): New.
4984 (i386_dr_low_set_control): Use update_debug_registers_callback.
4985 (i386_dr_low_get_control): New.
4986 (i386_dr_low_get_status): Adjust.
4987 * linux-low.c (linux_stop_lwp): New.
4988 * linux-low.h (linux_stop_lwp): Declare.
4990 * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
4991 argument instead of a i386_debug_reg_state.
4992 (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
4993 a i386_debug_reg_state.
4994 (i386_insert_aligned_watchpoint): Adjust.
4995 (i386_remove_aligned_watchpoint): Adjust.
4996 (i386_low_stopped_data_address): Read the debug registers from the
4997 inferior instead of from the mirrors.
4998 * i386-low.h (struct i386_debug_reg_state): Extend comment.
4999 (i386_dr_low_get_addr): Declare.
5000 (i386_dr_low_get_control): Declare.
5001 (i386_dr_low_get_status): Change prototype.
5003 * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
5004 (i386_dr_low_get_addr): New.
5005 (i386_dr_low_get_control): New.
5006 (i386_dr_low_get_status): Adjust prototype. Return
5008 (i386_initial_stuff): Clear dr_status_mirror and
5010 (i386_get_thread_context): Adjust.
5011 (i386_set_thread_context): Adjust.
5012 (i386_thread_added): Adjust.
5016 * linux-low.h (linux_thread_area): Delete declaration.
5020 * linux-low.c (linux_wait_1): Correctly return the ptid of the child
5021 after its termination.
5025 * linux-low.c (gdb_wants_lwp_stopped): Delete.
5026 (gdb_wants_all_stopped): Delete.
5027 (linux_wait_1): Don't call them.
5028 * server.c (handle_v_cont): Tag all threads as want-stopped.
5029 (gdb_wants_thread_stopped): Fix comments. Tag the thread that
5030 stopped as "client-wants-stopped".
5034 * Makefile.in (signals_h): New.
5035 (server_h): Depend on it.
5036 (server.o): Don't depend on $(signals_def).
5037 (signals.o): Depend on $(signals_def).
5041 * Makefile.in (signals_def): New.
5042 (server_h): Append include/gdb/signals.h and signals_def.
5043 (server.o): Append signals_def.
5047 * server.c (handle_target_event): Use target_signal_to_host for
5048 resume_info.sig initialization.
5049 * target.h (struct thread_resume) <sig>: New comment.
5053 * server.c (handle_query): strcpy() the returned string from paddress()
5054 instead of sprintf().
5055 * utils.c (paddress): Return phex_nz().
5059 * server.c (handle_v_cont): Call mourn_inferior if process
5061 (myresume): Likewise.
5065 Static tracepoints, and integration with UST.
5067 * configure.ac: Handle --with-ust. substitute ustlibs and ustinc.
5068 * mem-break.c (uninsert_all_breakpoints)
5069 (reinsert_all_breakpoints): New.
5070 * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
5071 * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
5072 (gdb_agent_ust_loaded, helper_thread_id)
5073 (gdb_agent_helper_thread_id): New macros.
5074 (struct ipa_sym_addresses): Add addr_ust_loaded,
5075 addr_helper_thread_id, addr_cmd_buf.
5076 (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
5077 (in_process_agent_loaded_ust): New.
5078 (write_e_ust_not_loaded): New.
5079 (maybe_write_ipa_ust_not_loaded): New.
5080 (struct collect_static_trace_data_action): New.
5081 (enum tracepoint_type) <static_tracepoint>: New.
5082 (struct tracepoint) <handle>: Mention static tracepoints.
5083 (struct static_tracepoint_ctx): New.
5084 (CMD_BUF_SIZE): New.
5085 (add_tracepoint_action): Handle static tracepoint actions.
5086 (unprobe_marker_at): New.
5087 (clear_installed_tracepoints): Handle static tracepoints.
5088 (cmd_qtdp): Handle static tracepoints.
5089 (probe_marker_at): New.
5090 (cmd_qtstart): Handle static tracepoints.
5091 (response_tracepoint): Handle static tracepoints.
5092 (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
5093 (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
5094 (get_context_regcache): Handle static tracepoints.
5095 (do_action_at_tracepoint): Handle static tracepoint actions.
5096 (traceframe_find_block_type): Handle static trace data blocks.
5097 (traceframe_read_sdata): New.
5098 (download_tracepoints): Download static tracepoint actions.
5099 [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
5100 (GDB_PROBE_NAME): New.
5105 (ust_marker_to_static_tracepoint): New.
5107 (collect_ust_data_at_tracepoint): New.
5108 (gdb_ust_probe): New.
5109 (UNIX_PATH_MAX, SOCK_DIR): New.
5110 (gdb_ust_connect_sync_socket): New.
5111 (resume_thread, stop_thread): New.
5112 (run_inferior_command): New.
5113 (init_named_socket): New.
5114 (gdb_ust_socket_init): New.
5115 (cstr_to_hexstr): New.
5117 (first_marker, next_marker): New.
5118 (response_ust_marker): New.
5119 (cmd_qtfstm, cmd_qtsstm): New.
5120 (unprobe_marker_at, probe_marker_at): New.
5121 (cmd_qtstmat, gdb_ust_thread): New.
5122 (gdb_ust_init): New.
5123 (initialize_tracepoint_ftlib): Call gdb_ust_init.
5124 * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
5126 (x86_64_st_collect_regmap): New.
5127 (X86_64_NUM_ST_COLLECT_GREGS): New.
5128 (AMD64_RIP_REGNUM): New.
5129 (supply_static_tracepoint_registers): New.
5130 * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
5132 (i386_st_collect_regmap): New.
5133 (i386_NUM_ST_COLLECT_GREGS): New.
5134 (supply_static_tracepoint_registers): New.
5135 * server.c (handle_query): Handle qXfer:statictrace:read.
5136 <qSupported>: Report support for StaticTracepoints, and
5137 qXfer:statictrace:read features.
5138 * server.h (traceframe_read_sdata)
5139 (supply_static_tracepoint_registers): Declare.
5140 * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
5141 (unpack_varlen_hex): Include in IPA build.
5142 * Makefile.in (ustlibs, ustinc): New.
5143 (IPA_OBJS): Add remote-utils-ipa.o.
5144 ($(IPA_LIB)): Link -ldl and -lpthread.
5146 (IPAGENT_CFLAGS): Add UST_CFLAGS.
5147 * config.in, configure: Regenerate.
5152 * linux-x86-low.c (always_true): Delete.
5153 (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
5154 trying to fool the compiler with always_true.
5158 * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
5159 conditions in gdbserver.
5163 * spu-low.c (spu_read_memory): Wrap around local store limit.
5164 (spu_write_memory): Likewise.
5168 * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
5169 (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
5171 * server.h (struct emit_ops): Replace int64_t uses with LONGEST
5173 * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
5174 uses with LONGEST uses.
5181 * linux-x86-low.c: Include limits.h.
5186 (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
5187 (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
5188 (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
5189 (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
5190 (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
5191 (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
5192 (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
5193 (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
5194 (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
5195 (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
5196 (amd64_emit_void_call_2): New.
5197 (amd64_emit_ops): New.
5198 (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
5199 (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
5200 (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
5201 (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
5202 (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
5203 (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
5204 (i386_emit_goto, i386_write_goto_address, i386_emit_const)
5205 (i386_emit_call, i386_emit_reg, i386_emit_pop)
5206 (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
5207 (i386_emit_stack_adjust, i386_emit_int_call_1)
5208 (i386_emit_void_call_2): New.
5209 (i386_emit_ops): New.
5210 (x86_emit_ops): New.
5211 (the_low_target): Install x86_emit_ops.
5212 * server.h (struct emit_ops): New.
5213 (get_raw_reg_func_addr): Declare.
5214 (current_insn_ptr, emit_error): Declare.
5215 * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
5216 (set_trace_state_variable_value): New defines.
5217 (struct ipa_sym_addresses): New fields addr_get_raw_reg,
5218 addr_get_trace_state_variable_value and
5219 addr_set_trace_state_variable_value.
5220 (symbol_list): New fields for get_raw_reg,
5221 get_trace_state_variable_value and set_trace_state_variable_value.
5222 (condfn): New typedef.
5223 (struct tracepoint): New field `compiled_cond'.
5224 (do_action_at_tracepoint): Clear compiled_cond.
5225 (get_trace_state_variable_value, set_trace_state_variable_value):
5227 (condition_true_at_tracepoint): If there's a compiled condition,
5229 (current_insn_ptr, emit_error): New globals.
5230 (struct bytecode_address): New.
5231 (get_raw_reg_func_addr): New.
5232 (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
5233 (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
5234 (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
5235 (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
5236 (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
5237 (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
5238 (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
5239 (compile_tracepoint_condition, compile_bytecodes): New.
5240 * target.h (emit_ops): Forward declare.
5241 (struct target_ops): New field emit_ops.
5242 (target_emit_ops): New.
5243 * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
5244 * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
5245 * linux-low.c (linux_emit_ops): New.
5246 (linux_target_ops): Install it.
5247 * linux-low.h (struct linux_target_ops): New field emit_ops.
5251 * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
5252 * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
5257 * Makefile.in (IPA_DEPFILES, extra_libraries): New.
5258 (all): Depend on $(extra_libraries).
5259 (install-only): Install the IPA.
5260 (IPA_OBJS, IPA_LIB): New.
5261 (clean): Remove the IPA lib.
5262 (IPAGENT_CFLAGS): New.
5263 (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
5264 (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
5265 (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
5266 * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
5267 * configure.ac: Check for atomic builtins support in the compiler.
5268 (IPA_DEPFILES, extra_libraries): Define.
5269 * configure.srv (ipa_obj): Add description.
5270 (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
5271 (i[34567]86-*-linux*): Set ipa_obj.
5272 (x86_64-*-linux*): Set ipa_obj.
5273 * linux-low.c (stabilizing_threads): New.
5274 (supports_fast_tracepoints): New.
5275 (linux_detach): Stabilize threads before detaching.
5276 (handle_tracepoints): Handle internal tracing breakpoints. Assert
5277 the lwp is either not stabilizing, or is moving out of a jump pad.
5278 (linux_fast_tracepoint_collecting): New.
5279 (maybe_move_out_of_jump_pad): New.
5280 (enqueue_one_deferred_signal): New.
5281 (dequeue_one_deferred_signal): New.
5282 (linux_wait_for_event_1): If moving out of a jump pad, defer
5283 pending signals to later.
5284 (linux_stabilize_threads): New.
5285 (linux_wait_1): Check if threads need moving out of jump pads, and
5287 (stuck_in_jump_pad_callback): New.
5288 (move_out_of_jump_pad_callback): New.
5290 (linux_resume_one_lwp): Handle moving out of jump pads.
5291 (linux_set_resume_request): Dequeue deferred signals.
5292 (need_step_over_p): Also step over fast tracepoint jumps.
5293 (start_step_over): Also uninsert fast tracepoint jumps.
5294 (finish_step_over): Also reinsert fast tracepoint jumps.
5295 (linux_install_fast_tracepoint_jump): New.
5296 (linux_target_ops): Install linux_stabilize_threads and
5297 linux_install_fast_tracepoint_jump_pad.
5298 * linux-low.h (linux_target_ops) <get_thread_area,
5299 install_fast_tracepoint_jump_pad>: New fields.
5300 (struct lwp_info) <collecting_fast_tracepoint,
5301 pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
5302 (linux_get_thread_area): Declare.
5303 * linux-x86-low.c (jump_insn): New.
5304 (x86_get_thread_area): New.
5305 (append_insns): New.
5307 (amd64_install_fast_tracepoint_jump_pad): New.
5308 (i386_install_fast_tracepoint_jump_pad): New.
5309 (x86_install_fast_tracepoint_jump_pad): New.
5310 (the_low_target): Install x86_get_thread_area and
5311 x86_install_fast_tracepoint_jump_pad.
5312 * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
5313 (struct fast_tracepoint_jump): New.
5314 (fast_tracepoint_jump_insn): New.
5315 (fast_tracepoint_jump_shadow): New.
5316 (find_fast_tracepoint_jump_at): New.
5317 (fast_tracepoint_jump_here): New.
5318 (delete_fast_tracepoint_jump): New.
5319 (set_fast_tracepoint_jump): New.
5320 (uninsert_fast_tracepoint_jumps_at): New.
5321 (reinsert_fast_tracepoint_jumps_at): New.
5322 (set_breakpoint_at): Use write_inferior_memory.
5323 (uninsert_raw_breakpoint): Use write_inferior_memory.
5324 (check_mem_read): Mask out fast tracepoint jumps.
5325 (check_mem_write): Mask out fast tracepoint jumps.
5326 * mem-break.h (struct fast_tracepoint_jump): Forward declare.
5327 (set_fast_tracepoint_jump): Declare.
5328 (delete_fast_tracepoint_jump)
5329 (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
5330 (reinsert_fast_tracepoint_jumps_at): Declare.
5331 * regcache.c: Don't compile many functions when building the
5332 in-process agent library.
5333 (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
5334 the register buffer in the heap.
5335 (free_register_cache): If the register buffer isn't owned by the
5336 regcache, don't free it.
5337 (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
5338 pre-existing register caches.
5339 * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
5341 (convert_ascii_to_int): : Constify `from' parameter type.
5342 (decode_M_packet, decode_X_packet): Replace the `to' parameter by
5343 a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc
5344 the needed buffer in-place.
5345 (relocate_instruction): New.
5346 * server.c (handle_query) <qSymbols>: If the target supports
5347 tracepoints, give it a chance of looking up symbols. Report
5348 support for fast tracepoints.
5349 (handle_status): Stabilize threads.
5350 (process_serial_event): Adjust.
5351 * server.h (struct fast_tracepoint_jump): Forward declare.
5352 (struct process_info) <fast_tracepoint_jumps>: New field.
5353 (convert_ascii_to_int, convert_int_to_ascii): Adjust.
5354 (decode_X_packet, decode_M_packet): Adjust.
5355 (relocate_instruction): Declare.
5356 (in_process_agent_loaded): Declare.
5357 (tracepoint_look_up_symbols): Declare.
5358 (struct fast_tpoint_collect_status): Declare.
5359 (fast_tracepoint_collecting): Declare.
5360 (force_unlock_trace_buffer): Declare.
5361 (handle_tracepoint_bkpts): Declare.
5362 (initialize_low_tracepoint)
5363 (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
5364 * target.h (struct target_ops) <stabilize_threads,
5365 install_fast_tracepoint_jump_pad>: New fields.
5366 (stabilize_threads, install_fast_tracepoint_jump_pad): New.
5367 * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
5368 [HAVE_STDINT_H]: Include stdint.h.
5369 (trace_debug_1): Rename to ...
5370 (trace_vdebug): ... this.
5371 (trace_debug): Rename to ...
5372 (trace_debug_1): ... this. Add `level' parameter.
5374 (ATTR_USED, ATTR_NOINLINE): New.
5375 (IP_AGENT_EXPORT): New.
5376 (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
5377 (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
5378 (about_to_request_buffer_space, trace_buffer_is_full)
5379 (stopping_tracepoint, expr_eval_result, error_tracepoint)
5380 (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
5381 (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
5382 (traceframe_write_count, traceframes_created)
5383 (trace_state_variables)
5384 New renaming defines.
5385 (struct ipa_sym_addresses): New.
5386 (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
5388 (ipa_sym_addrs): New.
5389 (all_tracepoint_symbols_looked_up): New.
5390 (in_process_agent_loaded): New.
5391 (write_e_ipa_not_loaded): New.
5392 (maybe_write_ipa_not_loaded): New.
5393 (tracepoint_look_up_symbols): New.
5394 (debug_threads) [IN_PROCESS_AGENT]: New.
5395 (read_inferior_memory) [IN_PROCESS_AGENT]: New.
5396 (UNKNOWN_SIDE_EFFECTS): New.
5397 (stop_tracing): New.
5398 (flush_trace_buffer): New.
5399 (stop_tracing_bkpt): New.
5400 (flush_trace_buffer_bkpt): New.
5401 (read_inferior_integer): New.
5402 (read_inferior_uinteger): New.
5403 (read_inferior_data_pointer): New.
5404 (write_inferior_data_pointer): New.
5405 (write_inferior_integer): New.
5406 (write_inferior_uinteger): New.
5407 (struct collect_static_trace_data_action): Delete.
5408 (enum tracepoint_type): New.
5409 (struct tracepoint) <type>: New field `type'.
5410 <actions_str, step_actions, step_actions_str>: Only include in
5412 <orig_size, obj_addr_on_target, adjusted_insn_addr>
5413 <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
5414 (tracepoints): Use IP_AGENT_EXPORT.
5415 (last_tracepoint): Don't include in the IPA.
5416 (stopping_tracepoint): Use IP_AGENT_EXPORT.
5417 (trace_buffer_is_full): Use IP_AGENT_EXPORT.
5418 (alloced_trace_state_variables): New.
5419 (trace_state_variables): Use IP_AGENT_EXPORT.
5420 (traceframe_t): Delete unused variable.
5421 (circular_trace_buffer): Don't include in the IPA.
5422 (trace_buffer_start): Delete.
5423 (struct trace_buffer_control): New.
5424 (trace_buffer_free): Delete.
5425 (struct ipa_trace_buffer_control): New.
5426 (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
5427 (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
5429 (trace_buffer_ctrl): New.
5430 (TRACE_BUFFER_CTRL_CURR): New.
5431 (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
5432 Reimplement as macros.
5433 (trace_buffer_wrap): Delete.
5434 (traceframe_write_count, traceframe_read_count)
5435 (traceframes_created, tracing): Use IP_AGENT_EXPORT.
5436 (struct tracepoint_hit_ctx) <type>: New field.
5437 (struct fast_tracepoint_ctx): New.
5438 (memory_barrier): New.
5440 (record_tracepoint_error): Update atomically in the IPA.
5441 (clear_inferior_trace_buffer): New.
5442 (about_to_request_buffer_space): New.
5443 (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
5444 updating the same buffer.
5445 (add_tracepoint): Default the tracepoint's type to trap
5446 tracepoint, and orig_size to -1.
5447 (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
5449 (create_trace_state_variable): New parameter `gdb'. Handle it.
5450 (clear_installed_tracepoints): Clear fast tracepoint jumps.
5451 (cmd_qtdp): Handle fast tracepoints.
5453 (max_jump_pad_size): New.
5454 (gdb_jump_pad_head): New.
5455 (get_jump_space_head): New.
5456 (claim_jump_space): New.
5457 (sort_tracepoints): New.
5458 (MAX_JUMP_SIZE): New.
5459 (cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the
5461 (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
5462 support. Upload fast traceframes, and delete internal IPA
5464 (stop_tracing_handler): New.
5465 (flush_trace_buffer_handler): New.
5466 (cmd_qtstop): Upload fast tracepoints.
5467 (response_tracepoint): Handle fast tracepoints.
5468 (tracepoint_finished_step): Upload fast traceframes. Set the
5469 tracepoint hit context's tracepoint type.
5470 (handle_tracepoint_bkpts): New.
5471 (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
5472 type. Add comment about fast tracepoints.
5473 (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
5474 non-existing action_str field.
5475 (get_context_regcache): Handle fast tracepoints.
5476 (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
5478 (fast_tracepoint_from_jump_pad_address): New.
5479 (fast_tracepoint_from_ipa_tpoint_address): New.
5480 (collecting_t): New.
5481 (force_unlock_trace_buffer): New.
5482 (fast_tracepoint_collecting): New.
5485 (write_inferior_data_ptr): New.
5486 (target_tp_heap): New.
5487 (target_malloc): New.
5488 (download_agent_expr): New.
5490 (download_tracepoints): New.
5491 (download_trace_state_variables): New.
5492 (upload_fast_traceframes): New.
5493 (IPA_FIRST_TRACEFRAME): New.
5494 (IPA_NEXT_TRACEFRAME_1): New.
5495 (IPA_NEXT_TRACEFRAME): New.
5496 [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
5497 [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
5498 (gdb_jump_pad_buffer_end): New.
5499 [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
5500 (initialize_tracepoint): Adjust.
5501 [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
5502 buffer. Initialize the low module.
5503 * utils.c (PREFIX, TOOLNAME): New.
5504 (malloc_failure): Use PREFIX.
5505 (error): In the IPA, an error causes an exit.
5506 (fatal, warning): Use PREFIX.
5507 (internal_error): Use TOOLNAME.
5508 (NUMCELLS): Increase to 10.
5509 * configure, config.in: Regenerate.
5513 * server.c (handle_query) <qSupported>: Do two passes over the
5514 qSupported string to avoid nesting strtok.
5518 * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
5520 * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also
5522 * configure: Regenerate.
5523 * proc-service.list: New.
5527 * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
5532 * gdbreplay.c (remote_open): Check error return from socket() call by
5533 its equality to -1 not by it being negative.
5534 * remote-utils.c (remote_open): Likewise.
5538 * config.h: Regenerate.
5542 * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
5543 doesn't provide PTRACE_GET_THREAD_AREA.
5547 * linux-m68k-low.c: Include <asm/ptrace.h>
5548 (ps_get_thread_area): Implement.
5552 * event-loop.c (struct callback_event): New struct.
5553 (callback_list): New global.
5554 (append_callback_event, delete_callback_event): New functions.
5555 (process_callback): New function.
5556 (start_event_loop): Call it.
5557 * remote-utils.c (NOT_SCHEDULED): Define.
5558 (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
5559 moved out of readchar.
5560 (readchar): Rewrite. Call reschedule before returning.
5561 (reset_readchar): New function.
5562 (remote_close): Call it.
5563 (process_remaining, reschedule): New functions.
5564 * server.h (callback_handler_func): New typedef.
5565 (append_callback_event, delete_callback_event): Declare.
5569 * proc-service.c (ps_pglobal_lookup): Use
5570 thread_db_look_up_one_symbol.
5571 * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
5572 parameter. Use it instead of all_symbols_looked_up.
5573 * server.h (struct process_info) <all_symbols_looked_up>: Delete
5575 (all_symbols_looked_up): Don't declare.
5576 (look_up_one_symbol): Add new `may_ask_gdb' parameter.
5577 * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
5579 (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
5580 Set all_symbols_looked_up here.
5581 (thread_db_look_up_one_symbol): New.
5582 (thread_db_get_tls_address): Adjust.
5583 (thread_db_load_search, try_thread_db_load_1): Always allocate the
5584 thread_db object on the heap, and tentatively set it in the
5586 (thread_db_init): Don't set all_symbols_looked_up here.
5587 * linux-low.h (thread_db_look_up_one_symbol): Declare.
5591 * linux-low.c (linux_kill, linux_detach): Adjust.
5592 (status_pending_p_callback): Remove redundant statement. Check
5593 for !TARGET_WAITIKIND_IGNORE, instead of
5594 TARGET_WAITKIND_STOPPED.
5595 (handle_tracepoints): Make sure LWP is locked. Adjust.
5596 (linux_wait_for_event_1): Adjust.
5597 (linux_cancel_breakpoints): New.
5598 (unsuspend_one_lwp): New.
5599 (unsuspend_all_lwps): New.
5600 (linux_wait_1): If finishing a step-over, unsuspend all lwps.
5601 (send_sigstop_callback): Change return type to int, add new
5602 `except' parameter and handle it.
5603 (suspend_and_send_sigstop_callback): New.
5604 (stop_all_lwps): Add new `suspend' and `expect' parameters, and
5605 pass them down. If SUSPEND, also increment the lwp's suspend
5607 (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
5608 (need_step_over_p): Don't consider suspended LWPs.
5609 (start_step_over): Adjust.
5610 (proceed_one_lwp): Change return type to int, add new `except'
5611 parameter and handle it.
5612 (unsuspend_and_proceed_one_lwp): New.
5613 (proceed_all_lwps): Use find_inferior instead of
5615 (unstop_all_lwps): Add `unsuspend' parameter. If UNSUSPEND, them
5616 also decrement the suspend count of LWPs. Pass `except' down,
5617 instead of hacking its suspend count.
5618 (linux_pause_all): Add `freeze' parameter. Adjust.
5619 (linux_unpause_all): New.
5620 (linux_target_ops): Install linux_unpause_all.
5621 * server.c (handle_status): Adjust.
5622 * target.h (struct target_ops): New fields `unpause_all' and
5623 `cancel_breakpoints'. Add new parameter to `pause_all'.
5624 (pause_all): Add new `freeze' parameter.
5626 (cancel_breakpoints): New.
5627 * tracepoint.c (clear_installed_tracepoints): Pause threads, and
5629 (cmd_qtstart): Pause threads.
5630 (stop_tracing): Pause threads, and cancel breakpoints.
5631 * win32-low.c (win32_target_ops): Adjust.
5635 * linux-low.c (linux_wait_for_event_1): Move passing the signal to
5636 the inferior right away from here...
5637 (linux_wait_1): ... to here, and adjust to check the thread's
5638 last_resume_kind instead of the lwp's step or stop_expected flags.
5642 * README: Use consistent `GDB' and `GDBserver' spellings.
5646 * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
5647 (linux_kill): Stop all lwps here. Don't delete the main lwp here.
5648 (linux_detach_one_lwp): Assume the lwp is stopped.
5649 (any_thread_of): Delete.
5650 (linux_detach): Stop all lwps here. Don't blindly delete all
5652 (delete_lwp_callback): New.
5653 (linux_mourn): Delete all lwps of the process that is gone.
5654 (linux_wait_1): Don't delete the last lwp of the process here.
5655 * mem-break.h (mark_breakpoints_out): Declare.
5656 * mem-break.c (mark_breakpoints_out): New.
5657 (free_all_breakpoints): Use it.
5658 * server.c (handle_target_event): If the process is gone, mark
5660 * thread-db.c (struct thread_db) <create_bp>: New field.
5661 (thread_db_enable_reporting): Fix prototype. Store a thread event
5662 breakpoint reference in the thread_db struct.
5663 (thread_db_load_search): Clear the thread_db object.
5664 (try_thread_db_load_1): Ditto.
5665 (switch_to_process): New.
5666 (disable_thread_event_reporting): Use it.
5667 (remove_thread_event_breakpoints): New.
5668 (thread_db_detach, thread_db_mourn): Use it.
5672 * linux-low.c (linux_enable_event_reporting): New.
5673 (linux_wait_for_event_1, handle_extended_wait): Use it.
5677 * linux-low.c (linux_kill_one_lwp, linux_kill)
5678 (linux_detach_one_lwp): Adjust to send_sigstop interface change.
5679 (send_sigstop): Take an lwp_info as parameter instead. Queue a
5680 SIGSTOP even if the LWP is stopped.
5681 (send_sigstop_callback): New.
5682 (stop_all_lwps): Use send_sigstop_callback instead.
5683 (linux_resume_one_thread): Adjust.
5684 (proceed_one_lwp): Still proceed an LWP that the client has
5685 requested to stop, if we haven't reported it as stopped yet. Make
5686 sure that LWPs the client want stopped, have a pending SIGSTOP.
5690 * server.c (handle_general_set): Make static.
5692 * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
5693 Print received char after testing for error/eof instead of before.
5694 (input_interrupt): Tweak comment.
5698 * server.c (start_inferior): Print inferior argv if --debug.
5702 * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
5703 * nto-x86-low.c: Include server.h
5707 * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
5708 be consistent with other sources of this directory.
5709 (init_registers_amd64): Correct name of source file of this function
5714 * configure.srv (x86_64-*-mingw*): New configuration for Windows
5719 * win32-i386-low.c: Add 64-bit support.
5720 (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
5721 (init_registers_amd64): Declare.
5722 (mappings): Add 64-bit version of array.
5723 (init_windows_x86): New function.
5724 (the_low_target): Change init_arch field to init_windows_x86.
5728 * win32-low.c: Adapt to support also 64-bit architecture.
5729 (child_xfer_memory): Use uintptr_t type for local variable `addr'.
5730 (get_image_name): Use SIZE_T type for local variable `done'.
5731 (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
5732 (toolhelp_get_dll_name): Idem.
5733 (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
5734 Use uintptr_t typecast to avoid warning.
5735 (handle_unload_dll): Use uintptr_t typecast to avoid warning.
5736 (handle_exception): Use phex_nz to avoid warning.
5737 (win32_wait): Remove unused local variable `process'.
5741 * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
5746 * configure.ac: Use `ws2_32' library for srv_mingw.
5747 * configure: Regenerate.
5748 * gdbreplay.c: Include winsock2.h instead of winsock.h.
5749 * remote-utils.c: Likewise.
5753 * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
5754 if __x86_64__ is defined.
5758 * configure: Regenerate.
5762 * server.c (handle_query): Handle 'qGetTIBAddr' query.
5763 * target.h (target_ops): New get_tib_address field.
5764 * win32-low.h (win32_thread_info): Add thread_local_base field.
5765 * win32-low.c (child_add_thread): Add tlb argument.
5766 Set thread_local_base field to TLB.
5767 (get_child_debug_event): Adapt to child_add_thread change.
5768 (win32_get_tib_address): New function.
5769 (win32_target_ops): Set get_tib_address field to
5770 win32_get_tib_address.
5771 * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
5775 * linux-low.c (linux_mourn): Also remove the process.
5776 * server.c (handle_target_event): Don't remove the process here.
5777 * nto-low.c (nto_mourn): New.
5778 (nto_target_ops): Install it.
5779 * spu-low.c (spu_mourn): New.
5780 (spu_target_ops): Install it.
5781 * win32-low.c (win32_mourn): New.
5782 (win32_target_ops): Install it.
5786 * server.h (buffer_xml_printf): Remove redundant `;'.
5790 * regcache.c (set_register_cache): Invalidate regcaches before
5791 changing the register cache layout.
5792 (regcache_invalidate_one): Allow a NULL regcache.
5793 * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
5794 regcaches before changing the register cache layout or the target
5799 * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
5800 variable warning on Linux/x86-64.
5804 GDBserver disconnected tracing support.
5806 * linux-low.c (linux_remove_process): Delete.
5807 (add_lwp): Don't set last_resume_kind here.
5808 (linux_kill): Use `mourn'.
5809 (linux_detach): Use `thread_db_detach', and `mourn'.
5811 (linux_attach_lwp_1): Adjust comment.
5812 (linux_attach): last_resume_kind moved the thread_info; adjust.
5813 (status_pending_p_callback): Adjust.
5814 (linux_wait_for_event_1): Adjust.
5815 (count_events_callback, select_singlestep_lwp_callback)
5816 (select_event_lwp_callback, cancel_breakpoints_callback)
5817 (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
5818 (proceed_one_lwp): Adjust.
5819 (linux_async): Add debug output.
5820 (linux_thread_stopped): New.
5821 (linux_pause_all): New.
5822 (linux_target_ops): Install linux_mourn, linux_thread_stopped and
5824 * linux-low.h (struct lwp_info): Delete last_resume_kind field.
5825 (thread_db_free): Delete declaration.
5826 (thread_db_detach, thread_db_mourn): Declare.
5827 * thread-db.c (thread_db_init): Use thread_db_mourn.
5828 (thread_db_free): Delete, split in two.
5829 (disable_thread_event_reporting): New.
5830 (thread_db_detach): New.
5831 (thread_db_mourn): New.
5833 * server.h (struct thread_info) <last_resume_kind>: New field.
5834 <attached>: Add comment.
5835 <gdb_detached>: New field.
5836 (handler_func): Change return type to int.
5837 (handle_serial_event, handle_target_event): Ditto.
5838 (gdb_connected): Declare.
5840 (disconnected_tracing): Declare.
5841 (stop_tracing): Declare.
5843 * server.c (handle_query) <qSupported>: Report support for
5844 disconnected tracing.
5845 (queue_stop_reply_callback): Account for running threads.
5846 (gdb_wants_thread_stopped): New.
5847 (gdb_wants_all_threads_stopped): New.
5848 (gdb_reattached_process): New.
5849 (handle_status): Clear the `gdb_detached' flag of all processes.
5850 In all-stop, stop all threads.
5851 (main): Be sure to leave tfind mode. Handle disconnected tracing.
5852 (process_serial_event): If the remote connection breaks, or if an
5853 exit was forced with "monitor exit", force an event loop exit.
5854 Handle disconnected tracing on detach.
5855 (handle_serial_event): Adjust.
5856 (handle_target_event): If GDB isn't connected, forward events back
5857 to the inferior, unless the last process exited, in which case,
5858 exit gdbserver. Adjust interface.
5860 * remote-utils.c (remote_open): Don't block in accept. Instead
5861 register an event loop source on the listen socket file
5862 descriptor. Refactor bits into ...
5863 (listen_desc): ... this new global.
5864 (gdb_connected): ... this new function.
5865 (enable_async_notification): ... this new function.
5866 (handle_accept_event): ... this new function.
5867 (remote_close): Clear remote_desc.
5869 * inferiors.c (add_thread): Set the new thread's last_resume_kind.
5871 * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
5873 (mourn_inferior): Define.
5874 (target_process_qsupported): Avoid the dangling else problem.
5875 (thread_stopped): Define.
5876 (pause_all): Define.
5877 (target_waitstatus_to_string): Declare.
5878 * target.c (target_waitstatus_to_string): New.
5880 * tracepoint.c (tracing): Make extern.
5881 (disconnected_tracing): New.
5882 (stop_tracing): Make extern. Handle tracing stops due to GDB
5884 (cmd_qtdisconnected): New.
5885 (cmd_qtstatus): Report disconnected tracing status in trace reply.
5886 (handle_tracepoint_general_set): Handle QTDisconnected.
5888 * event-loop.c (event_handler_func): Change return type to int.
5889 (process_event): Bail out if the event handler wants the event
5891 (handle_file_event): Ditto.
5892 (start_event_loop): Bail out if the event handler wants the event
5895 * nto-low.c (nto_target_ops): Adjust.
5896 * spu-low.c (spu_wait): Don't remove the process here.
5897 (spu_target_ops): Adjust.
5898 * win32-low.c (win32_wait): Don't remove the process here.
5899 (win32_target_ops): Adjust.
5903 * regcache.c (realloc_register_cache): Invalidate inferior's
5904 regcache before recreating it.
5908 * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
5913 * server.h (LONGEST): New.
5914 (struct thread_info) <while_stepping>: New field.
5915 (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
5917 (initialize_tracepoint, handle_tracepoint_general_set)
5918 (handle_tracepoint_query, tracepoint_finished_step)
5919 (tracepoint_was_hit, release_while_stepping_state_list):
5920 (current_traceframe): Declare.
5921 * server.c (handle_general_set): Handle tracepoint packets.
5923 (write_memory): New.
5924 (handle_search_memory_1): Use read_memory.
5925 (handle_query): Report support for conditional tracepoints, trace
5926 state variables, and tracepoint sources. Handle tracepoint
5928 (main): Initialize the tracepoints module.
5929 (process_serial_event): Handle traceframe reads/writes.
5931 * linux-low.c (handle_tracepoints): New.
5932 (linux_wait_1): Call it.
5933 (linux_resume_one_lwp): Handle while-stepping.
5934 (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
5935 (linux_target_ops): Install them.
5936 * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
5938 * linux-x86-low.c (x86_supports_tracepoints): New.
5939 (the_low_target). Install it.
5941 * mem-break.h (delete_breakpoint): Declare.
5942 * mem-break.c (delete_breakpoint): Make external.
5944 * target.h (struct target_ops): Add `supports_tracepoints',
5945 `read_pc', and `write_pc' fields.
5946 (target_supports_tracepoints): Define.
5947 * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
5950 * regcache.h (struct regcache) <registers_owned>: New field.
5951 (init_register_cache, regcache_cpy): Declare.
5952 (regcache_read_pc, regcache_write_pc): Declare.
5953 (register_cache_size): Declare.
5954 (supply_regblock): Declare.
5955 * regcache.c (init_register_cache): New.
5956 (new_register_cache): Use it.
5957 (regcache_cpy): New.
5958 (register_cache_size): New.
5959 (supply_regblock): New.
5960 (regcache_read_pc, regcache_write_pc): New.
5962 * tracepoint.c: New.
5964 * Makefile.in (OBS): Add tracepoint.o.
5965 (tracepoint.o): New rule.
5969 * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
5971 (i386-mmx.c): Likewise.
5972 (i386-mmx-linux.o): Likewise.
5973 (i386-mmx-linux.c): Likewise.
5975 * configure.srv (srv_i386_regobj): Add i386-mmx.o.
5976 (srv_i386_linux_regobj): Add i386-mmx-linux.o.
5977 (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
5978 (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
5980 * linux-x86-low.c (init_registers_i386_mmx_linux): New.
5981 (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
5982 and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
5986 * Makefile.in (clean): Updated.
5988 (i386-avx.c): Likewise.
5989 (i386-avx-linux.o): Likewise.
5990 (i386-avx-linux.c): Likewise.
5991 (amd64-avx.o): Likewise.
5992 (amd64-avx.c): Likewise.
5993 (amd64-avx-linux.o): Likewise.
5994 (amd64-avx-linux.c): Likewise.
5996 * configure.srv (srv_i386_regobj): Add i386-avx.o.
5997 (srv_i386_linux_regobj): Add i386-avx-linux.o.
5998 (srv_amd64_regobj): Add amd64-avx.o.
5999 (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
6000 (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
6001 (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
6002 (srv_i386_xmlfiles): Add i386/i386-avx.xml.
6003 (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
6004 (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
6005 (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
6007 * i387-fp.c: Include "i386-xstate.h".
6009 (i387_cache_to_xsave): Likewise.
6010 (i387_xsave_to_cache): Likewise.
6011 (x86_xcr0): Likewise.
6013 * i387-fp.h (i387_cache_to_xsave): Likewise.
6014 (i387_xsave_to_cache): Likewise.
6015 (x86_xcr0): Likewise.
6017 * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
6018 * linux-crisv32-low.c (target_regsets): Likewise.
6019 * linux-m68k-low.c (target_regsets): Likewise.
6020 * linux-mips-low.c (target_regsets): Likewise.
6021 * linux-ppc-low.c (target_regsets): Likewise.
6022 * linux-s390-low.c (target_regsets): Likewise.
6023 * linux-sh-low.c (target_regsets): Likewise.
6024 * linux-sparc-low.c (target_regsets): Likewise.
6025 * linux-xtensa-low.c (target_regsets): Likewise.
6027 * linux-low.c: Include <sys/uio.h>.
6028 (regsets_fetch_inferior_registers): Support nt_type.
6029 (regsets_store_inferior_registers): Likewise.
6030 (linux_process_qsupported): New.
6031 (linux_target_ops): Add linux_process_qsupported.
6033 * linux-low.h (regset_info): Add nt_type.
6034 (linux_target_ops): Add process_qsupported.
6036 * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
6038 (init_registers_i386_avx_linux): New.
6039 (init_registers_amd64_avx_linux): Likewise.
6040 (xmltarget_i386_linux_no_xml): Likewise.
6041 (xmltarget_amd64_linux_no_xml): Likewise.
6042 (PTRACE_GETREGSET): Likewise.
6043 (PTRACE_SETREGSET): Likewise.
6044 (x86_fill_xstateregset): Likewise.
6045 (x86_store_xstateregset): Likewise.
6046 (use_xml): Likewise.
6047 (x86_linux_update_xmltarget): Likewise.
6048 (x86_linux_process_qsupported): Likewise.
6049 (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
6050 (x86_arch_setup): Don't call init_registers_amd64_linux nor
6051 init_registers_i386_linux here. Call
6052 x86_linux_update_xmltarget.
6053 (the_low_target): Add x86_linux_process_qsupported.
6055 * server.c (handle_query): Call target_process_qsupported.
6057 * target.h (target_ops): Add process_qsupported.
6058 (target_process_qsupported): New.
6062 * inferiors.c (add_thread): Set last_status kind to
6063 TARGET_WAITKIND_IGNORE.
6064 * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
6065 fetch. Use ptid_of. Avoid unnecessary get_lwp_thread calls.
6066 (linux_wait_1): Move `thread' local definition to block that uses
6067 it. Don't NULL initialize `event_child'.
6068 (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
6069 Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
6070 * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
6074 * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
6075 an extended waitstatus, or by a watchpoint.
6076 (cancel_breakpoints_callback): Don't cancel a breakpoint if the
6077 thread was stepping or has been stopped by a watchpoint.
6081 * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
6082 (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
6083 of another, then delete the previous, and validate all
6085 (validate_inserted_breakpoint): New.
6086 (delete_disabled_breakpoints): New.
6087 (validate_breakpoints): New.
6088 (check_mem_read): Validate breakpoints before trusting their
6089 shadow. Delete disabled breakpoints.
6090 (check_mem_write): Validate breakpoints before trusting they
6091 should be inserted. Delete disabled breakpoints.
6092 * mem-break.h (validate_breakpoints):
6093 * server.c (handle_query): Validate breakpoints when we see a
6098 * linux-low.c (linux_wait_1): Avoid setting need_step_over is
6099 there's a GDB breakpoint at stop_pc. Always report a trap to GDB
6100 if we could tell there's a GDB breakpoint at stop_pc.
6101 (need_step_over_p): Don't do a step over if we find a GDB
6102 breakpoint at the resume PC.
6104 * mem-break.c (struct raw_breakpoint): New.
6105 (enum bkpt_type): New type `gdb_breakpoint'.
6106 (struct breakpoint): Delete the `PC', `old_data' and `inserted'
6107 fields. New field `raw'.
6108 (find_raw_breakpoint_at): New.
6109 (set_raw_breakpoint_at): Handle refcounting. Create a raw
6111 (set_breakpoint_at): Adjust.
6112 (delete_raw_breakpoint): New.
6113 (release_breakpoint): New.
6114 (delete_breakpoint): Rename to...
6115 (delete_breakpoint_1): ... this. Add proc parameter. Use
6116 release_breakpoint. Return ENOENT.
6117 (delete_breakpoint): Reimplement.
6118 (find_breakpoint_at): Delete.
6119 (find_gdb_breakpoint_at): New.
6120 (delete_breakpoint_at): Delete.
6121 (set_gdb_breakpoint_at): New.
6122 (delete_gdb_breakpoint_at): New.
6123 (gdb_breakpoint_here): New.
6124 (set_reinsert_breakpoint): Use release_breakpoint.
6125 (uninsert_breakpoint): Rename to ...
6126 (uninsert_raw_breakpoint): ... this.
6127 (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
6128 (reinsert_raw_breakpoint): Change parameter type to
6130 (reinsert_breakpoints_at): Adjust to handle raw breakpoints
6132 (check_breakpoints): Adjust. Use release_breakpoint.
6133 (breakpoint_here): Rewrite using find_raw_breakpoint_at.
6134 (breakpoint_inserted_here): Ditto.
6135 (check_mem_read): Adjust to iterate over raw breakpoints instead.
6136 Don't trust the breakpoint's shadow if it is not inserted.
6137 (check_mem_write): Adjust to iterate over raw breakpoints instead.
6138 (delete_all_breakpoints): Adjust.
6139 (free_all_breakpoints): Mark all breakpoints as uninserted, and
6140 use delete_breakpoint_1.
6142 * mem-break.h (breakpoints_supported): Delete declaration.
6143 (set_gdb_breakpoint_at): Declare.
6144 (gdb_breakpoint_here): Declare.
6145 (delete_breakpoint_at): Delete.
6146 (delete_gdb_breakpoint_at): Declare.
6148 * server.h (struct raw_breakpoint): Forward declare.
6149 (struct process_info): New field `raw_breakpoints'.
6151 * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
6156 * linux-low.c (status_pending_p_callback): Fix comment.
6157 (linux_wait_for_event_1): Move most of the internal breakpoint
6158 handling from here...
6159 (linux_wait_1): ... to here.
6160 (count_events_callback): New.
6161 (select_singlestep_lwp_callback): New.
6162 (select_event_lwp_callback): New.
6163 (cancel_breakpoints_callback): New.
6164 (select_event_lwp): New.
6165 (linux_wait_1): Simplify internal breakpoint handling. Give equal
6166 priority to all LWPs that have had events that should be reported
6167 to the client. Cancel breakpoints when about to reporting the
6168 event to the client, not while stopping lwps. No longer cancel
6169 finished single-steps here.
6170 (cancel_finished_single_step): Delete.
6171 (cancel_finished_single_steps): Delete.
6175 * mem-break.c (enum bkpt_type): New.
6176 (struct breakpoint): New field `type'.
6177 (set_breakpoint_at): Change return type to struct breakpoint
6178 pointer. Set type to `other_breakpoint' by default.
6179 (delete_breakpoint): Rewrite, supporting more than one breakpoint
6180 in the breakpoint list.
6181 (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
6182 (reinsert_breakpoint): Rename to ...
6183 (reinsert_raw_breakpoint): ... this.
6184 (reinsert_breakpoints_at): Adjust.
6185 * mem-break.h (struct breakpoint): Declare.
6186 (set_breakpoint_at): Change return type to struct breakpoint
6191 * server.c (handle_query): Assign, not compare.
6195 Teach linux gdbserver to step-over-breakpoints.
6197 * linux-low.c (can_hardware_single_step): New.
6198 (supports_breakpoints): New.
6199 (handle_extended_wait): If stopping threads, read the stop pc of
6202 (get_stop_pc): Add `lwp' parameter. Handle it. Bail out if the
6203 low target doesn't support retrieving the PC.
6204 (add_lwp): Set last_resume_kind to resume_continue.
6205 (linux_attach_lwp_1): Adjust comments. Always set stop_expected.
6206 (linux_attach): Don't clear stop_expected. Set the lwp's
6207 last_resume_kind to resume_stop.
6208 (linux_detach_one_lwp): Don't check for removed breakpoints.
6209 (check_removed_breakpoint): Delete.
6210 (status_pending_p): Rename to ...
6211 (status_pending_p_callback): ... this. Don't check for removed
6212 breakpoints. Don't consider threads that are stopped from GDB's
6214 (linux_wait_for_lwp): Always read the stop_pc here.
6215 (cancel_breakpoint): New.
6216 (step_over_bkpt): New global.
6217 (linux_wait_for_event_1): Implement stepping over breakpoints.
6218 (gdb_wants_lwp_stopped): New.
6219 (gdb_wants_all_stopped): New.
6220 (linux_wait_1): Tag threads as gdb-wants-stopped. Cancel finished
6221 single-step traps here. Store the thread's last reported target
6223 (send_sigstop): Don't clear stop_expected. Always set it,
6225 (mark_lwp_dead): Remove reference to pending_is_breakpoint.
6226 (cancel_finished_single_step): New.
6227 (cancel_finished_single_steps): New.
6228 (wait_for_sigstop): Don't cancel finished single-step traps here.
6229 (linux_resume_one_lwp): Don't check for removed breakpoints.
6230 Don't set `step' on non-hardware step archs.
6231 (linux_set_resume_request): Ignore resume_stop requests if already
6232 stopping or stopped. Set the lwp's last_resume_kind.
6233 (resume_status_pending_p): Don't check for removed breakpoints.
6234 (need_step_over_p): New.
6235 (start_step_over): New.
6236 (finish_step_over): New.
6237 (linux_resume_one_thread): Always queue a sigstop for resume_stop
6238 requests. Clear the thread's last reported target waitstatus.
6239 Don't use the `suspended' flag. Don't consider pending breakpoints.
6240 (linux_resume): Start a step-over if necessary.
6241 (proceed_one_lwp): New.
6242 (proceed_all_lwps): New.
6243 (unstop_all_lwps): New.
6244 * linux-low.h (struct lwp_info): Rewrite comment for the
6245 `suspended' flag. Add the `stop_pc' field. Delete the
6246 `pending_stop_pc' field. Tweak the `stepping' flag's comment.
6247 Add `'last_resume_kind' and `need_step_over' fields.
6248 * inferiors.c (struct thread_info): Delete, moved elsewhere.
6249 * mem-break.c (struct breakpoint): Delete `reinserting' flag.
6250 Delete `breakpoint_to_reinsert' field. New flag `inserted'.
6251 (set_raw_breakpoint_at): New.
6252 (set_breakpoint_at): Rewrite to use it.
6253 (reinsert_breakpoint_handler): Delete.
6254 (set_reinsert_breakpoint): New.
6255 (reinsert_breakpoint_by_bp): Delete.
6256 (delete_reinsert_breakpoints): New.
6257 (uninsert_breakpoint): Rewrite.
6258 (uninsert_breakpoints_at): New.
6259 (reinsert_breakpoint): Rewrite.
6260 (reinsert_breakpoints_at): New.
6261 (check_breakpoints): Rewrite.
6262 (breakpoint_here): New.
6263 (breakpoint_inserted_here): New.
6264 (check_mem_read): Adjust.
6265 * mem-break.h (breakpoints_supported, breakpoint_here)
6266 (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
6267 (reinsert_breakpoint_by_bp): Delete declaration.
6268 (delete_reinsert_breakpoints): Declare.
6269 (reinsert_breakpoint): Delete declaration.
6270 (reinsert_breakpoints_at): Declare.
6271 (uninsert_breakpoint): Delete declaration.
6272 (uninsert_breakpoints_at): Declare.
6273 (check_breakpoints): Adjust prototype.
6274 * server.h: Adjust include order.
6275 (struct thread_info): Declare here. Add a `last_status' field.
6279 * server.c (crc32): New function.
6280 (handle_query): Add handling for 'qCRC:' request.
6284 * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
6285 lwp had been stopped by a watchpoint.
6289 * server.h (internal_error): Declare.
6290 (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
6291 * utils.c (internal_error): New function.
6295 * configure.srv: Fix typo setting srv_regobj.
6299 * linux-low.c (fetch_register): Avoid passing a non string literal
6301 (usr_store_inferior_registers): Ditto.
6305 * linux-low.c (linux_write_memory): Bail out early if peeking
6310 * linux-low.h (struct lwp_info): New fields
6311 `stopped_by_watchpoint' and `stopped_data_address'.
6312 * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
6313 here, and cache them in the lwp object.
6314 (wait_for_sigstop): Check stopped_by_watchpoint lwp field
6316 (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
6318 (linux_stopped_by_watchpoint): Rewrite.
6319 (linux_stopped_data_address): Rewrite.
6323 * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
6324 switching the current inferior, not before.
6328 * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
6329 reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
6330 i386-linux.c and amd64-linux.c.
6331 (reg-i386.o): Removed.
6332 (reg-i386.c): Likewise.
6333 (reg-i386-linux.o): Likewise.
6334 (reg-i386-linux.c): Likewise.
6335 (reg-x86-64.o): Likewise.
6336 (reg-x86-64.c): Likewise.
6337 (reg-x86-64-linux.o): Likewise.
6338 (reg-x86-64-linux.c): Likewise.
6341 (i386-linux.o): Likewise.
6342 (i386-linux.c): Likewise.
6343 (amd64.o): Likewise.
6344 (amd64.c): Likewise.
6345 (amd64-linux.o): Likewise.
6346 (amd64-linux.c): Likewise.
6348 * configure.srv (srv_i386_regobj): New.
6349 (srv_i386_linux_regobj): Likewise.
6350 (srv_amd64_regobj): Likewise.
6351 (srv_amd64_linux_regobj): Likewise.
6352 (srv_i386_32bit_xmlfiles): Likewise.
6353 (srv_i386_64bit_xmlfiles): Likewise.
6354 (srv_i386_xmlfiles): Likewise.
6355 (srv_amd64_xmlfiles): Likewise.
6356 (srv_i386_linux_xmlfiles): Likewise.
6357 (srv_amd64_linux_xmlfiles): Likewise.
6358 (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set
6359 srv_xmlfiles to $srv_i386_xmlfiles.
6360 (i[34567]86-*-mingw32ce*): Likewise.
6361 (i[34567]86-*-mingw*): Likewise.
6362 (i[34567]86-*-nto*): Likewise.
6363 (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
6364 and $srv_amd64_linux_regobj. Set srv_xmlfiles to
6365 $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
6366 (x86_64-*-linux*): Likewise.
6368 * linux-x86-low.c (init_registers_x86_64_linux): Removed.
6369 (init_registers_amd64_linux): New.
6370 (x86_arch_setup): Replace init_registers_x86_64_linux with
6371 init_registers_amd64_linux.
6375 * configure.ac: Check for libdl. If it is not available link against
6376 static libthread_db.
6377 * configure: Regenerate.
6383 * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
6384 handing a read watchpoint.
6385 (i386_low_insert_watchpoint): Read watchpoints aren't supported.
6389 * linux-low.c (linux_supports_tracefork_flag): Document.
6390 (linux_look_up_symbols): Add comment.
6394 * regcache.c (supply_register): Clear regcache if buf is NULL.
6399 * inferiors.c (find_inferior): Add function documentation.
6400 (unloaded_dll): Handle the case where the unloaded dll has not
6401 been previously registered in the dll list.
6405 * linux-arm-low.c (thumb_breakpoint_len): Delete.
6406 (thumb2_breakpoint): New.
6407 (arm_breakpoint_at): Check for Thumb-2 breakpoints.
6411 * linux-low.c (get_stop_pc): Check for SIGTRAP.
6412 (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
6417 * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
6421 * linux-s390-low.c (s390_collect_ptrace_register)
6422 (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
6426 * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
6427 (PTRACE_ARG4_TYPE): New macro.
6428 (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
6429 (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
6430 (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
6431 (usr_store_inferior_registers): Ditto.
6432 (linux_read_memory, linux_write_memory): Ditto.
6433 (linux_test_for_tracefork): Ditto.
6435 * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
6436 Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
6440 * proc-service.c (ps_lgetregs): Don't refetch registers from the
6445 * spu-low.c (spu_fetch_registers, spu_store_registers): Change
6446 prototype to take a regcache. Adjust.
6450 * regcache.h (struct thread_info): Forward declare.
6451 (struct regcache): New.
6452 (new_register_cache): Adjust prototype.
6453 (get_thread_regcache): Declare.
6454 (free_register_cache): Adjust prototype.
6455 (registers_to_string, registers_from_string): Ditto.
6456 (supply_register, supply_register_by_name, collect_register)
6457 (collect_register_as_string, collect_register_by_name): Ditto.
6458 * regcache.c (struct inferior_regcache_data): Delete.
6459 (get_regcache): Rename to ...
6460 (get_thread_regcache): ... this. Adjust. Switch inferior before
6462 (regcache_invalidate_one): Adjust.
6463 (regcache_invalidate): Fix prototype.
6464 (new_register_cache): Return the new register cache.
6465 (free_register_cache): Change prototype.
6466 (realloc_register_cache): Adjust.
6467 (registers_to_string): Change prototype to take a regcache. Adjust.
6468 (registers_from_string): Ditto.
6469 (register_data): Ditto.
6470 (supply_register): Ditto.
6471 (supply_register_by_name): Ditto.
6472 (collect_register): Ditto.
6473 (collect_register_as_string): Ditto.
6474 (collect_register_by_name): Ditto.
6475 * server.c (process_serial_event): Adjust.
6476 * linux-low.h (regset_fill_func, regset_store_func): Change
6478 (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
6480 * linux-low.c (get_stop_pc): Adjust.
6481 (check_removed_breakpoint): Adjust.
6482 (linux_wait_for_event): Adjust.
6483 (linux_resume_one_lwp): Adjust.
6484 (fetch_register): Add regcache parameter. Adjust.
6485 (usr_store_inferior_registers): Ditto.
6486 (regsets_fetch_inferior_registers): Ditto.
6487 (regsets_store_inferior_registers): Ditto.
6488 (linux_fetch_registers, linux_store_registers): Ditto.
6489 * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
6491 (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
6493 * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
6494 prototype to take a regcache.
6495 (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
6496 * remote-utils.c (convert_ascii_to_int, outreg)
6497 (prepare_resume_reply): Change prototype to take a regcache.
6499 * target.h (struct target_ops) <fetch_registers, store_registers>:
6500 Change prototype to take a regcache.
6501 (fetch_inferior_registers, store_inferior_registers): Change
6502 prototype to take a regcache. Adjust.
6503 * proc-service.c (ps_lgetregs): Adjust.
6504 * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
6505 (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
6506 (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
6507 take a regcache. Adjust.
6508 * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
6509 (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
6510 (arm_store_vfpregset, arm_get_pc, arm_set_pc):
6511 (arm_breakpoint_at): Change prototype to take a regcache. Adjust.
6512 * linux-cris-low.c (cris_get_pc, cris_set_pc)
6513 (cris_cannot_fetch_register):
6514 (cris_breakpoint_at): Change prototype to take a regcache.
6516 * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
6517 cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
6518 to take a regcache. Adjust.
6519 (cris_breakpoint_at, cris_insert_point, cris_remove_point):
6521 * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
6522 take a regcache. Adjust.
6523 * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
6524 (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
6525 (m68k_set_pc): Change prototype to take a regcache. Adjust.
6526 * linux-mips-low.c (mips_get_pc):
6527 (mips_set_pc): Change prototype to take a regcache. Adjust.
6528 (mips_reinsert_addr): Adjust.
6529 (mips_collect_register): Change prototype to take a regcache.
6531 (mips_supply_register):
6532 (mips_collect_register_32bit, mips_supply_register_32bit)
6533 (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
6534 (mips_store_fpregset): Ditto.
6535 * linux-ppc-low.c (ppc_supply_ptrace_register)
6536 (ppc_supply_ptrace_register): Ditto.
6537 (parse_spufs_run): Adjust.
6538 (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
6539 (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
6540 (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
6541 take a regcache. Adjust.
6542 * linux-s390-low.c (s390_collect_ptrace_register)
6543 (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
6544 (s390_set_pc): Change prototype to take a regcache. Adjust.
6545 (s390_arch_setup): Adjust.
6546 * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
6547 (sh_fill_gregset): Change prototype to take a regcache. Adjust.
6548 * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6549 (sparc_fill_gregset, sparc_store_gregset_from_stack)
6550 (sparc_store_gregset, sparc_get_pc): Change prototype to take a
6552 (sparc_breakpoint_at): Adjust.
6553 * linux-xtensa-low.c (xtensa_fill_gregset):
6554 (xtensa_store_gregset):
6555 (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
6556 (xtensa_set_pc): Change prototype to take a regcache. Adjust.
6557 * nto-low.c (nto_fetch_registers, nto_store_registers): Change
6558 prototype to take a regcache. Adjust.
6559 * win32-arm-low.c (arm_fetch_inferior_register)
6560 (arm_store_inferior_register): Change prototype to take a
6562 * win32-i386-low.c (i386_fetch_inferior_register)
6563 (i386_store_inferior_register): Change prototype to take a
6565 * win32-low.c (child_fetch_inferior_registers)
6566 (child_store_inferior_registers): Change prototype to take a
6568 (win32_wait): Adjust.
6569 (win32_fetch_inferior_registers): Change prototype to take a
6571 (win32_store_inferior_registers): Adjust.
6572 * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
6573 store_inferior_register>: Change prototype to take a regcache.
6577 * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
6579 (linux_wait_for_event1, linux_init_signals): Ditto.
6580 (W_STOPCODE): Provide definition if missing.
6584 * linux-low.c (linux_core_of_thread): New.
6585 (compare_ints, show_process, list_threads): New.
6586 (linux_qxfer_osdata): Report threads and cores.
6587 (linux_target_op): Register linux_core_of_thread.
6588 * remote-utils.c (prepare_resume_reply): Report the core.
6589 (buffer_xml_printf): Support %d specifier.
6590 * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
6592 (handle_query): Handle qXfer:threads. Announce availability
6594 * target.h (struct target_ops): New field core_of_thread.
6598 * Makefile.in (clean): Remove new generated files.
6599 (reg-s390.o, reg-s390.c): Remove rules.
6600 (reg-s390x.o, reg-s390x.c): Likewise.
6601 (s390-linux32.o, s390-linux32.c): Add rules.
6602 (s390-linux64.o, s390-linux64.c): Likewise.
6603 (s390x-linux64.o, s390x-linux64.c): Likewise.
6604 * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
6605 * linux-s390-low.c: Include <elf.h>.
6606 (HWCAP_S390_HIGH_GPRS): Define if undefined.
6607 (init_registers_s390): Remove prototype.
6608 (init_registers_s390x): Likewise.
6609 (init_registers_s390_linux32): Add prototype.
6610 (init_registers_s390_linux64): Likewise.
6611 (init_registers_s390x_linux64): Likewise.
6612 (s390_num_regs_3264): New define.
6613 (s390_regmap_3264): New global variable.
6614 (s390_cannot_fetch_register): Remove obsolete check.
6615 (s390_cannot_store_register): Likewise.
6616 (s390_collect_ptrace_register): Handle upper/lower register halves.
6617 (s390_supply_ptrace_register): Likewise.
6618 (s390_fill_gregset): Update to register number changes.
6619 (s390_get_hwcap): New routine.
6620 (s390_arch_setup): Detect 32-bit process running on 64-bit system.
6621 Install appropriate regmap and register set.
6625 * server.c (gdbserver_version): Update copyright year to 2010.
6626 * gdbreplay.c (gdbreplay_version): Likewise.
6630 * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
6631 elf/external.h. Include <elf.h> instead but only if necessary.
6635 * linux-low.c (linux_remove_process): Remove `detaching'
6636 parameter. Don't release/detach from thread_db here.
6637 (linux_kill): Release/detach from thread_db here, ...
6638 (linux_detach): ... and here, before actually detaching.
6639 (linux_wait_1): ... and here, when a process exits.
6640 * thread-db.c (any_thread_of): New.
6641 (thread_db_free): Switch the current inferior to a thread of the
6646 * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
6648 * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
6649 Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
6650 warning ifndef __NR_tkill. Move setting of errno there too.
6651 Delete unnecessary resetting of errno after syscall.
6652 Minor comment changes to match gdb/linux-nat.c:kill_lwp.
6654 * configure.ac: Check for dladdr.
6655 * config.in: Regenerate.
6656 * configure: Regenerate.
6657 * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
6658 (try_thread_db_load): Update.
6660 * linux-low.c (my_waitpid): Delete unnecessary prototype.
6664 * event-loop.c: Include unistd.h if it exists.
6666 * linux-low.c (my_waitpid): Move definition away from being in
6667 between linux_tracefork_child/linux_test_for_tracefork.
6669 * gdb_proc_service.h (psaddr_t): Fix type.
6670 * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
6671 signature to match glibc.
6675 * linux-low.c (linux_read_memory): Fix argument to read.
6679 * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
6680 events, don't leave current_inferior pointing at null.
6684 * win32-low.c (LOG): Delete.
6685 (OUTMSG): Output to stderr.
6686 (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
6687 on compile time LOG macro.
6688 (win32_wait): Fix debug output.
6692 * win32-low.c (win32_add_one_solib): If the dll name is
6693 "ntdll.dll", prepend the system directory to the dll path.
6697 * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
6702 * Makefile.in (reg-cf.o, reg-cf.c): New targets.
6703 * configure.ac: Check for __mcoldfire__ and set
6704 gdb_cv_m68k_is_coldfire.
6705 * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
6706 reg-cf.o and reg-m68k.o.
6707 * configure: Regenerated.
6711 * linux-low.c (linux_remove_process): Add `detaching' parameter.
6712 Pass it to thread_db_free.
6713 (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
6714 proper `detaching' argument to linux_remove_process.
6715 * linux-low.h (thread_db_free): Add `detaching' parameter.
6716 * thread-db.c (thread_db_init): Pass false as `detaching' argument
6718 (thread_db_free): Add `detaching' parameter. Only
6719 call td_ta_clear_event if detaching from process.
6723 * thread-db.c (thread_db_free): Fix typo.
6728 * thread-db.c (thread_db_free): Call td_ta_clear_event.
6732 * configure.ac (i[34567]86-*): Check if we're targetting x86-64
6733 with an i686 compiler.
6734 * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
6736 * configure: Rebuilt.
6742 * server.c (handle_search_memory_1): Correct read_addr initialization
6743 in loop for searching subsequent chunks.
6747 * configure.ac: New --with-libthread-db option.
6748 * thread-db.c: Allow direct dependence on libthread_db.
6749 (thread_db_free): Adjust.
6750 * config.in: Regenerate.
6751 * configure: Likewise.
6756 * thread-db.c (attach_thread): New function.
6757 (maybe_attach_thread): Return success/failure.
6758 (find_new_threads_callback): Adjust.
6759 (thread_db_find_new_threads): Loop until no new threads.
6763 * proc-service.c (ps_lgetregs): Formatting.
6767 * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
6768 * configure.ac: Adjust.
6769 * linux-low.h (struct process_info_private): Move members to struct
6771 (thread_db_free, thread_db_handle_monitor_command): New prototype.
6772 * linux-low.c (linux_remove_process): Adjust.
6773 (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
6774 * server.c (handle_query): Move code ...
6775 (handle_monitor_command): ... here. New function.
6776 * target.h (struct target_ops): New member.
6777 * thread-db.c (struct thread_db): New.
6778 (libthread_db_search_path): New variable.
6779 (thread_db_create_event, thread_db_enable_reporting)
6780 (find_one_thread, maybe_attach_thread, find_new_threads_callback)
6781 (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
6782 (try_thread_db_load_1, dladdr_to_soname): New functions.
6783 (try_thread_db_load, thread_db_load_search): New functions.
6784 (thread_db_init): Search for libthread_db.
6785 (thread_db_free): New function.
6786 (thread_db_handle_monitor_command): Likewise.
6787 * config.in: Regenerate.
6788 * configure: Regenerate.
6792 * spu-low.c (spu_kill): Wait for inferior to terminate.
6793 Call clear_inferiors.
6794 (spu_detach): Call clear_inferiors.
6798 * aclocal.m4: Regenerate.
6799 * config.in: Likewise.
6800 * configure: Likewise.
6804 * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
6805 (parse_spufs_run): New function.
6806 (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
6807 (ppc_breakpoint_at): Handle SPU breakpoints.
6811 * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
6812 (SPUFS_MAGIC): Define.
6813 (spu_enumerate_spu_ids): New function.
6814 (linux_qxfer_spu): New function.
6815 (linux_target_ops): Install linux_qxfer_spu.
6819 * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
6820 and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml
6821 and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
6822 * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
6823 (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
6824 (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
6825 * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
6826 (init_registers_powerpc_cell32l): Add prototype.
6827 (init_registers_powerpc_cell64l): Likewise.
6828 (ppc_arch_setup): Detect Cell/B.E. architecture.
6832 * Makefile.in (datarootdir): New variable.
6836 * linux-low.c (linux_write_memory): Update debugging output.
6837 * Makefile.in (clean): Add new descriptions.
6838 (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
6839 (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
6840 * configure.srv: Add new files for arm*-*-linux*.
6841 * linux-arm-low.c: Add new declarations.
6842 (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
6843 (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
6844 (HWCAP_VFPv3D16): New.
6845 (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
6846 instead of __IWMMXT__.
6847 (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
6848 (arm_arch_setup): New.
6849 (target_regsets): Remove #ifdef. Add VFP regset.
6850 (the_low_target): Use arm_arch_setup.
6854 * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
6855 the main thread again.
6859 Adding Neutrino gdbserver.
6860 * configure: Regenerated.
6861 * configure.ac: Add case for srv_qnx and set LIBS accordingly.
6862 * configure.srv (i[34567]86-*-nto*): New target.
6863 * nto-low.c, nto-low.h, nto-x86-low.c: New files.
6864 * remote-utils.c [__QNX__]: Include sys/iomgr.h
6865 (nto_comctrl) [__QNX__]: New function.
6866 (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
6870 * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
6876 * win32-i386-low.c (i386_get_thread_context): Handle systems that
6877 don't support CONTEXT_EXTENDED_REGISTERS.
6878 (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
6879 (the_low_target): Install them.
6880 * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
6881 failing with ERROR_PIPE_NOT_CONNECTED.
6886 Add h/w watchpoint support to x86-linux, win32-i386.
6887 * Makefile.in (SFILES): Add i386-low.c
6888 (i386_low_h): Define.
6889 (i386-low.o): Add dependencies.
6890 (linux-x86-low.o): Add i386-low.h dependency.
6891 (win32-i386-low.o): Ditto.
6892 * i386-low.c: New file.
6893 * i386-low.h: New file.
6894 * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
6895 (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
6896 * linux-low.c (linux_add_process): Initialize arch_private.
6897 (linux_remove_process): Free arch_private.
6898 (add_lwp): Initialize arch_private.
6899 (delete_lwp): Free arch_private.
6900 (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
6902 * linux-low.h (process_info_private): New member arch_private.
6903 (lwp_info): New member arch_private.
6904 (linux_target_ops): New members new_process, new_thread,
6906 (ptid_of): New macro.
6907 * linux-x86-low.c: Include stddef.h, i386-low.h.
6908 (arch_process_info): New struct.
6909 (arch_lwp_info): New struct.
6910 (x86_linux_dr_get, x86_linux_dr_set): New functions.
6911 (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
6912 (i386_dr_low_get_status): New function.
6913 (x86_insert_point, x86_remove_point): New functions.
6914 (x86_stopped_by_watchpoint): New function.
6915 (x86_stopped_data_address): New function.
6916 (x86_linux_new_process, x86_linux_new_thread): New functions.
6917 (x86_linux_prepare_to_resume): New function.
6918 (the_low_target): Add entries for insert_point, remove_point,
6919 stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
6921 * server.c (debug_hw_points): New global.
6922 (monitor_show_help): Document set debug-hw-points.
6923 (handle_query): Process "set debug-hw-points".
6924 * server.h (debug_hw_points): Declare.
6925 (paddress): Declare.
6926 * utils.c (NUMCELLS, CELLSIZE): New macros.
6927 (get_sell, xsnprintf, paddress): New functions.
6928 * win32-arm-low.c (the_low_target): Add entries for insert_point,
6929 remove_point, stopped_by_watchpoint, stopped_data_address.
6930 * win32-i386-low.c: Include i386-low.h.
6931 (debug_reg_state): Replaces dr.
6932 (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
6933 (i386_dr_low_get_status): New function.
6934 (i386_insert_point, i386_remove_point): New functions.
6935 (i386_stopped_by_watchpoint): New function.
6936 (i386_stopped_data_address): New function.
6937 (i386_initial_stuff): Update.
6938 (get_thread_context,set_thread_context,i386_thread_added): Update.
6939 (the_low_target): Add entries for insert_point,
6940 remove_point, stopped_by_watchpoint, stopped_data_address.
6941 * win32-low.c (win32_insert_watchpoint): New function.
6942 (win32_remove_watchpoint): New function.
6943 (win32_stopped_by_watchpoint): New function.
6944 (win32_stopped_data_address): New function.
6945 (win32_target_ops): Add entries for insert_watchpoint,
6946 remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
6947 * win32-low.h (win32_target_ops): New members insert_point,
6948 remove_point, stopped_by_watchpoint, stopped_data_address.
6952 * server.c (process_serial_event): Re-return unsupported, not
6953 error, if the type isn't recognized. Re-allow supporting only
6954 insert or remove packets. Also call require_running for
6955 breakpoints. Add missing break statement to default case. Tidy.
6956 * target.h (struct target_ops): Rename insert_watchpoint to
6957 insert_point, and remove_watchpoint to remove_point.
6959 * linux-low.h (struct linux_target_ops): Likewise.
6960 * linux-low.c (linux_insert_watchpoint): Rename to ...
6961 (linux_insert_point): ... this. Adjust.
6962 (linux_remove_watchpoint): Rename to ...
6963 (linux_remove_point): ... this. Adjust.
6964 (linux_target_ops): Adjust.
6965 * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
6966 (cris_insert_point): ... this.
6967 (cris_remove_watchpoint): Rename to ...
6968 (cris_remove_point): ... this.
6969 (the_low_target): Adjust.
6973 * server.c (handle_v_kill): Pass signal_pid to
6974 kill_inferior if multi_process is zero.
6978 * server.c (process_serial_event): Add support for Z0 and Z1 packet.
6979 * target.h (target_ops): Comment for *_watchpoint to make it clear
6980 the functions can get types '0' and '1'.
6984 * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
6985 * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
6986 * regcache.c (get_regcache): Likewise.
6987 * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
6988 * win32-low.c (child_fetch_inferior_registers): Remove check for
6994 * target.h (struct target_ops) <supports_multi_process>: New
6996 (target_supports_multi_process): New.
6997 * server.c (handle_query): Even if GDB reports support, only
6998 enable multi-process if the target also supports it. Report
6999 multi-process support only if the target backend supports it.
7000 * linux-low.c (linux_supports_multi_process): New function.
7001 (linux_target_ops): Install it as target_supports_multi_process
7006 Global renaming of find_thread_pid to find_thread_ptid.
7007 * server.h (find_thread_ptid): Renamed from find_thread_pid.
7008 * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
7009 All callers updated.
7011 * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
7012 to resume the newly created thread, don't call ptrace (PTRACE_CONT)
7015 * linux-low.c (get_stop_pc): Print pc if debug_threads.
7016 (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
7017 (linux_resume_one_lwp): Ditto.
7021 * linux-low.c (linux_resume_one_lwp): Change type of first arg
7022 from struct inferior_list_entry * to struct lwp_info *.
7023 All callers updated.
7027 * linux-x86-low.c: Don't include assert.h.
7028 (x86_siginfo_fixup): Use fatal, not assert.
7029 (x86_arch_setup): Fix comment.
7033 Biarch support for i386/amd64 gdbserver.
7034 * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
7035 Add linux-x86-low.c.
7036 (linux-i386-low.o, linux-x86-64-low.o): Delete.
7037 (linux-x86-low.o): Add.
7038 * linux-x86-64-low.c: Delete.
7039 * linux-i386-low.c: Delete.
7040 * linux-x86-low.c: New file.
7041 * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
7043 (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
7045 (x86_64-linux srv_regobj): Add reg-i386-linux.o.
7046 * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
7047 (linux_child_pid_to_exec_file): New function.
7048 (elf_64_header_p, elf_64_file_p): New functions.
7049 (siginfo_fixup): New function.
7050 (linux_xfer_siginfo): New local inf_siginfo. Call siginfo_fixup to
7051 give target a chance to convert layout.
7052 * linux-low.h (linux_target_ops): New member siginfo_fixup.
7053 (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
7057 * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
7058 (regsets_store_inferior_registers): Ditto.
7064 * linux-low.c (must_set_ptrace_flags): Delete.
7065 (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
7067 (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here. Set
7068 `lwp->must_set_ptrace_flags' instead.
7069 (linux_wait_for_event_1): Set ptrace options here.
7070 (linux_wait_1): ... not here.
7074 * inferiors.c (started_inferior_callback): New function.
7075 (attached_inferior_callback): New function.
7076 (have_started_inferiors_p, have_attached_inferiors_p): New functions.
7077 * server.c (print_started_pid, print_attached_pid): New functions.
7078 (detach_or_kill_for_exit): New function.
7079 (main): Call it instead of for_each_inferior (kill_inferior_callback).
7080 * server.h (have_started_inferiors_p): Declare.
7081 (have_attached_inferiors_p): Declare.
7083 * inferiors.c (remove_process): Fix memory leak, free process.
7084 * linux-low.c (linux_remove_process): New function.
7085 (linux_kill): Call it instead of remove_process.
7086 (linux_detach, linux_wait_1): Ditto.
7090 * configure.srv: Add x86 Windows CE target.
7094 * inferiors.c (get_thread_process): Make global.
7095 * server.h (get_thread_process): Add prototype.
7096 * thread-db.c (find_one_thread): Use get_thread_process
7097 instead of current_process.
7098 (thread_db_get_tls_address): Do not crash if called when
7099 thread layer is not yet initialized.
7103 * remote-utils.c (prepare_resume_reply): Null-terminate packet.
7104 * spu-low.c (current_tid): Rename to ...
7105 (current_ptid): ... this.
7106 (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
7107 spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
7108 ptid_get_lwp (current_ptid) instead of current_tid.
7109 (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
7110 instead of current_tid. Use find_process_pid to verify pid
7111 argument is valid. Pass proper argument to remove_process.
7112 (spu_thread_alive): Compare current_ptid instead of current_tid.
7113 (spu_resume): Likewise.
7117 * linux-low.c (usr_store_inferior_registers): Declare local `pid'
7122 Implement the multiprocess extensions, and add linux multiprocess
7125 * server.h (ULONGEST): Declare.
7126 (struct ptid, ptid_t): New.
7127 (minus_one_ptid, null_ptid): Declare.
7128 (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
7129 (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
7130 (struct inferior_list_entry): Change `id' type from unsigned from
7132 (struct sym_cache, struct breakpoint, struct
7133 process_info_private): Forward declare.
7134 (struct process_info): Declare.
7135 (current_process): Declare.
7136 (all_processes): Declare.
7137 (initialize_inferiors): Declare.
7138 (add_thread): Adjust to use ptid_t.
7139 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
7140 (add_process, remove_process, find_thread_pid): Declare.
7141 (find_inferior_id): Adjust to use ptid_t.
7142 (cont_thread, general_thread, step_thread): Change type to ptid_t.
7143 (multi_process): Declare.
7144 (push_event): Adjust to use ptid_t.
7145 (read_ptid, write_ptid): Declare.
7146 (prepare_resume_reply): Adjust to use ptid_t.
7147 (clear_symbol_cache): Declare.
7148 * inferiors.c (all_processes): New.
7149 (null_ptid, minus_one_ptid): New.
7150 (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
7151 (ptid_get_tid, ptid_equal, ptid_is_pid): New.
7152 (add_thread): Change unsigned long to ptid. Remove gdb_id
7154 (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
7155 (gdb_id_to_thread): Rename to ...
7156 (find_thread_pid): ... this. Change unsigned long to ptid.
7157 (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
7158 (loaded_dll, pull_pid_from_list): Adjust.
7159 (add_process, remove_process, find_process_pid)
7160 (get_thread_process, current_process, initialize_inferiors): New.
7161 * target.h (struct thread_resume) <thread>: Change type to ptid_t.
7162 (struct target_waitstatus) <related_pid>: Ditto.
7163 (struct target_ops) <kill, detach>: Add `pid' argument. Change
7165 (struct target_ops) <join>: Add `pid' argument.
7166 (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
7167 (struct target_ops) <wait>: Add `ptid' field. Change return type
7169 (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
7170 (mywait): Add `ptid' argument. Change return type to ptid_t.
7171 (target_pid_to_str): Declare.
7172 * target.c (set_desired_inferior): Adjust to use ptids.
7173 (mywait): Add new `ptid' argument. Adjust.
7174 (target_pid_to_str): New.
7175 * mem-break.h (free_all_breakpoints): Declare.
7176 * mem-break.c (breakpoints): Delelete.
7177 (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
7178 (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
7179 to use per-process breakpoint list.
7180 (free_all_breakpoints): New.
7181 * remote-utils.c (struct sym_cache) <name>: Drop `const'.
7182 (symbol_cache, all_symbols_looked_up): Delete.
7184 (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
7186 (prepare_resume_reply): Change ptid argument's type from unsigned
7187 long to ptid_t. Adjust. Implement W;process and X;process.
7188 (free_sym_cache, clear_symbol_cache): New.
7189 (look_up_one_symbol): Adjust to per-process symbol cache. *
7190 * server.c (cont_thread, general_thread, step_thread): Change type
7193 (multi_process): New.
7194 (last_ptid): Change type to ptid_t.
7195 (struct vstop_notif) <ptid>: Change type to ptid_t.
7196 (queue_stop_reply, push_event): Change `ptid' argument's type to
7198 (discard_queued_stop_replies): Add `pid' argument.
7199 (start_inferior): Adjust to use ptids. Adjust to mywait interface
7200 changes. Don't reference the `attached' global.
7201 (attach_inferior): Adjust to mywait interface changes.
7202 (handle_query): Adjust to use ptids. Parse GDB's qSupported
7203 features. Handle and report "multiprocess+". Handle
7205 (handle_v_cont): Adjust to use ptids. Adjust to mywait interface
7207 (handle_v_kill): New.
7208 (handle_v_stopped): Adjust to use target_pid_to_str.
7209 (handle_v_requests): Allow multiple attaches and runs when
7210 multiprocess extensions are in effect. Handle "vKill".
7211 (myresume): Adjust to use ptids.
7212 (queue_stop_reply_callback): Add `arg' parameter. Handle it.
7213 (handle_status): Adjust to discard_queued_stop_replies interface
7215 (first_thread_of, kill_inferior_callback)
7216 (detach_or_kill_inferior_callback, join_inferiors_callback): New.
7217 (main): Call initialize_inferiors. Adjust to use ptids, killing
7218 and detaching from all inferiors. Handle multiprocess packet
7220 * linux-low.h: Include gdb_proc_service.h.
7221 (struct process_info_private): New.
7222 (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
7223 <lwpid_of>: Use ptid_get_lwp.
7224 (get_lwp_thread): Adjust.
7225 (struct lwp_info): Add `dead' member.
7226 (find_lwp_pid): Declare.
7227 * linux-low.c (thread_db_active): Delete.
7228 (new_inferior): Adjust comment.
7229 (inferior_pid): Delete.
7230 (linux_add_process): New.
7231 (handle_extended_wait): Adjust.
7232 (add_lwp): Change unsigned long to ptid.
7233 (linux_create_inferior): Add process to processes table. Adjust
7234 to use ptids. Don't set new_inferior here.
7235 (linux_attach_lwp): Rename to ...
7236 (linux_attach_lwp_1): ... this. Add `initial' argument. Handle
7237 it. Adjust to use ptids.
7238 (linux_attach_lwp): New.
7239 (linux_attach): Add process to processes table. Don't set
7241 (struct counter): New.
7242 (second_thread_of_pid_p, last_thread_of_process_p): New.
7243 (linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to
7245 (linux_kill): Add `pid' argument. Handle it. Adjust to multiple
7246 processes. Remove process from process table.
7247 (linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust
7248 to multiple processes.
7249 (any_thread_of): New.
7250 (linux_detach): Add `pid' argument, and handle it. Remove process
7251 from processes table.
7252 (linux_join): Add `pid' argument. Handle it.
7253 (linux_thread_alive): Change unsighed long argument to ptid_t.
7254 Consider dead lwps as not being alive.
7255 (status_pending_p): Rename `dummy' argument to `arg'. Filter out
7256 threads we're not interested in.
7257 (same_lwp, find_lwp_pid): New.
7258 (linux_wait_for_lwp): Change `pid' argument's type from int to
7260 (linux_wait_for_event): Rename to ...
7261 (linux_wait_for_event_1): ... this. Change `pid' argument's type
7262 from int to ptid_t. Adjust.
7263 (linux_wait_for_event): New.
7264 (linux_wait_1): Add `ptid' argument. Change return type to
7265 ptid_t. Adjust. Use last_thread_of_process_p. Remove processes
7266 that exit from the process table.
7267 (linux_wait): Add `ptid' argument. Change return type to ptid_t.
7269 (mark_lwp_dead): New.
7270 (wait_for_sigstop): Adjust to use ptids. If a process exits while
7271 stopping all threads, mark its main lwp as dead.
7272 (linux_set_resume_request, linux_resume_one_thread): Adjust to use
7274 (fetch_register, usr_store_inferior_registers)
7275 (regsets_fetch_inferior_registers)
7276 (regsets_store_inferior_registers, linux_read_memory)
7277 (linux_write_memory): Inline `inferior_pid'.
7278 (linux_look_up_symbols): Adjust to use per-process
7280 (linux_request_interrupt): Adjust to use ptids.
7281 (linux_read_auxv): Inline `inferior_pid'.
7282 (initialize_low): Don't reference thread_db_active.
7283 * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
7284 * proc-service.c (ps_lgetregs): Use find_lwp_pid.
7285 (ps_getpid): Return the pid of the current inferior.
7286 * thread-db.c (proc_handle, thread_agent): Delete.
7287 (thread_db_create_event, thread_db_enable_reporting): Adjust to
7289 (find_one_thread): Change argument type to ptid_t. Adjust to
7291 (maybe_attach_thread): Adjust to per-process data and ptids.
7292 (thread_db_find_new_threads): Ditto.
7293 (thread_db_init): Ditto.
7294 * spu-low.c (spu_create_inferior, spu_attach): Add process to
7295 processes table. Adjust to use ptids.
7296 (spu_kill, spu_detach): Adjust interface. Remove process from
7298 (spu_join, spu_thread_alive): Adjust interface.
7299 (spu_wait): Adjust interface. Remove process from processes
7300 table. Adjust to use ptids.
7301 * win32-low.c (current_inferior_tid): Delete.
7302 (current_inferior_ptid): New.
7303 (debug_event_ptid): New.
7304 (thread_rec): Take a ptid. Adjust.
7305 (child_add_thread): Add `pid' argument. Adjust to use ptids.
7306 (child_delete_thread): Ditto.
7307 (do_initial_child_stuff): Add `attached' argument. Add process to
7309 (child_fetch_inferior_registers, child_store_inferior_registers):
7311 (win32_create_inferior): Pass 0 to do_initial_child_stuff.
7312 (win32_attach): Pass 1 to do_initial_child_stuff.
7313 (win32_kill): Adjust interface. Remove process from processes
7315 (win32_detach): Ditto.
7316 (win32_join): Adjust interface.
7317 (win32_thread_alive): Take a ptid.
7318 (win32_resume): Adjust to use ptids.
7319 (get_child_debug_event): Ditto.
7320 (win32_wait): Adjust interface. Remove exiting process from
7325 Non-stop mode support.
7327 * server.h (non_stop): Declare.
7328 (gdb_client_data, handler_func): Declare.
7329 (delete_file_handler, add_file_handler, start_event_loop):
7331 (handle_serial_event, handle_target_event, push_event)
7332 (putpkt_notif): Declare.
7333 * target.h (enum resume_kind): New.
7334 (struct thread_resume): Replace `step' field by `kind' field.
7335 (TARGET_WNOHANG): Define.
7336 (struct target_ops) <wait>: Add `options' argument.
7337 <supports_non_stop, async, start_non_stop>: New fields.
7338 (target_supports_non_stop, target_async): New.
7339 (start_non_stop): Declare.
7340 (mywait): Add `options' argument.
7341 * target.c (mywait): Add `options' argument. Print child exit
7343 (start_non_stop): New.
7344 * server.c (non_stop, own_buf, mem_buf): New globals.
7345 (struct vstop_notif): New.
7346 (notif_queue): New global.
7347 (queue_stop_reply, push_event, discard_queued_stop_replies)
7348 (send_next_stop_reply): New.
7349 (start_inferior): Adjust to use resume_kind. Adjust to mywait
7351 (attach_inferior): In non-stop mode, don't wait for the target
7353 (handle_general_set): Handle QNonStop.
7354 (handle_query): When handling qC, return the current general
7355 thread, instead of the first thread of the list.
7356 (handle_query): If the backend supports non-stop mode, include
7357 QNonStop+ in the qSupported query response.
7358 (handle_v_cont): Adjust to use resume_kind. Handle resume_stop
7360 (handle_v_attach, handle_v_run): Handle non-stop mode.
7361 (handle_v_stopped): New.
7362 (handle_v_requests): Report support for vCont;t. Handle vStopped.
7363 (myresume): Adjust to use resume_kind. Handle non-stop.
7364 (queue_stop_reply_callback): New.
7365 (handle_status): Handle non-stop mode.
7366 (main): Clear non_stop flag on reconnection. Use the event-loop.
7367 Refactor serial protocol handling from here ...
7368 (process_serial_event): ... to this new function. When GDB
7369 selects any thread, select one here. In non-stop mode, wait until
7370 GDB acks all pending events before exiting.
7371 (handle_serial_event, handle_target_event): New.
7372 * remote-utils.c (remote_open): Install remote_desc in the event
7374 (remote_close): Remove remote_desc from the event loop.
7375 (putpkt_binary): Rename to...
7376 (putpkt_binary_1): ... this. Add `is_notic' argument. Handle it.
7377 (putpkt_binary): New as wrapper around putpkt_binary_1.
7378 (putpkt_notif): New.
7379 (prepare_resume_reply): In non-stop mode, don't change the
7381 * event-loop.c: New.
7382 * Makefile.in (OBJ): Add event-loop.o.
7383 (event-loop.o): New rule.
7385 * linux-low.h (pid_of): Moved here.
7387 (get_lwp_thread): Use lwpid_of.
7388 (struct lwp_info): Delete `lwpid' field. Add `suspended' field.
7389 * linux-low.c (pid_of): Delete.
7390 (inferior_pid): Use lwpid_of.
7391 (linux_event_pipe): New.
7392 (target_is_async_p): New.
7394 (handle_extended_wait): Use lwpid_of.
7395 (add_lwp): Don't set lwpid field.
7396 (linux_attach_lwp): Adjust debug output. Use lwpid_of.
7397 (linux_kill_one_lwp): If killing a running lwp, stop it first.
7398 Use lwpid_of. Adjust to linux_wait_for_event interface changes.
7399 (linux_detach_one_lwp): If detaching from a running lwp, stop it
7400 first. Adjust to linux_wait_for_event interface changes. Use
7402 (linux_detach): Don't delete the main lwp here.
7403 (linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of.
7404 (status_pending_p): Don't consider explicitly suspended lwps.
7405 (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
7406 pointer. Add OPTIONS argument. Change return type to int. Use
7407 my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of.
7408 (linux_wait_for_event): Take an integer pid instead of a lwp_info
7409 pointer. Add status pointer argument. Return a pid instead of a
7410 status. Use lwpid_of. Adjust to linux_wait_for_lwp interface
7411 changes. In non-stop mode, don't switch to a random thread.
7412 (linux_wait): Rename to...
7413 (linux_wait_1): ... this. Add target_options argument, and handle
7414 it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode,
7415 don't handle the continue thread. Handle TARGET_WNOHANG. Merge
7416 clean exit and signal exit code. Don't stop all threads in
7417 non-stop mode. In all-stop mode, only stop all threads when
7418 reporting a stop to GDB. Handle explicit thread stop requests.
7419 (async_file_flush, async_file_mark): New.
7421 (send_sigstop): Use lwpid_of.
7422 (wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event
7423 interface changes. In non-stop mode, don't switch to a random
7425 (linux_resume_one_lwp): Use lwpid_of.
7426 (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
7427 (linux_resume_one_thread): ... this. Handle resume_stop. In
7428 non-stop mode, don't look for pending flag in all threads.
7429 (resume_status_pending_p): Don't consider explicitly suspended
7431 (my_waitpid): Reimplement. Emulate __WALL.
7432 (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
7434 (sigchld_handler, linux_supports_non_stop, linux_async)
7435 (linux_start_non_stop): New.
7436 (linux_target_ops): Register linux_supports_non_stop, linux_async
7437 and linux_start_non_stop.
7438 (initialize_low): Install SIGCHLD handler.
7439 * thread-db.c (thread_db_create_event, find_one_thread)
7440 (thread_db_get_tls_address): Use lwpid_of.
7441 * win32-low.c (win32_detach): Adjust to use resume_kind.
7442 (win32_wait): Add `options' argument.
7443 * spu-low.c (spu_resume): Adjust to use resume_kind.
7444 (spu_wait): Add `options' argument.
7448 Decouple target code from remote protocol.
7450 * target.h (enum target_waitkind): New.
7451 (struct target_waitstatus): New.
7452 (struct target_ops) <wait>: Return an unsigned long. Take a
7453 target_waitstatus pointer instead of a char pointer.
7455 * target.c (mywait): Change prototype to return an unsigned long.
7456 Take a target_waitstatus pointer instead of a char pointer. Adjust.
7457 * server.h (thread_from_wait, old_thread_from_wait): Delete
7459 (prepare_resume_reply): Change prototype to take a
7461 * server.c (thread_from_wait, old_thread_from_wait): Delete.
7462 (last_status, last_ptid): New.
7463 (start_inferior): Remove "statusptr" argument. Adjust. Return a
7464 pid instead of a signal.
7465 (attach_inferior): Remove "status" and "signal" parameters.
7467 (handle_query): For qGetTLSAddr, parse the thread id with strtol,
7469 (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
7470 (handle_v_requests, myresume): Remove "status" and "signal"
7472 (handle_status): New.
7473 (main): Delete local `status'. Adjust.
7474 * remote-utils.c: Include target.h.
7475 (prepare_resume_reply): Change prototype to take a
7476 target_waitstatus. Adjust.
7478 * linux-low.c (linux_wait): Adjust to new target_ops->wait
7480 * spu-low.c (spu_wait): Adjust.
7481 * win32-low.c (enum target_waitkind, struct target_waitstatus):
7483 (win32_wait): Adjust.
7487 * target.h (struct thread_resume): Delete leave_stopped member.
7488 (struct target_ops): Add a `n' argument to the `resume' callback.
7489 * server.c (start_inferior): Adjust.
7490 (handle_v_cont, myresume): Adjust.
7491 * linux-low.c (check_removed_breakpoint): Adjust to resume
7492 interface change, and to removed leave_stopped field.
7493 (resume_ptr): Delete.
7494 (struct thread_resume_array): New.
7495 (linux_set_resume_request): Add new `arg' parameter. Adjust to
7496 resume interface change.
7497 (linux_continue_one_thread, linux_queue_one_thread)
7498 (resume_status_pending_p): Check if the resume field is NULL
7499 instead of checking the leave_stopped member.
7500 (linux_resume): Adjust to the target resume interface change.
7501 * spu-low.c (spu_resume): Adjust to the target resume interface
7503 * win32-low.c (win32_detach, win32_resume): Ditto.
7507 * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
7509 (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
7511 (linux_continue_one_thread): Only preserve the stepping flag if
7512 there's a pending breakpoint.
7516 * server.c (main): After the inferior having exited, call
7517 remote_close before exiting gdbserver.
7521 Fix size of FPSCR in Power 7 processors.
7522 * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
7523 (PPC_FEATURE_HAS_DFP): New #define.
7524 (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
7529 * server.c (handle_query) Whitespace and formatting.
7533 * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
7534 linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
7535 linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
7536 linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
7537 regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
7538 thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
7539 Makefile.in, configure.ac: Fix whitespace throughout.
7540 * configure: Regenerate.
7544 * inferiors.c (find_inferior): Make it safe for the callback
7545 function to delete the currently iterated inferior.
7549 * Makefile.in (linuw_low_h): Move higher.
7550 (thread-db.o): Depend on $(linux_low_h).
7554 Rename "process" to "lwp" throughout.
7556 * linux-low.c (all_processes): Rename to...
7557 (all_lwps): ... this.
7558 (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
7559 (add_process): Rename to ...
7560 (add_lwp): ... this. Adjust.
7561 (linux_create_inferior): Adjust.
7562 (linux_attach_lwp): Adjust.
7563 (linux_attach): Adjust.
7564 (linux_kill_one_process): Rename to ...
7565 (linux_kill_one_lwp): ... this. Adjust.
7566 (linux_kill): Adjust.
7567 (linux_detach_one_process): Rename to ...
7568 (linux_detach_one_lwp): ... this. Adjust.
7569 (linux_detach): Adjust.
7570 (check_removed_breakpoint): Adjust.
7571 (status_pending_p): Adjust.
7572 (linux_wait_for_process): Rename to ...
7573 (linux_wait_for_lwp): ... this. Adjust.
7574 (linux_wait_for_event): Adjust.
7575 (send_sigstop): Adjust.
7576 (wait_for_sigstop): Adjust.
7577 (stop_all_processes): Rename to ...
7578 (stop_all_lwps): ... this.
7579 (linux_resume_one_process): Rename to ...
7580 (linux_resume_one_lwp): ... this. Adjust.
7581 (linux_set_resume_request, linux_continue_one_thread)
7582 (linux_queue_one_thread, resume_status_pending_p)
7583 (usr_store_inferior_registers, regsets_store_inferior_registers)
7584 (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
7586 * linux-low.h (get_process): Rename to ...
7587 (get_lwp): ... this. Adjust.
7588 (get_thread_process): Rename to ...
7589 (get_thread_lwp): ... this. Adjust.
7590 (get_process_thread): Rename to ...
7591 (get_lwp_thread): ... this. Adjust.
7592 (struct process_info): Rename to ...
7593 (struct lwp_info): ... this.
7594 (all_processes): Rename to ...
7595 (all_lwps): ... this.
7596 * proc-service.c (ps_lgetregs): Adjust.
7597 * thread-db.c (thread_db_create_event, find_one_thread)
7598 (maybe_attach_thread, thread_db_get_tls_address): Adjust.
7602 * server.c (handle_query): Handle "qAttached".
7606 * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
7607 GPLv3, update license URL.
7611 * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
7612 (server_h): Add gdb_signals.h.
7613 (signals.o): Update.
7614 * server.h (target_signal_from_host,target_signal_to_host_p)
7615 (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
7619 * remote-utils.c (getpkt): Also generate remote-debug
7620 information if noack_mode is set.
7624 * server.c (handle_query): Report qXfer:siginfo:read and
7625 qXfer:siginfo:write as supported and handle them.
7626 * target.h (struct target_ops) <qxfer_siginfo>: New field.
7627 * linux-low.c (linux_xfer_siginfo): New.
7628 (linux_target_ops): Set it.
7632 * server.c (gdbserver_usage): Mention --remote-debug.
7633 (main): Accept '--remote-debug' switch.
7637 * regcache.c (new_register_cache): No need to check result of xcalloc.
7638 * server.c (handle_search_memory): Back out calls to xmalloc,
7639 result is checked and error is returned to user upon failure.
7640 (handle_query): Ditto. Add more checks for result of malloc.
7641 (handle_v_cont): Check result of malloc, report error back to
7643 (handle_v_run): Ditto. Call freeargv.
7644 * server.h (freeargv): Declare.
7645 * utils.c (freeargv): New fn.
7649 * gdbreplay.c (perror_with_name): Make arg const char *.
7650 * server.h (target_signal_to_name): Make return type const char *.
7651 * thread-db.c (thread_db_err_str): Make return type const char *.
7652 * utils.c (perror_with_name): Make arg const char *.
7656 * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
7657 when handling a EXIT_PROCESS_DEBUG_EVENT.
7661 * gdbreplay.c (gdbreplay_version): Update copyright year.
7662 * server.c (gdbserver_version): Likewise.
7666 * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
7667 (handle_extended_wait): Improve comment.
7671 * utils.c (xmalloc,xcalloc,xstrdup): New fns.
7672 * server.h (ATTR_MALLOC): New macro.
7673 (xmalloc,xcalloc,xstrdup): Declare.
7674 * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
7675 * inferiors.c: Ditto.
7676 * linux-low.c: Ditto.
7677 * mem-break.c: Ditto.
7678 * regcache.c: Ditto.
7679 * remote-utils.c: Ditto.
7682 * win32-low.c: Ditto.
7686 * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
7687 in debugging printf.
7689 * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
7693 * linux-low.h (struct process_info): Delete member tid, unused.
7694 * thread-db.c (find_one_thread): Update.
7695 (maybe_attach_thread): Update.
7699 * target.h (struct target_ops): Add qxfer_osdata member.
7700 * linux-low.c: Include ctype.h and pwd.h and sys/types.h
7702 (linux_qxfer_osdata): New functions.
7703 (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
7705 * server.c (handle_query): Handle "qXfer:osdata:read:".
7706 * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
7707 (buffer_xml_printf): New functions.
7708 * server.h (struct buffer): New.
7709 (buffer_grow_str, buffer_grow_str0): New macros.
7710 (buffer_grow, buffer_free, buffer_init, buffer_finish)
7711 (buffer_xml_printf): Declare.
7715 * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
7719 * server.c (handle_v_run): Always use the supplied argument list.
7723 * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
7724 (xtensa_regmap_table): Add entry for scompare1.
7728 * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
7729 powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
7730 powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
7731 powerpc-isa205-64l.o, powerpc-isa205-64l.c,
7732 powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
7733 powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
7734 * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
7735 XML target descriptions.
7736 * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
7737 when inferior is running on an ISA 2.05 or later processor. Add
7738 special case to return offset for full 64-bit slot of FPSCR when
7743 * Makefile.in (SFILES, clean): Added sparc64 files.
7744 (reg-sparc64.o, reg-sparc64.c): New.
7745 * configure.srv (sparc*-*-linux*): New configuration.
7746 * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
7747 syscall arguments for SPARC.
7748 (regsets_store_inferior_registers): Likewise.
7749 * linux-sparc-low.c: New file.
7753 * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
7754 (READLINE_DIR,READLINE_DEP): Delete.
7755 (INTERNAL_CFLAGS): Update.
7756 (LINTFLAGS): Update.
7760 * server.c (handle_v_run): If GDB didn't specify an argv, use the
7761 whole argv from the last run, not just argv[0].
7765 * regcache.c (new_register_cache): Return NULL if the register
7766 cache size isn't known yet.
7767 (free_register_cache): Avoid dereferencing a NULL regcache.
7771 * configure.srv: Merge MIPS and MIPS64.
7775 * Makefile.in (uninstall): Apply $(EXEEXT) too.
7779 * Makefile.in: Add required vsx dependencies.
7781 * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
7782 Declare init_registers_powerpc_vsx32l.
7783 Declare init_registers_powerpc_vsx64l.
7784 Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
7785 (ppc_arch_setup): Check for VSX in hwcap.
7786 (ppc_fill_vsxregset): New function.
7787 (ppc_store_vsxregset): New function.
7788 Add new VSX entry in regset_info target_regsets.
7790 * configure.srv: Add new VSX dependencies.
7794 * remote-utils.c (noack_mode, transport_is_reliable): New globals.
7795 (remote_open): Set or clear transport_is_reliable.
7796 (putpkt_binary): Don't expect acks in noack mode.
7797 (getpkt): Don't send ack/nac in noack mode.
7798 * server.c (handle_general_set): Handle QStartNoAckMode.
7799 (handle_query): If connected by tcp pass QStartNoAckMode+ in
7801 (main): Reset noack_mode on every connection.
7802 * server.h (noack_mode): Declare.
7806 * Makefile.in (GDBREPLAY_OBS): New variable.
7807 (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
7812 * linux-low.c (linux_resume_one_process): Ignore ESRCH.
7813 (usr_store_inferior_registers): Likewise.
7814 (regsets_store_inferior_registers): Likewise.
7819 * configure.ac: Check for memmem declaration.
7820 * server.c [HAVE_MALLOC_H]: Include malloc.h.
7821 (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
7822 (disable_packet_qfThreadInfo): Unconditionally compile.
7823 * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
7824 * configure, config.in: Regenerate.
7828 * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
7829 (linux_write_memory): Remove declaration of errno.
7833 * linux-low.c (handle_extended_wait): Do not use "status"
7834 variable uninitialized.
7838 * server.c (handle_v_attach): Inhibit reporting dll changes.
7842 * remote-utils.c (prepare_resume_reply): If requested, don't
7843 output "thread:TID" in the T stop reply.
7845 * server.c (disable_packet_vCont, disable_packet_Tthread)
7846 (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
7847 (handle_query): If requested, disable support for qC, qfThreadInfo
7849 (handle_v_requests): If requested, disable support for vCont.
7850 (gdbserver_show_disableable): New.
7851 (main): Handle --disable-packet and --disable-packet=LIST.
7853 * server.h (disable_packet_vCont, disable_packet_Tthread)
7854 (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
7858 * server.c (gdbserver_usage): Mention --version.
7862 * Makefile.in (gdbreplay.o): New rule.
7866 * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
7867 message, not gdbserver.
7873 * acinclude.m4: Include ../../config/acx.m4.
7874 * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
7875 * configure, config.in: Regenerate.
7876 * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
7877 * server.c (gdbserver_version): Print PKGVERSION.
7878 (gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO.
7879 (main): Adjust gdbserver_usage calls.
7880 * gdbreplay.c (version, host_name): Add declarations.
7881 (gdbreplay_version, gdbreplay_usage): New.
7882 (main): Accept --version and --help options.
7886 * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
7887 (arm_breakpoint_at): Handle Thumb.
7888 (the_low_target): Add comment.
7892 * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
7896 * server.h (decode_search_memory_packet): Declare.
7897 * remote-utils.c (decode_search_memory_packet): New fn.
7898 * server.c (handle_search_memory_1): New fn.
7899 (handle_search_memory): New fn.
7900 (handle_query): Process qSearch:memory packets.
7904 * regcache.c (registers_length): Remove.
7905 (set_register_cache): Verify that PBUFSIZ is large enough to hold a
7906 full register packet.
7907 * regcache.h (registers_length): Remove prototype.
7908 * server.h (PBUFSIZ): Define to 16384.
7912 * configure.srv (powerpc*-*-linux*): Set srv_regobj to
7913 powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
7914 powerpc-64l.o, and powerpc-altivec64l.o.
7915 Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
7916 rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
7917 rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
7918 rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
7919 rs6000/power-linux.xml, and rs6000/power64-linux.xml
7922 * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
7923 (powerpc-32l.o, powerpc-32l.c): ... these new rules.
7924 (powerpc-32.o, powerpc-32.c): Remove, replace by ...
7925 (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
7926 (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
7927 (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
7928 (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
7929 (powerpc-64l.o, powerpc-64l.c): ... these new rules.
7930 (powerpc-64.o, powerpc-64.c): Remove, replace by ...
7931 (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
7934 * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
7935 (init_registers_powerpc_32l): ... this new prototype.
7936 (init_registers_powerpc_32): Remove, replace by ...
7937 (init_registers_powerpc_altivec32l): ... this new prototype.
7938 (init_registers_powerpc_e500): Remove, replace by ...
7939 (init_registers_powerpc_e500l): ... this new prototype.
7940 (init_registers_ppc64): Remove, replace by ...
7941 (init_registers_powerpc_64l): ... this new prototype.
7942 (init_registers_powerpc_64): Remove, replace by ...
7943 (init_registers_powerpc_altivec64l): ... this new prototype.
7944 (ppc_num_regs): Set to 73.
7945 (PT_ORIG_R3, PT_TRAP): Define if necessary.
7946 (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
7947 (ppc_cannot_store_register): Handle orig_r3 and trap.
7948 (ppc_arch_setup): Update init_registers_... calls.
7949 (ppc_fill_gregset): Handle orig_r3 and trap.
7951 * inferiors.c (clear_inferiors): Reset current_inferior.
7955 * acinclude.m4: Add override.m4.
7956 * configure: Regenerate.
7960 * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
7961 initial call to init_register_ppc64.
7965 * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
7966 single powerpc*-*-linux* case.
7967 (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
7971 * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
7972 srv_regobj. Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
7974 * linux-ppc-low.c: Include <elf.h>.
7975 (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
7976 (ppc_hwcap): New global variable.
7977 (ppc_regmap): Remove __SPE__ #ifdef sections.
7978 (ppc_regmap_e500): New global variable.
7979 (ppc_cannot_store_register): Update __SPE__ special case.
7980 (ppc_get_hwcap): New function.
7981 (ppc_arch_setup): Use it to determine whether inferior supports
7982 AltiVec or SPE registers. Set the_low_target.regmap if appropriate.
7983 (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
7984 Do not access registers if target does not support AltiVec.
7985 (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
7986 Do not access registers if target does not support SPE.
7987 (target_regsets): Unconditionally include AltiVec and SPE regsets.
7991 * linux-low.c (disabled_regsets, num_regsets): New.
7992 (use_regsets_p): Delete.
7993 (linux_wait_for_process): Clear disabled_regsets.
7994 (regsets_fetch_inferior_registers): Check and set it.
7995 (regsets_store_inferior_registers): Likewise.
7996 (linux_fetch_registers, linux_store_registers): Do not use
7998 (initialize_low): Allocate disabled_regsets.
8002 * Makefile.in (LIBOBJS): New.
8004 (memmem.o): New rule.
8005 * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
8006 * configure: Regenerated.
8010 * server.c (handle_query): Never return "unsupported" for
8011 qXfer:features:read queries.
8015 * server.c (get_features_xml): Fix inverted condition.
8016 (handle_query): Always support qXfer:feature:read.
8020 * server.c (wrapper_argv): New.
8021 (start_inferior): Handle wrapper_argv. If set, expect an extra
8023 (gdbserver_usage): Document --wrapper.
8024 (main): Parse --wrapper.
8028 * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
8029 powerpc-*-linux* to srv_regobj and reg_xmlfiles.
8030 * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
8031 (ppc_set_pc): Likewise.
8032 (ppc_arch_setup): New function.
8033 (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
8034 of collect_register.
8035 (the_low_target): Use ppc_arch_setup as arch_setup initializer.
8039 * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
8040 instead of linux-ppc64-low.o.
8041 * linux-ppc64-low.c: Remove file.
8042 * Makefile.in (SFILES): Remove linux-ppc64-low.c.
8043 (linux-ppc64-low.o): Remove rule.
8045 * linux-ppc-low.c (init_registers_ppc64): Add prototype.
8046 (init_registers_powerpc_64): Likewise.
8047 (ppc_regmap): Conditionally define depending on __powerpc64__.
8048 (ppc_cannot_store_register): Do not special-case "fpscr" when
8049 compiled on __powerpc64__.
8050 (ppc_collect_ptrace_register): New function.
8051 (ppc_supply_ptrace_register): New function.
8052 (ppc_breakpoint): Change type to "unsigned int".
8053 (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
8054 (the_low_target): Conditionally provide initializers for the
8055 arch_setup member depending on __powerpc64__. Install
8056 collect_ptrace_register and supply_ptrace_register members.
8060 * regcache.h (gdbserver_xmltarget): Add extern declaration.
8061 * server.c (gdbserver_xmltarget): Define.
8062 (get_features_xml): Use it to replace "target.xml" and arch_string.
8064 * configure.srv: Remove srv_xmltarget. Add XML files that were
8065 mentioned there to srv_xmlfiles instead. Remove conditional tests
8066 on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
8067 srv_xmlfiles and srv_regobj to include all possible choices.
8068 * configure.ac (srv_xmltarget): Remove.
8069 (srv_xmlfiles): Do not add "target.xml".
8070 (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
8071 checks for supplementary target information.
8072 * configure: Regenerate.
8073 * Makefile.in (XML_TARGET): Remove.
8074 (target.xml): Remove rule.
8075 (clean): Do not clean up target.xml.
8076 (.PRECIOUS): Do not mention target.xml.
8078 * target.h (struct target_ops): Remove arch_string member.
8079 * linux-low.c (linux_arch_string): Remove.
8080 (linux_target_ops): Remove arch_string initializer.
8081 * linux-low.h (struct linux_target_ops): Remove arch_string member.
8082 * linux-i386-low.c (the_low_target): Remove arch_string initializer.
8083 * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
8084 * spu-low.c (spu_arch_string): Remove.
8085 (spu_target_ops): Remove arch_string initializer.
8086 * win32-low.c (win32_arch_string): Remove.
8087 (win32_target_ops): Remove arch_string initializer.
8088 * win32-low.h (struct win32_target_ops): Remove arch_string member.
8089 * win32-arm-low.c (the_low_target): Remove arch_string initializer.
8090 * win32-i368-low.c (the_low_target): Remove arch_string initializer.
8094 * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
8095 by collect_ptrace_register and supply_ptrace_register hooks.
8096 * linux-low.c (fetch_register): Use supply_ptrace_register callback
8097 instead of checking for the_low_target.left_pad_xfer.
8098 (usr_store_inferior_registers): Use collect_ptrace_register callback
8099 instead of checking for the_low_target.left_pad_xfer.
8101 * linux-s390-low.c (s390_collect_ptrace_register): New function.
8102 (s390_supply_ptrace_register): Likewise.
8103 (s390_fill_gregset): Call s390_collect_ptrace_register.
8104 (the_low_target): Update.
8106 * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
8107 (ppc_supply_ptrace_register): Likewise.
8108 (the_low_target): Update.
8110 * linux-i386-low.c (the_low_target): Update.
8111 * linux-x86-64-low.c (the_low_target): Update.
8115 * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
8116 reg-s390.o and reg-s390x.o.
8118 * linux-low.c (new_inferior): New global variable.
8119 (linux_create_inferior, linux_attach): Set it.
8120 (linux_wait_for_process): Call the_low_target.arch_setup after the
8121 target has stopped for the first time.
8122 (initialize_low): Do not call the_low_target.arch_setup.
8124 * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
8125 (s390_set_pc): Likewise.
8126 (s390_arch_setup): New function.
8127 (the_low_target): Use s390_arch_setup as arch_setup routine.
8129 * regcache.c (realloc_register_cache): New function.
8130 (set_register_cache): Call it for each existing regcache.
8134 * server.h (init_registers): Remove prototype.
8136 * linux-low.h (struct linux_target_ops): Add arch_setup field.
8137 * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
8138 instead of init_registers ().
8139 * linux-arm-low.c (init_registers_arm): Add prototype.
8140 (init_registers_arm_with_iwmmxt): Likewise.
8141 (the_low_target): Add initializer for arch_setup field.
8142 * linux-cris-low.c (init_registers_cris): Add prototype.
8143 (the_low_target): Add initializer for arch_setup field.
8144 * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
8145 (the_low_target): Add initializer for arch_setup field.
8146 * linux-i386-low.c (init_registers_i386_linux): Add prototype.
8147 (the_low_target): Add initializer for arch_setup field.
8148 * linux-ia64-low.c (init_registers_ia64): Add prototype.
8149 (the_low_target): Add initializer for arch_setup field.
8150 * linux-m32r-low.c (init_registers_m32r): Add prototype.
8151 (the_low_target): Add initializer for arch_setup field.
8152 * linux-m68k-low.c (init_registers_m68k): Add prototype.
8153 (the_low_target): Add initializer for arch_setup field.
8154 * linux-mips-low.c (init_registers_mips_linux): Add prototype.
8155 (init_registers_mips64_linux): Likewise.
8156 (the_low_target): Add initializer for arch_setup field.
8157 * linux-ppc-low.c (init_registers_ppc): Add prototype.
8158 (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
8159 (the_low_target): Add initializer for arch_setup field.
8160 * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
8161 (init_registers_powerpc_64): Likewise.
8162 (the_low_target): Add initializer for arch_setup field.
8163 * linux-s390-low.c (init_registers_s390): Add prototype.
8164 (init_registers_s390x): Likewise.
8165 (the_low_target): Add initializer for arch_setup field.
8166 * linux-sh-low.c (init_registers_sh): Add prototype.
8167 (the_low_target): Add initializer for arch_setup field.
8168 * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
8169 (the_low_target): Add initializer for arch_setup field.
8170 * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
8171 (the_low_target): Add initializer for arch_setup field.
8173 * win32-low.h (struct win32_target_ops): Add arch_setup field.
8174 * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
8175 instead of init_registers ().
8176 * win32-arm-low.c (init_registers_arm): Add prototype.
8177 (the_low_target): Add initializer for arch_setup field.
8178 * win32-i386-low.c (init_registers_i386): Add prototype.
8179 (the_low_target): Add initializer for arch_setup field.
8181 * spu-low.c (init_registers_spu): Add prototype.
8182 (initialize_low): Call initialie_registers_spu () instead of
8183 initialize_registers ().
8187 * server.c (handle_v_requests): When handling the vRun and vAttach
8188 packets, if already debugging a process, don't kill it. Return an
8193 * server.c (handle_query): Correct length check.
8197 * win32-low.c (do_initial_child_stuff): Add process handle
8198 parameter. Set current_process_handle and current_process_id from the
8199 parameters. Clear globals.
8200 (win32_create_inferior): Don't set current_process_handle and
8201 current_process_id here. Instead pass them on the call to
8202 do_initial_child_stuff.
8203 (win32_attach): Likewise.
8204 (win32_clear_inferiors): New.
8205 (win32_kill): Don't close the current process handle or the
8206 current thread handle here. Instead call win32_clear_inferiors.
8207 (win32_detach): Don't open a new handle to the process. Call
8208 win32_clear_inferiors.
8209 (win32_join): Don't rely on current_process_handle; open a new
8210 handle using the process id.
8211 (win32_wait): Call win32_clear_inferiors when the inferior process
8216 * server.c (monitor_show_help): Add "exit".
8220 * Makefile.in (SFILES): Add linux-xtensa-low.c.
8221 (clean): Add reg-xtensa.c.
8222 (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
8223 * configure.srv (xtensa*-*-linux*) New target.
8224 * linux-xtensa-low.c: New.
8225 * xtensa-xtregs.c: New.
8229 * hostio.c: Don't include errno.h.
8230 (errno_to_fileio_errno): Move to hostio-errno.
8231 * hostio.c: (hostio_error): Remove the error parameter. Defer the
8232 error number outputting to the target->hostio_last_error callback.
8233 (hostio_packet_error): Use FILEIO_EINVAL directly.
8234 (handle_open, handle_pread, hostio_error, handle_unlink): Update
8235 calls to hostio_error.
8236 * hostio-errno.c: New.
8237 * server.h (hostio_last_error_from_errno): Declare.
8238 * target.h (target_ops): Add hostio_last_error member.
8239 * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
8240 as hostio_last_error handler.
8241 * spu-low.c (spu_target_ops): Likewise.
8242 * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
8243 (wince_hostio_last_error): New functions.
8244 (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
8245 as hostio_last_error handler.
8246 (win32_target_ops) [!_WIN32_WCE]: Register
8247 hostio_last_error_from_errno as hostio_last_error handler.
8248 * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
8249 (hostio-errno.o): New rule.
8250 * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
8251 * configure.srv (srv_hostio_err_objs): New variable. Default to
8253 (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
8254 * configure: Regenerate.
8258 * linux-low.c (linux_attach_lwp): Do not _exit after errors.
8259 (linux_kill, linux_detach): Clean up the process list.
8260 * remote-utils.c (remote_open): Improve port number parsing.
8261 (putpkt_binary, input_interrupt): Only send interrupts if the target
8263 * server.c (extended_protocol): Make static.
8264 (attached): Define earlier.
8265 (exit_requested, response_needed, program_argv): New variables.
8266 (target_running): New.
8267 (start_inferior): Clear attached here.
8268 (attach_inferior): Set attached here.
8269 (require_running): Define.
8270 (handle_query): Use require_running and target_running. Implement
8272 (handle_v_attach, handle_v_run): New.
8273 (handle_v_requests): Use require_running. Handle vAttach and vRun.
8274 (gdbserver_usage): Update.
8275 (main): Redo argument parsing. Handle --debug and --multi. Handle
8276 --attach along with other options or after the port. Save
8277 program_argv. Support no initial program. Resynchronize
8278 communication with GDB after an error. Handle "monitor exit".
8279 Use require_running and target_running. Always allow the extended
8280 protocol. Do not error out for Hc0 or Hc-1. Do not automatically
8281 restart in extended mode.
8282 * README: Refer to the GDB manual. Update --attach usage.
8286 * linux-low.c (STACK_SIZE): Define.
8287 (linux_tracefork_child): Use it. Use __clone2 on ia64.
8288 (linux_test_for_tracefork): Likewise.
8292 * linux-low.c (linux_wait_for_event): Update messages. Do not
8293 reinsert auto-delete breakpoints.
8294 * mem-break.c (struct breakpoint): Change return type of handler to
8296 (set_breakpoint_at): Update handler type.
8297 (reinsert_breakpoint_handler): Return 1 instead of calling
8299 (reinsert_breakpoint_by_bp): Check for the original breakpoint before
8301 (check_breakpoints): Delete auto-delete breakpoints and return 2.
8302 * mem-break.h (set_breakpoint_at): Update handler type.
8303 * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
8304 * win32-low.c (auto_delete_breakpoint): New.
8305 (get_child_debug_event): Use it.
8309 * configure.ac: Check for pread and pwrite.
8310 * hostio.c (handle_pread): Fall back to lseek and read.
8311 (handle_pwrite): Fall back to lseek and write.
8312 * config.in, configure: Regenerated.
8316 * server.c (myresume): Add own_buf argument.
8317 (main): Update calls.
8321 * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
8322 * remote-utils.c (remote_open): Do not call disable_async_io.
8323 (block_async_io): Delete.
8324 (unblock_async_io): Make static.
8325 (initialize_async_io): New.
8326 * server.c (handle_v_cont): Handle async I/O here.
8327 (myresume): Likewise. Move other common resume tasks here...
8328 (main): ... from here. Call initialize_async_io. Disable async
8329 I/O before the main loop.
8330 * server.h (initialize_async_io): Declare.
8331 (block_async_io, unblock_async_io): Delete prototypes.
8332 * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
8336 * remote-utils.c (readchar): Allow binary data in received messages.
8340 * win32-low.c (attaching): New global.
8341 (win32_create_inferior): Clear the `attaching' global.
8342 (win32_attach): Set the `attaching' global.
8343 (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
8344 attaching. Only set a breakpoint at the entry point if not
8349 * server.c (main): Don't report dll events on the initial
8350 connection on attaches.
8354 * server.c (main): Relax numerical bases supported for the pid of
8355 the --attach command line argument.
8359 * win32-low.c (win32_attach): Call OpenProcess before
8360 DebugActiveProcess, not after. Add last error output to error
8365 * win32-low.c (win32_get_thread_context)
8366 (win32_set_thread_context): New functions.
8367 (thread_rec): Use win32_get_thread_context.
8368 (continue_one_thread, win32_resume): Use win32_set_thread_context.
8369 * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
8372 2007-12-03 Leo Zayas
8375 * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
8377 (child_add_thread): Minor cleanup.
8378 (child_continue): Resume artificially suspended threads before
8379 calling ContinueDebugEvent.
8380 (suspend_one_thread): New.
8381 (fake_breakpoint_event): New.
8382 (get_child_debug_event): Change return type to int. Check here if
8383 gdb sent an interrupt request. If a soft interrupt was requested,
8384 fake a breakpoint event. Return 0 if there is no event to handle,
8386 (win32_wait): Don't check here if gdb sent an interrupt request.
8387 Ensure there is a valid event to handle.
8388 (win32_request_interrupt): Add soft interruption method as last
8391 2007-12-03 Leo Zayas
8394 * win32-low.h (win32_thread_info): Add descriptions to the
8395 structure members. Replace `suspend_count' counter by a
8397 * win32-low.c (thread_rec): Update condition of when to get the
8398 context from the inferior. Rely on ContextFlags being set if it
8399 has already been retrieved. Only suspend the inferior thread if
8400 we haven't already. Warn if that fails.
8401 (continue_one_thread): s/suspend_count/suspended/. Only call
8402 ResumeThread once. Warn if that fails.
8406 * win32-low.c (win32_wait): Don't read from the inferior when it
8411 * Makefile.in (win32_low_h): New variable.
8412 (win32-low.o): Add dependency on $(win32_low_h).
8413 (win32-arm-low.o, win32-i386-low.o): New rules.
8417 * hostio.c: Correct copyright year.
8421 * Makefile.in (OBS): Add hostio.o.
8422 (hostio.o): New rule.
8423 * server.h (handle_vFile): Declare.
8424 * hostio.c: New file.
8425 * server.c (handle_v_requests): Take packet_len and new_packet_len
8426 for binary packets. Call handle_vFile.
8427 (main): Update call to handle_v_requests.
8431 * linux-low.c: Include <sched.h>.
8435 * linux-low.c (linux_tracefork_grandchild): New.
8436 (linux_tracefork_child): Use clone.
8437 (linux_test_for_tracefork): Use clone; allocate and free a stack.
8441 * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
8445 * linux-low.c (handle_extended_wait): Handle unexpected signals.
8449 * inferiors.c (change_inferior_id): Delete.
8450 (add_pid_to_list, pull_pid_from_list): New.
8451 * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
8452 (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
8453 (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
8454 (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
8455 (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
8456 (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
8457 (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
8458 (using_threads): Always set to 1.
8459 (handle_extended_wait): New.
8460 (add_process): Do not set TID.
8461 (linux_create_inferior): Set must_set_ptrace_flags.
8462 (linux_attach_lwp): Remove TID argument. Do not check using_threads.
8463 Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers.
8464 (linux_thread_alive): Rename TID argument to LWPID.
8465 (linux_wait_for_process): Handle unknown processes. Do not use TID.
8466 (linux_wait_for_event): Do not use TID or check using_threads. Update
8467 call to dead_thread_notify. Call handle_extended_wait.
8468 (linux_create_inferior): Use PTRACE_SETOPTIONS.
8469 (send_sigstop): Delete sigstop_sent.
8470 (wait_for_sigstop): Avoid TID.
8471 (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
8472 (linux_test_for_tracefork): New.
8473 (linux_lookup_signals): Use thread_db_active and
8474 linux_supports_tracefork_flag.
8475 (initialize_low): Use thread_db_active and linux_test_for_tracefork.
8476 * linux-low.h (get_process_thread): Avoid TID.
8477 (struct process_ifo): Move thread_known and tid to the end. Remove
8479 (linux_attach_lwp, thread_db_init): Update prototypes.
8480 * server.h (change_inferior_id): Delete prototype.
8481 (add_pid_to_list, pull_pid_from_list): New prototypes.
8482 * thread-db.c (thread_db_use_events): New.
8483 (find_first_thread): Rename to...
8484 (find_one_thread): ...this. Update callers and messages. Do not
8485 call fatal. Check thread_db_use_events. Do not call
8486 change_inferior_id or new_thread_notify.
8487 (maybe_attach_thread): Update. Do not call new_thread_notify.
8488 (thread_db_init): Set thread_db_use_events. Check use_events.
8489 * utils.c (fatal, warning): Correct message prefix.
8493 * Makefile.in (clean): Remove new files.
8494 (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
8495 (powerpc-64.o, powerpc-64.c): New rules.
8496 * configure.srv: Use alternate register sets for powerpc64-*-linux*
8497 with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
8499 * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
8501 (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
8502 (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
8503 (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
8504 (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
8505 (target_regsets): Add AltiVec and SPE register sets.
8506 * configure.ac: Check for AltiVec and SPE.
8507 * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
8508 (ppc_fill_vrregset, ppc_store_vrregset): New.
8509 (target_regsets): Add AltiVec register set.
8510 * configure: Regenerated.
8514 * linux-low.c (O_LARGEFILE): Define.
8515 (linux_read_memory): Use /proc/PID/mem.
8516 * configure.ac: Use AC_GNU_SOURCE. Check for pread64.
8517 * configure, config.in: Regenerated.
8521 * linux-low.c (linux_wait_for_event): Do not pass signals while
8526 * win32-low.c (create_process): New.
8527 (win32_create_inferior): Use create_process instead of
8528 CreateProcess. If create_process failed retry appending an ".exe"
8529 suffix. Store the GetLastError result immediatelly after
8530 create_process calls and use it on the call to error.
8534 * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
8538 * configure.ac: Switch license to GPLv3.
8542 * remote-utils.c (putpkt_binary): Memory leak, free buf2.
8546 * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
8548 (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
8549 (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL. Get
8550 CloseToolhelp32Snapshot.
8551 (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
8552 CloseToolhelp32Snapshot.
8556 * server.c (main): Check for inferior exit before main loop.
8560 * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
8561 instead of on tmp_desc.
8566 * inferiors.c (all_dlls, dlls_changed, get_dll): New.
8567 (add_thread): Minor cleanups.
8568 (clear_inferiors): Move lower in the file. Clear the DLL
8570 (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
8571 * remote-utils.c (prepare_resume_reply): Check dlls_changed.
8572 (xml_escape_text): New.
8573 * server.c (handle_query): Handle qXfer:libraries:read. Report it
8575 (handle_v_cont): Report errors.
8576 (gdbserver_version): Update.
8577 (main): Correct size of own_buf. Do not report initial DLL events.
8578 * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
8579 (unloaded_dll, xml_escape_text): New.
8580 * win32-low.c (enum target_waitkind): Update comments.
8581 (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
8582 (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
8583 (win32_EnumProcessModules, win32_GetModuleInformation)
8584 (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
8585 (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
8586 (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
8587 (win32_Module32First, win32_Module32Next, load_toolhelp)
8588 (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
8589 (get_child_debug_event): Handle DLL events.
8590 (win32_wait): Likewise.
8594 * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
8595 * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
8599 * win32-low.c (handle_output_debug_string): Ignore event if not
8604 * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
8608 * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
8612 * inferiors.c (change_inferior_id): Add comment.
8613 * linux-low.c (check_removed_breakpoint): Add an early
8614 prototype. Improve debug output.
8615 (linux_attach): Doc update.
8616 (linux_detach_one_process, linux_detach): Clean up before releasing
8618 (send_sigstop, wait_for_sigstop): Improve comments and debug output.
8619 * linux-low.h (struct process_info): Doc improvement.
8620 * mem-break.c (delete_all_breakpoints): New.
8621 * mem-break.h (delete_all_breakpoints): New prototype.
8622 * thread-db.c (find_first_thread): New.
8623 (thread_db_create_event): Call it instead of
8624 thread_db_find_new_threads. Clean up unused variables.
8625 (maybe_attach_thread): Remove first thread handling.
8626 (thread_db_find_new_threads): Use find_first_thread.
8627 (thread_db_get_tls_address): Likewise.
8631 * thread-db.c (thread_db_find_new_threads): Add prototype.
8632 (thread_db_create_event): Check for the main thread before adding
8634 (maybe_attach_thread): Only enable event reporting if TID == 0.
8635 (thread_db_get_tls_address): Check for new threads.
8639 * linux-low.c (linux_create_inferior): Try execv before execvp.
8640 * spu-low.c (spu_create_inferior): Likewise.
8644 * linux-low.c (linux_create_inferior): Change execv to execvp.
8645 * spu-low.c (spu_create_inferior): Likewies.
8649 * Makefile.in (clean): Clean new files instead of deleted ones.
8650 (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
8651 (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
8653 * configure.srv: Specify XML files and new regformats for MIPS and
8655 * linux-mips-low.c (mips_num_regs): Set to only used registers.
8656 (mips_regmap): Do not fetch $0. Remove unused registers. Add
8657 an entry for the restart register.
8658 (mips_cannot_fetch_register, mips_cannot_store_register)
8659 (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
8660 register names to match the XML descriptions.
8661 (mips_fill_gregset, mips_store_gregset): Likewise. Handle the
8662 restart register instead of $0.
8667 * remote-utils.c (decode_xfer_write): New function.
8668 * server.h (decode_xfer_write): Add prototype.
8669 * server.c (handle_query): Add PACKET_LEN argument. Support
8670 qXfer:spu:read and qXfer:spu:write packets.
8671 (main): Pass packet_len to handle_query.
8672 * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
8673 * target.h (target_ops): Add qxfer_spu.
8677 * spu-low.c (spu_proc_xfer_spu): Do not return failure when
8678 accessing non-seekable spufs files.
8682 * server.c (handle_query): Add reply for qC packet.
8685 Leo Zayas <lerele@champenstudios@com>
8687 * server.h (check_remote_input_interrupt_request): New function.
8688 * remote_utils.c (INVALID_DESCRIPTOR): New define.
8689 (remote_desc): Initialize with INVALID_DESCRIPTOR.
8690 (input_interrupt): Expose on USE_WIN32API too. Fix whitespace.
8691 (check_remote_input_interrupt_request): New function.
8692 * server.h (check_remote_input_interrupt_request): Declare.
8693 * win32-low.c (winapi_DebugBreakProcess,
8694 winapi_GenerateConsoleCtrlEvent): New typedefs.
8695 (get_child_debug_event): Lower Win32 debug event polling from 1 sec
8697 (win32_wait): Check for remote interrupt request
8698 with check_remote_input_interrupt_request.
8699 (win32_request_interrupt): New function.
8700 (win32_target_op): Set request_interrupt to win32_request_interrupt.
8704 * win32-low.c (debug_registers_changed,
8705 debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
8706 CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
8707 CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
8708 (thread_rec): Get context using the low target.
8709 (child_add_thread): Call thread_added on the low target,
8710 which does the same thing.
8712 (do_initial_child_stuff): Remove debug registers references.
8713 Set context using the low target. Resume threads after
8714 setting the contexts.
8715 (child_continue): Remove dead variable. Remove debug
8716 registers references.
8717 (child_fetch_inferior_registers): Go through the low target.
8718 (do_child_store_inferior_registers): Remove.
8719 (child_store_inferior_registers): Go through the low target.
8720 (win32_resume): Remove debug registers references.
8721 Set context using the low target.
8722 (handle_exception): Change return type to void. Don't record
8723 context here. Set status to TARGET_WAITKIND_SPURIOUS on a
8724 first chance exception.
8725 (get_child_debug_event): Change return type to void. Remove
8726 goto loop. Always return after waiting for debug event.
8727 (win32_wait): Convert to switch statement. Handle spurious
8730 * win32-i386-low.c (debug_registers_changed,
8731 debug_registers_used): New.
8732 (initial_stuff): Rename to ...
8733 (i386_initial_stuff): ... this. Clear debug registers
8735 (store_debug_registers): Delete.
8736 (i386_get_thread_context): New.
8737 (load_debug_registers): Delete.
8738 (i386_set_thread_context): New.
8739 (i386_thread_added): New.
8740 (single_step): Rename to ...
8741 (i386_single_step): ... this.
8742 (do_fetch_inferior_registers): Rename to ...
8743 (i386_fetch_inferior_register): ... this.
8744 (i386_store_inferior_register): New.
8745 (the_low_target): Adapt to new interface.
8747 * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
8748 (arm_get_thread_context): New.
8749 (arm_set_thread_context): New.
8751 (do_fetch_inferior_registers): Rename to ...
8752 (arm_fetch_inferior_register): ... this.
8753 (arm_store_inferior_register): New.
8754 (arm_wince_breakpoint): Reimplement as unsigned long.
8755 (arm_wince_breakpoint_len): Define.
8756 (the_low_target): Adapt to new interface.
8758 * win32-low.h (target_ops): Remove regmap, store_debug_registers and
8759 load_debug_registers. Add get_thread_context, set_thread_context,
8760 thread_added and store_inferior_register. Rename
8761 fetch_inferior_registers to fetch_inferior_register.
8762 (regptr): Remove declaration.
8766 * linux-low.c (linux_detach): Change return type to int. Return 0.
8767 * spu-low.c (spu_detach): Likewise.
8771 * target.h (target_ops): Change return type of detach to int.
8773 (join_inferior): New.
8774 * server.c (main): Don't skip detach support on mingw32.
8775 If the inferior doesn't support detaching return error.
8776 Call join_inferior instead of using waitpid.
8777 * linux-low.c (linux_join): New.
8778 (linux_target_op): Add linux_join.
8779 * spu-low.c (spu_join): New.
8780 (spu_target_ops): Add spu_join.
8781 * win32-low.c (win32_detach): Adapt to new interface.
8782 Reopen current_process_handle before detaching. Issue a child
8783 resume before detaching.
8785 (win32_target_op): Add win32_join.
8789 * win32-low.c (win32-attach): Fix return value.
8790 * target.h (target_ops): Describe ATTACH return values.
8794 * win32-low.c (GETPROCADDRESS): Define.
8795 (winapi_DebugActiveProcessStop): Add WINAPI. typedef as pointer.
8796 (winapi_DebugSetProcessKillOnExit): Likewise.
8797 (win32_create_inferior): Force usage of ansi CreateProcessA.
8798 (win32_attach): Use GETPROCADDRESS.
8799 (win32_detach): Likewise.
8803 * win32-low.c (win32_wait): Don't use WSTOPSIG.
8807 * win32-low.c: Commit leftover changes from 2007-03-29.
8811 * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
8812 fields short instead of int. Add explicit padding.
8813 (i387_cache_to_fsave): Remove unnecessary casts.
8814 (i387_fsave_to_cache): Doc fix.
8815 (i387_cache_to_fxsave): Remove unnecessary casts and masking.
8819 * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
8820 (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
8824 * configure.srv (arm*-*-mingw32ce*): Move near the other
8829 * configure.ac: Add errno checking.
8830 (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
8831 sys/file.h and malloc.h.
8832 (AC_CHECK_DECLS): Add perror.
8833 (srv_mingwce): Handle.
8834 * configure.srv (i[34567]86-*-cygwin*): Add
8835 win32-i386-low.o to srv_tgtobj.
8836 (i[34567]86-*-mingw*): Likewise.
8837 (arm*-*-mingw32ce*): Add case.
8838 * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
8839 HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
8840 [__MINGW32CE__] (strerror): New function.
8841 [__MINGW32CE__] (errno): Define to GetLastError.
8842 [__MINGW32CE__] (COUNTOF): New macro.
8843 (remote_open): Remove extra close call.
8844 * mem-break.c (delete_breakpoint_at): New function.
8845 * mem-break.h (delete_breakpoint_at): Declare.
8846 * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
8847 HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
8848 [USE_WIN32API] (read, write): Add char* casts.
8849 * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
8850 * server.h: Include wincecompat.h on Windows CE.
8851 [HAVE_ERRNO_H]: Check.
8852 (perror): Declare if not declared.
8853 * utils.c: Add stdlib.h, errno.h and malloc.h includes.
8854 (perror_with_name): Remove errno declaration.
8855 * wincecompat.h: New.
8856 * wincecompat.c: New.
8858 * win32-arm-low.c: New.
8859 * win32-i386-low.c: New.
8860 (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
8861 (OUTMSG2): Make it safe.
8863 (COUNTOF): New macro.
8864 (NUM_REGS): Get it from the low target.
8865 (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
8866 CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
8867 (thread_rec): Let low target handle debug registers.
8868 (child_add_thread): Likewise.
8869 (child_init_thread_list): Likewise.
8870 (continue_one_thread): Likewise.
8872 (do_child_fetch_inferior_registers): Move to ...
8873 * win32-i386-low.c: ... here, and rename to ...
8874 (do_fetch_inferior_registers): ... this.
8875 * win32-low.c (child_fetch_inferior_registers):
8876 Go through the low target.
8877 (do_child_store_inferior_registers): Use regptr.
8878 (strwinerror): New function.
8879 (win32_create_inferior): Handle Windows CE.
8880 Use strwinerror instead of strerror on Windows error
8881 codes. Add program to the error output.
8882 Don't close the main thread handle on Windows CE.
8883 (win32_attach): Use coredll.dll on Windows CE.
8884 (win32_kill): Close current process and current
8886 (win32_detach): Use coredll.dll on Windows CE.
8887 (win32_resume): Let low target handle debug registers, and
8889 (handle_exception): Add/Remove initial breakpoint. Avoid
8890 non-existant WSTOPSIG on Windows CE.
8891 (win32_read_inferior_memory): Cast to remove warning.
8892 (win32_arch_string): Go through the low target.
8893 (initialize_low): Call set_breakpoint_data with the low
8894 target's breakpoint.
8895 * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
8896 FOP_REGNUM, mappings): Move to ...
8897 * win32-i386-low.c: ... here.
8898 * win32-low.c (win32_thread_info): Move to ...
8899 * win32-low.h: ... here.
8900 * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
8901 win32-arm-low.c and wincecompat.c.
8902 (all:): Add $EXEEXT.
8903 (install-only:): Likewise.
8904 (gdbserver:): Likewise.
8905 (gdbreplay:): Likewise.
8906 * config.in: Regenerate.
8907 * configure: Regenerate.
8911 * win32-low.c: Rename typedef thread_info to
8912 win32_thread_info throughout.
8916 * win32-i386-low.c: Rename to ...
8917 * win32-low.c: ... this.
8918 * configure.srv: Replace win32-i386-low.o with win32-low.o.
8919 * Makefile.in: Likewise.
8923 * remote-utils.c (monitor_output): Constify msg parameter.
8924 * server.h (monitor_output): Likewise.
8925 * win32-i386-low.c (handle_output_debug_string): New.
8926 (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
8927 handle_output_debug_string.
8928 (get_child_debug_event): Likewise.
8932 * server.c (main): Correct strtoul check.
8936 * linux-low.c: Check __ARCH_HAS_MMU__ also.
8940 * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
8944 * terminal.h: Check HAVE_SGTTY_H.
8948 * remote-utils.c (remote_open): Print out the assigned port number.
8952 * remote-utils.c (monitor_output): New function.
8953 * server.c (debug_threads): Define here.
8954 (monitor_show_help): New function.
8955 (handle_query): Handle qRcmd.
8956 (main): Do not handle 'd' packet.
8957 * server.h (debug_threads, remote_debug, monitor_output): Declare.
8958 * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
8963 * Makefile.in (EXEEXT): New.
8964 (clean): Use $(EXEEXT).
8968 * target.h (target_ops): Rename send_signal to request_interrupt,
8969 and remove enum target_signal parameter.
8970 * linux-low.c (linux_request_interrupt): Rename from
8971 linux_send_signal, and always send SIGINT.
8972 * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
8973 and always send SIGINT.
8974 * remote-utils.c (putpkt_binary): Call request_interrupt, instead
8976 (input_interrupt): Likewise.
8980 * server.c (get_features_xml): Check if target implemented
8982 * win32-i386-low.c (win32_arch_string): New.
8983 (win32_target_ops): Add win32_arch_string as arch_string member.
8987 * spu-low.c (spu_arch_string): New.
8988 (spu_target_ops): Add spu_arch_string.
8992 * remote-utils.c: Remove HAVE_TERMINAL_H check.
8993 * configure.ac: Do not check for terminal.h.
8994 * configure, config.in: Regenerated.
8998 * Makefile.in (OBS): Add $(XML_BUILTIN).
8999 (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
9001 (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
9002 (arm-with-iwmmxt.c): New.
9003 * config.in, configure: Regenerate.
9004 * configure.ac: Check for iWMMXt. Handle srv_xmltarget,
9005 srv_xmlbuiltin, and srv_xmlfiles. Define USE_XML.
9006 * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
9007 (arm*-*-linux*): Add iWMMXt and regset support.
9008 * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
9009 (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
9010 (arm_store_wmmxregset, target_regsets): New.
9011 * server.c (get_features_xml): Take annex argument. Check builtin
9013 (handle_query): Handle multiple annexes.
9017 * remote-utils.c [USE_WIN32API] (read, write): Define.
9018 (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
9023 * linux-i386-low.c (the_low_target): Set arch_string.
9024 * linux-x86-64-low.c (the_low_target): Likewise.
9025 * linux-low.c (linux_arch_string): New.
9026 (linux_target_ops): Add it.
9027 * linux-low.h (struct linux_target_ops): Add arch_string.
9028 * server.c (write_qxfer_response): Use const void * for DATA.
9029 (get_features_xml): New.
9030 (handle_query): Handle qXfer:features:read. Report it for qSupported.
9031 * target.h (struct target_ops): Add arch_string method.
9036 * linux-low.c (linux_kill): Handle being called with no threads.
9037 * win32-i386-low.c (win32_kill): Likewise.
9038 (get_child_debug_event): Clear current_process_handle.
9043 * remote-utils.c (remote_open): Check the type of specified
9044 serial port devices before opening them.
9045 * server.c (main): Kill the inferior if an error occurs during
9046 the first remote_open.
9050 * README: Update supported targets.
9054 * Makefile.in (clean): Remove reg-mips64.c.
9055 (reg-mips64.c, reg-mips64.o): New rules.
9056 * configure.srv: Handle mips64. Include regset support for mips.
9057 * linux-mips-low.c (union mips_register): New.
9058 (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
9059 (mips_breakpoint, mips_breakpoint_at): Use int.
9060 (mips_collect_register, mips_supply_register)
9061 (mips_collect_register_32bit, mips_supply_register_32bit)
9062 (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9063 (mips_store_fpregset, target_regsets): New.
9064 * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
9068 * configure.srv: Add target "spu*-*-*".
9069 * Makefile.in (clean): Remove reg-spu.c.
9070 (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
9071 * spu-low.c: New file.
9075 * configure.ac: Correct td_thr_tls_get_addr test.
9076 * configure: Regenerated.
9080 * linux-low.c (linux_wait_for_event): Reformat. Use the
9082 * remote-utils.c (decode_address_to_semicolon): New.
9083 * server.c (pass_signals, handle_general_set): New.
9084 (handle_query): Mention QPassSignals for qSupported.
9085 (main): Call handle_general_set.
9086 * server.h (pass_signals, decode_address_to_semicolon): New.
9090 * server.c (handle_query): Correct error handling for read_auxv.
9094 * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
9095 and srv_linux_thread_db to yes.
9096 * linux-s390-low.c (s390_fill_gregset): New function.
9097 (target_regsets): Define data structure.
9101 * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
9102 * configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR.
9103 * config.in, configure: Regenerated.
9104 * inferiors.c (gdb_id_to_thread): New function.
9105 (gdb_id_to_thread_id): Use it.
9106 * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
9107 * linux-low.h (struct process_info): Add th member.
9108 (thread_db_get_tls_address): New prototype.
9109 * remote-utils.c (decode_address): Make non-static.
9110 * server.c (handle_query): Handle qGetTLSAddr.
9111 * server.h (gdb_id_to_thread, decode_address): New prototypes.
9112 * target.h (struct target_ops): Add get_tls_address.
9113 * thread-db.c (maybe_attach_thread): Save the thread handle.
9114 (thread_db_get_tls_address): New.
9118 * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
9119 (linux_resume_one_process): Take a siginfo_t *. Update all
9120 callers. Queue it if necessary. Use PTRACE_SETSIGINFO.
9121 (struct pending_signals): Add a siginfo_t.
9122 (linux_wait_for_process): Always set last_status.
9123 (linux_wait_for_event): Use PTRACE_GETSIGINFO.
9124 (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
9125 * linux-low.h (struct process_info): Add last_status.
9129 * remote-utils.c (try_rle): New function.
9130 (putpkt_binary): Use it.
9134 * Makefile.in (clean): Clean reg-x86-64-linux.c.
9135 (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
9136 * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
9137 * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
9138 (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
9143 * server.c (terminal_fd): New variable.
9144 (old_foreground_pgrp): Likewise.
9145 (restore_old_foreground_pgrp): New function.
9146 (start_inferior): Record the terminal file descriptor in terminal_fd
9147 and its original foreground group in old_foreground_pgrp. Register
9148 restore_old_foreground_pgrp with atexit().
9152 * server.c (handle_query): Correct qPart to qXfer.
9156 * configure.ac: Check for more headers which are missing on
9157 Windows. Automatically supply -lwsock32 and USE_WIN32API.
9158 * configure.srv: Add Cygwin and mingw32.
9159 * remote-utils.c: Don't include headers unconditionally which
9160 are missing on mingw32. Include <winsock.h> for mingw32.
9161 (remote_open): Adjust for mingw32 support. Flush
9162 standard error after writing to it.
9163 (remote_close, putpkt_binary, input_interrupt, block_async_io)
9164 (unblock_async_io, enable_async_io, disable_async_io)
9165 (readchar, getpkt): Update for Winsock support.
9166 (prepare_resume_reply): Expect a protocol signal number.
9167 * server.c: Disable <sys/wait.h> on mingw32.
9168 (start_inferior): Adjust for mingw32 support. Flush
9169 standard error after writing to it.
9170 (attach_inferior): Likewise. Use protocol signal
9172 (main): Skip 'D' packet on mingw32. Use protocol signal numbers
9174 * win32-i386-low.c: New file.
9175 * Makefile.in (XM_CLIBS): Set.
9176 (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
9177 (win32-i386-low.o): New dependency rule.
9178 * linux-low.c (linux_wait): Use target signal numbers.
9179 * target.h (struct target_ops): Doc fix.
9180 * server.h (target_signal_to_name): New prototype.
9181 * gdbreplay.c: Don't include headers unconditionally which
9182 are missing on mingw32. Include <winsock.h> for mingw32.
9183 (remote_close, remote_open): Adjust for Winsock support.
9184 * configure, config.in: Regenerated.
9188 * server.c (decode_xfer_read, write_qxfer_response): New.
9189 (handle_query): Take a packet length argument. Handle
9190 qXfer:auxv:read instead of qPart:auxv:read. Mention it in
9191 the qSupported response.
9192 (main): Update call to handle_query.
9196 * remote-utils.c (remote_escape_output, remote_unescape_input): New.
9197 (putpkt_binary): Renamed from putpkt and adjusted for binary
9199 (putpkt): New wrapper for putpkt_binary.
9200 (readchar): Don't mask off the high bit.
9201 (decode_X_packet): New function.
9202 * server.c (main): Call putpkt_binary if a handler sets the packet
9203 length. Save the length of the incoming packet. Handle 'X'.
9204 * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
9208 * server.c (handle_query): Handle qSupported.
9212 * remote-utils.c (all_symbols_looked_up): New variable.
9213 (look_up_one_symbol): Check it.
9214 * server.h (look_up_one_symbol): New declaration.
9215 * thread-db.c (thread_db_init): Set all_symbols_looked_up.
9219 * Makefile.in (linux-arm-low.o): Update dependencies.
9220 * linux-arm-low.c: Include "gdb_proc_service.h".
9221 (PTRACE_GET_THREAD_AREA): Define.
9222 (ps_get_thread_area): New function.
9226 * configure.srv (m68k*-*-uclinux*): New target.
9227 * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
9228 (linux_resume_one_process): Remove extraneous cast.
9229 (linux_read_offsets): New.
9230 (linux_target_op): Add linux_read_offsets on mmuless systems.
9231 * server.c (handle_query): Add qOffsets logic.
9232 * target.h (struct target_ops): Add read_offsets.
9236 * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
9237 (PTRACE_GET_THREAD_AREA): Define.
9238 (ps_get_thread_area): New function.
9239 * Makefile.in (linux-i386-low.o, linux-mips-low.o)
9240 (linux-x86-64-low.o): Update.
9244 * configure.ac: Remove checks for prfpregset_t.
9245 * gdb_proc_service.h: New file.
9246 * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
9247 new "gdb_proc_service.h".
9248 * proc-service.c: Likewise.
9249 (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
9250 (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
9251 * Makefile.in (gdb_proc_service_h): Updated.
9252 * configure, config.in: Regenerated.
9256 * remote-utils.c (prepare_resume_reply): Move declaration
9257 of gdb_id_from_wait to the top of the block.
9261 * linux-low.c (regsets_store_inferior_registers): Read the regset
9262 from the target before filling it.
9266 * server.c (attach_inferior): Return SIGTRAP for a successful
9271 * Makefile.in (OBS): Add version.o.
9272 (STAGESTUFF): Delete.
9273 (version.o): Add dependencies.
9274 (version.c): Replace rule.
9275 (clean): Remove version.c.
9276 * server.c (gdbserver_version): New.
9277 (gdbserver_usage): Use printf.
9278 (main): Handle --version and --help.
9279 * server.h (version, host_name): Add declarations.
9293 * linux-x86-64-low.c:
9296 * linux-ppc64-low.c:
9305 * linux-crisv32-low.c:
9317 * gdbserver.1: Add (C) after Copyright. Update the FSF
9322 * linux-arm-low.c (arm_eabi_breakpoint): New variable.
9323 (arm_breakpoint_at): Recognize both breakpoints.
9324 (the_low_target): Use the correct breakpoint instruction.
9328 * configure.srv (x86_64-*-linux*): Turn on thread_db support.
9329 * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
9330 (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
9331 (the_low_target): Update.
9335 * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
9337 * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
9338 (ia64_num_regs): Reduce to 462.
9342 * acinclude.m4: Correct quoting.
9343 * aclocal.m4: Regenerated.
9346 * thread-db.c (thread_db_err_str): Handle TD_VERSION.
9347 (thread_db_init): Call thread_db_err_str.
9348 * configure.ac: Check for TD_VERSION.
9349 * config.in, configure: Regenerated.
9353 * server.h (error, fatal, warning): Add ATTR_FORMAT.
9357 * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
9358 is not available. Define HAVE_PTRACE_GETREGS if it is.
9359 * config.in, configure: Regenerated.
9360 * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
9361 * linux-i386-low.c, linux-m68k-low.c: Update to use
9362 HAVE_PTRACE_GETREGS.
9363 * linux-low.c (regsets_fetch_inferior_registers)
9364 (regsets_store_inferior_registers): Only return 0 if we processed
9366 * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
9367 * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
9371 * inferiors.c (struct thread_info): Add gdb_id.
9372 (add_thread): Add gdb_id argument.
9373 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
9374 * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
9375 calls to add_thread.
9376 * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
9377 * server.c (handle_query): Use thread_to_gdb_id.
9378 (handle_v_cont, main): Use gdb_id_to_thread_id.
9379 * server.h (add_thread): Update prototype.
9380 (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
9385 * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
9386 left-padded registers.
9387 * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
9388 * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
9392 * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
9393 * configure: Regenerate.
9394 * config.in: Regenerate.
9395 * server.h (NEED_DECLARATION_STRERROR):
9396 Replace with !HAVE_DECL_STRERROR.
9400 * linux-low.c (linux_wait, linux_send_signal): Don't test
9401 an unsigned long variable for > 0 if it could be MAX_ULONG.
9402 * server.c (myresume): Likewise.
9403 * target.c (set_desired_inferior): Likewise.
9407 * configure.ac: Simplify and improve check for socklen_t.
9408 * configure, config.in: Regenerate.
9412 * acconfig.h: Remove.
9413 * configure.ac: Add a test for socklen_t. Use three-argument
9414 AC_DEFINE throughout.
9415 * config.in: Regenerated using autoheader 2.59.
9416 * configure: Regenerated.
9418 * gdbreplay.c (socklen_t): Provide a default.
9419 (remote_open): Use socklen_t.
9420 * remote-utils.c (socklen_t): Provide a default.
9421 (remote_open): Use socklen_t.
9422 (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
9425 * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
9427 * linux-low.c (linux_read_memory, linux_write_memory)
9428 (linux_read_auxv): Likewise.
9429 * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
9430 (check_mem_write): Likewise.
9431 * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
9433 * regcache.c (struct inferior_rgcache_data, registers_to_string)
9434 (registers_from_string, register_data): Likewise.
9435 * server.c (handle_query, main): Likewise.
9436 * server.h (convert_ascii_to_int, convert_int_to_ascii)
9437 (decode_M_packet): Likewise.
9438 * target.c (read_inferior_memory, write_inferior_memory): Likewise.
9439 * target.h (struct target_ops): Update read_memory, write_memory,
9441 (read_inferior_memory, write_inferior_memory): Update.
9442 * linux-low.h (struct linux_target_ops): Change type of breakpoint
9444 * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
9445 linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
9446 linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
9447 linux-s390-low.c, linux-sh-low.c: Update for changes in
9448 read_inferior_memory and the_low_target->breakpoint.
9452 * Makefile.in (SFILES): Add linux-ppc64-low.c.
9453 (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
9454 * configure.srv: Add powerpc64-*-linux*.
9455 * linux-ppc64-low.c: New file.
9459 * linux-cris-low.c: New file with support for CRIS.
9460 * linux-crisv32-low.c: Ditto for CRISv32.
9461 * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
9462 (clean): Add reg-cris.c and reg-crisv32.c.
9463 Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
9464 reg-crisv32.o, and reg-crisv32.c to make rules.
9465 * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
9470 * linux-low.c (fetch_register): Ensure buffer size is a multiple
9471 of sizeof (PTRACE_XFER_TYPE).
9472 (usr_store_inferior_registers): Likewise. Zero out excess bytes.
9476 * target.h (struct target_ops): Add insert_watchpoint,
9477 remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
9478 pointers for hardware watchpoint support.
9479 * linux-low.h (struct linux_target_ops): Ditto.
9480 * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
9481 (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add
9482 to linux_target_ops.
9483 * remote-utils.c (prepare_resume_reply): Add watchpoint information to
9485 * server.c (main): Recognize 'Z' and 'z' packets.
9489 * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
9490 (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
9491 (the_low_target): Add new members.
9495 * proc-service.c (ps_lgetregs): Search all_processes instead of
9500 * server.c (start_inferior): Change return type to int.
9501 (attach_inferior): Change sigptr to int *.
9502 (handle_v_cont, handle_v_requests): Change signal to int *.
9503 (main): Change signal to int.
9507 * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
9508 * configure.srv: Add m32r*-*-linux*.
9509 * linux-m32r-low.c: New file.
9513 * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
9517 * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
9518 Take unsigned long arguments for PIDs.
9519 * linux-low.c (add_process, linux_attach_lwp, linux_attach)
9520 (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
9521 (wait_for_sigstop, linux_resume_one_process)
9522 (regsets_fetch_inferior_registers, linux_send_signal)
9523 (linux_read_auxv): Likewise. Update the types of variables holding
9524 PIDs. Update format string specifiers.
9525 * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
9526 * remote-utils.c (prepare_resume_reply): Likewise.
9527 * server.c (cont_thread, general_thread, step_thread)
9528 (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
9530 (handle_query): Update format specifiers.
9531 (handle_v_cont, main): Use strtoul for thread IDs.
9532 * server.h (struct inferior_list_entry): Use unsigned long for ID.
9533 (add_thread, find_inferior_id, change_inferior_id, cont_thread)
9534 (general_thread, step_thread, thread_from_wait)
9535 (old_thread_from_wait): Update.
9536 * target.h (struct thread_resume): Use unsigned long for THREAD.
9537 (struct target_ops): Use unsigned long for arguments to attach and
9542 * acinclude.m4: Include bfd/bfd.m4 directly.
9543 * configure.ac: Use AC_ARG_PROGRAM. Suggested by Aron Griffis
9545 * aclocal.m4, configure: Regenerated.
9549 * configure.ac: Rename configure.in, require autoconf 2.59.
9550 * configure: Re-generate.
9554 * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset
9556 * aclocal.m4: Regenerated.
9557 * configure: Regenerated.
9561 * linux-m68k-low.c (m68k_num_gregs): Define.
9562 (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
9563 (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
9564 (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
9565 (m68k_breakpoint_at): New. Add to the_low_target.
9567 * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
9568 srv_linux_thread_db to yes.
9572 * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
9573 (ARCH_SET_FS): Likewise.
9574 (ARCH_GET_FS): Likewise.
9575 (ARCH_GET_GS): Likewise.
9579 * linux-i386-low.c (ps_get_thread_area): New.
9580 * linux-x86-64-low.c (ps_get_thread_area): New.
9581 * linux-low.c: Include <sys/syscall.h>.
9582 (linux_kill_one_process): Don't kill the first thread here.
9583 (linux_kill): Kill the first thread here.
9584 (kill_lwp): New function.
9585 (send_sigstop, linux_send_signal): Use it.
9586 * proc-service.c: Clean up #ifdefs.
9587 (fpregset_info): Delete.
9588 (ps_lgetregs): Update and enable implementation.
9589 (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
9591 * remote-utils.c (struct sym_cache, symbol_cache): New.
9592 (input_interrupt): Print a clearer message.
9593 (async_io_enabled): New variable.
9594 (enable_async_io, disable_async_io): Use it. Update comments.
9595 (look_up_one_symbol): Use the symbol cache.
9596 * thread-db.c (thread_db_look_up_symbols): New function.
9597 (thread_db_init): Update comments. Call thread_db_look_up_symbols.
9601 * configure.in: Test for -rdynamic.
9602 * configure: Regenerated.
9603 * Makefile (INTERNAL_LDFLAGS): New.
9604 (gdbserver, gdbreplay): Use it.
9608 * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
9612 * linux-low.c (linux_wait): Clear all_processes list also.
9616 * linux-low.c: Include <errno.h>. Remove extern declaration of
9621 * gdbreplay.c, server.h, utils.c: Update copyright years.
9625 * server.c (main): Print child status or termination signal from
9626 variable 'signal', not 'sig'.
9630 * linux-low.c (linux_read_memory): Change return type to
9631 int. Check for and return error from ptrace().
9632 * target.c (read_inferior_memory): Change return type to int. Pass
9633 back return status from the_target->read_memory().
9634 * target.h (struct target_ops): Adapt *read_memory() prototype.
9636 (read_inferior_memory): Adapt prototype.
9637 * server.c (main): Return an error packet if
9638 read_inferior_memory() returns an error.
9642 * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
9643 Unify with other clean targets.
9647 * server.c (handle_v_cont): Call set_desired_inferior.
9651 * remote-utils.c (prepare_resume_reply): Always supply "thread:".
9655 * linux-low.c (linux_wait): Unblock async I/O.
9656 (linux_resume): Block and enable async I/O.
9657 * remote-utils.c (block_async_io, unblock_async_io): New functions.
9658 * server.h (block_async_io, unblock_async_io): Add prototypes.
9662 * remote-utils.c (remote_open): Print a status notice after
9664 * server.c (attach_inferior): Print a status notice after
9669 * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
9673 * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
9675 * server.c, target.h: Update copyright years.
9679 * target.h (struct target_ops): New member `read_auxv'.
9680 * server.c (handle_query): Handle qPart:auxv:read: query using that.
9681 * linux-low.c (linux_read_auxv): New function.
9682 (linux_target_ops): Initialize `read_auxv' member to that.
9688 * linux-s390-low.c (s390_num_regs): Update.
9689 (s390_regmap): Remove control registers. Use __s390x__ predefine
9690 instead of GPR_SIZE to distiguish s390 and s390x targets.
9694 * linux-low.c: Update copyright year.
9695 (check_removed_breakpoint): Clear pending_is_breakpoint.
9696 (linux_set_resume_request, linux_queue_one_thread)
9697 (resume_status_pending_p): New functions.
9698 (linux_continue_one_thread): Use process->resume.
9699 (linux_resume): Only resume threads if there are no pending events.
9700 * linux-low.h (struct process_info): Add resume request
9705 * regcache.c (new_register_cache): Clear the allocated register
9710 * linux-low.c (linux_resume): Take a struct thread_resume *
9712 (linux_wait): Update call.
9713 (resume_ptr): New static variable.
9714 (linux_continue_one_thread): Renamed from
9715 linux_continue_one_process. Use resume_ptr.
9716 (linux_resume): Use linux_continue_one_thread.
9717 * server.c (handle_v_cont, handle_v_requests): New functions.
9718 (myresume): New function.
9719 (main): Handle 'v' case.
9720 * target.h (struct thread_resume): New type.
9721 (struct target_ops): Change argument of "resume" to struct
9723 (myresume): Delete macro.
9727 * Makefile.in (install-only): Create dest dir. Support DESTDIR.
9728 (uninstall): Support DESTDIR.
9732 * configure.srv: Add xscale*linux copy of arm*linux entry.
9736 * linux-arm-low.c (arm_reinsert_addr): New function.
9737 (the_low_target): Add arm_reinsert_addr.
9741 * mem-break.c: Remove whitespace at end of file.
9745 * configure.in: Check whether we need to prototype strerror.
9746 * server.h: Optionally prototype strerror.
9747 * gdbreplay.c (perror_with_name): Use strerror.
9748 * linux-low.c (linux_attach_lwp): Use strerror.
9749 * utils.c (perror_with_name): Use strerror.
9750 * config.in, configure: Regenerated.
9754 * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
9759 * Makefile.in (SFILES): Update.
9760 * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
9761 low-sun3.c: Remove files.
9765 * linux-low.c: Move comment to linux_thread_alive where it belonged.
9766 (linux_detach_one_process, linux_detach): New functions.
9767 (linux_target_ops): Add linux_detach.
9768 * server.c (main): Handle 'D' packet.
9769 * target.h (struct target_ops): Add "detach" member.
9770 (detach_inferior): Define.
9775 * configure.srv: Accept i[34567]86 variants.
9779 * linux-low.c (linux_wait_for_event): Correct comment typos.
9780 (linux_resume_one_process): Call check_removed_breakpoint.
9781 (linux_send_signal): New function.
9782 (linux_target_ops): Add linux_send_signal.
9783 * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
9785 * target.h (struct target_ops): Add send_signal.
9789 * linux-low.c (usr_store_inferior_registers): Transfer buf in
9790 PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise,
9791 if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
9792 away part of the register's value.
9796 * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
9797 (linux_wait_for_event, linux_init_signals): Likewise.
9801 * configure.in: Check for stdlib.h.
9802 * configure: Regenerated.
9803 * config.in: Regenerated.
9807 * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
9811 * Makefile.in: Remove obsolete code.
9815 * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
9816 defined(PT_FPR0_HI).
9820 * linux-arm-low.c (arm_num_regs): Increase.
9821 (arm_regmap): Include status register.
9825 * linux-low.c (register_addr): Remove incorrect -1 check.
9829 * linux-low.c (linux_create_inferior): Call setpgid. Return
9831 (unstopped_p, linux_signal_pid): Remove.
9832 (linux_target_ops): Remove linux_signal_pid.
9833 * remote-utils.c (putpkt, input_interrupt): Use signal_pid
9834 global instead of target method.
9835 * target.h (struct target_ops): Remove signal_pid. Update comment
9836 for create_inferior.
9837 * server.c (signal_pid): New variable.
9838 (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in
9839 gdbserver. Set the child to be the foreground process group.
9840 (attach_inferior): Set signal_pid.
9844 * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
9848 * Makefile.in (LDFLAGS): Allow the configure script to establish a
9853 * Makefile.in: Make chill references obsolete.
9857 * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
9858 * configure: Regenerate.
9859 * config.in: Regenerate.
9863 * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
9864 (perror_with_name, remote_close, remote_open, expect, play): Static.
9868 * linux-x86-64-low.c (x86_64_regmap): Make it an array of
9869 byte offsets instead of an array of indexes.
9870 (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
9874 * regcache.c: Add comment.
9878 * thread-db.c: New file.
9879 * proc-service.c: New file.
9880 * acinclude.m4: New file.
9881 * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
9882 proc-service.o, and thread-db.o.
9883 (linux-low.o): Add USE_THREAD_DB.
9884 * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
9885 HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
9886 * aclocal.m4: Regenerated.
9887 * config.in: Regenerated.
9888 * configure: Regenerated.
9889 * configure.in: Check for proc_service.h, sys/procfs.h,
9890 thread_db.h, and linux/elf.h headrs.
9891 Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
9892 PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB.
9893 Check for -lthread_db and thread support.
9894 * configure.srv: Enable thread_db support for ARM, i386, MIPS,
9895 PowerPC, and SuperH.
9896 * i387-fp.c: Constify arguments.
9897 * i387-fp.h: Likewise.
9898 * inferiors.c: (struct thread_info): Renamed from
9899 `struct inferior_info'. Remove PID member. Use generic inferior
9900 list header. All uses updated.
9901 (inferiors, signal_pid): Removed.
9902 (all_threads): New variable.
9903 (get_thread): Define.
9904 (add_inferior_to_list): New function.
9905 (for_each_inferior): New function.
9906 (change_inferior_id): New function.
9907 (add_inferior): Removed.
9908 (remove_inferior): New function.
9909 (add_thread): New function.
9910 (free_one_thread): New function.
9911 (remove_thread): New function.
9912 (clear_inferiors): Use for_each_inferior and free_one_thread.
9913 (find_inferior): New function.
9914 (find_inferior_id): New function.
9915 (inferior_target_data): Update argument type.
9916 (set_inferior_target_data): Likewise.
9917 (inferior_regcache_data): Likewise.
9918 (set_inferior_regcache_data): Likewise.
9919 * linux-low.c (linux_bp_reinsert): Remove.
9920 (all_processes, stopping_threads, using_thrads)
9921 (struct pending_signals, debug_threads, pid_of): New.
9922 (inferior_pid): Replace with macro.
9923 (struct inferior_linux_data): Remove.
9924 (get_stop_pc, add_process): New functions.
9925 (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
9926 Use add_process and add_thread.
9927 (linux_attach_lwp): New function, based on old linux_attach. Use
9928 add_process and add_thread. Set stop_expected for new threads.
9929 (linux_attach): New function.
9930 (linux_kill_one_process): New function.
9931 (linux_kill): Kill all LWPs.
9932 (linux_thread_alive): Use find_inferior_id.
9933 (check_removed_breakpoints, status_pending_p): New functions.
9934 (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
9935 Update. Use WNOHANG. Wait for cloned processes also. Update process
9936 struct for the found process.
9937 (linux_wait_for_event): New function.
9938 (linux_wait): Use it. Support LWPs.
9939 (send_sigstop, wait_for_sigstop, stop_all_processes)
9940 (linux_resume_one_process, linux_continue_one_process): New functions.
9941 (linux_resume): Support LWPs.
9942 (REGISTER_RAW_SIZE): Remove.
9943 (fetch_register): Use register_size instead. Call supply_register.
9944 (usr_store_inferior_registers): Likewise. Call collect_register.
9946 (regsets_fetch_inferior_registers): Improve error message.
9947 (regsets_store_inferior_registers): Add debugging.
9948 (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
9949 (unstopped_p, linux_signal_pid): New functions.
9950 (linux_target_ops): Add linux_signal_pid.
9951 (linux_init_signals): New function.
9952 (initialize_low): Call it. Initialize using_threads.
9953 * regcache.c (inferior_regcache_data): Add valid
9955 (get_regcache): Fetch registers lazily. Add fetch argument
9956 and update all callers.
9957 (regcache_invalidate_one, regcache_invalidate): New
9959 (new_register_cache): Renamed from create_register_cache.
9960 Return the new regcache.
9961 (free_register_cache): Change argument to a void *.
9962 (registers_to_string, registers_from_string): Call get_regcache
9963 with fetch flag set.
9964 (register_data): Make static. Pass fetch flag to get_regcache.
9965 (supply_register): Call get_regcache with fetch flag clear.
9966 (collect_register): Call get_regcache with fetch flag set.
9967 (collect_register_as_string): New function.
9968 * regcache.h: Update.
9969 * remote-utils.c (putpkt): Flush after debug output and use
9971 Handle input interrupts while waiting for an ACK.
9972 (input_interrupt): Use signal_pid method.
9973 (getpkt): Flush after debug output and use stderr.
9974 (outreg): Use collect_register_as_string.
9975 (new_thread_notify, dead_thread_notify): New functions.
9976 (prepare_resume_reply): Check using_threads. Set thread_from_wait
9978 (look_up_one_symbol): Flush after debug output.
9979 * server.c (step_thread, server_waiting): New variables.
9980 (start_inferior): Don't use signal_pid. Update call to mywait.
9981 (attach_inferior): Update call to mywait.
9982 (handle_query): Handle qfThreadInfo and qsThreadInfo.
9983 (main): Don't fetch/store registers explicitly. Use
9984 set_desired_inferior. Support proposed ``Hs'' packet. Update
9987 (struct inferior_list, struct_inferior_list_entry): New.
9988 * target.c (set_desired_inferior): New.
9989 (write_inferior_memory): Constify.
9990 (mywait): New function.
9992 (struct target_ops): New signal_pid method.
9993 (mywait): Removed macro, added prototype.
9995 * linux-low.h (regset_func): Removed.
9996 (regset_fill_func, regset_store_func): New.
9997 (enum regset_type): New.
9998 (struct regset_info): Add type field. Use new operation types.
9999 (struct linux_target_ops): stop_pc renamed to get_pc.
10000 Add decr_pc_after_break and breakpoint_at.
10001 (get_process, get_thread_proess, get_process_thread)
10002 (strut process_info, all_processes, linux_attach_lwp)
10003 (thread_db_init): New.
10005 * linux-arm-low.c (arm_get_pc, arm_set_pc,
10006 arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
10007 (the_low_target): Add new members.
10008 * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
10009 (i386_store_fpxregset): Constify.
10010 (target_regsets): Add new kind identifier.
10011 (i386_get_pc): Renamed from i386_stop_pc. Simplify.
10012 (i386_set_pc): Add debugging.
10013 (i386_breakpoint_at): New function.
10014 (the_low_target): Add new members.
10015 * linux-mips-low.c (mips_get_pc, mips_set_pc)
10016 (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
10017 (mips_breakpoint_at): New.
10018 (the_low_target): Add new members.
10019 * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
10020 (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
10021 (the_low_target): Add new members.
10022 * linux-sh-low.c (sh_get_pc, sh_set_pc)
10023 (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
10024 (the_low_target): Add new members.
10025 * linux-x86-64-low.c (target_regsets): Add new kind
10031 * server.c (gdbserver_usage): New function.
10036 * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
10037 stop_at -> stop_pc.
10041 * Makefile.in: Remove obsolete code.
10045 * linux-low.c (regsets_fetch_inferior_registers),
10046 (regsets_store_inferior_registers): Removed cast to int from
10048 * regcache.h: Added declaration of struct inferior_info.
10052 * inferiors.c (struct inferior_info): Add regcache_data.
10053 (add_inferior): Call create_register_cache.
10054 (clear_inferiors): Call free_register_cache.
10055 (inferior_regcache_data, set_inferior_regcache_data): New functions.
10056 * regcache.c (struct inferior_regcache_data): New.
10057 (registers): Remove.
10058 (get_regcache): New function.
10059 (create_register_cache, free_register_cache): New functions.
10060 (set_register_cache): Don't initialize the register cache here.
10061 (registers_to_string, registers_from_string, register_data): Call
10063 * regcache.h: Add prototypes.
10064 * server.h: Likewise.
10068 * mem-break.c: New file.
10069 * mem-break.h: New file.
10070 * Makefile.in: Add mem-break.o rule; update server.h
10072 * inferiors.c (struct inferior_info): Add target_data
10074 (clear_inferiors): Free target_data member if set.
10075 (inferior_target_data, set_inferior_target_data): New functions.
10076 * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
10077 (i386_stop_pc, i386_set_pc): New. Add to the_low_target.
10078 * linux-low.c (linux_bp_reinsert): New variable.
10079 (struct inferior_linux_data): New.
10080 (linux_create_inferior): Use set_inferior_target_data.
10081 (linux_attach): Likewise. Call add_inferior.
10082 (linux_wait_for_one_inferior): New function.
10083 (linux_wait): Call it.
10084 (linux_write_memory): Add const.
10085 (initialize_low): Call set_breakpoint_data.
10086 * linux-low.h (struct linux_target_ops): Add breakpoint
10088 * server.c (attach_inferior): Remove extra add_inferior
10090 * server.h: Include mem-break.h. Update inferior.c
10092 * target.c (read_inferior_memory)
10093 (write_inferior_memory): New functions.
10094 * target.h (read_inferior_memory)
10095 (write_inferior_memory): Change macros to prototypes.
10096 (struct target_ops): Update comments. Add const to write_memory
10101 * linux-low.c (usr_store_inferior_registers): Support
10102 registers which are allowed to fail to store.
10103 * linux-low.h (linux_target_ops): Likewise.
10104 * linux-ppc-low.c (ppc_regmap): Support FPSCR.
10105 (ppc_cannot_store_register): FPSCR may not be storable.
10109 * server.h: Include <string.h> if HAVE_STRING_H.
10110 * ChangeLog: Correct paths in last ChangeLog entry.
10114 * linux-low.h: Remove obsolete prototypes.
10115 (struct linux_target_ops): New.
10116 (extern the_low_target): New.
10117 * linux-low.c (num_regs, regmap): Remove declarations.
10118 (register_addr): Use the_low_target explicitly.
10119 (fetch_register): Likewise.
10120 (usr_fetch_inferior_registers): Likewise.
10121 (usr_store_inferior_registers): Likewise.
10122 * linux-arm-low.c (num_regs): Remove.
10123 (arm_num_regs): Define.
10124 (arm_regmap): Renamed from regmap, made static.
10125 (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
10127 (arm_cannot_store_register): Renamed from cannot_store_register,
10129 (the_low_target): New.
10130 * linux-i386-low.c (num_regs): Remove.
10131 (i386_num_regs): Define.
10132 (i386_regmap): Renamed from regmap, made static.
10133 (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
10135 (i386_cannot_store_register): Renamed from cannot_store_register,
10137 (the_low_target): New.
10138 * linux-ia64-low.c (num_regs): Remove.
10139 (ia64_num_regs): Define.
10140 (ia64_regmap): Renamed from regmap, made static.
10141 (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
10143 (ia64_cannot_store_register): Renamed from cannot_store_register,
10145 (the_low_target): New.
10146 * linux-m68k-low.c (num_regs): Remove.
10147 (m68k_num_regs): Define.
10148 (m68k_regmap): Renamed from regmap, made static.
10149 (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
10151 (m68k_cannot_store_register): Renamed from cannot_store_register,
10153 (the_low_target): New.
10154 * linux-mips-low.c (num_regs): Remove.
10155 (mips_num_regs): Define.
10156 (mips_regmap): Renamed from regmap, made static.
10157 (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
10159 (mips_cannot_store_register): Renamed from cannot_store_register,
10161 (the_low_target): New.
10162 * linux-ppc-low.c (num_regs): Remove.
10163 (ppc_num_regs): Define.
10164 (ppc_regmap): Renamed from regmap, made static.
10165 (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
10167 (ppc_cannot_store_register): Renamed from cannot_store_register,
10169 (the_low_target): New.
10170 * linux-s390-low.c (num_regs): Remove.
10171 (s390_num_regs): Define.
10172 (s390_regmap): Renamed from regmap, made static.
10173 (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
10175 (s390_cannot_store_register): Renamed from cannot_store_register,
10177 (the_low_target): New.
10178 * linux-sh-low.c (num_regs): Remove.
10179 (sh_num_regs): Define.
10180 (sh_regmap): Renamed from regmap, made static.
10181 (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
10183 (sh_cannot_store_register): Renamed from cannot_store_register,
10185 (the_low_target): New.
10186 * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
10187 (the_low_target): New.
10191 * Makefile.in: Add stamp-h target.
10192 * configure.in: Create stamp-h.
10193 * configure: Regenerated.
10197 * inferiors.c: New file.
10198 * target.c: New file.
10199 * target.h: New file.
10200 * Makefile.in: Add target.o and inferiors.o. Update
10202 * linux-low.c (inferior_pid): New static variable,
10203 moved from server.c.
10204 (linux_create_inferior): Renamed from create_inferior.
10205 Call add_inferior. Return 0 on success instead of a PID.
10206 (linux_attach): Renamed from myattach.
10207 (linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
10208 (linux_thread_alive): Renamed from mythread_alive.
10209 (linux_wait): Renamed from mywait. Call clear_inferiors () if the
10211 (linux_resume): Renamed from myresume. Add missing ``return 0''.
10212 (regsets_store_inferior_registers): Correct error message.
10213 Add missing ``return 0''.
10214 (linux_fetch_registers): Renamed from fetch_inferior_registers.
10215 (linux_store_registers): Renamed from store_inferior_registers.
10216 (linux_read_memory): Renamed from read_inferior_memory.
10217 (linux_write_memory): Renamed from write_inferior_memory.
10218 (linux_target_ops): New structure.
10219 (initialize_low): Call set_target_ops ().
10220 * remote-utils.c (unhexify): New function.
10221 (hexify): New function.
10222 (input_interrupt): Send signals to ``signal_pid''.
10223 * server.c (inferior_pid): Remove.
10224 (start_inferior): Update create_inferior call.
10225 (attach_inferior): Call add_inferior.
10226 (handle_query): New function.
10227 (main): Call handle_query for `q' packets.
10228 * server.h: Include "target.h". Remove obsolete prototypes.
10229 Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
10233 * Makefile.in: Add WARN_CFLAGS. Update configury
10235 * configure.in: Check for <string.h>
10236 * configure: Regenerate.
10237 * config.in: Regenerate.
10238 * gdbreplay.c: Include needed system headers.
10239 (remote_open): Remove strchr prototype.
10240 * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
10241 * regcache.c (supply_register): Change buf argument to const void *.
10242 (supply_register_by_name): Likewise.
10243 (collect_register): Change buf argument to void *.
10244 (collect_register_by_name): Likewise.
10245 * regcache.h: Add missing prototypes.
10246 * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
10247 * server.c (handle_query): New function.
10248 (attached): New static variable, moved out of main.
10249 (main): Quiet longjmp clobber warnings.
10250 * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
10251 * utils.c (error): Remove NORETURN.