Clear *VAL in regcache_raw_read_unsigned
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2016-02-10  Yao Qi  <yao.qi@linaro.org>
2
3         * regcache.c (regcache_raw_read_unsigned): Clear *VAL.
4
5 2016-02-09  Simon Marchi  <simon.marchi@ericsson.com>
6
7         * configure.ac: Use AC_CONFIG_FILES instead of passing arguments
8         to AC_OUTPUT.
9         * configure: Regenerate.
10
11 2016-02-09  Simon Marchi  <simon.marchi@ericsson.com>
12
13         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change
14         void * to gdb_byte *.
15         * linux-low.c (siginfo_fixup): Likewise.
16         (linux_xfer_siginfo): Likewise.
17         * linux-low.h (struct linux_target_ops) <siginfo_fixup>:
18         Likewise.
19         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
20
21 2016-02-02  Walfred Tedeschi  <walfred.tedeschi@intel.com>
22
23         * configure.srv (x86_64-*-linux*): Add amd64-linux-siginfo.o
24         to srv_tgtobj.
25         (i[34567]86-*-linux*): Add amd64-linux-siginfo.o
26         to srv_tgtobj.
27         * linux-x86-low.c [__x86_64__]: Include
28         "nat/amd64-linux-siginfo.h".
29         (compat_siginfo_from_siginfo, siginfo_from_compat_siginfo)
30         (compat_x32_siginfo_from_siginfo, siginfo_from_compat_x32_siginfo)
31         (compat_timeval, compat_sigval, compat_x32_clock, cpt_si_pid)
32         (cpt_si_uid, cpt_si_timerid, cpt_si_overrun, cpt_si_status)
33         (cpt_si_utime, cpt_si_stime, cpt_si_ptr, cpt_si_addr, cpt_si_band)
34         (cpt_si_fd, si_timerid, si_overrun): Move from
35         nat/amd64-linux-siginfo.c.
36         * Makefile.in (amd64-linux-siginfo.o:): New rule.
37
38 2016-01-28  Simon Marchi  <simon.marchi@ericsson.com>
39
40         * server.c (skip_to_semicolon):  Remove.
41         (process_point_options): Use strchrnul instead of
42         skip_to_semicolon.
43
44 2016-01-26  Yao Qi  <yao.qi@linaro.org>
45
46         * linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc.
47         * linux-low.c (install_software_single_step_breakpoints): Don't
48         call regcache_read_pc.
49         * linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove
50         argument pc.
51
52 2016-01-26  Yao Qi  <yao.qi@linaro.org>
53
54         * linux-low.c (install_software_single_step_breakpoints): Call
55         regcache_read_pc instead of get_pc.
56
57 2016-01-26  Yao Qi  <yao.qi@linaro.org>
58
59         * remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO.
60         (unblock_async_io): Rename to ...
61         (block_unblock_async_io): ... it.  New function.
62         (enable_async_io): Don't install SIGIO handler.  Unblock it
63         instead.
64         (disable_async_io): Don't ignore SIGIO.  Block it instead.
65         (initialize_async_io): Install SIGIO handler.  Don't call
66         unblock_async_io.
67
68 2016-01-26  Yao Qi  <yao.qi@linaro.org>
69
70         * remote-utils.c (getpkt): If the buffer isn't empty, and the
71         first character is '\003', call *the_target->request_interrupt.
72
73 2016-01-25  Yao Qi  <yao.qi@linaro.org>
74
75         * remote-utils.c (new_thread_notify): Remove.
76         (dead_thread_notify): Likewise.
77         * remote-utils.h (new_thread_notify): Remove declaration.
78         (dead_thread_notify): Likewise.
79
80 2016-01-23  Marcin Koƛcielnicki  <koriakin@0x04.net>
81
82         * gdb.trace/pending.exp: Fix expected message on continue.
83
84 2016-01-22  Marcin Koƛcielnicki  <koriakin@0x04.net>
85
86         * tracepoint.c (write_inferior_data_ptr): Cast to uintptr_t, so that
87         it works properly on big-endian machines where sizeof (CORE_ADDR)
88         != sizeof (void *).
89
90 2016-01-21  Pedro Alves  <palves@redhat.com>
91
92         * Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
93         (INTERNAL_CFLAGS_BASE): Use COMPILER_CFLAGS instead of CFLAGS.
94         * configure: Regenerate.
95
96 2016-01-21  Yao Qi  <yao.qi@linaro.org>
97
98         * linux-arm-low.c (arm_sigreturn_next_pc): Add parameter
99         is_thumb and set it according to CPSR saved on the stack.
100         (get_next_pcs_syscall_next_pc): Pass is_thumb to
101         arm_sigreturn_next_pc.
102
103 2016-01-18  Yao Qi  <yao.qi@linaro.org>
104
105         * linux-low.c (linux_set_pc_64bit): New function.
106         (linux_get_pc_64bit): New function.
107         * linux-low.h (linux_set_pc_64bit, linux_get_pc_64bit):
108         Declare.
109         * linux-sparc-low.c (debug_threads): Remove declaration.
110         (sparc_get_pc): Remove.
111         (the_low_target): Use linux_get_pc_64bit instead of
112         sparc_get_pc.
113         * linux-tile-low.c (tile_get_pc, tile_set_pc): Remove.
114         (the_low_target): Use linux_get_pc_64bit and
115         linux_set_pc_64bit.
116
117 2016-01-18  Yao Qi  <yao.qi@linaro.org>
118
119         * linux-arm-low.c (debug_threads): Remove declaration.
120         (arm_get_pc, arm_set_pc): Remove.
121         (the_low_target): Use linux_get_pc_32bit and
122         linux_set_pc_32bit.
123         * linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove.
124         (the_low_target): Use linux_get_pc_32bit and
125         linux_set_pc_32bit.
126         * linux-cris-low.c (debug_threads): Remove declaration.
127         (cris_get_pc, cris_set_pc,): Remove.
128         (the_low_target): Use linux_get_pc_32bit and
129         linux_set_pc_32bit.
130         * linux-crisv32-low.c (debug_threads): Remove declaration.
131         (cris_get_pc, cris_set_pc): Remove.
132         (the_low_target): Use linux_get_pc_32bit and
133         linux_set_pc_32bit.
134         * linux-low.c: Include inttypes.h.
135         (linux_get_pc_32bit, linux_set_pc_32bit): New functions.
136         * linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare.
137         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove.
138         (the_low_target): Use linux_get_pc_32bit and
139         linux_set_pc_32bit.
140         * linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove.
141         (the_low_target): Use linux_get_pc_32bit and
142         linux_set_pc_32bit.
143         * linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove.
144         (the_low_target): Use linux_get_pc_32bit and
145         linux_set_pc_32bit.
146         * linux-sh-low.c (sh_get_pc, sh_set_pc): Remove.
147         (the_low_target): Use linux_get_pc_32bit and
148         linux_set_pc_32bit.
149         * linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove.
150         (the_low_target): Use linux_get_pc_32bit and
151         linux_set_pc_32bit.
152
153 2016-01-18  Gary Benson  <gbenson@redhat.com>
154
155         * configure.ac (AC_FUNC_FORK): New check.
156         * config.in: Regenerate.
157         * configure: Likewise.
158
159 2016-01-14  Yao Qi  <yao.qi@linaro.org>
160
161         * linux-aarch32-low.c (thumb2_breakpoint): Make it static.
162         * linux-aarch32-low.h (thumb2_breakpoint): Remove declaration.
163         * linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to
164         arm_get_next_pcs_ctor.
165
166 2016-01-12  Josh Stone  <jistone@redhat.com>
167             Philippe Waroquiers  <philippe.waroquiers@skynet.be>
168
169         * inferiors.h: Include "gdb_vecs.h".
170         (struct process_info): Add syscalls_to_catch.
171         * inferiors.c (remove_process): Free syscalls_to_catch.
172         * remote-utils.c (prepare_resume_reply): Report syscall_entry and
173         syscall_return stops.
174         * server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define.
175         * server.c (handle_general_set): Handle QCatchSyscalls.
176         (handle_query): Report support for QCatchSyscalls.
177         * target.h (struct target_ops): Add supports_catch_syscall.
178         (target_supports_catch_syscall): New macro.
179         * linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo.
180         (struct lwp_info): Add syscall_state.
181         * linux-low.c (handle_extended_wait): Mark syscall_state as an entry.
182         Maintain syscall_state and syscalls_to_catch across exec.
183         (get_syscall_trapinfo): New function, proxy to the_low_target.
184         (linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD.
185         (linux_low_filter_event): Toggle syscall_state entry/return for
186         syscall traps, and set it ignored for all others.
187         (gdb_catching_syscalls_p): New function.
188         (gdb_catch_this_syscall_p): New function.
189         (linux_wait_1): Handle SYSCALL_SIGTRAP.
190         (linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility.
191         (linux_supports_catch_syscall): New function.
192         (linux_target_ops): Install it.
193         * linux-x86-low.c (x86_get_syscall_trapinfo): New function.
194         (the_low_target): Install it.
195
196 2016-01-12  Mike Frysinger  <vapier@gentoo.org>
197
198         * acinclude.m4: Include new ../warning.m4 file.
199         * configure: Regenerated.
200         * configure.ac: Replace all warning logic with AM_GDB_WARNINGS.
201
202 2016-01-12  Mike Frysinger  <vapier@gentoo.org>
203
204         * ax.c (is_goto_target): Mark static.
205         * linux-low.c (register_addr): Likewise.
206         (linux_fetch_registers, linux_store_registers): Likewise.
207         * mem-break.c (any_persistent_commands): Fix old prototype.
208         (add_commands_to_breakpoint): Mark static.
209         * regcache.c (find_register_by_name): Delete unused func.
210         * remote-utils.c (hex_or_minus_one): Mark static.
211         * server.c (monitor_show_help): Mark static.
212         (handle_query, handle_v_cont, handle_v_attach, handle_v_kill,
213         handle_v_requests): Likewise.
214
215 2016-01-12  Pedro Alves  <palves@redhat.com>
216
217         Remove use of the registered trademark symbol throughout.
218
219 2016-01-08  Yao Qi  <yao.qi@linaro.org>
220
221         * remote-utils.c (getpkt): If c is '\003', call target hook
222         request_interrupt.
223
224 2016-01-06  Yao Qi  <yao.qi@linaro.org>
225
226         * linux-aarch32-low.h (arm_abi_breakpoint): Move to
227         linux-aarch32-low.c.
228         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
229         (arm_breakpoint_len, thumb_breakpoint_len): Likewise.
230         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
231         (thumb2_breakpoint): Declare.
232         * linux-aarch32-low.c (arm_abi_breakpoint): Moved from
233         linux-aarch32-low.h.
234         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
235         (arm_breakpoint_len, thumb_breakpoint_len): Likewise.
236         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
237
238 2016-01-01  Joel Brobecker  <brobecker@adacore.com>
239
240         * gdbreplay.c (gdbreplay_version): Change copyright year in
241         version message.
242         * server.c (gdbserver_version): Likewise.
243
244 2015-12-28  Patrick Palka  <patrick@parcs.ath.cx>
245
246         * server.c (crc32_table): Delete.
247         (crc32): Use libiberty's xcrc32 function.
248
249 2015-12-22  Joel Brobecker  <brobecker@adacore.com>
250
251         * lynx-low.c (lynx_delete_thread_callback): New function.
252         (lynx_mourn): Properly delete our process and all of its
253         threads.  Remove call to clear_inferiors.
254
255 2015-12-22  Joel Brobecker  <brobecker@adacore.com>
256
257         * target.c (thread_search_callback): Add check that
258         the thread_stopped target callback is not NULL before
259         calling it.
260
261 2015-12-21  Yao Qi  <yao.qi@linaro.org>
262
263         * linux-aarch32-low.h [__aarch64__]: Use arm_abi_breakpoint
264         arm breakpoint.
265
266 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
267
268         * server.c (handle_query): Call target_supports_software_single_step.
269
270 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
271
272         * linux-low.c (single_step): New function.
273         (linux_resume_one_lwp_throw): Call single_step.
274         (start_step_over): Likewise.
275
276 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
277
278         * Makefile.in (SFILES): Append arch/arm-linux.c,
279         arch/arm-get-next-pcs.c.
280         (arm-linux.o): New rule.
281         (arm-get-next-pcs.o): New rule.
282         * configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
283         arm-linux.o.
284         * linux-aarch32-low.c (arm_abi_breakpoint): Remove macro.  Moved
285         to linux-aarch32-low.c.
286         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
287         (arm_breakpoint_len, thumb_breakpoint): Likewise.
288         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
289         (thumb2_breakpoint_len): Likewise.
290         (arm_is_thumb_mode): Make non-static.
291         * linux-aarch32-low.h (arm_abi_breakpoint): New macro.  Moved
292         from linux-aarch32-low.c.
293         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
294         (arm_breakpoint_len, thumb_breakpoint): Likewise.
295         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
296         (thumb2_breakpoint_len): Likewise.
297         (arm_is_thumb_mode): New declaration.
298         * linux-arm-low.c: Include arch/arm-linux.h
299         aarch/arm-get-next-pcs.h, sys/syscall.h.
300         (get_next_pcs_ops): New struct.
301         (get_next_pcs_addr_bits_remove): New function.
302         (get_next_pcs_is_thumb): New function.
303         (get_next_pcs_read_memory_unsigned_integer): Likewise.
304         (arm_sigreturn_next_pc): Likewise.
305         (get_next_pcs_syscall_next_pc): Likewise.
306         (arm_gdbserver_get_next_pcs): Likewise.
307         (struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
308         Initialize.
309         * linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
310         * server.h: Include gdb_vecs.h.
311
312 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
313
314         * Makefile.in (SFILES): Append common/common-regcache.c.
315         (OBS): Append common-regcache.o.
316         (common-regcache.o): New rule.
317         * regcache.c (init_register_cache): Initialize cache to
318         REG_UNAVAILABLE.
319         (regcache_raw_read_unsigned): New function.
320         * regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared
321         register_status enum.
322
323 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
324
325         * linux-aarch64-low.c (the_low_targets): Rename
326         breakpoint_reinsert_addr to get_next_pcs.
327         * linux-arm-low.c (the_low_targets): Likewise.
328         * linux-bfin-low.c (the_low_targets): Likewise.
329         * linux-cris-low.c (the_low_targets): Likewise.
330         * linux-crisv32-low.c (the_low_targets): Likewise.
331         * linux-low.c (can_software_single_step): Likewise.
332         (install_software_single_step_breakpoints): New function.
333         (start_step_over): Use install_software_single_step_breakpoints.
334         * linux-low.h: New CORE_ADDR vector.
335         (struct linux_target_ops) Rename breakpoint_reinsert_addr to
336         get_next_pcs.
337         * linux-mips-low.c (the_low_targets): Likewise.
338         * linux-nios2-low.c (the_low_targets): Likewise.
339         * linux-sparc-low.c (the_low_targets): Likewise.
340
341 2015-12-17  Pedro Alves  <palves@redhat.com>
342
343         * linux-low.c (linux_kill_one_lwp): Remove references to
344         LinuxThreads.
345         (kill_lwp): Remove HAVE_TKILL_SYSCALL check.  No longer fall back
346         to 'kill'.
347         (linux_init_signals): Delete.
348         (initialize_low): Adjust.
349         * thread-db.c (thread_db_init): Remove LinuxThreads reference.
350
351 2015-12-16  Pedro Alves  <palves@redhat.com>
352
353         * configure.ac (compiler warning flags): When testing a
354         -Wno-foo option, check whether -Wfoo works instead.
355         * configure: Regenerate.
356
357 2015-12-11  Don Breazeal  <donb@codesourcery.com>
358
359         * server.c (process_serial_event): Don't exit from gdbserver
360         in remote mode if there are still active inferiors.
361
362 2015-12-11  Yao Qi  <yao.qi@linaro.org>
363
364         * linux-aarch64-low.c (aarch64_breakpoint_at): Call
365         arm_breakpoint_at if the process is 32-bit.
366
367 2015-12-11  Yao Qi  <yao.qi@linaro.org>
368
369         * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
370         arm breakpoint.
371
372 2015-12-07  Yao Qi  <yao.qi@linaro.org>
373
374         * configure.srv: Append arm.o to srv_tgtobj for
375         aarch64*-*-linux* target.
376         * linux-aarch32-low.c (arm_abi_breakpoint): New macro.  Moved
377         from linux-arm-low.c.
378         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
379         (arm_breakpoint_len, thumb_breakpoint): Likewise.
380         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
381         (thumb2_breakpoint_len): Likewise.
382         (arm_is_thumb_mode, arm_breakpoint_at): Likewise.
383         (arm_breakpoint_kinds): Likewise.
384         (arm_breakpoint_kind_from_pc): Likewise.
385         (arm_sw_breakpoint_from_kind): Likewise.
386         (arm_breakpoint_kind_from_current_state): Likewise.
387         * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
388         (arm_sw_breakpoint_from_kind): Declare.
389         (arm_breakpoint_kind_from_current_state): Declare.
390         (arm_breakpoint_at): Declare.
391         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
392         arm_sw_breakpoint_from_kind if process is 32-bit.
393         (aarch64_breakpoint_kind_from_pc): New function.
394         (aarch64_breakpoint_kind_from_current_state): New function.
395         (the_low_target): Initialize fields breakpoint_kind_from_pc
396         and breakpoint_kind_from_current_state.
397         * linux-arm-low.c (arm_breakpoint_kinds): Move to
398         linux-aarch32-low.c.
399         (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
400         (arm_breakpoint, arm_breakpoint_len): Likewise.
401         (thumb_breakpoint, thumb_breakpoint_len): Likewise.
402         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
403         (arm_is_thumb_mode): Likewise.
404         (arm_breakpoint_at): Likewise.
405         (arm_breakpoint_kind_from_pc): Likewise.
406         (arm_sw_breakpoint_from_kind): Likewise.
407         (arm_breakpoint_kind_from_current_state): Likewise.
408
409         Revert:
410         2015-08-04  Yao Qi  <yao.qi@linaro.org>
411
412         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
413         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
414         * server.c (extended_protocol): Remove "static".
415         * server.h (extended_protocol): Declare it.
416
417 2015-12-04  Josh Stone  <jistone@redhat.com>
418
419         * target.h (struct target_ops) <arch_setup>: Rename to ...
420         (struct target_ops) <post_create_inferior>: ... this.
421         (target_arch_setup): Rename to ...
422         (target_post_create_inferior): ... this, calling post_create_inferior.
423         * server.c (start_inferior): Update target_arch_setup calls to
424         target_post_create_inferior.
425         * linux-low.c (linux_low_ptrace_options): Forward declare.
426         (linux_arch_setup): Update its comment for general use.
427         (linux_post_create_inferior): New, run arch_setup and setup ptrace.
428         (struct linux_target_ops): Use linux_post_create_inferior.
429         * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
430         to post_create_inferior.
431         * nto-low.c (struct nto_target_ops): Likewise.
432         * spu-low.c (struct spu_target_ops): Likewise.
433         * win32-low.c (struct win32_target_ops): Likewise.
434
435 2015-12-03  Antoine Tremblay  <antoine.tremblay@ericsson.com>
436
437         * linux-arm-low.c: Remove duplicate arch/arm.h include.
438
439 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
440
441         * linux-arm-low.c (arm_reinsert_addr): Remove function.
442         (struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
443         * linux-cris-low.c (cris_reinsert_addr> Remove function.
444         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
445         * linux-crisv32-low.c (cris_reinsert_addr): Remove function.
446         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
447         * linux-mips-low.c (mips_reinsert_addr): Remove function.
448         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
449         * linux-nios2-low.c (nios2_reinsert_addr): Remove function.
450         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
451         * linux-sparc-low.c (sparc_reinsert_addr): Remove function.
452         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
453
454 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
455
456         * linux-low.c (linux_look_up_symbols): Don't call
457         linux_supports_traceclone.
458         * linux-low.h (thread_db_init): Remove use_events argument.
459         * thread-db.c (thread_db_use_event): Remove global variable.
460         (struct thread_db) <td_thr_event_enable_p>: Remove field.
461         (struct thread_db) <td_create_bp>: Remove field.
462         (thread_db_create_event): Remove function.
463         (thread_db_enable_reporting): Likewise.
464         (find_one_thread): Don't check for thread_db_use_events.
465         (attach_thread): Likewise.
466         (thread_db_load_search): Remove td_thr_event_enable_p initialization.
467         (try_thread_db_load_1): Don't check for thread_db_use_events.
468         (thread_db_init): Remove use_events argument and thread events
469         handling.
470         (remove_thread_event_breakpoints): Remove function.
471         (thread_db_detach): Remove call to remove_thred_event_breakpoints.
472
473 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
474
475         * linux-aarch64-low.c (aarch64_supports_hardware_single_step):
476         New function.
477         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
478         * linux-arm-low.c (arm_supports_hardware_single_step): New function.
479         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
480         * linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
481         (struct linux_target_ops) <bfin_supports_hardware_single_step>:
482         Initialize.
483         * linux-crisv32-low.c (cris_supports_hardware_single_step):
484         New function.
485         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
486         * linux-low.c (can_hardware_single_step): Use
487         supports_hardware_single_step.
488         (can_software_single_step): New function.
489         (start_step_over): Call can_software_single_step.
490         (linux_supports_hardware_single_step): New function.
491         (struct target_ops) <supports_software_single_step>: Initialize.
492         * linux-low.h (struct linux_target_ops)
493         <supports_hardware_single_step>: Initialize.
494         * linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
495         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
496         * linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
497         (struct linux_target_ops) <supports_hardware_single_step> Initialize.
498         * linux-s390-low.c (s390_supports_hardware_single_step): New function.
499         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
500         * linux-sh-low.c (sh_supports_hardware_single_step): New function.
501         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
502         * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
503         (struct linux_target_ops) <tic6x_supports_hardware_single_step>:
504         Initialize.
505         * linux-tile-low.c (tile_supports_hardware_single_step): New function.
506         (struct linux_target_ops) <tile_supports_hardware_single_step>:
507         Initialize.
508         * linux-x86-low.c (x86_supports_hardware_single_step) New function.
509         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
510         * linux-xtensa-low.c (xtensa_supports_hardware_single_step):
511         New function.
512         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
513         * target.h (struct target_ops): <supports_software_single_step>:
514         New field.
515         (target_supports_software_single_step): New macro.
516
517 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
518
519         * linux-low.c (linux_wait_1): Fix pc advance condition.
520         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
521         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
522
523 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
524
525         * linux-arm-low.c (arm_is_thumb_mode): New function.
526         (arm_breakpoint_at): Use arm_is_thumb_mode.
527         (arm_breakpoint_kind_from_current_state): New function.
528         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
529         Initialize.
530         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
531         (linux_breakpoint_kind_from_current_state): New function.
532         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
533         * linux-low.h (struct linux_target_ops)
534         <breakpoint_kind_from_current_state>: New field.
535         * target.h (struct target_ops): Likewise.
536         (target_breakpoint_kind_from_current_state): New macro.
537
538 2015-11-30  Pedro Alves  <palves@redhat.com>
539
540         * linux-low.c (linux_resume): Wake up the event loop before
541         returning.
542
543 2015-11-30  Pedro Alves  <palves@redhat.com>
544
545         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
546         check.
547         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
548         to -1.
549         * target.c (struct thread_search): New structure.
550         (thread_search_callback): New function.
551         (prev_general_thread): New global.
552         (prepare_to_access_memory, done_accessing_memory): New functions.
553         * target.h (prepare_to_access_memory, done_accessing_memory):
554         Replace macros with function declarations.
555
556 2015-11-30  Pedro Alves  <palves@redhat.com>
557
558         PR 14618
559         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
560         report TARGET_WAITKIND_NO_RESUMED.
561         * remote-utils.c (prepare_resume_reply): Handle
562         TARGET_WAITKIND_NO_RESUMED.
563         * server.c (report_no_resumed): New global.
564         (handle_query) <qSupported>: Handle "no-resumed+".  Report
565         "no-resumed+" support.
566         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
567         return error if the client doesn't support no-resumed events.
568         (push_stop_notification): New function.
569         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
570         events if the client supports them.
571
572 2015-11-30  Pedro Alves  <palves@redhat.com>
573
574         * linux-low.c (thread_still_has_status_pending_p): Don't check
575         vCont;t here.
576         (lwp_resumed): New function.
577         (status_pending_p_callback): Return early if the LWP is not
578         supposed to be resumed.
579
580 2015-11-30  Pedro Alves  <palves@redhat.com>
581
582         * linux-low.c (handle_extended_wait): Assert that the LWP's
583         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
584         thread create events, leave the new child's status pending.
585         (linux_low_filter_event): If GDB wants to hear about thread exit
586         events, leave the LWP marked dead and don't delete it.
587         (linux_wait_for_event_filtered): Don't check for thread exit.
588         (filter_exit_event): New function.
589         (linux_wait_1): Use it, when returning an exit event.
590         (linux_resume_one_lwp_throw): Assert that the LWP's
591         waitstatus is TARGET_WAITKIND_IGNORE.
592         * remote-utils.c (prepare_resume_reply): Handle
593         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
594         * server.c (report_thread_events): New global.
595         (handle_general_set): Handle QThreadEvents.
596         (handle_query) <qSupported>: Handle and report QThreadEvents+;
597         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
598         TARGET_WAITKIND_THREAD_EXITED.
599         * server.h (report_thread_events): Declare.
600
601 2015-11-30  Pedro Alves  <palves@redhat.com>
602
603         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
604         the thread's last_resume_kind was resume_stop.
605
606 2015-11-30  Pedro Alves  <palves@redhat.com>
607
608         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
609         before returning.
610
611 2015-11-30  Pedro Alves  <palves@redhat.com>
612
613         * server.c (handle_v_requests): Handle vCtrlC.
614
615 2015-11-30  Pedro Alves  <palves@redhat.com>
616
617         * gdbthread.h (find_any_thread_of_pid): Declare.
618         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
619         functions.
620         * server.c (handle_query): If current_thread is NULL, look for
621         another thread of the selected process.
622
623 2015-11-26  Daniel Colascione  <dancol@dancol.org>
624             Simon Marchi  <simon.marchi@ericsson.com>
625
626         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
627         * server.c (handle_qxfer_threads_worker): Refactor to include thread
628         name in reply.
629         * target.h (struct target_ops) <thread_name>: New field.
630         (target_thread_name): New macro.
631
632 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
633
634         * regcache.h (regcache_invalidate_pid): Add declaration.
635         * regcache.c (regcache_invalidate_pid): New function, extracted
636         from regcache_invalidate.
637         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
638         Add trivial documentation comment.
639         * lynx-low.c: Use regcache_invalidate_pid instead of
640         regcache_invalidate.
641
642 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
643
644         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
645         and Elf64_auxv_t if the target is Android.
646
647 2015-11-22  Doug Evans  <xdje42@gmail.com>
648
649         * target.h: #include <sys/types.h>.
650
651 2015-11-19  Pedro Alves  <palves@redhat.com>
652
653         * linux-low.c (linux_process_qsupported): Change prototype.
654         Adjust.
655         * linux-low.h (struct linux_target_ops) <process_qsupported>:
656         Change prototype.
657         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
658         and adjust to loop over all features.
659         * server.c (handle_query) <qSupported>: Adjust to call
660         target_process_qsupported once, passing it a vector of unprocessed
661         features.
662         * target.h (struct target_ops) <process_qsupported>: Change
663         prototype.
664         (target_process_qsupported): Adjust.
665
666 2015-11-19  Pedro Alves  <palves@redhat.com>
667
668         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
669         mode.
670         * configure: Regenerate.
671
672 2015-11-19  Pedro Alves  <palves@redhat.com>
673
674         * configure: Regenerate.
675
676 2015-11-19  Yao Qi  <yao.qi@linaro.org>
677
678         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
679         type to uint32_t.
680
681 2015-11-19  Yao Qi  <yao.qi@linaro.org>
682
683         * linux-aarch64-low.c (enum aarch64_operand_type): New.
684         (struct aarch64_operand): Move enum out.
685
686 2015-11-19  Yao Qi  <yao.qi@linaro.org>
687
688         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
689         struct user_fpsimd_state *.
690         (aarch64_store_fpregset): Likewise.
691
692 2015-11-19  Yao Qi  <yao.qi@linaro.org>
693
694         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
695         struct user_pt_regs *.
696         (aarch64_store_gregset): Likewise.
697
698 2015-11-18  Pedro Alves  <palves@redhat.com>
699
700         * Makefile.in (all_object_files): Add $IPA_OBJS.
701
702 2015-11-17  Pedro Alves  <palves@redhat.com>
703
704         * win32-low.c (win32_resume): Use gdb_signal_from_host,
705         GDB_SIGNAL_0 and gdb_signal_to_string.
706
707 2015-11-17  Pedro Alves  <palves@redhat.com>
708
709         * win32-low.c (handle_output_debug_string): Remove parameter.
710         (win32_kill): Remove our_status local and adjust call to
711         handle_output_debug_string.
712         (get_child_debug_event): Adjust call to
713         handle_output_debug_string.
714
715 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
716
717         * linux-mips-low.c (mips_fill_gregset): Add cast.
718         (mips_store_gregset): Likewise.
719         (mips_fill_fpregset): Likewise.
720         (mips_store_fpregset): Likewise.
721
722 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
723
724         * linux-mips-low.c (mips_add_watchpoint): Rename private to
725         priv.
726
727 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
728
729         * linux-mips-low.c (mips_linux_new_thread): Change type of
730         watch_type to enum target_hw_bp_type.
731
732 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
733
734                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
735                 Change return type to arm_hwbp_type.
736
737 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
738
739         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
740         (arm_store_gregset): Likewise.
741         * linux-arm-low.c (arm_get_hwcap): Likewise.
742         (arm_read_description): Likewise.
743
744 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
745
746         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
747
748 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
749
750         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
751         (ppc_fill_vsxregset): Likewise.
752         (ppc_store_vsxregset): Likewise.
753         (ppc_fill_vrregset): Likewise.
754         (ppc_store_vrregset): Likewise.
755         (ppc_fill_evrregset): Likewise.
756         (ppc_store_evrregset): Likewise.
757
758 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
759
760         * linux-ppc-low.c (ppc_usrregs_info): Remove
761         forward-declaration.
762         (ppc_arch_setup): Move lower in file.
763
764 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
765
766         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
767         (ps_pdwrite): Likewise.
768
769 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
770
771         * linux-arm-low.c (arm_new_thread): Move pointer dereference
772         to after assert checks.
773
774 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
775
776         * proc-service.c (ps_pdread): Add/adjust casts.
777         (ps_pdwrite): Add/adjust casts.
778
779 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
780
781         * server.c (handle_search_memory_1): Cast return value of
782         memmem.
783
784 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
785
786         * server.c (write_qxfer_response): Change type of data to
787         gdb_byte *.
788
789 2015-10-29  Pedro Alves  <palves@redhat.com>
790
791         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
792
793 2015-10-29  Pedro Alves  <palves@redhat.com>
794
795         * tracepoint.c (clear_installed_tracepoints): Add casts.
796
797 2015-10-29  Pedro Alves  <palves@redhat.com>
798
799         * server.c (handle_v_cont, process_serial_event): Add enum
800         gdb_signal casts to signal parsing code.
801
802 2015-10-29  Pedro Alves  <palves@redhat.com>
803
804         * linux-low.h (NULL_REGSET): Define.
805         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
806         * linux-arm-low.c (arm_regsets): Likewise.
807         * linux-crisv32-low.c (cris_regsets): Likewise.
808         * linux-m68k-low.c (m68k_regsets): Likewise.
809         * linux-mips-low.c (mips_regsets): Likewise.
810         * linux-nios2-low.c (nios2_regsets): Likewise.
811         * linux-ppc-low.c (ppc_regsets): Likewise.
812         * linux-s390-low.c (s390_regsets): Likewise.
813         * linux-sh-low.c (sh_regsets): Likewise.
814         * linux-sparc-low.c (sparc_regsets): Likewise.
815         * linux-tic6x-low.c (tic6x_regsets): Likewise.
816         * linux-tile-low.c (tile_regsets): Likewise.
817         * linux-x86-low.c (x86_regsets): Likewise.
818         * linux-xtensa-low.c (xtensa_regsets): Likewise.
819
820 2015-10-29  Pedro Alves  <palves@redhat.com>
821
822         * linux-low.h (NULL_REGSET): Define.
823         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
824         * linux-arm-low.c (arm_regsets): Likewise.
825         * linux-crisv32-low.c (cris_regsets): Likewise.
826         * linux-m68k-low.c (m68k_regsets): Likewise.
827         * linux-mips-low.c (mips_regsets): Likewise.
828         * linux-nios2-low.c (nios2_regsets): Likewise.
829         * linux-ppc-low.c (ppc_regsets): Likewise.
830         * linux-s390-low.c (s390_regsets): Likewise.
831         * linux-sh-low.c (sh_regsets): Likewise.
832         * linux-sparc-low.c (sparc_regsets): Likewise.
833         * linux-tic6x-low.c (tic6x_regsets): Likewise.
834         * linux-tile-low.c (tile_regsets): Likewise.
835         * linux-x86-low.c (x86_regsets): Likewise.
836         * linux-xtensa-low.c (xtensa_regsets): Likewise.
837
838 2015-10-26  Doug Evans  <dje@google.com>
839
840         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
841
842 2015-10-26  Doug Evans  <dje@google.com>
843
844         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
845
846 2015-10-26  Doug Evans  <dje@google.com>
847
848         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
849         for debug_printf.
850         (attach_thread, find_new_threads_callback): Ditto.
851
852 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
853
854         * mem-break.h (set_breakpoint_data): Remove.
855
856 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
857
858         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
859         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
860         (initialize_low): Remove set_breakpoint_data call.
861         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
862         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
863         (initialize_low): Remove set_breakpoint_data call.
864         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
865         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
866         (initialize_low): Remove set_breakpoint_data call.
867
868 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
869
870         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
871         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
872         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
873         * target.h (target_breakpoint_kind_from_pc): New macro.
874
875 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
876
877         * linux-low.c (default_breakpoint_kind_from_pc): New function.
878         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
879         the default breakpoint kind.
880
881 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
882
883         * linux-arm-low.c (arm_supports_z_point_type): Add software
884         breakpoint support.
885
886 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
887
888         * linux-arm-low.c: Refactor breakpoint definitions.
889         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
890         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
891
892 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
893
894         * Makefile.in: Add arm.c/o.
895         * configure.srv: Likewise.
896         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
897         (arm_breakpoint_kind_from_pc): New function.
898         (arm_sw_breakpoint_from_kind): Return proper kind.
899         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
900
901 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
902
903         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
904         removal.
905         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
906         (struct raw_breakpoint) <size>: Remove.
907         (struct raw_breakpoint) <kind>: Add.
908         (bp_size): New function.
909         (bp_opcode): Likewise.
910         (find_raw_breakpoint_at): Adjust for kind.
911         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
912         (remove_memory_breakpoint): Adjust for kind call bp_size.
913         (set_raw_breakpoint_at): Adjust for kind.
914         (set_breakpoint): Likewise.
915         (set_breakpoint_at): Call breakpoint_kind_from_pc.
916         (delete_raw_breakpoint): Adjust for kind.
917         (delete_breakpoint): Likewise.
918         (find_gdb_breakpoint): Likewise.
919         (set_gdb_breakpoint_1): Likewise.
920         (set_gdb_breakpoint): Likewise.
921         (delete_gdb_breakpoint_1): Likewise.
922         (delete_gdb_breakpoint): Likewise.
923         (uninsert_raw_breakpoint): Likewise.
924         (reinsert_raw_breakpoint): Likewise.
925         (set_breakpoint_data): Remove.
926         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
927         (check_mem_read): Adjust for kind call bp_size.
928         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
929         (clone_one_breakpoint): Adjust for kind.
930         * mem-break.h (set_gdb_breakpoint): Likewise.
931         (delete_gdb_breakpoint): Likewise.
932         * server.c (process_serial_event): Likewise.
933
934 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
935
936         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
937         (struct linux_target_ops) <breakpoint>: Remove.
938         (struct linux_target_ops) <breakpoint_len>: Remove.
939         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
940         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
941         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
942         (arm_sw_breakpoint_from_kind): New function.
943         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
944         (struct linux_target_ops) <breakpoint>: Remove.
945         (struct linux_target_ops) <breakpoint_len>: Remove.
946         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
947         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
948         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
949         (struct linux_target_ops) <breakpoint>: Remove.
950         (struct linux_target_ops) <breakpoint_len>: Remove.
951         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
952         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
953         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
954         (struct linux_target_ops) <breakpoint>: Remove.
955         (struct linux_target_ops) <breakpoint_len>: Remove.
956         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
957         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
958         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
959         and sw_breakpoint_from_kind to increment the pc.
960         (linux_breakpoint_kind_from_pc): New function.
961         (linux_sw_breakpoint_from_kind): New function.
962         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
963         (initialize_low): Call breakpoint_kind_from_pc and
964         sw_breakpoint_from_kind to replace breakpoint_data/len.
965         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
966         New field.
967         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
968         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
969         (struct linux_target_ops) <breakpoint>: Remove.
970         (struct linux_target_ops) <breakpoint_len>: Remove.
971         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
972         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
973         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
974         (struct linux_target_ops) <breakpoint>: Remove.
975         (struct linux_target_ops) <breakpoint_len>: Remove.
976         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
977         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
978         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
979         (struct linux_target_ops) <breakpoint>: Remove.
980         (struct linux_target_ops) <breakpoint_len>: Remove.
981         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
982         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
983         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
984         (struct linux_target_ops) <breakpoint>: Remove.
985         (struct linux_target_ops) <breakpoint_len>: Remove.
986         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
987         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
988         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
989         (struct linux_target_ops) <breakpoint>: Remove.
990         (struct linux_target_ops) <breakpoint_len>: Remove.
991         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
992         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
993         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
994         (struct linux_target_ops) <breakpoint>: Remove.
995         (struct linux_target_ops) <breakpoint_len>: Remove.
996         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
997         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
998         * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
999         (struct linux_target_ops) <breakpoint>: Remove.
1000         (struct linux_target_ops) <breakpoint_len>: Remove.
1001         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1002         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1003         * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
1004         (struct linux_target_ops) <breakpoint>: Remove.
1005         (struct linux_target_ops) <breakpoint_len>: Remove.
1006         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1007         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1008         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
1009         (struct linux_target_ops) <breakpoint>: Remove.
1010         (struct linux_target_ops) <breakpoint_len>: Remove.
1011         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1012         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1013         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
1014         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
1015         (struct linux_target_ops) <breakpoint>: Remove.
1016         (struct linux_target_ops) <breakpoint_len>: Remove.
1017         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1018         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1019         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
1020         (struct linux_target_ops) <breakpoint>: Remove.
1021         (struct linux_target_ops) <breakpoint_len>: Remove.
1022         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1023         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1024
1025 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1026
1027         * linux-cris-low.c (cris_get_pc): Remove void arg.
1028
1029 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
1030
1031         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
1032         variable name.
1033
1034 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
1035
1036         * inferiors.c (thread_pid_matches_callback): New function.
1037         (find_thread_process): New function.
1038         (remove_thread): Reset current_thread.
1039         (remove_process): Assert threads have been removed first.
1040
1041 2015-10-15  Yao Qi  <yao.qi@linaro.org>
1042
1043         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
1044         if it is 3.
1045         (aarch64_remove_point): Likewise.
1046         * regcache.c (regcache_register_size): New function.
1047
1048 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1049
1050         * linux-aarch64-low.c: Update all callers as emit_load_store
1051         is renamed to aarch64_emit_load_store.
1052
1053 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1054
1055         * linux-aarch64-low.c: Update all callers of function renaming
1056         from emit_insn to aarch64_emit_insn.
1057
1058 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1059
1060         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
1061         arch/aarch64-insn.h.
1062         (struct aarch64_memory_operand): Likewise.
1063         (ENCODE): Likewise.
1064         (emit_insn): Move to arch/aarch64-insn.c.
1065         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
1066         (emit_load_store): Move to arch/aarch64-insn.c.
1067         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
1068         (can_encode_int32): Remove.
1069
1070 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1071
1072         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
1073         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
1074         (aarch64_relocate_instruction): Likewise.
1075         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
1076         (struct aarch64_insn_visitor): Likewise.
1077
1078 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1079
1080         * linux-aarch64-low.c (struct aarch64_insn_data): New.
1081         (struct aarch64_insn_visitor): New.
1082         (struct aarch64_insn_relocation_data): New.
1083         (aarch64_ftrace_insn_reloc_b): New function.
1084         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
1085         (aarch64_ftrace_insn_reloc_cb): Likewise.
1086         (aarch64_ftrace_insn_reloc_tb): Likewise.
1087         (aarch64_ftrace_insn_reloc_adr): Likewise.
1088         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
1089         (aarch64_ftrace_insn_reloc_others): Likewise.
1090         (visitor): New.
1091         (aarch64_relocate_instruction): Use visitor.
1092
1093 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1094
1095         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
1096         int.  Add argument buf.
1097         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
1098         aarch64_relocate_instruction.
1099
1100 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1101
1102         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
1103         argument insn.  Remove local variable insn.  Don't call
1104         target_read_uint32.
1105         (aarch64_install_fast_tracepoint_jump_pad): Call
1106         target_read_uint32.
1107
1108 2015-09-30  Yao Qi  <yao.qi@linaro.org>
1109
1110         * linux-aarch64-low.c (emit_movk): Shorten a long line.
1111         (emit_load_store_pair): Likewise.
1112
1113 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
1114
1115         * dll.c (match_dll): Add cast(s).
1116         (unloaded_dll): Likewise.
1117         * linux-low.c (second_thread_of_pid_p): Likewise.
1118         (delete_lwp_callback): Likewise.
1119         (count_events_callback): Likewise.
1120         (select_event_lwp_callback): Likewise.
1121         (linux_set_resume_request): Likewise.
1122         * server.c (accumulate_file_name_length): Likewise.
1123         (emit_dll_description): Likewise.
1124         (handle_qxfer_threads_worker): Likewise.
1125         (visit_actioned_threads): Likewise.
1126         * thread-db.c (any_thread_of): Likewise.
1127         * tracepoint.c (same_process_p): Likewise.
1128         (match_blocktype): Likewise.
1129         (build_traceframe_info_xml): Likewise.
1130
1131 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
1132
1133         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
1134         assignment.
1135         (gdb_unparse_agent_expr): Likewise.
1136         * hostio.c (require_data): Likewise.
1137         (handle_pread): Likewise.
1138         * linux-low.c (disable_regset): Likewise.
1139         (fetch_register): Likewise.
1140         (store_register): Likewise.
1141         (get_dynamic): Likewise.
1142         (linux_qxfer_libraries_svr4): Likewise.
1143         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
1144         (set_fast_tracepoint_jump): Likewise.
1145         (uninsert_fast_tracepoint_jumps_at): Likewise.
1146         (reinsert_fast_tracepoint_jumps_at): Likewise.
1147         (validate_inserted_breakpoint): Likewise.
1148         (clone_agent_expr): Likewise.
1149         * regcache.c (init_register_cache): Likewise.
1150         * remote-utils.c (putpkt_binary_1): Likewise.
1151         (decode_M_packet): Likewise.
1152         (decode_X_packet): Likewise.
1153         (look_up_one_symbol): Likewise.
1154         (relocate_instruction): Likewise.
1155         (monitor_output): Likewise.
1156         * server.c (handle_search_memory): Likewise.
1157         (handle_qxfer_exec_file): Likewise.
1158         (handle_qxfer_libraries): Likewise.
1159         (handle_qxfer): Likewise.
1160         (handle_query): Likewise.
1161         (handle_v_cont): Likewise.
1162         (handle_v_run): Likewise.
1163         (captured_main): Likewise.
1164         * target.c (write_inferior_memory): Likewise.
1165         * thread-db.c (try_thread_db_load_from_dir): Likewise.
1166         * tracepoint.c (init_trace_buffer): Likewise.
1167         (add_tracepoint_action): Likewise.
1168         (add_traceframe): Likewise.
1169         (add_traceframe_block): Likewise.
1170         (cmd_qtdpsrc): Likewise.
1171         (cmd_qtdv): Likewise.
1172         (cmd_qtstatus): Likewise.
1173         (response_source): Likewise.
1174         (response_tsv): Likewise.
1175         (cmd_qtnotes): Likewise.
1176         (gdb_collect): Likewise.
1177         (initialize_tracepoint): Likewise.
1178
1179 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1180
1181         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
1182         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
1183         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
1184         <NOP>: New.
1185         (enum aarch64_condition_codes): New enum.
1186         (w0): New static global.
1187         (fp): Likewise.
1188         (lr): Likewise.
1189         (struct aarch64_memory_operand) <type>: New
1190         MEMORY_OPERAND_POSTINDEX type.
1191         (postindex_memory_operand): New helper function.
1192         (emit_ret): New function.
1193         (emit_load_store_pair): New function, factored out of emit_stp
1194         with support for MEMORY_OPERAND_POSTINDEX.
1195         (emit_stp): Rewrite using emit_load_store_pair.
1196         (emit_ldp): New function.
1197         (emit_load_store): Likewise.
1198         (emit_ldr): Mention post-index instruction in comment.
1199         (emit_ldrh): New function.
1200         (emit_ldrb): New function.
1201         (emit_ldrsw): Mention post-index instruction in comment.
1202         (emit_str): Likewise.
1203         (emit_subs): New function.
1204         (emit_cmp): Likewise.
1205         (emit_and): Likewise.
1206         (emit_orr): Likewise.
1207         (emit_orn): Likewise.
1208         (emit_eor): Likewise.
1209         (emit_mvn): Likewise.
1210         (emit_lslv): Likewise.
1211         (emit_lsrv): Likewise.
1212         (emit_asrv): Likewise.
1213         (emit_mul): Likewise.
1214         (emit_sbfm): Likewise.
1215         (emit_sbfx): Likewise.
1216         (emit_ubfm): Likewise.
1217         (emit_ubfx): Likewise.
1218         (emit_csinc): Likewise.
1219         (emit_cset): Likewise.
1220         (emit_nop): Likewise.
1221         (emit_ops_insns): New helper function.
1222         (emit_pop): Likewise.
1223         (emit_push): Likewise.
1224         (aarch64_emit_prologue): New function.
1225         (aarch64_emit_epilogue): Likewise.
1226         (aarch64_emit_add): Likewise.
1227         (aarch64_emit_sub): Likewise.
1228         (aarch64_emit_mul): Likewise.
1229         (aarch64_emit_lsh): Likewise.
1230         (aarch64_emit_rsh_signed): Likewise.
1231         (aarch64_emit_rsh_unsigned): Likewise.
1232         (aarch64_emit_ext): Likewise.
1233         (aarch64_emit_log_not): Likewise.
1234         (aarch64_emit_bit_and): Likewise.
1235         (aarch64_emit_bit_or): Likewise.
1236         (aarch64_emit_bit_xor): Likewise.
1237         (aarch64_emit_bit_not): Likewise.
1238         (aarch64_emit_equal): Likewise.
1239         (aarch64_emit_less_signed): Likewise.
1240         (aarch64_emit_less_unsigned): Likewise.
1241         (aarch64_emit_ref): Likewise.
1242         (aarch64_emit_if_goto): Likewise.
1243         (aarch64_emit_goto): Likewise.
1244         (aarch64_write_goto_address): Likewise.
1245         (aarch64_emit_const): Likewise.
1246         (aarch64_emit_call): Likewise.
1247         (aarch64_emit_reg): Likewise.
1248         (aarch64_emit_pop): Likewise.
1249         (aarch64_emit_stack_flush): Likewise.
1250         (aarch64_emit_zero_ext): Likewise.
1251         (aarch64_emit_swap): Likewise.
1252         (aarch64_emit_stack_adjust): Likewise.
1253         (aarch64_emit_int_call_1): Likewise.
1254         (aarch64_emit_void_call_2): Likewise.
1255         (aarch64_emit_eq_goto): Likewise.
1256         (aarch64_emit_ne_goto): Likewise.
1257         (aarch64_emit_lt_goto): Likewise.
1258         (aarch64_emit_le_goto): Likewise.
1259         (aarch64_emit_gt_goto): Likewise.
1260         (aarch64_emit_ge_got): Likewise.
1261         (aarch64_emit_ops_impl): New static global variable.
1262         (aarch64_emit_ops): New target function, return
1263         &aarch64_emit_ops_impl.
1264         (struct linux_target_ops): Install it.
1265
1266 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1267
1268         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
1269         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
1270         aarch64-ipa.o.
1271         * linux-aarch64-ipa.c: New file.
1272         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
1273         and endian.h.
1274         (aarch64_get_thread_area): New target method.
1275         (extract_signed_bitfield): New helper function.
1276         (aarch64_decode_ldr_literal): New function.
1277         (enum aarch64_opcodes): New enum.
1278         (struct aarch64_register): New struct.
1279         (struct aarch64_operand): New struct.
1280         (x0): New static global.
1281         (x1): Likewise.
1282         (x2): Likewise.
1283         (x3): Likewise.
1284         (x4): Likewise.
1285         (w2): Likewise.
1286         (ip0): Likewise.
1287         (sp): Likewise.
1288         (xzr): Likewise.
1289         (aarch64_register): New helper function.
1290         (register_operand): Likewise.
1291         (immediate_operand): Likewise.
1292         (struct aarch64_memory_operand): New struct.
1293         (offset_memory_operand): New helper function.
1294         (preindex_memory_operand): Likewise.
1295         (enum aarch64_system_control_registers): New enum.
1296         (ENCODE): New macro.
1297         (emit_insn): New helper function.
1298         (emit_b): New function.
1299         (emit_bcond): Likewise.
1300         (emit_cb): Likewise.
1301         (emit_tb): Likewise.
1302         (emit_blr): Likewise.
1303         (emit_stp): Likewise.
1304         (emit_ldp_q_offset): Likewise.
1305         (emit_stp_q_offset): Likewise.
1306         (emit_load_store): Likewise.
1307         (emit_ldr): Likewise.
1308         (emit_ldrsw): Likewise.
1309         (emit_str): Likewise.
1310         (emit_ldaxr): Likewise.
1311         (emit_stxr): Likewise.
1312         (emit_stlr): Likewise.
1313         (emit_data_processing_reg): Likewise.
1314         (emit_data_processing): Likewise.
1315         (emit_add): Likewise.
1316         (emit_sub): Likewise.
1317         (emit_mov): Likewise.
1318         (emit_movk): Likewise.
1319         (emit_mov_addr): Likewise.
1320         (emit_mrs): Likewise.
1321         (emit_msr): Likewise.
1322         (emit_sevl): Likewise.
1323         (emit_wfe): Likewise.
1324         (append_insns): Likewise.
1325         (can_encode_int32_in): New helper function.
1326         (aarch64_relocate_instruction): New function.
1327         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
1328         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
1329         (struct linux_target_ops): Install aarch64_get_thread_area,
1330         aarch64_install_fast_tracepoint_jump_pad and
1331         aarch64_get_min_fast_tracepoint_insn_len.
1332
1333 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1334
1335         * Makefile.in (aarch64-insn.o): New rule.
1336         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
1337
1338 2015-09-21  Yao Qi  <yao.qi@linaro.org>
1339
1340         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
1341
1342 2015-09-21  Yao Qi  <yao.qi@linaro.org>
1343
1344         * tracepoint.c (max_jump_pad_size): Remove.
1345
1346 2015-09-18  Yao Qi  <yao.qi@linaro.org>
1347
1348         * linux-aarch64-low.c: Don't include sys/uio.h.
1349         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
1350
1351 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
1352
1353         * tracepoint.c (eval_result_type): Change prototype.
1354         (condition_true_at_tracepoint): Fix argument to compiled_cond.
1355
1356 2015-09-15  Pedro Alves  <palves@redhat.com>
1357
1358         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
1359         Check whether to report exec events instead of checking whether
1360         multiprocess is enabled.
1361
1362 2015-09-15  Pedro Alves  <palves@redhat.com>
1363
1364         PR remote/18965
1365         * remote-utils.c (prepare_resume_reply): Merge
1366         TARGET_WAITKIND_VFORK_DONE switch case with the
1367         TARGET_WAITKIND_FORKED case.
1368
1369 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1370
1371         * server.c (handle_query): Check string comparison using
1372         "else if" instead of "if".
1373
1374 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1375
1376         * server.c (vCont_supported): New global variable.
1377         (handle_query): Set vCont_supported to 1 if "vContSupported+"
1378         matches.  Append ";vContSupported+" to own_buf.
1379         (handle_v_requests): Append ";s;S" to own_buf if target supports
1380         hardware single step or vCont_supported is false.
1381         (capture_main): Set vCont_supported to zero.
1382
1383 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1384
1385         * linux-low.c (linux_supports_conditional_breakpoints): Rename
1386         it to ...
1387         (linux_supports_hardware_single_step): ... New function.
1388         (linux_target_ops): Update.
1389         * lynx-low.c (lynx_target_ops): Set field
1390         supports_hardware_single_step to target_can_do_hardware_single_step.
1391         * nto-low.c (nto_target_ops): Likewise.
1392         * spu-low.c (spu_target_ops): Likewise.
1393         * win32-low.c (win32_target_ops): Likewise.
1394         * target.c (target_can_do_hardware_single_step): New function.
1395         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1396         Remove.  <supports_hardware_single_step>: New field.
1397         (target_supports_conditional_breakpoints): Remove.
1398         (target_supports_hardware_single_step): New macro.
1399         (target_can_do_hardware_single_step): Declare.
1400         * server.c (handle_query): Use target_supports_hardware_single_step
1401         instead of target_supports_conditional_breakpoints.
1402
1403 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1404
1405         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
1406         function.
1407         (struct linux_target_ops the_low_target): Install
1408         aarch64_linux_siginfo_fixup.
1409
1410 2015-09-11  Don Breazeal  <donb@codesourcery.com>
1411             Luis Machado  <lgustavo@codesourcery.com>
1412
1413         * linux-low.c (linux_mourn): Static declaration.
1414         (linux_arch_setup): Move in front of
1415         handle_extended_wait.
1416         (linux_arch_setup_thread): New function.
1417         (handle_extended_wait): Handle exec events.  Call
1418         linux_arch_setup_thread.  Make event_lwp argument a
1419         pointer-to-a-pointer.
1420         (check_zombie_leaders): Do not check stopped threads.
1421         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
1422         (linux_low_filter_event): Add lwp and thread for exec'ing
1423         non-leader thread if leader thread has been deleted.
1424         Refactor code into linux_arch_setup_thread and call it.
1425         Pass child lwp pointer by reference to handle_extended_wait.
1426         (linux_wait_for_event_filtered): Update comment.
1427         (linux_wait_1): Prevent clobbering exec event status.
1428         (linux_supports_exec_events): New function.
1429         (linux_target_ops) <supports_exec_events>: Initialize new member.
1430         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
1431         new member.
1432         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
1433         * server.c (report_exec_events): New global variable.
1434         (handle_query): Handle qSupported query for exec-events feature.
1435         (captured_main): Initialize report_exec_events.
1436         * server.h (report_exec_events): Declare new global variable.
1437         * target.h (struct target_ops) <supports_exec_events>: New
1438         member.
1439         (target_supports_exec_events): New macro.
1440         * win32-low.c (win32_target_ops) <supports_exec_events>:
1441         Initialize new member.
1442
1443 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
1444
1445         * linux-low.c (linux_low_enable_btrace): Remove.
1446         (linux_target_ops): Replace linux_low_enable_btrace with
1447         linux_enable_btrace.
1448
1449 2015-09-03  Yao Qi  <yao.qi@linaro.org>
1450
1451         * linux-aarch64-low.c (aarch64_insert_point): Call
1452         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
1453         returns true.
1454
1455 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1456
1457         * linux-low.c (check_stopped_by_breakpoint): Use
1458         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
1459
1460 2015-08-27  Pedro Alves  <palves@redhat.com>
1461
1462         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
1463
1464 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
1465
1466         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
1467         the XNEW-family equivalent.
1468         (compile_bytecodes): Likewise.
1469         * dll.c (loaded_dll): Likewise.
1470         * event-loop.c (append_callback_event): Likewise.
1471         (create_file_handler): Likewise.
1472         (create_file_event): Likewise.
1473         * hostio.c (handle_open): Likewise.
1474         * inferiors.c (add_thread): Likewise.
1475         (add_process): Likewise.
1476         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
1477         * linux-arm-low.c (arm_new_process): Likewise.
1478         (arm_new_thread): Likewise.
1479         * linux-low.c (add_to_pid_list): Likewise.
1480         (linux_add_process): Likewise.
1481         (handle_extended_wait): Likewise.
1482         (add_lwp): Likewise.
1483         (enqueue_one_deferred_signal): Likewise.
1484         (enqueue_pending_signal): Likewise.
1485         (linux_resume_one_lwp_throw): Likewise.
1486         (linux_resume_one_thread): Likewise.
1487         (linux_read_memory): Likewise.
1488         (linux_write_memory): Likewise.
1489         * linux-mips-low.c (mips_linux_new_process): Likewise.
1490         (mips_linux_new_thread): Likewise.
1491         (mips_add_watchpoint): Likewise.
1492         * linux-x86-low.c (initialize_low_arch): Likewise.
1493         * lynx-low.c (lynx_add_process): Likewise.
1494         * mem-break.c (set_raw_breakpoint_at): Likewise.
1495         (set_breakpoint): Likewise.
1496         (add_condition_to_breakpoint): Likewise.
1497         (add_commands_to_breakpoint): Likewise.
1498         (clone_agent_expr): Likewise.
1499         (clone_one_breakpoint): Likewise.
1500         * regcache.c (new_register_cache): Likewise.
1501         * remote-utils.c (look_up_one_symbol): Likewise.
1502         * server.c (queue_stop_reply): Likewise.
1503         (start_inferior): Likewise.
1504         (queue_stop_reply_callback): Likewise.
1505         (handle_target_event): Likewise.
1506         * spu-low.c (fetch_ppc_memory): Likewise.
1507         (store_ppc_memory): Likewise.
1508         * target.c (set_target_ops): Likewise.
1509         * thread-db.c (thread_db_load_search): Likewise.
1510         (try_thread_db_load_1): Likewise.
1511         * tracepoint.c (add_tracepoint): Likewise.
1512         (add_tracepoint_action): Likewise.
1513         (create_trace_state_variable): Likewise.
1514         (cmd_qtdpsrc): Likewise.
1515         (cmd_qtro): Likewise.
1516         (add_while_stepping_state): Likewise.
1517         * win32-low.c (child_add_thread): Likewise.
1518         (get_image_name): Likewise.
1519
1520 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1521
1522         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1523
1524 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1525
1526         * Makefile.in (aarch64-linux.o): New rule.
1527         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1528         srv_tgtobj.
1529         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1530         (aarch64_init_debug_reg_state): Make it extern.
1531         (aarch64_linux_prepare_to_resume): Remove.
1532
1533 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1534
1535         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1536         lwp_arch_private_info and ptid_of_lwp.
1537
1538 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1539
1540         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1541         Find proc_info by find_process_pid.  All callers updated.
1542
1543 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1544
1545         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1546         Remove.
1547         (debug_reg_change_callback): Remove.
1548         (aarch64_notify_debug_reg_change): Remove.
1549
1550 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1551
1552         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1553         Call current_lwp_ptid.
1554
1555 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1556
1557         * linux-aarch64-low.c (debug_reg_change_callback): Use
1558         debug_printf.
1559
1560 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1561
1562         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1563
1564 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1565
1566         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1567
1568 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1569
1570         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1571         the code.
1572
1573 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1574
1575         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1576         Remove.
1577         (debug_reg_change_callback): Remove argument entry and add argument
1578         lwp.  Remove local variable thread.  Don't print thread id in the
1579         debugging output.  Don't check whether pid of thread equals to pid.
1580         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1581         iterate_over_lwps instead find_inferior.
1582
1583 2015-08-24  Pedro Alves  <palves@redhat.com>
1584
1585         * inferiors.c (get_first_process): New function.
1586         * inferiors.h (get_first_process): New declaration.
1587         * remote-utils.c (read_ptid): Default to the first process in the
1588         list, instead of to the current thread's process.
1589
1590 2015-08-24  Pedro Alves  <palves@redhat.com>
1591
1592         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1593         * event-loop.c: Likewise.
1594         * remote-utils.c: Likewise.
1595         * tracepoint.c: Likewise.
1596
1597 2015-08-24  Pedro Alves  <palves@redhat.com>
1598
1599         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1600         ptid_get_lwp.
1601
1602 2015-08-21  Pedro Alves  <palves@redhat.com>
1603
1604         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1605         instead of literal 1.
1606
1607 2015-08-21  Pedro Alves  <palves@redhat.com>
1608
1609         * tdesc.c (default_description): Explicitly zero-initialize.
1610
1611 2015-08-21  Pedro Alves  <palves@redhat.com>
1612
1613         PR gdb/18749
1614         * inferiors.c (remove_thread): Discard any pending stop reply for
1615         this thread.
1616         * server.c (remove_all_on_match_pid): Rename to ...
1617         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1618         instead of a pid.
1619         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1620         extern.
1621         (handle_v_kill, kill_inferior_callback, captured_main)
1622         (process_serial_event): Adjust.
1623         * server.h (discard_queued_stop_replies): Declare.
1624
1625 2015-08-21  Pedro Alves  <palves@redhat.com>
1626
1627         * linux-low.c (wait_for_sigstop): Always switch to no thread
1628         selected if the previously current thread dies.
1629         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1630         process instead of the current thread's.
1631         * remote-utils.c (input_interrupt): Don't check if there's no
1632         current thread.
1633         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1634         current thread to the general thread fails, error out.
1635         (handle_qxfer_auxv, handle_qxfer_libraries)
1636         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1637         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1638         (handle_query): Check if there's a thread selected instead of
1639         checking whether there's any thread in the thread list.
1640         (handle_qxfer_threads, handle_qxfer_btrace)
1641         (handle_qxfer_btrace_conf): Don't error out early if there's no
1642         thread in the thread list.
1643         (handle_v_cont, myresume): Don't set the current thread to the
1644         continue thread.
1645         (process_serial_event) <Hg handling>: Also set thread_id if the
1646         previous general thread is still alive.
1647         (process_serial_event) <g/G handling>: If setting the current
1648         thread to the general thread fails, error out.
1649         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1650         thread's lwp instead of the current thread's.
1651         * target.c (set_desired_thread): If the desired thread was not
1652         found, leave the current thread pointing to NULL.  Return an int
1653         (boolean) indicating success.
1654         * target.h (set_desired_thread): Change return type to int.
1655
1656 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1657
1658         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1659         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1660         #includes.
1661         (ps_get_thread_area): New function.
1662
1663 2015-08-19  Gary Benson  <gbenson@redhat.com>
1664
1665         * hostio.c (handle_pread): Do not attempt to read more data
1666         than hostio_reply_with_data can fit in a packet.
1667
1668 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1669
1670         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1671
1672 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1673
1674         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1675
1676 2015-08-06  Pedro Alves  <palves@redhat.com>
1677
1678         * tracepoint.c (expr_eval_result): Now an int.
1679
1680 2015-08-06  Pedro Alves  <palves@redhat.com>
1681
1682         * gdbthread.h (struct regcache): Forward declare.
1683         (struct thread_info) <regcache_data>: Now a struct regcache
1684         pointer.
1685         * inferiors.c (inferior_regcache_data)
1686         (set_inferior_regcache_data): Now work with struct regcache
1687         pointers.
1688         * inferiors.h (struct regcache): Forward declare.
1689         (inferior_regcache_data, set_inferior_regcache_data): Now work
1690         with struct regcache pointers.
1691         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1692         (free_register_cache_thread): Remove struct regcache pointer
1693         casts.
1694
1695 2015-08-06  Pedro Alves  <palves@redhat.com>
1696
1697         * server.c (captured_main): On error, print the exception message
1698         to stderr, and if run_once is set, throw a quit.
1699
1700 2015-08-06  Pedro Alves  <palves@redhat.com>
1701
1702         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1703         the current thread.
1704
1705 2015-08-06  Pedro Alves  <palves@redhat.com>
1706
1707         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1708         reading beyond the passed in buffer length.
1709
1710 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1711
1712         * tracepoint.c (symbol_list) <required>: Remove.
1713
1714 2015-08-06  Pedro Alves  <palves@redhat.com>
1715
1716         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1717         count if stopping and suspending threads.
1718         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1719         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1720         (linux_detach): Complete an ongoing step-over.
1721         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1722         throughout.
1723         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1724         (linux_wait_1): If passing a signal to the inferior after
1725         finishing a step-over, unsuspend and re-resume all lwps.  If we
1726         see a single-step event but the thread should be continuing, don't
1727         pass the trap to gdb.
1728         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1729         internal_error instead of gdb_assert.
1730         (enqueue_pending_signal): New function.
1731         (check_ptrace_stopped_lwp_gone): Add debug output.
1732         (start_step_over): Use internal_error instead of gdb_assert.
1733         (complete_ongoing_step_over): New function.
1734         (linux_resume_one_thread): Don't resume a suspended thread.
1735         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1736         it stepping.
1737
1738 2015-08-06  Pedro Alves  <palves@redhat.com>
1739
1740         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1741         (linux_thread_alive): Use lwp_is_marked_dead.
1742         (extended_event_reported): Delete.
1743         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1744         instead of extended_event_reported.
1745         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1746         as well.
1747         (lwp_is_marked_dead): New function.
1748         (lwp_running): Use lwp_is_marked_dead.
1749         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1750         comment.
1751
1752 2015-08-06  Pedro Alves  <palves@redhat.com>
1753
1754         * linux-low.c (linux_wait_1): Move fork event output out of the
1755         !report_to_gdb check.  Pass event_child->waitstatus to
1756         target_waitstatus_to_string instead of ourstatus.
1757
1758 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1759
1760         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1761         if current_thread is 32 bit.
1762
1763 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1764
1765         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1766         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1767         * server.c (extended_protocol): Remove "static".
1768         * server.h (extended_protocol): Declare it.
1769
1770 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1771
1772         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1773         both aarch64 and aarch32.
1774         (aarch64_set_pc): Likewise.
1775
1776 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1777
1778         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1779         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1780         arm-with-neon.xml to srv_xmlfiles.
1781         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1782         (is_64bit_tdesc): New function.
1783         (aarch64_linux_read_description): New function.
1784         (aarch64_arch_setup): Call aarch64_linux_read_description.
1785         (regs_info): Rename to regs_info_aarch64.
1786         (aarch64_regs_info): Return right regs_info.
1787         (initialize_low_arch): Call initialize_low_arch_aarch32.
1788
1789 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1790
1791         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1792         * linux-aarch32-low.c: New file.
1793         * linux-aarch32-low.h: New file.
1794         * linux-arm-low.c (arm_fill_gregset): Move it to
1795         linux-aarch32-low.c.
1796         (arm_store_gregset): Likewise.
1797         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1798         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1799         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1800         (regs_info): Rename to regs_info_arm.
1801         (arm_regs_info): Return regs_info_aarch32 if
1802         have_ptrace_getregset is 1 and target description is
1803         arm_with_neon or arm_with_vfpv3.
1804         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1805         Call initialize_low_arch_aarch32 instead.
1806
1807 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1808
1809         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1810         * linux-low.c: ... here.
1811         * linux-low.h (have_ptrace_getregset): Declare it.
1812
1813 2015-08-04  Pedro Alves  <palves@redhat.com>
1814
1815         * thread-db.c (struct thread_db): Use new typedefs.
1816         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1817         CHK calls.
1818         (disable_thread_event_reporting): Cast result of dlsym to
1819         destination function pointer type.
1820         (thread_db_mourn): Use td_ta_delete_ftype.
1821
1822 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1823
1824         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1825         arch variant.
1826         (CDX_BREAKPOINT): Define for R2.
1827         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1828         (the_low_target): Add comments.
1829
1830 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1831
1832         * linux-arm-low.c (arm_hwcap): Remove it.
1833         (arm_read_description): New local variable arm_hwcap.  Don't
1834         set arm_hwcap to zero.
1835
1836 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1837
1838         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1839         Use regcache->tdesc instead.
1840         (arm_store_wmmxregset): Likewise.
1841         (arm_fill_vfpregset): Likewise.
1842         (arm_store_vfpregset): Likewise.
1843
1844 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1845
1846         * linux-arm-low.c: Include arch/arm.h.
1847         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1848         (arm_store_gregset): Likewise.
1849
1850 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1851
1852         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1853         ptrace's 4th parameter.
1854
1855 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1856
1857         * configure.srv (case aarch64*-*-linux*): Don't set
1858         srv_linux_usrregs.
1859
1860 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1861
1862         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1863         sys/ptrace.h.
1864         * linux-arm-low.c: Likewise.
1865         * linux-cris-low.c: Likewise.
1866         * linux-crisv32-low.c: Likewise.
1867         * linux-low.c: Likewise.
1868         * linux-m68k-low.c: Likewise.
1869         * linux-mips-low.c: Likewise.
1870         * linux-nios2-low.c: Likewise.
1871         * linux-s390-low.c: Likewise.
1872         * linux-sparc-low.c: Likewise.
1873         * linux-tic6x-low.c: Likewise.
1874         * linux-tile-low.c: Likewise.
1875         * linux-x86-low.c: Likewise.
1876
1877 2015-07-24  Pedro Alves  <palves@redhat.com>
1878
1879         * config.in: Regenerate.
1880         * configure: Regenerate.
1881
1882 2015-07-24  Pedro Alves  <palves@redhat.com>
1883
1884         * acinclude.m4: Include ../ptrace.m4.
1885         * configure.ac: Call GDB_AC_PTRACE.
1886         * config.in, configure: Regenerate.
1887
1888 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1889
1890         * linux-low.c (linux_create_inferior): Remove setting to
1891         proc->priv->new_inferior.
1892         (linux_attach): Likewise.
1893         (linux_low_filter_event): Likewise.
1894         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1895
1896 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1897
1898         * linux-low.c (linux_arch_setup): New function.
1899         (linux_low_filter_event): If proc->tdesc is NULL and
1900         proc->attached is true, call the_low_target.arch_setup.
1901         Otherwise, keep status pending, and return.
1902         (linux_resume_one_lwp_throw): Don't call get_pc if
1903         thread->while_stepping isn't NULL.  Don't call
1904         get_thread_regcache if proc->tdesc is NULL.
1905         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1906         (linux_target_ops): Install arch_setup.
1907         * server.c (start_inferior): Call the_target->arch_setup.
1908         * target.h (struct target_ops) <arch_setup>: New field.
1909         (target_arch_setup): New marco.
1910         * lynx-low.c (lynx_target_ops): Update.
1911         * nto-low.c (nto_target_ops): Update.
1912         * spu-low.c (spu_target_ops): Update.
1913         * win32-low.c (win32_target_ops): Update.
1914
1915 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1916
1917         * linux-low.c (linux_add_process): Don't set
1918         proc->priv->new_inferior.
1919         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1920         (linux_attach): Likewise.
1921
1922 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1923
1924         * server.c (start_inferior): Code refactor.
1925
1926 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1927
1928         * server.c (process_serial_event): Set general_thread.
1929
1930 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1931
1932         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1933         aarch64_linux_get_debug_reg_capacity.
1934
1935 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1936
1937         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1938         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1939         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1940         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1941         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1942         (AARCH64_HWP_ALIGNMENT): Likewise.
1943         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1944         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1945         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1946         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1947         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1948         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1949         (struct aarch64_debug_reg_state): Likewise.
1950         (struct arch_lwp_info): Likewise.
1951         (aarch64_align_watchpoint): Likewise.
1952         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1953         (aarch64_watchpoint_length): Likewise.
1954         (aarch64_point_encode_ctrl_reg): Likewise
1955         (aarch64_point_is_aligned): Likewise.
1956         (aarch64_align_watchpoint): Likewise.
1957         (aarch64_linux_set_debug_regs):
1958         (aarch64_dr_state_insert_one_point): Likewise.
1959         (aarch64_dr_state_remove_one_point): Likewise.
1960         (aarch64_handle_breakpoint): Likewise.
1961         (aarch64_handle_aligned_watchpoint): Likewise.
1962         (aarch64_handle_unaligned_watchpoint): Likewise.
1963         (aarch64_handle_watchpoint): Likewise.
1964
1965 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1966
1967         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1968         and don't aarch64_get_debug_reg_state.  All callers update.
1969         (aarch64_handle_aligned_watchpoint): Likewise.
1970         (aarch64_handle_unaligned_watchpoint): Likewise.
1971         (aarch64_handle_watchpoint): Likewise.
1972         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1973         (aarch64_remove_point): Likewise.
1974
1975 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1976
1977         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1978         debug_printf.
1979         (aarch64_handle_unaligned_watchpoint): Likewise.
1980
1981 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1982
1983         Revert the previous 3 commits:
1984         Move gdb_regex* to common/
1985         Move linux_find_memory_regions_full & co.
1986         gdbserver build-id attribute generator
1987
1988 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1989             Jan Kratochvil  <jan.kratochvil@redhat.com>
1990
1991         gdbserver build-id attribute generator.
1992         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1993         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1994         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1995         (find_phdr): New.
1996         (get_dynamic): Use find_pdhr to traverse program headers.
1997         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1998         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1999         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
2000         (get_hex_build_id): New.
2001         (linux_qxfer_libraries_svr4): Add optional build-id attribute
2002         to reply XML document.
2003
2004 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
2005             Jan Kratochvil  <jan.kratochvil@redhat.com>
2006
2007         * target.c: Include target/target-utils.h and fcntl.h.
2008         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
2009         (target_fileio_read_stralloc): New functions.
2010
2011 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
2012
2013         * Makefile.in (OBS): Add gdb_regex.o.
2014         (gdb_regex.o): New.
2015         * config.in: Rebuilt.
2016         * configure: Rebuilt.
2017
2018 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
2019             Jan Kratochvil  <jan.kratochvil@redhat.com>
2020
2021         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
2022         * Makefile.in (OBS): Add target-utils.o.
2023         (linux-maps.o, target-utils.o): New.
2024         * configure.srv (srv_linux_obj): Add linux-maps.o.
2025
2026 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
2027
2028         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
2029         function, return 1.
2030         (the_low_target): Install it.
2031
2032 2015-07-14  Pedro Alves  <palves@redhat.com>
2033
2034         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
2035         Instead, ignore ECHILD, and throw an error for other errnos.
2036
2037 2015-07-10  Pedro Alves  <palves@redhat.com>
2038
2039         * event-loop.c (struct callback_event) <data>: Change type to
2040         gdb_client_data instance instead of gdb_client_data pointer.
2041         (append_callback_event): Adjust.
2042
2043 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
2044
2045         * linux-aarch64-low.c: Add comments for each linux_target_ops
2046         method.  Remove comments already covered in target_ops and
2047         linux_target_ops definitions.
2048         (the_low_target): Add comments for each unimplemented method.
2049
2050 2015-07-09  Yao Qi  <yao.qi@linaro.org>
2051
2052         * linux-aarch64-low.c (aarch64_regmap): Remove.
2053         (aarch64_usrregs_info): Remove.
2054         (regs_info): Set field usrregs to NULL.
2055
2056 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
2057
2058         * linux-low.c: Include "rsp-low.h"
2059         (linux_low_encode_pt_config, linux_low_encode_raw): New.
2060         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
2061         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
2062         (handle_btrace_enable_pt): New.
2063         (handle_btrace_general_set): Support "pt".
2064         (handle_btrace_conf_general_set): Support "pt:size".
2065
2066 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
2067
2068         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
2069         Z_PACKET_SW_BP.
2070
2071 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
2072
2073         * linux-aarch64-low.c: Remove comment about endianness.
2074         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
2075         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
2076         memcmp.
2077
2078 2015-06-24  Gary Benson  <gbenson@redhat.com>
2079
2080         * linux-i386-ipa.c (stdint.h): Do not include.
2081         * lynx-i386-low.c (stdint.h): Likewise.
2082         * lynx-ppc-low.c (stdint.h): Likewise.
2083         * mem-break.c (stdint.h): Likewise.
2084         * thread-db.c (stdint.h): Likewise.
2085         * tracepoint.c (stdint.h): Likewise.
2086         * win32-low.c (stdint.h): Likewise.
2087
2088 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
2089
2090         * server.c (write_qxfer_response): Update call to
2091         remote_escape_output.
2092
2093 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
2094             Jan Kratochvil  <jan.kratochvil@redhat.com>
2095
2096         Merge multiple hex conversions.
2097         * gdbreplay.c (tohex): Rename to 'fromhex'.
2098         (logchar): Use fromhex.
2099
2100 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
2101
2102         * server.c (handle_qxfer_libraries): Set `version' attribute for
2103         <library-list>.
2104
2105 2015-06-10  Gary Benson  <gbenson@redhat.com>
2106
2107         * target.h (struct target_ops) <multifs_open>: New field.
2108         <multifs_unlink>: Likewise.
2109         <multifs_readlink>: Likewise.
2110         * linux-low.c (nat/linux-namespaces.h): New include.
2111         (linux_target_ops): Initialize the_target->multifs_open,
2112         the_target->multifs_unlink and the_target->multifs_readlink.
2113         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
2114         * hostio.c (hostio_fs_pid): New static variable.
2115         (hostio_handle_new_gdb_connection): New function.
2116         (handle_setfs): Likewise.
2117         (handle_open): Use the_target->multifs_open as appropriate.
2118         (handle_unlink): Use the_target->multifs_unlink as appropriate.
2119         (handle_readlink): Use the_target->multifs_readlink as
2120         appropriate.
2121         (handle_vFile): Handle vFile:setfs packets.
2122         * server.c (handle_query): Call hostio_handle_new_gdb_connection
2123         after target_handle_new_gdb_connection.
2124
2125 2015-06-10  Gary Benson  <gbenson@redhat.com>
2126
2127         * configure.ac (AC_CHECK_FUNCS): Add setns.
2128         * config.in: Regenerate.
2129         * configure: Likewise.
2130         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
2131         (linux-namespaces.o): New rule.
2132         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
2133
2134 2015-06-09  Gary Benson <gbenson@redhat.com>
2135
2136         * hostio.c (handle_open): Process mode argument with
2137         fileio_to_host_mode.
2138
2139 2015-06-01  Yao Qi  <yao.qi@linaro.org>
2140
2141         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
2142         * linux-x86-low.c: Likewise.
2143
2144 2015-05-28  Don Breazeal  <donb@codesourcery.com>
2145
2146         * linux-low.c (handle_extended_wait): Initialize
2147         thread_info.last_resume_kind for new fork children.
2148
2149 2015-05-15  Pedro Alves  <palves@redhat.com>
2150
2151         * target.h (target_handle_new_gdb_connection): Rewrite using if
2152         wrapped in do/while.
2153
2154 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
2155
2156         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
2157         * configure, config.in: Regenerate.
2158         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
2159         Declare typedef.
2160
2161 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2162
2163         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
2164         PTRACE_EVENT_VFORK_DONE.
2165         (linux_low_ptrace_options, extended_event_reported): Add vfork
2166         events.
2167         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
2168         and "vforkdone" for RSP 'T' Stop Reply Packet.
2169         * server.h (report_vfork_events): Declare
2170         global variable.
2171
2172 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2173
2174         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
2175         (the_low_target) <new_fork>: Initialize new member.
2176         * linux-arm-low.c (arm_new_fork): New function.
2177         (the_low_target) <new_fork>: Initialize new member.
2178         * linux-low.c (handle_extended_wait): Call new target function
2179         new_fork.
2180         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
2181         * linux-mips-low.c (mips_add_watchpoint): New function
2182         extracted from mips_insert_point.
2183         (the_low_target) <new_fork>: Initialize new member.
2184         (mips_linux_new_fork): New function.
2185         (mips_insert_point): Call mips_add_watchpoint.
2186         * linux-x86-low.c (x86_linux_new_fork): New function.
2187         (the_low_target) <new_fork>: Initialize new member.
2188
2189 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2190
2191         * linux-low.c (handle_extended_wait): Implement return value,
2192         rename argument 'event_child' to 'event_lwp', handle
2193         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
2194         (linux_low_ptrace_options): New function.
2195         (linux_low_filter_event): Call linux_low_ptrace_options,
2196         use different argument fo linux_enable_event_reporting,
2197         use return value from handle_extended_wait.
2198         (extended_event_reported): New function.
2199         (linux_wait_1): Call extended_event_reported and set
2200         status to report fork events.
2201         (linux_write_memory): Add pid to debug message.
2202         (reset_lwp_ptrace_options_callback): New function.
2203         (linux_handle_new_gdb_connection): New function.
2204         (linux_target_ops): Initialize new structure member.
2205         * linux-low.h (struct lwp_info) <waitstatus>: New member.
2206         * lynx-low.c: Initialize new structure member.
2207         * remote-utils.c (prepare_resume_reply): Implement stop reason
2208         "fork" for "T" stop message.
2209         * server.c (handle_query): Call handle_new_gdb_connection.
2210         * server.h (report_fork_events): Declare global flag.
2211         * target.h (struct target_ops) <handle_new_gdb_connection>:
2212         New member.
2213         (target_handle_new_gdb_connection): New macro.
2214         * win32-low.c: Initialize new structure member.
2215
2216 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2217
2218         * mem-break.c (APPEND_TO_LIST): Define macro.
2219         (clone_agent_expr): New function.
2220         (clone_one_breakpoint): New function.
2221         (clone_all_breakpoints): New function.
2222         * mem-break.h: Declare new functions.
2223
2224 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2225
2226         * linux-low.c (linux_supports_fork_events): New function.
2227         (linux_supports_vfork_events): New function.
2228         (linux_target_ops): Initialize new structure members.
2229         (initialize_low): Call linux_check_ptrace_features.
2230         * lynx-low.c (lynx_target_ops): Initialize new structure
2231         members.
2232         * server.c (report_fork_events, report_vfork_events):
2233         New global flags.
2234         (handle_query): Add new features to qSupported packet and
2235         response.
2236         (captured_main): Initialize new global variables.
2237         * target.h (struct target_ops) <supports_fork_events>:
2238         New member.
2239         <supports_vfork_events>: New member.
2240         (target_supports_fork_events): New macro.
2241         (target_supports_vfork_events): New macro.
2242         * win32-low.c (win32_target_ops): Initialize new structure
2243         members.
2244
2245 2015-05-12  Gary Benson <gbenson@redhat.com>
2246
2247         * server.c (handle_qxfer_exec_file): Use current process
2248         if annex is empty.
2249
2250 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
2251
2252         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
2253         Remove HAVE_PTRACE_GETREGS conditionals.
2254         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
2255         instead of PTRACE_GETREGS and PTRACE_SETREGS.
2256
2257 2015-05-08  Yao Qi  <yao.qi@linaro.org>
2258
2259         * linux-low.c (linux_supports_conditional_breakpoints): New
2260         function.
2261         (linux_target_ops): Install new target method.
2262         * lynx-low.c (lynx_target_ops): Install NULL hook for
2263         supports_conditional_breakpoints.
2264         * nto-low.c (nto_target_ops): Likewise.
2265         * spu-low.c (spu_target_ops): Likewise.
2266         * win32-low.c (win32_target_ops): Likewise.
2267         * server.c (handle_query): Check
2268         target_supports_conditional_breakpoints.
2269         * target.h (struct target_ops) <supports_conditional_breakpoints>:
2270         New field.
2271         (target_supports_conditional_breakpoints): New macro.
2272
2273 2015-05-06  Pedro Alves  <palves@redhat.com>
2274
2275         PR server/18081
2276         * server.c (start_inferior): If the process exits, mourn it.
2277
2278 2015-04-21  Gary Benson <gbenson@redhat.com>
2279
2280         * hostio.c (fileio_open_flags_to_host): Factored out to
2281         fileio_to_host_openflags in common/fileio.c.  Single use
2282         updated.
2283
2284 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
2285
2286         * linux-xtensa-low.c (xtensa_fill_gregset)
2287         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
2288         XCHAL_HAVE_LOOP.
2289
2290 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
2291
2292         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
2293         (regs_info): Replace usrregs pointer with NULL.
2294
2295 2015-04-17  Gary Benson  <gbenson@redhat.com>
2296
2297         * target.h (struct target_ops) <pid_to_exec_file>: New field.
2298         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
2299         * server.c (handle_qxfer_exec_file): New function.
2300         (qxfer_packets): Add exec-file entry.
2301         (handle_query): Report qXfer:exec-file:read as supported packet.
2302
2303 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
2304
2305         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
2306
2307 2015-04-09  Gary Benson <gbenson@redhat.com>
2308
2309         * hostio-errno.c (errno_to_fileio_error): Remove function.
2310         Update caller to use remote_fileio_to_fio_error.
2311
2312 2015-04-09  Yao Qi  <yao.qi@linaro.org>
2313
2314         * linux-low.c (linux_insert_point): Call
2315         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
2316         (linux_remove_point): Call remove_memory_breakpoint if type is
2317         raw_bkpt_type_sw.
2318         * linux-x86-low.c (x86_insert_point): Don't call
2319         insert_memory_breakpoint.
2320         (x86_remove_point): Don't call remove_memory_breakpoint.
2321
2322 2015-04-01  Pedro Alves  <palves@redhat.com>
2323             Cleber Rosa  <crosa@redhat.com>
2324
2325         * server.c (gdbserver_usage): Reorganize and extend the usage
2326         message.
2327
2328 2015-03-24  Pedro Alves  <palves@redhat.com>
2329
2330         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
2331         output.  Also dump TRAP_TRACE.
2332         (linux_low_filter_event): In debug output, distinguish a
2333         resume_stop SIGSTOP from a delayed SIGSTOP.
2334
2335 2015-03-24  Gary Benson  <gbenson@redhat.com>
2336
2337         * linux-x86-low.c (x86_linux_new_thread): Moved to
2338         nat/x86-linux.c.
2339         (x86_linux_prepare_to_resume): Likewise.
2340
2341 2015-03-24  Gary Benson  <gbenson@redhat.com>
2342
2343         * Makefile.in (x86-linux-dregs.o): New rule.
2344         * configure.srv: Add x86-linux-dregs.o to relevant targets.
2345         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
2346         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
2347         (x86_linux_dr_get): Likewise.
2348         (x86_linux_dr_set): Likewise.
2349         (update_debug_registers_callback): Likewise.
2350         (x86_linux_dr_set_addr): Likewise.
2351         (x86_linux_dr_get_addr): Likewise.
2352         (x86_linux_dr_set_control): Likewise.
2353         (x86_linux_dr_get_control): Likewise.
2354         (x86_linux_dr_get_status): Likewise.
2355         (x86_linux_update_debug_registers): Likewise.
2356
2357 2015-03-24  Gary Benson  <gbenson@redhat.com>
2358
2359         * linux-x86-low.c (x86_linux_update_debug_registers):
2360         New function, factored out from...
2361         (x86_linux_prepare_to_resume): ...this.
2362
2363 2015-03-24  Gary Benson  <gbenson@redhat.com>
2364
2365         * linux-x86-low.c (x86_linux_dr_get): Update comments.
2366         (x86_linux_dr_set): Likewise.
2367         (update_debug_registers_callback): Likewise.
2368         (x86_linux_dr_set_addr): Likewise.
2369         (x86_linux_dr_get_addr): Likewise.
2370         (x86_linux_dr_set_control): Likewise.
2371         (x86_linux_dr_get_control): Likewise.
2372         (x86_linux_dr_get_status): Likewise.
2373         (x86_linux_prepare_to_resume): Likewise.
2374
2375 2015-03-24  Gary Benson  <gbenson@redhat.com>
2376
2377         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
2378         Use perror_with_name.  Pass string through gettext.
2379         (x86_linux_dr_set): Likewise.
2380
2381 2015-03-24  Gary Benson  <gbenson@redhat.com>
2382
2383         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
2384         (x86_linux_dr_set_addr): ...this.
2385         (x86_dr_low_get_addr): Rename to...
2386         (x86_linux_dr_get_addr): ...this.
2387         (x86_dr_low_set_control): Rename to...
2388         (x86_linux_dr_set_control): ...this.
2389         (x86_dr_low_get_control): Rename to...
2390         (x86_linux_dr_get_control): ...this.
2391         (x86_dr_low_get_status): Rename to...
2392         (x86_linux_dr_get_status): ...this.
2393         (x86_dr_low): Update with new function names.
2394
2395 2015-03-24  Gary Benson  <gbenson@redhat.com>
2396
2397         * Makefile.in (x86-linux.o): New rule.
2398         * configure.srv: Add x86-linux.o to relevant targets.
2399         * linux-low.c (lwp_set_arch_private_info): New function.
2400         (lwp_arch_private_info): Likewise.
2401         * linux-x86-low.c: Include nat/x86-linux.h.
2402         (arch_lwp_info): Removed structure.
2403         (update_debug_registers_callback):
2404         Use lwp_set_debug_registers_changed.
2405         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
2406         and lwp_set_debug_registers_changed.
2407         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2408
2409 2015-03-24  Gary Benson  <gbenson@redhat.com>
2410
2411         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
2412         * linux-arm-low.c (arm_new_thread): Likewise.
2413         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
2414         * linux-mips-low.c (mips_linux_new_thread): Likewise.
2415         * linux-x86-low.c (x86_linux_new_thread): Likewise.
2416         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
2417
2418 2015-03-24  Gary Benson  <gbenson@redhat.com>
2419
2420         * linux-low.c (ptid_of_lwp): New function.
2421         (lwp_is_stopped): Likewise.
2422         (lwp_stop_reason): Likewise.
2423         * linux-x86-low.c (update_debug_registers_callback):
2424         Use lwp_is_stopped.
2425         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
2426         lwp_stop_reason.
2427
2428 2015-03-24  Gary Benson  <gbenson@redhat.com>
2429
2430         * linux-low.h (linux_stop_lwp): Remove declaration.
2431
2432 2015-03-24  Gary Benson  <gbenson@redhat.com>
2433
2434         * linux-low.h: Include nat/linux-nat.h.
2435         * linux-low.c (iterate_over_lwps_args): New structure.
2436         (iterate_over_lwps_filter): New function.
2437         (iterate_over_lwps): Likewise.
2438         * linux-x86-low.c (update_debug_registers_callback):
2439         Update signature to what iterate_over_lwps expects.
2440         Remove PID check that iterate_over_lwps now performs.
2441         (x86_dr_low_set_addr): Use iterate_over_lwps.
2442         (x86_dr_low_set_control): Likewise.
2443
2444 2015-03-24  Gary Benson  <gbenson@redhat.com>
2445
2446         * linux-x86-low.c (x86_debug_reg_state): New function.
2447         (x86_linux_prepare_to_resume): Use the above.
2448
2449 2015-03-24  Gary Benson  <gbenson@redhat.com>
2450
2451         * linux-low.c (current_lwp_ptid): New function.
2452         * linux-x86-low.c: Include nat/linux-nat.h.
2453         (x86_dr_low_get_addr): Use current_lwp_ptid.
2454         (x86_dr_low_get_control): Likewise.
2455         (x86_dr_low_get_status): Likewise.
2456
2457 2015-03-20  Pedro Alves  <palves@redhat.com>
2458
2459         * tracepoint.c (cmd_qtstatus): Make "str" const.
2460
2461 2015-03-20  Pedro Alves  <palves@redhat.com>
2462
2463         * server.c (handle_general_set): Make "req_str" const.
2464
2465 2015-03-19  Pedro Alves  <palves@redhat.com>
2466
2467         * linux-low.c (linux_resume_one_lwp): Rename to ...
2468         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
2469         instead call perror_with_name.
2470         (check_ptrace_stopped_lwp_gone): New function.
2471         (linux_resume_one_lwp): Reimplement as wrapper around
2472         linux_resume_one_lwp_throw that swallows errors if the LWP is
2473         gone.
2474
2475 2015-03-19  Pedro Alves  <palves@redhat.com>
2476
2477         * linux-low.c (count_events_callback, select_event_lwp_callback):
2478         No longer check whether the thread has resume_stop as last resume
2479         kind.
2480
2481 2015-03-19 Pedro Alves  <palves@redhat.com>
2482
2483         * linux-low.c (count_events_callback, select_event_lwp_callback):
2484         Use the lwp's status_pending_p field, not the thread's.
2485
2486 2015-03-19  Pedro Alves  <palves@redhat.com>
2487
2488         * linux-low.c (select_event_lwp_callback): Update comments to
2489         no longer mention SIGTRAP.
2490
2491 2015-03-18  Gary Benson  <gbenson@redhat.com>
2492
2493         * server.c (handle_query): Do not report vFile:fstat as supported.
2494
2495 2015-03-11  Gary Benson  <gbenson@redhat.com>
2496
2497         * hostio.c (sys/types.h): New include.
2498         (sys/stat.h): Likewise.
2499         (common-remote-fileio.h): Likewise.
2500         (handle_fstat): New function.
2501         (handle_vFile): Handle vFile:fstat packets.
2502
2503 2015-03-11  Gary Benson  <gbenson@redhat.com>
2504
2505         * configure.ac (AC_CHECK_MEMBERS): Add checks for
2506         struct stat.st_blocks and struct stat.st_blksize.
2507         * configure: Regenerate.
2508         * config.in: Likewise.
2509         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
2510         (OBS): Add common-remote-fileio.o.
2511         (common-remote-fileio.o): New rule.
2512
2513 2015-03-09  Pedro Alves  <palves@redhat.com>
2514
2515         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2516         'struct sockaddr' pointer in 'accept' call.
2517
2518 2015-03-09  Pedro Alves  <palves@redhat.com>
2519
2520         Revert:
2521         2015-03-07  Pedro Alves  <palves@redhat.com>
2522         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2523         or <winsock2.h> here.  Instead include "gdb_socket.h".
2524         (remote_open): Use union gdb_sockaddr_u.
2525         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2526         or <winsock2.h> here.  Instead include "gdb_socket.h".
2527         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2528         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2529         or <sys/un.h>.
2530         (init_named_socket, gdb_agent_helper_thread): Use union
2531         gdb_sockaddr_u.
2532
2533 2015-03-07  Pedro Alves  <palves@redhat.com>
2534
2535         * configure.ac (build_warnings): Move
2536         -Wdeclaration-after-statement to the C-specific set.
2537         * configure: Regenerate.
2538
2539 2015-03-07  Pedro Alves  <palves@redhat.com>
2540
2541         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2542         or <winsock2.h> here.  Instead include "gdb_socket.h".
2543         (remote_open): Use union gdb_sockaddr_u.
2544         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2545         or <winsock2.h> here.  Instead include "gdb_socket.h".
2546         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2547         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2548         or <sys/un.h>.
2549         (init_named_socket, gdb_agent_helper_thread): Use union
2550         gdb_sockaddr_u.
2551
2552 2015-03-07  Pedro Alves  <palves@redhat.com>
2553
2554         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2555         instead.
2556
2557 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2558
2559         * linux-aarch64-low.c (aarch64_insert_point): Use
2560         show_debug_regs as a boolean.
2561         (aarch64_remove_point): Likewise.
2562
2563 2015-03-05  Pedro Alves  <palves@redhat.com>
2564
2565         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2566         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2567         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2568         * nto-low.c (nto_target_ops): Likewise.
2569         * spu-low.c (spu_target_ops): Likewise.
2570         * win32-low.c (win32_target_ops): Likewise.
2571
2572 2015-03-04  Pedro Alves  <palves@redhat.com>
2573
2574         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2575         Decide whether a breakpoint triggered based on the SIGTRAP's
2576         siginfo.si_code.
2577         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2578         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2579         (linux_low_filter_event): Check for breakpoints before checking
2580         watchpoints.
2581         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2582         siginfo.si_code.
2583         (linux_stopped_by_sw_breakpoint)
2584         (linux_supports_stopped_by_sw_breakpoint)
2585         (linux_stopped_by_hw_breakpoint)
2586         (linux_supports_stopped_by_hw_breakpoint): New functions.
2587         (linux_target_ops): Install new target methods.
2588
2589 2015-03-04  Pedro Alves  <palves@redhat.com>
2590
2591         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2592         * server.c (swbreak_feature, hwbreak_feature): New globals.
2593         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2594         (captured_main): Clear swbreak_feature and hwbreak_feature.
2595         * server.h (swbreak_feature, hwbreak_feature): Declare.
2596         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2597         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2598         supports_stopped_by_hw_breakpoint>: New fields.
2599         (target_supports_stopped_by_sw_breakpoint)
2600         (target_stopped_by_sw_breakpoint)
2601         (target_supports_stopped_by_hw_breakpoint)
2602         (target_stopped_by_hw_breakpoint): Declare.
2603
2604 2015-03-04  Pedro Alves  <palves@redhat.com>
2605
2606         enum lwp_stop_reason -> enum target_stop_reason
2607         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2608         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2609         (linux_wait_1, stuck_in_jump_pad_callback)
2610         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2611         (linux_stopped_by_watchpoint):
2612         * linux-low.h (enum lwp_stop_reason): Delete.
2613         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2614         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2615
2616 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2617
2618         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2619
2620 2015-03-03  Gary Benson  <gbenson@redhat.com>
2621
2622         * hostio.c (handle_vFile): Fix prefix lengths.
2623
2624 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2625
2626         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2627         ptr_bits.
2628
2629 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2630
2631         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2632         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2633         (clean): Add "rm -f" for above C files.
2634         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2635         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2636         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2637         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2638         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2639         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2640         (init_registers_s390x_vx_linux64)
2641         (init_registers_s390x_tevx_linux64)
2642         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2643         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2644         declarations.
2645         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2646         (s390_store_vxrs_high): New functions.
2647         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2648         NT_S390_VXRS_HIGH.
2649         (s390_arch_setup): Add logic for selecting one of the new target
2650         descriptions.  Activate the new vector regsets if applicable.
2651         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2652         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2653         and init_registers_s390x_tevx_linux64.
2654
2655 2015-03-01  Pedro Alves  <palves@redhat.com>
2656
2657         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2658         parameter.
2659
2660 2015-02-27  Pedro Alves  <palves@redhat.com>
2661
2662         * linux-x86-low.c (u_debugreg_offset): New function.
2663         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2664
2665 2015-02-27  Pedro Alves  <palves@redhat.com>
2666
2667         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2668         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2669         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2670         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2671         (ps_lsetfpregs, ps_getpid)
2672         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2673         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2674         (ps_lsetxregs, ps_plog): Declare.
2675
2676 2015-02-27  Pedro Alves  <palves@redhat.com>
2677
2678         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2679         IP_AGENT_EXPORT_FUNC.
2680         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2681         IP_AGENT_EXPORT_FUNC.
2682         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2683         (IP_AGENT_EXPORT): Delete.
2684         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2685         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2686         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2687         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2688         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2689         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2690         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2691         (traceframe_read_count, traceframe_write_count)
2692         (traceframes_created, trace_state_variables, get_raw_reg)
2693         (get_trace_state_variable_value, set_trace_state_variable_value)
2694         (ust_loaded, helper_thread_id, cmd_buf): Use
2695         IPA_SYM_EXPORTED_NAME.
2696         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2697         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2698         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2699         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2700         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2701         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2702         EXTERN_C_PUSH/EXTERN_C_POP.
2703         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2704         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2705         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2706         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2707         (traceframe_write_count, traceframe_read_count)
2708         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2709         (about_to_request_buffer_space, get_trace_state_variable_value)
2710         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2711         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2712         EXTERN_C_PUSH/EXTERN_C_POP.
2713         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2714         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2715         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2716         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2717         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2718         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2719         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2720         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2721         Define.
2722         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2723         (IP_AGENT_EXPORT_VAR_DECL): Define.
2724         (tracing): Declare.
2725         (gdb_agent_get_raw_reg): Declare.
2726
2727 2015-02-27  Tom Tromey  <tromey@redhat.com>
2728             Pedro Alves  <palves@redhat.com>
2729
2730         Rename symbols whose names are reserved C++ keywords throughout.
2731
2732 2015-02-27  Pedro Alves  <palves@redhat.com>
2733
2734         * Makefile.in (COMPILER): New, get it from autoconf.
2735         (CXX): Get from autoconf instead.
2736         (COMPILE.pre): Use COMPILER.
2737         (CC-LD): Rename to ...
2738         (CC_LD): ... this.  Use COMPILER.
2739         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2740         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2741         * acinclude.m4: Include build-with-cxx.m4.
2742         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2743         Disable -Werror by default if building in C++ mode.
2744         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2745         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2746         the C++ compiler.  Save/restore CXXFLAGS too.
2747         * configure: Regenerate.
2748
2749 2015-02-27  Pedro Alves  <palves@redhat.com>
2750
2751         * acinclude.m4: Include libiberty.m4.
2752         * configure.ac: Call libiberty_INIT.
2753         * config.in, configure: Regenerate.
2754
2755 2015-02-26  Pedro Alves  <palves@redhat.com>
2756
2757         * linux-low.c (linux_wait_1): When incrementing the PC past a
2758         program breakpoint always use the_low_target.breakpoint_len as
2759         increment, rather than the maximum between that and
2760         the_low_target.decr_pc_after_break.
2761
2762 2015-02-23  Pedro Alves  <palves@redhat.com>
2763
2764         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2765         thread was doing a step-over; always adjust the PC if
2766         we stepped over a permanent breakpoint.
2767         (linux_wait_1): If we stepped over breakpoint that was on top of a
2768         permanent breakpoint, manually advance the PC past it.
2769
2770 2015-02-23  Pedro Alves  <palves@redhat.com>
2771
2772         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2773         modes.
2774         (x86_fill_gregset, x86_store_gregset): Use it when handling
2775         $orig_eax.
2776
2777 2015-02-20  Pedro Alves  <palves@redhat.com>
2778
2779         * thread-db.c: Include "nat/linux-procfs.h".
2780         (thread_db_init): Skip listing new threads if the kernel supports
2781         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2782
2783 2015-02-20  Pedro Alves  <palves@redhat.com>
2784
2785         * linux-low.c (status_pending_p_callback): Use ptid_match.
2786
2787 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2788
2789         PR breakpoints/16812
2790         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2791         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2792         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2793
2794 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2795
2796         PR breakpoints/15956
2797         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2798
2799 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2800
2801         * linux-low.c (linux_low_btrace_conf): Print size.
2802         * server.c (handle_btrace_conf_general_set): New.
2803         (hanle_general_set): Call handle_btrace_conf_general_set.
2804         (handle_query): Report Qbtrace-conf:bts:size as supported.
2805
2806 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2807
2808         * linux-low.c (linux_low_enable_btrace): Update parameters.
2809         (linux_low_btrace_conf): New.
2810         (linux_target_ops)<to_btrace_conf>: Initialize.
2811         * server.c (current_btrace_conf): New.
2812         (handle_btrace_enable): Rename to ...
2813         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2814         to target_enable_btrace.  Update comment.  Update users.
2815         (handle_qxfer_btrace_conf): New.
2816         (qxfer_packets): Add btrace-conf entry.
2817         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2818         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2819         (target_ops)<read_btrace_conf>: New.
2820         (target_enable_btrace): Update parameters.
2821         (target_read_btrace_conf): New.
2822
2823 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2824
2825         * server.c (handle_btrace_general_set): Remove call to
2826         target_supports_btrace.
2827         (supported_btrace_packets): New.
2828         (handle_query): Call supported_btrace_packets.
2829         * target.h: include btrace-common.h.
2830         (btrace_target_info): Removed.
2831         (supports_btrace, target_supports_btrace): Update parameters.
2832
2833 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2834
2835         * Makefile.in (SFILES): Add common/btrace-common.c.
2836         (OBS): Add common/btrace-common.o.
2837         (btrace-common.o): Add build rules.
2838         * linux-low: Include btrace-common.h.
2839         (linux_low_read_btrace): Use struct btrace_data.  Call
2840         btrace_data_init and btrace_data_fini.
2841
2842 2015-02-06  Pedro Alves  <palves@redhat.com>
2843
2844         * thread-db.c (find_new_threads_callback): Add debug output.
2845
2846 2015-02-04  Pedro Alves  <palves@redhat.com>
2847
2848         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2849         (resume_stopped_resumed_lwps): New function.
2850         (linux_wait_for_event_filtered): Use it.
2851
2852 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2853
2854         * Makefile.in (SFILES): Add linux-personality.c.
2855         (linux-personality.o): New rule.
2856         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2857         list of objects to be built.
2858         * linux-low.c: Include nat/linux-personality.h.
2859         (linux_create_inferior): Remove code to disable address space
2860         randomization (moved to ../nat/linux-personality.c).  Create
2861         cleanup to disable address space randomization.
2862
2863 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2864
2865         * Makefile.in (posix-strerror.o): New rule.
2866         (mingw-strerror.o): Likewise.
2867         * configure: Regenerated.
2868         * configure.ac: Source file ../common/common.host.  Initialize new
2869         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2870
2871 2015-01-14  Yao Qi  <yao@codesourcery.com>
2872
2873         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2874         (ppc-linux.o): New rule.
2875         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2876         * configure.ac: AC_CHECK_FUNCS(getauxval).
2877         * config.in: Re-generated.
2878         * configure: Re-generated.
2879         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2880         ppc64_64bit_inferior_p
2881
2882 2015-01-14  Yao Qi  <yao@codesourcery.com>
2883
2884         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2885          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2886         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2887         (PT_ORIG_R3, PT_TRAP): Likewise.
2888         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2889         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2890         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2891
2892 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2893
2894         * i387-fp.c (i387_cache_to_xsave): In look over
2895         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2896         zmmh_low_space field by use of zmmh_high_space.
2897
2898 2015-01-09  Pedro Alves  <palves@redhat.com>
2899
2900         * linux-low.c (step_over_bkpt): Move higher up in the file.
2901         (handle_extended_wait): Don't store the stop_pc here.
2902         (get_stop_pc): Adjust comments and rename to ...
2903         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2904         stopped for a software breakpoint or hardware breakpoint.
2905         (thread_still_has_status_pending_p): New function.
2906         (status_pending_p_callback): Use
2907         thread_still_has_status_pending_p.  If the event is no longer
2908         interesting, resume the LWP.
2909         (handle_tracepoints): Add assert.
2910         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2911         (wstatus_maybe_breakpoint): New function.
2912         (cancel_breakpoint): Delete function.
2913         (check_stopped_by_watchpoint): New function, factored out from
2914         linux_low_filter_event.
2915         (lp_status_maybe_breakpoint): Delete function.
2916         (linux_low_filter_event): Remove filter_ptid argument.
2917         Leave thread group exits pending here.  Store the LWP's stop PC.
2918         Always leave events pending.
2919         (linux_wait_for_event_filtered): Pull all events out of the
2920         kernel, and leave them all pending.
2921         (count_events_callback, select_event_lwp_callback): Consider all
2922         events.
2923         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2924         (select_event_lwp): Only give preference to the stepping LWP in
2925         all-stop mode.  Adjust comments.
2926         (ignore_event): New function.
2927         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2928         references to cancel_breakpoints.  Adjust to renames.  Also give
2929         equal priority to all LWPs that have had events in non-stop mode.
2930         If reporting a software breakpoint event, unadjust the LWP's PC.
2931         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2932         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2933         Adjust.
2934         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2935         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2936         (linux_stopped_by_watchpoint): Adjust.
2937         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2938         * linux-low.h (enum lwp_stop_reason): New.
2939         (struct lwp_info) <stop_pc>: Adjust comment.
2940         <stopped_by_watchpoint>: Delete field.
2941         <stop_reason>: New field.
2942         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2943         * mem-break.c (software_breakpoint_inserted_here)
2944         (hardware_breakpoint_inserted_here): New function.
2945         * mem-break.h (software_breakpoint_inserted_here)
2946         (hardware_breakpoint_inserted_here): Declare.
2947         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2948         (cancel_breakpoints): Delete.
2949         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2950         (upload_fast_traceframes): Remove references to
2951         cancel_breakpoints.
2952
2953 2015-01-09  Pedro Alves  <palves@redhat.com>
2954
2955         * thread-db.c (find_new_threads_callback): Ignore thread if the
2956         kernel thread ID is -1.
2957
2958 2015-01-09  Pedro Alves  <palves@redhat.com>
2959
2960         * linux-low.c (linux_attach_fail_reason_string): Move to
2961         nat/linux-ptrace.c, and rename.
2962         (linux_attach_lwp): Update comment.
2963         (attach_proc_task_lwp_callback): New function.
2964         (linux_attach): Adjust to rename and use
2965         linux_proc_attach_tgid_threads.
2966         (linux_attach_fail_reason_string): Delete declaration.
2967
2968 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2969
2970         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2971         * server.c (gdbserver_version): Likewise.
2972
2973 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2974
2975         * remote-utils.c: Include ctype.h.
2976         (input_interrupt): Explicitly handle the case when the char
2977         received is the NUL byte.  Improve the printing of non-ASCII
2978         characters.
2979
2980 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2981
2982         * linux-low.c (linux_low_filter_event): Update call to
2983         linux_enable_event_reporting following the addition of
2984         a new parameter to that function.
2985
2986 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2987
2988         PR server/17457
2989         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2990         (AARCH64_FPCR_REGNO): Likewise.
2991         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2992         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2993         (aarch64_store_fpregset): Likewise.
2994
2995 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2996
2997         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2998         Remove FIXME comment about assumption about N.
2999
3000 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
3001
3002         * configure.ac: If large-file support is disabled in GDBserver,
3003         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
3004         * configure: Regenerate.
3005
3006 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3007
3008         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
3009         warning upon ENODATA from ptrace.
3010         * linux-s390-low.c (s390_store_tdb): New.
3011         (s390_regsets): Add regset for NT_S390_TDB.
3012
3013 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3014
3015         * linux-low.c (regsets_store_inferior_registers): Skip regsets
3016         without a fill_function.
3017         * linux-s390-low.c (s390_fill_last_break): Remove.
3018         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
3019         (s390_arch_setup): Use regset's size instead of fill_function for
3020         loop end condition.
3021
3022 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3023
3024         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
3025         the regset's store function when ptrace returned an error.
3026         * regcache.c (get_thread_regcache): Invalidate register cache
3027         before fetching inferior's registers.
3028
3029 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3030
3031         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
3032         while-loop as for-loop.
3033         (regsets_store_inferior_registers): Likewise.
3034
3035 2014-11-28  Yao Qi  <yao@codesourcery.com>
3036
3037         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
3038         * config.in, configure: Re-generate.
3039         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
3040         is defined.
3041
3042 2014-11-21  Yao Qi  <yao@codesourcery.com>
3043
3044         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
3045         (AC_CHECK_HEADERS): Remove malloc.h.
3046         * configure: Re-generated.
3047         * config.in: Re-generated.
3048         * server.h: Don't include alloca.h and malloc.h.
3049         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
3050         Don't include malloc.h.
3051
3052 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
3053
3054         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
3055         corresponding ERRNO check in same block.
3056
3057 2014-11-12  Pedro Alves  <palves@redhat.com>
3058
3059         * server.c (cont_thread): Update comment.
3060         (start_inferior, attach_inferior): No longer clear cont_thread.
3061         (handle_v_cont): No longer set cont_thread.
3062         (captured_main): Clear cont_thread each time a GDB connects.
3063
3064 2014-11-12  Pedro Alves  <palves@redhat.com>
3065
3066         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
3067         thread, and don't resume all threads if the Hc thread has exited.
3068
3069 2014-11-12  Pedro Alves  <palves@redhat.com>
3070
3071         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
3072         the process group instead of to a specific LWP.
3073
3074 2014-10-15  Pedro Alves  <palves@redhat.com>
3075
3076         PR server/17487
3077         * win32-arm-low.c (arm_set_thread_context): Remove current_event
3078         parameter.
3079         (arm_set_thread_context): Delete.
3080         (the_low_target): Adjust.
3081         * win32-i386-low.c (debug_registers_changed)
3082         (debug_registers_used): Delete.
3083         (update_debug_registers_callback): New function.
3084         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
3085         needing to update their debug registers.
3086         (win32_get_current_dr): New function.
3087         (x86_dr_low_get_addr, x86_dr_low_get_control)
3088         (x86_dr_low_get_status): Fetch the debug register from the thread
3089         record's context.
3090         (i386_initial_stuff): Adjust.
3091         (i386_get_thread_context): Remove current_event parameter.  Don't
3092         clear debug_registers_changed nor copy DR values to
3093         debug_reg_state.
3094         (i386_set_thread_context): Delete.
3095         (i386_prepare_to_resume): New function.
3096         (i386_thread_added): Mark the thread as needing to update irs
3097         debug registers.
3098         (the_low_target): Remove i386_set_thread_context and install
3099         i386_prepare_to_resume.
3100         * win32-low.c (win32_get_thread_context): Adjust.
3101         (win32_set_thread_context): Use SetThreadContext
3102         directly.
3103         (win32_prepare_to_resume): New function.
3104         (win32_require_context): New function, factored out from ...
3105         (thread_rec): ... this.
3106         (continue_one_thread): Call win32_prepare_to_resume on each thread
3107         we're about to continue.
3108         (win32_resume): Call win32_prepare_to_resume on the event thread.
3109         * win32-low.h (struct win32_thread_info)
3110         <debug_registers_changed>: New field.
3111         (struct win32_target_ops): Change prototype of set_thread_context,
3112         delete set_thread_context and add prepare_to_resume.
3113         (win32_require_context): New declaration.
3114
3115 2014-10-08  Gary Benson  <gbenson@redhat.com>
3116
3117         * server.h: Do not include common-exceptions.h.
3118
3119 2014-10-08  Gary Benson  <gbenson@redhat.com>
3120
3121         * server.h: Do not include cleanups.h.
3122
3123 2014-09-30  James Hogan  <james.hogan@imgtec.com>
3124
3125         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
3126         mips64-dsp-linux.c.
3127
3128 2014-09-23  Yao Qi  <yao@codesourcery.com>
3129
3130         * linux-low.c (lp_status_maybe_breakpoint): New function.
3131         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
3132         (count_events_callback): Likewise.
3133         (select_event_lwp_callback): Likewise.
3134         (cancel_breakpoints_callback): Likewise.
3135
3136 2014-09-19  Don Breazeal  <donb@codesourcery.com>
3137
3138         * linux-low.c (handle_extended_wait): Call
3139         linux_ptrace_get_extended_event.
3140         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
3141         linux_is_extended_waitstatus.
3142
3143 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
3144
3145         * Makefile.in (CPPFLAGS): Define.
3146         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
3147         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
3148
3149 2014-09-16  Gary Benson  <gbenson@redhat.com>
3150
3151         * inferiors.h (current_inferior): Renamed as...
3152         (current_thread): New variable.  All uses updated.
3153         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
3154         (maybe_move_out_of_jump_pad): Likewise.
3155         (cancel_breakpoint): Likewise.
3156         (linux_low_filter_event): Likewise.
3157         (wait_for_sigstop): Likewise.
3158         (linux_resume_one_lwp): Likewise.
3159         (need_step_over_p): Likewise.
3160         (start_step_over): Likewise.
3161         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
3162         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
3163         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
3164         and save_inferior as saved_thread.
3165         * regcache.c (get_thread_regcache): Renamed saved_inferior as
3166         saved_thread.
3167         (regcache_invalidate_thread): Likewise.
3168         * remote-utils.c (prepare_resume_reply): Likewise.
3169         * thread-db.c (thread_db_get_tls_address): Likewise.
3170         (disable_thread_event_reporting): Likewise.
3171         (remove_thread_event_breakpoints): Likewise.
3172         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
3173         as saved_thread.
3174         * target.h (set_desired_inferior): Renamed as...
3175         (set_desired_thread): New declaration.  All uses updated.
3176         * server.c (myresume): Updated comment to reference thread instead
3177         of inferior.
3178         (handle_serial_event): Likewise.
3179         (handle_target_event): Likewise.
3180
3181 2014-09-12  Tom Tromey  <tromey@redhat.com>
3182             Gary Benson  <gbenson@redhat.com>
3183
3184         * regcache.h: Include common-regcache.h.
3185         (regcache_read_pc): Don't declare.
3186         * regcache.c (get_thread_regcache_for_ptid): New function.
3187
3188 2014-09-11  Tom Tromey  <tromey@redhat.com>
3189             Gary Benson  <gbenson@redhat.com>
3190
3191         * symbol.c: New file.
3192         * Makefile.in (SFILES): Add symbol.c.
3193         (OBS): Add symbol.o.
3194
3195 2014-09-11  Gary Benson  <gbenson@redhat.com>
3196
3197         * target.c (target_stop_ptid, target_continue_ptid): New
3198         functions.
3199
3200 2014-09-11  Tom Tromey  <tromey@redhat.com>
3201             Gary Benson  <gbenson@redhat.com>
3202
3203         * target.h: Include target/target.h.
3204         * target.c (target_read_memory, target_read_uint32)
3205         (target_write_memory): New functions.
3206
3207 2014-09-11  Gary Benson  <gbenson@redhat.com>
3208
3209         * server.h (debug_hw_points): Don't declare.
3210         * server.c (debug_hw_points): Don't define.  Replace all uses
3211         with show_debug_regs.
3212         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
3213         all uses with show_debug_regs.
3214
3215 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
3216
3217         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
3218         endianness into account.
3219         (ppc_supply_ptrace_register): Likewise.
3220
3221 2014-09-03  James Hogan  <james.hogan@imgtec.com>
3222
3223         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
3224         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
3225
3226 2014-09-03  Gary Benson  <gbenson@redhat.com>
3227
3228         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
3229         ALL_DEBUG_ADDRESS_REGISTERS.
3230
3231 2014-09-02  Gary Benson  <gbenson@redhat.com>
3232
3233         * i386-low.h: Renamed as...
3234         * x86-low.h: New file.  All type, function and variable name
3235         prefixes changed from "i386_" to "x86_".  All references updated.
3236         * i386-low.c: Renamed as...
3237         * x86-low.c: New file.  All type, function and variable name
3238         prefixes changed from "i386_" to "x86_".  All references updated.
3239
3240 2014-09-02  Gary Benson  <gbenson@redhat.com>
3241
3242         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
3243         (x86_linux_new_thread): Likewise.
3244
3245 2014-08-29  Gary Benson  <gbenson@redhat.com>
3246
3247         * server.h (setjmp.h): Do not include.
3248         (toplevel): Do not declare.
3249         (common-exceptions.h): Include.
3250         (cleanups.h): Likewise.
3251         * server.c (toplevel): Do not define.
3252         (exit_code): New static global.
3253         (detach_or_kill_for_exit_cleanup): New function.
3254         (main): New function.  Original main renamed to...
3255         (captured_main): New function.
3256         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
3257
3258 2014-08-29  Gary Benson  <gbenson@redhat.com>
3259
3260         * Makefile.in (SFILES): Add common/common-exceptions.c.
3261         (OBS): Add common-exceptions.o.
3262         (common-exceptions.o): New rule.
3263         * utils.c (prepare_to_throw_exception): New function.
3264
3265 2014-08-29  Gary Benson  <gbenson@redhat.com>
3266
3267         * config.in: Regenerate.
3268         * configure: Likewise.
3269
3270 2014-08-29  Gary Benson  <gbenson@redhat.com>
3271
3272         * Makefile.in (SFILES): Add common/cleanups.c.
3273         (OBS): cleanups.o.
3274         (cleanups.o): New rule.
3275
3276 2014-08-29  Gary Benson  <gbenson@redhat.com>
3277
3278         * utils.c (internal_vwarning): New function.
3279
3280 2014-08-28  Gary Benson  <gbenson@redhat.com>
3281
3282         * utils.h (fatal): Remove declaration.
3283         * utils.c (fatal): Remove function.
3284
3285 2014-08-28  Gary Benson  <gbenson@redhat.com>
3286
3287         * tracepoint.c (gdb_agent_init): Replace fatal with
3288         perror_with_name.
3289         (initialize_tracepoint): Likewise.
3290
3291 2014-08-28  Gary Benson  <gbenson@redhat.com>
3292
3293         * remote-utils.c (remote_prepare): Replace fatal with error.
3294
3295 2014-08-28  Gary Benson  <gbenson@redhat.com>
3296
3297         * linux-low.c (linux_async): Replace fatal with warning.
3298         Tidy up and return.
3299         (linux_start_non_stop): Return -1 if linux_async failed.
3300
3301 2014-08-28  Gary Benson  <gbenson@redhat.com>
3302
3303         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
3304         gdb_assert.
3305         (i386_dr_low_get_addr): Remove vague comment.
3306         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
3307         gdb_assert.
3308
3309 2014-08-28  Gary Benson  <gbenson@redhat.com>
3310
3311         * inferiors.c (get_thread_process): Replace check with gdb_assert.
3312         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
3313         internal_error.
3314         (linux_resume_one_lwp): Likewise.
3315         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
3316         gdb_assert.
3317         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
3318         with internal_error.
3319         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
3320         (init_register_cache): Replace fatal with gdb_assert_not_reached.
3321         (find_register_by_name): Replace fatal with internal_error.
3322         (find_regno): Likewise.
3323         * tdesc.c (init_target_desc): Replace check with gdb_assert.
3324         * thread-db.c (thread_db_create_event): Likewise.
3325         (thread_db_load_search): Likewise.
3326         (try_thread_db_load_1): Likewise.
3327         * tracepoint.c (get_jump_space_head): Replace fatal with
3328         internal_error.
3329         (claim_trampoline_space): Likewise.
3330         (have_fast_tracepoint_trampoline_buffer): Likewise.
3331         (cmd_qtstart): Likewise.
3332         (stop_tracing): Likewise.
3333         (fast_tracepoint_collecting): Likewise.
3334         (target_malloc): Likewise.
3335         (download_tracepoint): Likewise.
3336         (download_trace_state_variables): Replace check with gdb_assert.
3337         (upload_fast_traceframes): Replace fatal with internal_error.
3338
3339 2014-08-19  Tom Tromey  <tromey@redhat.com>
3340             Gary Benson  <gbenson@redhat.com>
3341
3342         * Makefile.in (SFILES): Add common/common-debug.c.
3343         (OBS): Add common-debug.o.
3344         (common-debug.o): New rule.
3345         * debug.h (debug_printf): Don't declare.
3346         * debug.c (debug_printf): Renamed and rewritten as...
3347         (debug_vprintf): New function.
3348
3349 2014-08-19  Gary Benson  <gbenson@redhat.com>
3350
3351         * utils.h: Do not include print-utils.h.
3352
3353 2014-08-19  Tom Tromey  <tromey@redhat.com>
3354             Gary Benson  <gbenson@redhat.com>
3355
3356         * server.h: Add static assertion.
3357         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
3358
3359 2014-08-19  Tom Tromey  <tromey@redhat.com>
3360             Gary Benson  <gbenson@redhat.com>
3361
3362         * Makefile.in (SFILES): Add common/errors.c.
3363         (OBS): Add errors.o.
3364         (IPA_OBS): Add errors-ipa.o.
3365         (errors.o): New rule.
3366         (errors-ipa.o): Likewise.
3367         * utils.h (perror_with_name, error, warning): Don't declare.
3368         * utils.c (warning): Renamed and rewritten as...
3369         (vwarning): New function.
3370         (error): Renamed and rewritten as...
3371         (verror): New function.
3372         (internal_error): Renamed and rewritten as...
3373         (internal_verror): New function.
3374
3375 2014-08-07  Gary Benson  <gbenson@redhat.com>
3376
3377         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
3378         * configure: Regenerate.
3379         * config.in: Likewise.
3380         * server.h: Do not include errno.h.
3381         * event-loop.c: Likewise.
3382         * hostio-errno.c: Likewise.
3383         * linux-low.c: Likewise.
3384         * remote-utils.c: Likewise.
3385         * spu-low.c: Likewise.
3386         * utils.c: Likewise.
3387         * gdbreplay.c: Unconditionally include errno.h.
3388
3389 2014-08-07  Gary Benson  <gbenson@redhat.com>
3390
3391         * server.h: Do not include string.h.
3392         * event-loop.c: Likewise.
3393         * linux-low.c: Likewise.
3394         * regcache.c: Likewise.
3395         * remote-utils.c: Likewise.
3396         * spu-low.c: Likewise.
3397         * utils.c: Likewise.
3398
3399 2014-08-07  Gary Benson  <gbenson@redhat.com>
3400
3401         * server.h: Do not include gdb_assert.h.
3402
3403 2014-08-07  Gary Benson  <gbenson@redhat.com>
3404
3405         * server.h: Do not include common-utils.h.
3406
3407 2014-08-07  Gary Benson  <gbenson@redhat.com>
3408
3409         * server.h: Do not include ptid.h.
3410         * notif.h: Likewise.
3411
3412 2014-08-07  Gary Benson  <gbenson@redhat.com>
3413
3414         * server.h: Do not include gdb_locale.h.
3415
3416 2014-08-07  Gary Benson  <gbenson@redhat.com>
3417
3418         * server.h: Do not include gdb/signals.h.
3419         * win32-low.c: Likewise.
3420
3421 2014-08-07  Gary Benson  <gbenson@redhat.com>
3422
3423         * server.h: Do not include pathmax.h.
3424
3425 2014-08-07  Gary Benson  <gbenson@redhat.com>
3426
3427         * server.h: Do not include libiberty.h.
3428         * linux-bfin-low.c: Likewise.
3429
3430 2014-08-07  Gary Benson  <gbenson@redhat.com>
3431
3432         * server.h: Do not include ansidecl.h.
3433
3434 2014-08-07  Gary Benson  <gbenson@redhat.com>
3435
3436         * linux-x86-low.c: Do not include stddef.h.
3437         * lynx-ppc-low.c: Likewise.
3438         * tracepoint.c: Likewise.
3439
3440 2014-08-07  Gary Benson  <gbenson@redhat.com>
3441
3442         * server.h: Do not include stdarg.h.
3443         * nto-low.c: Likewise.
3444
3445 2014-08-07  Gary Benson  <gbenson@redhat.com>
3446
3447         * server.h: Do not include stdlib.h.
3448         * inferiors.c: Likewise.
3449         * linux-low.c: Likewise.
3450         * regcache.c: Likewise.
3451         * spu-low.c: Likewise.
3452         * tracepoint.c: Likewise.
3453         * utils.c: Likewise.
3454
3455 2014-08-07  Gary Benson  <gbenson@redhat.com>
3456
3457         * server.h: Do not include stdio.h.
3458         * linux-low.c: Likewise.
3459         * remote-utils.c: Likewise.
3460         * spu-low.c: Likewise.
3461         * utils.c: Likewise.
3462         * wincecompat.c: Likewise.
3463
3464 2014-08-06  Gary Benson  <gbenson@redhat.com>
3465
3466         * regcache.c (init_register_cache): Move conditionals inside if.
3467
3468 2014-08-06  Gary Benson  <gbenson@redhat.com>
3469
3470         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
3471
3472 2014-07-31  Gary Benson  <gbenson@redhat.com>
3473
3474         * ax.h: Do not include server.h.
3475         * gdbthread.h: Likewise.
3476         * lynx-low.h: Likewise.
3477         * notif.h: Likewise.
3478
3479 2014-07-30  Gary Benson  <gbenson@redhat.com>
3480
3481         * server.h: Include common-defs.h.
3482         Do not include config.h or build-gnulib-gdbserver/config.h.
3483
3484 2014-07-30  Gary Benson  <gbenson@redhat.com>
3485
3486         * hostio-errno.c: Move server.h to top of includes list.
3487         * inferiors.c: Likewise.
3488         * linux-x86-low.c: Likewise.
3489         * notif.c: Include server.h.
3490
3491 2014-07-24  Tom Tromey  <tromey@redhat.com>
3492             Gary Benson  <gbenson@redhat.com>
3493
3494         * server.h (CORE_ADDR): Now unsigned.
3495
3496 2014-07-16  Pedro Alves  <palves@redhat.com>
3497
3498         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
3499
3500 2014-07-15  Pedro Alves  <palves@redhat.com>
3501
3502         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
3503         copy.
3504
3505 2014-07-11  Pedro Alves  <palves@redhat.com>
3506
3507         * linux-low.c (kill_wait_lwp): New function, based on
3508         kill_one_lwp_callback, but use my_waitpid directly.
3509         (kill_one_lwp_callback, linux_kill): Use it.
3510
3511 2014-06-23  Pedro Alves  <palves@redhat.com>
3512
3513         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
3514         before setting DR0..DR3.
3515
3516 2014-06-20  Gary Benson  <gbenson@redhat.com>
3517
3518         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3519         * configure: Regenerated.
3520         * config.in: Likewise.
3521
3522 2014-06-20  Gary Benson  <gbenson@redhat.com>
3523
3524         * Makefile.in (SFILES): Update locations for files moved
3525         from common to nat.
3526         (object file files): Reordered.
3527
3528 2014-06-20  Gary Benson  <gbenson@redhat.com>
3529
3530         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3531         (i386_dr_low_set_addr): Likewise.
3532         (i386_dr_low_get_addr): Likewise.
3533         (i386_dr_low_can_set_control): Likewise.
3534         (i386_dr_low_set_control): Likewise.
3535         (i386_dr_low_get_control): Likewise.
3536         (i386_dr_low_get_status): Likewise.
3537         (i386_get_debug_register_length): Likewise.
3538         * linux-x86-low.c (i386_dr_low_set_addr):
3539         Changed signature.  Made static.
3540         (i386_dr_low_get_addr): Likewise.
3541         (i386_dr_low_set_control): Likewise.
3542         (i386_dr_low_get_control): Likewise.
3543         (i386_dr_low_get_status): Likewise.
3544         (i386_dr_low): New global variable.
3545         * win32-i386-low.c (i386_dr_low_set_addr):
3546         Changed signature.  Made static.
3547         (i386_dr_low_get_addr): Likewise.
3548         (i386_dr_low_set_control): Likewise.
3549         (i386_dr_low_get_control): Likewise.
3550         (i386_dr_low_get_status): Likewise.
3551         (i386_dr_low): New global variable.
3552
3553 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3554
3555         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3556         * Makefile.in (AR, AR_FLAGS): Define.
3557         * configure: Regenerate.
3558
3559 2014-06-19  Gary Benson  <gbenson@redhat.com>
3560
3561         * Makefile.in (i386-dregs.o): New rule.
3562         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3563         * i386-low.c (target.h): Remove include.
3564         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3565         (DR_CONTROL_SHIFT): Likewise.
3566         (DR_CONTROL_SIZE): Likewise.
3567         (DR_RW_EXECUTE): Likewise.
3568         (DR_RW_WRITE): Likewise.
3569         (DR_RW_READ): Likewise.
3570         (DR_RW_IORW): Likewise.
3571         (DR_LEN_1): Likewise.
3572         (DR_LEN_2): Likewise.
3573         (DR_LEN_4): Likewise.
3574         (DR_LEN_8): Likewise.
3575         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3576         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3577         (DR_ENABLE_SIZE): Likewise.
3578         (DR_LOCAL_SLOWDOWN): Likewise.
3579         (DR_GLOBAL_SLOWDOWN): Likewise.
3580         (DR_CONTROL_RESERVED): Likewise.
3581         (I386_DR_CONTROL_MASK): Likewise.
3582         (I386_DR_VACANT): Likewise.
3583         (I386_DR_LOCAL_ENABLE): Likewise.
3584         (I386_DR_GLOBAL_ENABLE): Likewise.
3585         (I386_DR_DISABLE): Likewise.
3586         (I386_DR_SET_RW_LEN): Likewise.
3587         (I386_DR_GET_RW_LEN): Likewise.
3588         (I386_DR_WATCH_HIT): Likewise.
3589         (i386_wp_op_t): Likewise.
3590         (i386_show_dr): Likewise.
3591         (i386_length_and_rw_bits): Likewise.
3592         (i386_insert_aligned_watchpoint): Likewise.
3593         (i386_remove_aligned_watchpoint): Likewise.
3594         (i386_handle_nonaligned_watchpoint): Likewise.
3595         i386_update_inferior_debug_regs(): Likewise.
3596         (i386_dr_insert_watchpoint): Likewise.
3597         (i386_dr_remove_watchpoint): Likewise.
3598         (i386_dr_region_ok_for_watchpoint): Likewise.
3599         (i386_dr_stopped_data_address): Likewise.
3600         (i386_dr_stopped_by_watchpoint): Likewise.
3601
3602 2014-06-19  Gary Benson  <gbenson@redhat.com>
3603
3604         * i386-low.c (i386_dr_show): Renamed to
3605         i386_show_dr and made static.  All uses updated.
3606         (i386_dr_length_and_rw_bits): Renamed to
3607         i386_length_and_rw_bits and made static.
3608         All uses updated.
3609         (i386_dr_insert_aligned_watchpoint): Renamed to
3610         i386_insert_aligned_watchpoint and made static.
3611         All uses updated.
3612         (i386_dr_remove_aligned_watchpoint): Renamed to
3613         i386_remove_aligned_watchpoint and made static.
3614         All uses updated.
3615         (i386_dr_update_inferior_debug_regs): Renamed to
3616         i386_update_inferior_debug_regs and made static.
3617         All uses updated.
3618
3619 2014-06-18  Gary Benson  <gbenson@redhat.com>
3620
3621         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3622         (i386_dr_low_can_set_control): Likewise.
3623         (i386_get_debug_register_length): Likewise.
3624         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3625         (i386_dr_low_can_set_control): Likewise.
3626         (i386_get_debug_register_length): Likewise.
3627
3628 2014-06-17  Gary Benson  <gbenson@redhat.com>
3629
3630         * i386-low.h (i386-dregs.h): New include.
3631         (DR_FIRSTADDR): Now in i386-dregs.h.
3632         (DR_LASTADDR): Likewise.
3633         (DR_NADDR): Likewise.
3634         (DR_STATUS): Likewise.
3635         (DR_CONTROL): Likewise.
3636         (i386_debug_reg_state): Likewise.
3637         (i386_dr_insert_watchpoint): Likewise.
3638         (i386_dr_remove_watchpoint): Likewise.
3639         (i386_dr_region_ok_for_watchpoint): Likewise.
3640         (i386_dr_stopped_data_address): Likewise.
3641         (i386_dr_stopped_by_watchpoint): Likewise.
3642         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3643
3644 2014-06-18  Gary Benson  <gbenson@redhat.com>
3645
3646         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3647         i386_dr_insert_watchpoint.
3648         (i386_low_remove_watchpoint): Renamed to
3649         i386_dr_remove_watchpoint.
3650         (i386_low_region_ok_for_watchpoint): Renamed to
3651         i386_dr_region_ok_for_watchpoint.
3652         (i386_low_stopped_data_address): Renamed to
3653         i386_dr_stopped_data_address.
3654         (i386_low_stopped_by_watchpoint): Renamed to
3655         i386_dr_stopped_by_watchpoint.
3656         * i386-low.c (i386_show_dr): Renamed to
3657         i386_dr_show and made nonstatic.  All uses updated.
3658         (i386_length_and_rw_bits): Renamed to
3659         i386_dr_length_and_rw_bits and made nonstatic.
3660         All uses updated.
3661         (i386_insert_aligned_watchpoint): Renamed to
3662         i386_dr_insert_aligned_watchpoint and made nonstatic.
3663         All uses updated.
3664         (i386_remove_aligned_watchpoint): Renamed to
3665         i386_dr_remove_aligned_watchpoint and made nonstatic.
3666         All uses updated.
3667         (i386_update_inferior_debug_regs): Renamed to
3668         i386_dr_update_inferior_debug_regs and made nonstatic.
3669         All uses updated.
3670         (i386_low_insert_watchpoint): Renamed to
3671         i386_dr_insert_watchpoint.  All uses updated.
3672         (i386_low_remove_watchpoint): Renamed to
3673         i386_dr_remove_watchpoint.  All uses updated.
3674         (i386_low_region_ok_for_watchpoint): Renamed to
3675         i386_dr_region_ok_for_watchpoint.  All uses updated.
3676         (i386_low_stopped_data_address): Renamed to
3677         i386_dr_stopped_data_address.  All uses updated.
3678         (i386_low_stopped_by_watchpoint): Renamed to
3679         i386_dr_stopped_by_watchpoint.  All uses updated.
3680
3681 2014-06-18  Gary Benson  <gbenson@redhat.com>
3682
3683         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3684         (i386_dr_low_can_set_control): Likewise.
3685         (i386_insert_aligned_watchpoint): New check.
3686
3687 2014-06-18  Gary Benson  <gbenson@redhat.com>
3688
3689         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3690         Renamed to state.
3691
3692 2014-06-18  Gary Benson  <gbenson@redhat.com>
3693
3694         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3695         instead of fatal and error.
3696         (i386_handle_nonaligned_watchpoint): Likewise.
3697
3698 2014-06-18  Gary Benson  <gbenson@redhat.com>
3699
3700         * i386-low.c (i386_get_debug_register_length): New macro.
3701         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3702         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3703         phex to format values.
3704
3705 2014-06-18  Gary Benson  <gbenson@redhat.com>
3706
3707         * i386-low.h: Comment changes.
3708         * i386-low.c: Likewise.
3709
3710 2014-06-18  Gary Benson  <gbenson@redhat.com>
3711
3712         * i386-low.c: Whitespace changes.
3713
3714 2014-06-12  Tom Tromey  <tromey@redhat.com>
3715
3716         * utils.c (freeargv): Remove.
3717
3718 2014-06-12  Tom Tromey  <tromey@redhat.com>
3719
3720         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3721         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3722         (parse_debug_format_options): Likewise.
3723         (gdbserver_usage): Likewise.
3724         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3725         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3726         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3727         against libiberty.
3728         ($(LIBGNU)): Depend on libiberty.
3729         (all-lib): Recurse into all subdirs.
3730         (install-only): Invoke "install" target in subdirs.
3731         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3732         targets.
3733         * configure: Rebuild.
3734         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3735         for vasprintf, vsnprintf, or gettimeofday.
3736         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3737         srv_tgtobj.
3738
3739 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3740
3741         * development.sh: Delete.
3742         * Makefile.in (config.status): Adjust dependency on development.sh.
3743         * configure.ac: Adjust development.sh source call.
3744         * configure: Regenerate.
3745
3746 2014-06-02  Pedro Alves  <palves@redhat.com>
3747
3748         * ax.c (gdb_free_agent_expr): New function.
3749         * ax.h (gdb_free_agent_expr): New declaration.
3750         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3751         list.
3752         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3753         static.
3754         (clear_breakpoint_conditions_and_commands): New function.
3755         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3756         (clear_breakpoint_conditions_and_commands): New declaration.
3757
3758 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3759
3760         * linux-aarch64-low.c (asm/ptrace.h): Include.
3761
3762 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3763
3764         Fix TLS access for -static -pthread.
3765         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3766         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3767         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3768
3769 2014-05-20  Pedro Alves  <palves@redhat.com>
3770
3771         * linux-aarch64-low.c (aarch64_insert_point)
3772         (aarch64_remove_point): No longer check whether the type is
3773         supported here.  Adjust to new interface.
3774         (the_low_target): Install aarch64_supports_z_point_type as
3775         supports_z_point_type method.
3776         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3777         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3778         instead of a Z packet char.  Adjust.
3779         (arm_supports_z_point_type): New function.
3780         (arm_insert_point, arm_remove_point): Adjust to new interface.
3781         (the_low_target): Install arm_supports_z_point_type.
3782         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3783         (cris_insert_point, cris_remove_point): Adjust to new interface.
3784         Don't check whether the type is supported here.
3785         (the_low_target): Install cris_supports_z_point_type.
3786         * linux-low.c (linux_supports_z_point_type): New function.
3787         (linux_insert_point, linux_remove_point): Adjust to new interface.
3788         * linux-low.h (struct linux_target_ops) <insert_point,
3789         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3790         raw_breakpoint pointer parameter.
3791         <supports_z_point_type>: New method.
3792         * linux-mips-low.c (mips_supports_z_point_type): New function.
3793         (mips_insert_point, mips_remove_point): Adjust to new interface.
3794         Use mips_supports_z_point_type.
3795         (the_low_target): Install mips_supports_z_point_type.
3796         * linux-ppc-low.c (the_low_target): Install NULL as
3797         supports_z_point_type method.
3798         * linux-s390-low.c (the_low_target): Install NULL as
3799         supports_z_point_type method.
3800         * linux-sparc-low.c (the_low_target): Install NULL as
3801         supports_z_point_type method.
3802         * linux-x86-low.c (x86_supports_z_point_type): New function.
3803         (x86_insert_point): Adjust to new insert_point interface.  Use
3804         insert_memory_breakpoint.  Adjust to new
3805         i386_low_insert_watchpoint interface.
3806         (x86_remove_point): Adjust to remove_point interface.  Use
3807         remove_memory_breakpoint.  Adjust to new
3808         i386_low_remove_watchpoint interface.
3809         (the_low_target): Install x86_supports_z_point_type.
3810         * lynx-low.c (lynx_target_ops): Install NULL as
3811         supports_z_point_type callback.
3812         * nto-low.c (nto_supports_z_point_type): New.
3813         (nto_insert_point, nto_remove_point): Adjust to new interface.
3814         (nto_target_ops): Install nto_supports_z_point_type.
3815         * mem-break.c: Adjust intro comment.
3816         (struct raw_breakpoint) <raw_type, size>: New fields.
3817         <inserted>: Update comment.
3818         <shlib_disabled>: Delete field.
3819         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3820         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3821         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3822         (raw_bkpt_type_to_target_hw_bp_type): New function.
3823         (find_enabled_raw_code_breakpoint_at): New function.
3824         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3825         (insert_memory_breakpoint): New function, based off
3826         set_raw_breakpoint_at.
3827         (remove_memory_breakpoint): New function.
3828         (set_raw_breakpoint_at): Reimplement.
3829         (set_breakpoint): New, based on set_breakpoint_at.
3830         (set_breakpoint_at): Reimplement.
3831         (delete_raw_breakpoint): Go through the_target->remove_point
3832         instead of assuming memory breakpoints.
3833         (find_gdb_breakpoint_at): Delete.
3834         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3835         (find_gdb_breakpoint): New function.
3836         (set_gdb_breakpoint_at): Delete.
3837         (z_type_supported): New function.
3838         (set_gdb_breakpoint_1): New function, loosely based off
3839         set_gdb_breakpoint_at.
3840         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3841         (delete_gdb_breakpoint_at): Delete.
3842         (delete_gdb_breakpoint_1): New function, loosely based off
3843         delete_gdb_breakpoint_at.
3844         (delete_gdb_breakpoint): New function.
3845         (clear_gdb_breakpoint_conditions): Rename to ...
3846         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3847         breakpoint.
3848         (add_condition_to_breakpoint): Make static.
3849         (add_breakpoint_condition): Take a struct breakpoint pointer
3850         instead of an address.  Adjust.
3851         (gdb_condition_true_at_breakpoint): Rename to ...
3852         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3853         z_type parameter.
3854         (gdb_condition_true_at_breakpoint): Reimplement.
3855         (add_breakpoint_commands): Take a struct breakpoint pointer
3856         instead of an address.  Adjust.
3857         (gdb_no_commands_at_breakpoint): Rename to ...
3858         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3859         parameter.  Return true if no breakpoint was found.  Change debug
3860         output.
3861         (gdb_no_commands_at_breakpoint): Reimplement.
3862         (run_breakpoint_commands): Rename to ...
3863         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3864         and change return type to boolean.
3865         (run_breakpoint_commands): New function.
3866         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3867         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3868         breakpoint.  Go through the_target->remove_point instead of
3869         assuming memory breakpoint.
3870         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3871         software and hardware breakpoints.
3872         (reinsert_raw_breakpoint): Go through the_target->insert_point
3873         instead of assuming memory breakpoint.
3874         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3875         software and hardware breakpoints.
3876         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3877         Check both software and hardware breakpoints.
3878         (validate_inserted_breakpoint): Assert the breakpoint is a
3879         software breakpoint.  Set the inserted flag to -1 instead of
3880         setting shlib_disabled.
3881         (delete_disabled_breakpoints): Adjust.
3882         (validate_breakpoints): Only validate software breakpoints.
3883         Adjust to inserted flag change.
3884         (check_mem_read, check_mem_write): Skip breakpoint types other
3885         than software breakpoints.  Adjust to inserted flag change.
3886         * mem-break.h (enum raw_bkpt_type): New enum.
3887         (raw_breakpoint, struct process_info): Forward declare.
3888         (Z_packet_to_target_hw_bp_type): Delete declaration.
3889         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3890         (set_gdb_breakpoint, delete_gdb_breakpoint)
3891         (clear_breakpoint_conditions): New declarations.
3892         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3893         (breakpoint_inserted_here): Update comment.
3894         (add_breakpoint_condition, add_breakpoint_commands): Replace
3895         address parameter with a breakpoint pointer parameter.
3896         (gdb_breakpoint_here): Update comment.
3897         (delete_gdb_breakpoint_at): Delete.
3898         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3899         * server.c (process_point_options): Take a struct breakpoint
3900         pointer instead of an address.  Adjust.
3901         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3902         delete_gdb_breakpoint.
3903         * spu-low.c (spu_target_ops): Install NULL as
3904         supports_z_point_type method.
3905         * target.h: Include mem-break.h.
3906         (struct target_ops) <prepare_to_access_memory>: Update comment.
3907         <supports_z_point_type>: New field.
3908         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3909         instead of a char.  Also take a raw breakpoint pointer.
3910         * win32-arm-low.c (the_low_target): Install NULL as
3911         supports_z_point_type.
3912         * win32-i386-low.c (i386_supports_z_point_type): New function.
3913         (i386_insert_point, i386_remove_point): Adjust to new interface.
3914         (the_low_target): Install i386_supports_z_point_type.
3915         * win32-low.c (win32_supports_z_point_type): New function.
3916         (win32_insert_point, win32_remove_point): Adjust to new interface.
3917         (win32_target_ops): Install win32_supports_z_point_type.
3918         * win32-low.h (struct win32_target_ops):
3919         <supports_z_point_type>: New method.
3920         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3921         instead of a char.  Also take a raw breakpoint pointer.
3922
3923 2014-05-20  Pedro Alves  <palves@redhat.com>
3924
3925         * mem-break.h: Include break-common.h.
3926         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3927         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3928         (Z_packet_to_target_hw_bp_type): New declaration.
3929         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3930         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3931         (Z_PACKET_ACCESS_WP): Delete macros.
3932         (Z_packet_to_hw_type): Delete function.
3933         * i386-low.h: Don't include break-common.h here.
3934         (Z_packet_to_hw_type): Delete declaration.
3935         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3936         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3937         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3938         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3939         * linux-aarch64-low.c: Don't include break-common.h here.
3940         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3941         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3942         (Z_packet_to_target_hw_bp_type): Delete function.
3943         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3944         function.
3945         (mips_insert_point, mips_remove_point): Use
3946         Z_packet_to_target_hw_bp_type.
3947
3948 2014-05-20  Pedro Alves  <palves@redhat.com>
3949
3950         * linux-aarch64-low.c: Include break-common.h.
3951         (enum target_point_type): Delete.
3952         (Z_packet_to_point_type): Rename to ...
3953         (Z_packet_to_target_hw_bp_type): ... this, and return a
3954         target_hw_bp_type instead.
3955         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3956         instead of an enum target_point_type.
3957         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3958         breakpoint type.
3959         (aarch64_dr_state_insert_one_point)
3960         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3961         (aarch64_handle_aligned_watchpoint)
3962         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3963         Take an enum target_hw_bp_type instead of an enum
3964         target_point_type.
3965         (aarch64_supports_z_point_type): New function.
3966         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3967         use Z_packet_to_target_hw_bp_type.
3968
3969 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3970
3971         * configure.ac: Only use -Werror by default when DEVELOPMENT
3972         is true.
3973         * configure: Regenerate.
3974
3975 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3976
3977         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3978         * linux-x86-low.c (X86_64_USER_REGS): New.
3979         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3980
3981 2014-04-28  Yao Qi  <yao@codesourcery.com>
3982
3983         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3984         name.
3985
3986 2014-04-25  Pedro Alves  <palves@redhat.com>
3987
3988         PR server/16255
3989         * linux-low.c (linux_attach_fail_reason_string): New function.
3990         (linux_attach_lwp): Delete.
3991         (linux_attach_lwp_1): Rename to ...
3992         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3993         argument.  Remove "initial" parameter.  Return int instead of
3994         void.  Don't error or warn here.
3995         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3996         failure to attach to the tgid.  Call warning when failing to
3997         attach to an lwp.
3998         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3999         argument.  Remove "initial" parameter.  Return int instead of
4000         void.  Don't error or warn here.
4001         (linux_attach_fail_reason_string): New declaration.
4002         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
4003         interface change.  Use linux_attach_fail_reason_string.
4004
4005 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
4006             Walfred Tedeschi  <walfred.tedeschi@intel.com>
4007
4008         * Makefile.in: Added rules to handle new files
4009         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
4010         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
4011         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
4012         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
4013         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
4014         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
4015         x32-avx512-linux.o.
4016         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
4017         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
4018         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
4019         i386/x32-avx512.xml.
4020         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
4021         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
4022         i386/x32-avx512-linux.xml.
4023         * i387-fp.c (num_avx512_k_registers): New constant for number
4024         of K registers.
4025         (num_avx512_zmmh_low_registers): New constant for number of
4026         lower ZMM registers (0-15).
4027         (num_avx512_zmmh_high_registers): New constant for number of
4028         higher ZMM registers (16-31).
4029         (num_avx512_ymmh_registers): New contant for number of higher
4030         YMM registers (ymm16-31 added by avx521 on x86_64).
4031         (num_avx512_xmm_registers): New constant for number of higher
4032         XMM registers (xmm16-31 added by AVX512 on x86_64).
4033         (struct i387_xsave): Add space for AVX512 registers.
4034         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
4035         Add code to handle AVX512 registers.
4036         (i387_xsave_to_cache): Add code to handle AVX512 registers.
4037         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
4038         prototypei from generated file.
4039         (tdesc_amd64_avx512_linux): Likewise.
4040         (init_registers_x32_avx512_linux): Likewise.
4041         (tdesc_x32_avx512_linux): Likewise.
4042         (init_registers_i386_avx512_linux): Likewise.
4043         (tdesc_i386_avx512_linux): Likewise.
4044         (x86_64_regmap): Add AVX512 registers.
4045         (x86_linux_read_description): Add code to handle AVX512 XSTATE
4046         mask.
4047         (initialize_low_arch): Add code to initialize AVX512 registers.
4048
4049 2014-04-23  Pedro Alves  <palves@redhat.com>
4050
4051         * mem-break.c (find_gdb_breakpoint_at): Make static.
4052         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
4053
4054 2014-04-23  Pedro Alves  <palves@redhat.com>
4055
4056         * i386-low.c: Don't include break-common.h here.
4057         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
4058         prototype to take target_hw_bp_type as argument instead of a Z
4059         packet char.
4060         * i386-low.h: Include break-common.h here.
4061         (Z_packet_to_hw_type): Declare.
4062         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
4063         prototypes.
4064         * linux-x86-low.c (x86_insert_point): Convert the packet number to
4065         a target_hw_bp_type before calling i386_low_insert_watchpoint.
4066         (x86_remove_point): Convert the packet number to a
4067         target_hw_bp_type before calling i386_low_remove_watchpoint.
4068         * win32-i386-low.c (i386_insert_point): Convert the packet number
4069         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
4070         (i386_remove_point): Convert the packet number to a
4071         target_hw_bp_type before calling i386_low_remove_watchpoint.
4072
4073 2014-04-23  Pedro Alves  <palves@redhat.com>
4074
4075         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
4076
4077 2014-04-10  Pedro Alves  <palves@redhat.com>
4078
4079         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
4080         Check if the condition or command is NULL before checking if the
4081         breakpoint is known.  On success, return true.
4082         * mem-break.h (add_breakpoint_condition): Document return.
4083         (add_breakpoint_commands): Add describing comment.
4084         * server.c (skip_to_semicolon): New function.
4085         (process_point_options): Use it.
4086
4087 2014-04-09  Pedro Alves  <palves@redhat.com>
4088
4089         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
4090         to lwpid_of.
4091
4092 2014-02-27  Pedro Alves  <palves@redhat.com>
4093
4094         PR 12702
4095         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
4096         macros.
4097         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
4098         output.
4099         (last_thread_of_process_p): Take a PID argument instead of a
4100         thread pointer.
4101         (linux_wait_for_lwp): Delete.
4102         (num_lwps, check_zombie_leaders, not_stopped_callback): New
4103         functions.
4104         (linux_low_filter_event): New function, party factored out from
4105         linux_wait_for_event.
4106         (linux_wait_for_event): Rename to ...
4107         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
4108         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
4109         sigsuspend.  Check for zombie leaders.
4110         (linux_wait_for_event): Reimplement as wrapper around
4111         linux_wait_for_event_filtered.
4112         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
4113         a normal or signal exit is seen, it's the whole process exiting.
4114         (wait_for_sigstop): No longer a for_each_inferior callback.
4115         Rewrite on top of linux_wait_for_event_filtered.
4116         (stop_all_lwps): Call wait_for_sigstop directly.
4117         * server.c (resume, handle_target_event): Handle
4118         TARGET_WAITKIND_NO_RESUMED.
4119
4120 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4121
4122         * win32-low.c (psapi_get_dll_name,
4123         * win32_CreateToolhelp32Snapshot): Delete.
4124         (win32_CreateToolhelp32Snapshot, win32_Module32First)
4125         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
4126         Delete.
4127         (handle_load_dll): Add function description.
4128         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
4129
4130 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4131
4132         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
4133         Add comment.
4134         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
4135         base address when calling win32_add_one_solib.
4136         (handle_load_dll): Delete local variable load_addr.
4137         Remove 0x1000 offset applied to DLL base address when calling
4138         win32_add_one_solib.
4139         (handle_unload_dll): Add comment.
4140
4141 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4142
4143         * win32-low.c (win32_add_all_dlls): Renames
4144         win32_ensure_ntdll_loaded.  Rewrite function documentation.
4145         Adjust implementation to always load all DLLs.
4146         Add 0x1000 offset to DLL base address when calling
4147         win32_add_one_solib.
4148         (child_initialization_done): New static global.
4149         (do_initial_child_stuff): Set child_initialization_done to
4150         zero during child initialization, and 1 after.  Replace call
4151         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
4152         Add comment.
4153         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
4154         (handle_unload_dll): Add function documentation.
4155         (get_child_debug_event): Ignore load and unload DLL events
4156         during child initialization.
4157
4158 2014-02-20  Doug Evans  <dje@google.com>
4159
4160         Remove global all_lwps.
4161         * inferiors.h (ptid_of): Move here from linux-low.h.
4162         (pid_of, lwpid_of): Ditto.
4163         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
4164         parameter is a struct thread_info * now.
4165         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
4166         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
4167         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
4168         directly.
4169         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
4170         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
4171         * linux-arm-low.c (update_registers_callback): Update, "entry"
4172         parameter is a struct thread_info * now.
4173         Fetch lwpid from current_inferior directly.
4174         (arm_insert_point): Pass &all_threads to find_inferior instead of
4175         &all_lwps.
4176         (arm_remove_point): Ditto.
4177         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
4178         (arm_prepare_to_resume): Fetch pid from thread.
4179         (arm_read_description): Fetch lwpid from current_inferior directly.
4180         * linux-low.c (all_lwps): Delete.
4181         (delete_lwp): Delete call to remove_inferior.
4182         (handle_extended_wait): Fetch lwpid from thread.
4183         (add_lwp): Don't set lwp->entry.id.  Remove call to
4184         add_inferior_to_list.
4185         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
4186         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
4187         (kill_one_lwp_callback): Ditto.
4188         (linux_kill): Don't dereference NULL pointer.
4189         Fetch ptid,lwpid from thread.
4190         (get_detach_signal): Fetch ptid from thread.
4191         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
4192         Simplify call to regcache_invalidate_thread.
4193         (delete_lwp_callback): Update, "entry" parameter is a
4194         struct thread_info * now.  Fetch pid from thread.
4195         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
4196         (status_pending_p_callback): Update, "entry" parameter is a
4197         struct thread_info * now.  Fetch ptid from thread.
4198         (find_lwp_pid): Update, "entry" parameter is a
4199         struct thread_info * now.
4200         (linux_wait_for_lwp): Fetch pid from thread.
4201         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
4202         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
4203         (enqueue_one_deferred_signal): Fetch lwpid from thread.
4204         (dequeue_one_deferred_signal): Ditto.
4205         (cancel_breakpoint): Fetch ptid from current_inferior.
4206         (linux_wait_for_event): Pass &all_threads to find_inferior,
4207         not &all_lwps.  Fetch ptid, lwpid from thread.
4208         (count_events_callback): Update, "entry" parameter is a
4209         struct thread_info * now.
4210         (select_singlestep_lwp_callback): Ditto.
4211         (select_event_lwp_callback): Ditto.
4212         (cancel_breakpoints_callback): Ditto.
4213         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
4214         not &all_lwps.
4215         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
4216         (unsuspend_one_lwp): Update, "entry" parameter is a
4217         struct thread_info * now.
4218         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
4219         not &all_lwps.
4220         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
4221         Fetch lwpid from thread, not lwp.
4222         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
4223         Pass &all_threads to find_inferior, not &all_lwps.
4224         (send_sigstop): Fetch lwpid from thread, not lwp.
4225         (send_sigstop_callback): Update, "entry" parameter is a
4226         struct thread_info * now.
4227         (suspend_and_send_sigstop_callback): Ditto.
4228         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
4229         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
4230         struct thread_info * now.
4231         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
4232         from thread, lwp.
4233         (lwp_running): Update, "entry" parameter is a
4234         struct thread_info * now.
4235         (stop_all_lwps): Fetch ptid from thread.
4236         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
4237         (linux_resume_one_lwp): Fetch lwpid from thread.
4238         (linux_set_resume_request): Update, "entry" parameter is a
4239         struct thread_info * now.  Fetch pid, lwpid from thread.
4240         (resume_status_pending_p): Update, "entry" parameter is a
4241         struct thread_info * now.
4242         (need_step_over_p): Ditto.  Fetch lwpid from thread.
4243         (start_step_over): Fetch lwpid from thread.
4244         (linux_resume_one_thread): Update, "entry" parameter is a
4245         struct thread_info * now.  Fetch lwpid from thread.
4246         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
4247         (proceed_one_lwp): Update, "entry" parameter is a
4248         struct thread_info * now.  Fetch lwpid from thread.
4249         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
4250         struct thread_info * now.
4251         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
4252         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
4253         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
4254         directly.
4255         (regsets_store_inferior_registers): Ditto.
4256         (fetch_register, store_register): Ditto.
4257         (linux_read_memory, linux_write_memory): Ditto.
4258         (linux_request_interrupt): Ditto.
4259         (linux_read_auxv): Ditto.
4260         (linux_xfer_siginfo): Ditto.
4261         (linux_qxfer_spu): Ditto.
4262         (linux_qxfer_libraries_svr4): Ditto.
4263         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
4264         moved to inferiors.h.
4265         (get_lwp): Delete.
4266         (get_thread_lwp): Update.
4267         (struct lwp_info): Delete member "entry".  Simplify comment for
4268         member "thread".
4269         (all_lwps): Delete.
4270         * linux-mips-low.c (mips_read_description): Fetch lwpid from
4271         current_inferior directly.
4272         (update_watch_registers_callback): Update, "entry" parameter is a
4273         struct thread_info * now.  Fetch pid from thread.
4274         (mips_linux_prepare_to_resume): Fetch ptid from thread.
4275         (mips_insert_point): Fetch lwpid from current_inferior.
4276         Pass &all_threads to find_inferior, not &all_lwps.
4277         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
4278         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
4279         directly.
4280         (mips_stopped_data_address): Ditto.
4281         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
4282         directly.
4283         * linux-tile-low.c (tile_arch_setup): Ditto.
4284         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
4285         (update_debug_registers_callback): Update, "entry" parameter is a
4286         struct thread_info * now.  Fetch pid from thread.
4287         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
4288         Pass &all_threads to find_inferior, not &all_lwps.
4289         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
4290         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
4291         Pass &all_threads to find_inferior, not &all_lwps.
4292         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
4293         (i386_dr_low_get_status): Ditto.
4294         (x86_linux_prepare_to_resume): Fetch ptid from thread.
4295         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
4296         (x86_linux_read_description): Ditto.
4297         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
4298
4299 2014-02-20  Doug Evans  <dje@google.com>
4300
4301         * inferiors.c (get_first_inferior): Fix buglet.
4302
4303 2014-02-19  Doug Evans  <dje@google.com>
4304
4305         * gdbthread.h (add_thread): Change result type to struct thread_info *.
4306         * inferiors.c (add_thread): Change result type to struct thread_info *.
4307         All callers updated.
4308         (add_lwp): Call add_thread here instead of in callers.
4309         All callers updated.
4310         * linux-low.h (get_lwp_thread): Rewrite.
4311         (struct lwp_info): New member "thread".
4312
4313 2014-02-19  Doug Evans  <dje@google.com>
4314
4315         * linux-low.c (add_lwp): Change result to struct lwp_info *.
4316         All callers updated.
4317
4318 2014-02-19  Doug Evans  <dje@google.com>
4319
4320         * inferiors.c (add_thread): Fix whitespace.
4321
4322 2014-02-19  Doug Evans  <dje@google.com>
4323
4324         * dll.c (clear_dlls): Replace accessing list implemention details
4325         with API function.
4326         * gdbthread.h (get_first_thread): Declare.
4327         * inferiors.c (for_each_inferior_with_data): New function.
4328         (get_first_thread): New function.
4329         (find_thread_ptid): Simplify.
4330         (get_first_inferior): New function.
4331         (clear_list): Delete.
4332         (one_inferior_p): New function.
4333         (clear_inferior_list): New function.
4334         (clear_inferiors): Update.
4335         * inferiors.h (for_each_inferior_with_data): Declare.
4336         (clear_inferior_list): Declare.
4337         (one_inferior_p): Declare.
4338         (get_first_inferior): Declare.
4339         * linux-low.c (linux_wait_for_event): Replace accessing list
4340         implemention details with API function.
4341         * server.c (target_running): Ditto.
4342         (accumulate_file_name_length): New function.
4343         (emit_dll_description): New function.
4344         (handle_qxfer_libraries): Replace accessing list implemention
4345         details with API function.
4346         (handle_qxfer_threads_worker): New function.
4347         (handle_qxfer_threads_proper): Replace accessing list implemention
4348         details with API function.
4349         (handle_query): Ditto.
4350         (visit_actioned_threads_callback_ftype): New typedef.
4351         (visit_actioned_threads_data): New struct.
4352         (visit_actioned_threads): Rewrite to be find_inferior callback.
4353         (resume): Call find_inferior.
4354         (handle_status): Replace accessing list implemention
4355         details with API function.
4356         (process_serial_event): Replace accessing list implemention details
4357         with API function.
4358         * target.c (set_desired_inferior): Replace accessing list implemention
4359         details with API function.
4360         * tracepoint.c (same_process_p): New function.
4361         (gdb_agent_about_to_close): Replace accessing list implemention
4362         details with API function.
4363         * win32-low.c (child_delete_thread): Replace accessing list
4364         implemention details with API function.
4365         (match_dll_by_basename): New function.
4366         (dll_is_loaded_by_basename): New function.
4367         (win32_ensure_ntdll_loaded): Replace accessing list implemention
4368         details call to dll_is_loaded_by_basename.
4369
4370 2014-02-19  Doug Evans  <dje@google.com>
4371
4372         * dll.h (struct dll_info): Add comment.
4373         * gdbthread.h (struct thread_info): Add comment.
4374         (current_ptid): Simplify.
4375         * inferiors.c (add_process): Update.
4376         (remove_process): Update.
4377         * inferiors.h (struct process_info): Rename member "head" to "entry".
4378         * linux-low.c (delete_lwp): Update.
4379         (add_lwp): Update.
4380         (last_thread_of_process_p): Update.
4381         (kill_one_lwp_callback, linux_kill): Update.
4382         (status_pending_p_callback): Update.
4383         (wait_for_sigstop): Update.  Simplify read of ptid.
4384         (start_step_over): Update.
4385         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
4386         (get_lwp_thread): Update.
4387         (struct lwp_info): Rename member "head" to "entry".
4388         * regcache.h (inferior_list_entry): Delete.
4389         * server.c (kill_inferior_callback): Update.
4390         (detach_or_kill_inferior_callback): Update.
4391         (print_started_pid): Update.
4392         (print_attached_pid): Update.
4393         (process_serial_event): Simplify read of ptid.
4394         * thread-db.c (thread_db_create_event): Update.
4395         (thread_db_get_tls_address): Update.
4396         * win32-low.c (current_inferior_ptid): Simplify.
4397
4398 2014-02-19  Tom Tromey  <tromey@redhat.com>
4399
4400         * target.h (struct target_ops) <supports_btrace>: Add target_ops
4401         argument.
4402         (target_supports_btrace): Update.
4403
4404 2014-02-14  Yao Qi  <yao@codesourcery.com>
4405
4406         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
4407         (rsp-low-ipa.o): New target.
4408
4409 2014-02-12  Tom Tromey  <tromey@redhat.com>
4410
4411         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
4412         convert_ascii_to_int.
4413         * regcache.c (registers_to_string): Likewise.
4414         * remote-utils.c (decode_M_packet): Likewise.
4415         * server.c (process_serial_event): Likewise.
4416
4417 2014-02-12  Tom Tromey  <tromey@redhat.com>
4418
4419         * server.c (handle_query, handle_v_run): Use hex2bin, not
4420         unhexify.
4421         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
4422
4423 2014-02-12  Tom Tromey  <tromey@redhat.com>
4424
4425         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
4426         convert_int_to_ascii.
4427         * regcache.c (registers_to_string, collect_register_as_string):
4428         Likewise.
4429         * remote-utils.c (look_up_one_symbol, relocate_instruction):
4430         Likewise.
4431         * server.c (process_serial_event): Likewise.
4432         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
4433         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
4434
4435 2014-02-12  Tom Tromey  <tromey@redhat.com>
4436
4437         * remote-utils.c (look_up_one_symbol, monitor_output): Use
4438         bin2hex, not hexify.
4439         * tracepoint.c (cmd_qtstatus): Likewise.
4440
4441 2014-02-12  Tom Tromey  <tromey@redhat.com>
4442
4443         * remote-utils.c (monitor_output): Pass explicit length to
4444         hexify.
4445
4446 2014-02-12  Tom Tromey  <tromey@redhat.com>
4447
4448         * tracepoint.c: Include rsp-low.h.
4449         * server.c: Include rsp-low.h.
4450         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
4451         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
4452         declare.
4453         * remote-utils.c: Include rsp-low.h.
4454         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
4455         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
4456         (convert_int_to_ascii, convert_ascii_to_int): Move to
4457         common/rsp-low.c.
4458         * regcache.c: Include rsp-low.h.
4459         * ax.c: Include rsp-low.h.
4460         * Makefile.in (SFILES): Add common/rsp-low.c.
4461         (OBS): Add rsp-low.o.
4462         (rsp-low.o): New target.
4463
4464 2014-02-12  Tom Tromey  <tromey@redhat.com>
4465
4466         * utils.h (pulongest, plongest, phex_nz): Don't declare.
4467         Include print-utils.h.
4468         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
4469         (plongest, thirty_two, phex_nz): Remove.
4470         * Makefile.in (SFILES): Add common/print-utils.c.
4471         (OBS): Add print-utils.o.
4472         (print-utils-ipa.o): New target.
4473         (print-utils.o): New target.
4474         (IPA_OBJS): Add print-utils-ipa.o.
4475
4476 2014-02-06  Tom Tromey  <tromey@redhat.com>
4477
4478         * Makefile.in (SFILES): Fix indentation.
4479
4480 2014-02-05  Doug Evans  <dje@google.com>
4481
4482         * linux-low.c (linux_wait_for_event): Improve comment.
4483         (linux_wait_1): Keep current_inferior in sync with event_child.
4484
4485 2014-01-22  Doug Evans  <dje@google.com>
4486
4487         * gdbthread.h (gdb_id_to_thread): Delete, unused.
4488
4489 2014-01-22  Doug Evans  <dje@google.com>
4490
4491         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
4492         * configure: Regenerate.
4493         * config.in: Regenerate.
4494         * Makefile.in (SFILES): Add debug.c.
4495         (OBS): Add debug.o.
4496         * debug.c: New file.
4497         * debug.h: New file.
4498         * linux-aarch64-low.c (*): Update all debugging printfs to use
4499         debug_printf instead of fprintf.
4500         * linux-arm-low.c (*): Ditto.
4501         * linux-cris-low.c (*): Ditto.
4502         * linux-crisv32-low.c (*): Ditto.
4503         * linux-m32r-low.c (*): Ditto.
4504         * linux-sparc-low.c (*): Ditto.
4505         * linux-x86.c (*): Ditto.
4506         * linux-low.c (*): Ditto.
4507         (linux_wait_1): Add calls to debug_enter, debug_exit.
4508         (linux_wait): Remove redundant debugging printf.
4509         (stop_all_lwps): Add calls to debug_enter, debug_exit.
4510         (linux_resume, unstop_all_lwps): Ditto.
4511         * mem-break.c (*): Update all debugging printfs to use
4512         debug_printf instead of fprintf.
4513         * remote-utils.c (*): Ditto.
4514         * thread-db.c (*): Ditto.
4515         * server.c #include <ctype.h>, "gdb_vecs.h".
4516         (debug_threads): Moved to debug.c.
4517         (*): Update all debugging printfs to use debug_printf instead of
4518         fprintf.
4519         (start_inferior): Replace call to fflush with call to debug_flush.
4520         (monitor_show_help): Mention set debug-format.
4521         (parse_debug_format_options): New function.
4522         (handle_monitor_command): Handle "monitor set debug-format".
4523         (gdbserver_usage): Mention --debug-format.
4524         (main): Parse --debug-format.
4525         * server.h (debug_threads): Declaration moved to debug.h.
4526         #include "debug.h".
4527         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4528         trace_debug_1 that uses debug_printf.
4529         (tracepoint_look_up_symbols): Update all debugging printfs to use
4530         debug_printf instead of fprintf.
4531
4532 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4533
4534         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4535         sys/ptrace.h.
4536
4537 2014-01-17  Pedro Alves  <palves@redhat.com>
4538
4539         PR build/16445
4540         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4541         defined after including gdb_proc_service.h.
4542
4543 2014-01-16  Doug Evans  <dje@google.com>
4544
4545         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4546         (match_dll): Use it.
4547
4548 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4549
4550         * target.h (target_ops) <read_btrace>: Change parameters and
4551         return type to allow error reporting.
4552         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4553         trace reading errors on.
4554         * linux-low.c (linux_low_read_btrace): Pass trace reading
4555         errors on.
4556         (linux_low_disable_btrace): New.
4557
4558 2014-01-15  Doug Evans  <dje@google.com>
4559
4560         * inferiors.c (thread_id_to_gdb_id): Delete.
4561         * inferiors.h (thread_id_to_gdb_id): Delete.
4562
4563 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4564
4565         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4566         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4567         versions.
4568
4569 2014-01-08  Pedro Alves  <palves@redhat.com>
4570
4571         * server.c (handle_status): Don't discard previous queued stop
4572         replies or thread's pending status here.
4573         (main) <disconnection>: Do it here instead.
4574
4575 2014-01-08  Pedro Alves  <palves@redhat.com>
4576
4577         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4578         * server.c (visit_actioned_threads, handle_pending_status): New
4579         function.
4580         (handle_v_cont): Factor out parts to ...
4581         (resume): ... this new function.  If in all-stop, and a thread
4582         being resumed has a pending status, report it without actually
4583         resuming.
4584         (myresume): Adjust to use the new 'resume' function.
4585         (clear_pending_status_callback, set_pending_status_callback)
4586         (find_status_pending_thread_callback): New functions.
4587         (handle_status): Handle the case of multiple threads having
4588         interesting statuses to report.  Report threads' real last signal
4589         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4590         with an interesting thread to report the status for, instead of
4591         always reporting the status of the first thread.
4592
4593 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4594
4595         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4596         * gdbreplay.c (gdbreplay_version): Likewise.
4597
4598 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4599
4600         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4601         iov.iov_len with the real length in use.
4602
4603 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4604
4605         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4606         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4607         for all targets that use win32-low.c.
4608         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4609         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4610
4611 2013-12-13  Pedro Alves  <palves@redhat.com>
4612
4613         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4614         if equal to TARGET_WAITKIND_LOADED.
4615         * win32-low.c (cached_status): New static global.
4616         (win32_wait): Add declaration.
4617         (do_initial_child_stuff): Flush all initial pending debug events
4618         up to the initial breakpoint.
4619         (win32_wait): If CACHED_STATUS was set, return that instead
4620         of doing a real wait.  Remove the code resuming the execution
4621         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4622         during the initial phase.  Also remove the code changing
4623         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4624         TARGET_WAITKIND_STOPPED.
4625
4626 2013-12-11  Yao Qi  <yao@codesourcery.com>
4627
4628         * notif.c (handle_notif_ack): Return 0 if no notification
4629         matches.
4630
4631 2013-11-20  Doug Evans  <dje@google.com>
4632
4633         * linux-low.c (linux_set_resume_request): Fix comment.
4634
4635 2013-11-20  Doug Evans  <dje@google.com>
4636
4637         * linux-low.c (resume_status_pending_p): Tweak comment.
4638
4639 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4640
4641         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4642         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4643         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4644         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4645         (srv_amd64_regobj): Add amd64-mpx.o.
4646         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4647         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4648         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4649         * i387-fp.c (num_pl_bnd_register) Added constant.
4650         (num_pl_bnd_cfg_registers) Added constant.
4651         (struct i387_xsave) Added reserved area and MPX fields.
4652         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4653         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4654         function.
4655         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4656         (init_registers_amd64_mpx_linux): Declare new function.
4657         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4658         (x86_64_regmap): Add MPX registers.
4659         (x86_linux_read_description): Add MPX case.
4660         (initialize_low_arch): Initialize MPX targets.
4661
4662 2013-11-18  Tom Tromey  <tromey@redhat.com>
4663
4664         * configure: Rebuild.
4665         * configure.ac: Don't check for stdlib.h.
4666         * gdbreplay.c: Unconditionally include stdlib.h.
4667
4668 2013-11-18  Tom Tromey  <tromey@redhat.com>
4669
4670         * config.in: Rebuild.
4671         * configure: Rebuild.
4672         * configure.ac: Don't use AC_HEADER_DIRENT.
4673
4674 2013-11-18  Tom Tromey  <tromey@redhat.com>
4675
4676         * server.h: Don't check HAVE_STRING_H.
4677         * gdbreplay.c: Don't check HAVE_STRING_H.
4678         * configure: Rebuild.
4679
4680 2013-11-18  Tom Tromey  <tromey@redhat.com>
4681
4682         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4683         LIBGNU.
4684
4685 2013-11-08  Tom Tromey  <tromey@redhat.com>
4686
4687         * configure, config.in: Rebuild.
4688         * configure.ac: Remove unused configury.
4689
4690 2013-11-08  Tom Tromey  <tromey@redhat.com>
4691
4692         * acinclude.m4: Include common.m4, codeset.m4.
4693         * configure, config.in: Rebuild.
4694         * configure.ac: Use GDB_AC_COMMON.
4695
4696 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4697
4698         * linux-s390-low.c (HWCAP_S390_TE): New define.
4699         (s390_arch_setup): Consider the TE field in the HWCAP for
4700         determining 'have_regset_tdb'.
4701
4702 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4703
4704         PR gdb/16014
4705         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4706         call to sizeof.
4707
4708 2013-10-02  Pedro Alves  <palves@redhat.com>
4709
4710         * server.c (process_serial_event): Don't output "GDBserver
4711         exiting" if GDB is connected through stdio.
4712         * target.c (mywait): Likewise, be silent if GDB is connected
4713         through stdio.
4714
4715 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4716
4717         * lynx-low.c (lynx_add_threads_after_attach): New function.
4718         (lynx_attach): Remove call to add_thread.  Add call to
4719         lynx_add_threads_after_attach instead.
4720
4721 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4722
4723         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4724         * config.in, configure: Regenerated.
4725
4726 2013-09-18  Yao Qi  <yao@codesourcery.com>
4727
4728         PR server/15959
4729         * server.c (start_inferior): Clear 'resume_info'.
4730
4731 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4732
4733         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4734         for each register.
4735
4736 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4737
4738         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4739         linux-tile-low.o to srv_tgtobj.
4740
4741 2013-09-16  Will Newton  <will.newton@linaro.org>
4742
4743         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4744         out regs.
4745
4746 2013-09-06  Pedro Alves  <palves@redhat.com>
4747
4748         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4749         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4750         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4751         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4752         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4753         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4754
4755 2013-09-06  Pedro Alves  <palves@redhat.com>
4756
4757         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4758         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4759
4760 2013-09-06  Pedro Alves  <palves@redhat.com>
4761
4762         * linux-amd64-ipa.c: Include tracepoint.h.
4763         * linux-i386-ipa.c: Include tracepoint.h.
4764
4765 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4766
4767         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4768         (ps_get_thread_area): New function.
4769
4770 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4771
4772         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4773         (initialize_low_arch): Call init_registers_crisv32 rather than
4774         init_register_crisv32.
4775
4776 2013-09-05  Pedro Alves  <palves@redhat.com>
4777
4778         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4779         to ...
4780         * hostio.h: ... this new file.
4781         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4782         win32-low.c: Include hostio.h.
4783
4784 2013-09-05  Pedro Alves  <palves@redhat.com>
4785
4786         * server.h (gdb_client_data, handler_func, callback_handler_func)
4787         (delete_file_handler, add_file_handler, append_callback_event)
4788         (delete_callback_event, start_event_loop, initialize_event_loop):
4789         Move to event-loop.h and include it.
4790         * event-loop.h: New file.
4791
4792 2013-09-05  Pedro Alves  <palves@redhat.com>
4793
4794         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4795         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4796         (loaded_dll, unloaded_dll): Move to ...
4797         * dll.h: ... this new file.
4798         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4799
4800 2013-09-05  Pedro Alves  <palves@redhat.com>
4801
4802         * server.h (current_process, get_thread_process, all_processes)
4803         (add_inferior_to_list, for_each_inferior, current_inferior)
4804         (remove_inferior, add_process, remove_process, find_process_pid)
4805         (have_started_inferiors_p, have_attached_inferiors_p)
4806         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4807         (clear_inferiors, find_inferior, find_inferior_id)
4808         (inferior_target_data, set_inferior_target_data)
4809         (inferior_regcache_data, set_inferior_regcache_data): Move to
4810         inferiors.h, and include it.
4811         * inferiors.h: New file.
4812
4813 2013-09-05  Pedro Alves  <palves@redhat.com>
4814
4815         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4816         Move ...
4817         * ax.h: ... here.
4818
4819 2013-09-05  Pedro Alves  <palves@redhat.com>
4820
4821         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4822         tracepoint.h.
4823         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4824         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4825         (handle_tracepoint_general_set, handle_tracepoint_query)
4826         (tracepoint_finished_step, tracepoint_was_hit)
4827         (release_while_stepping_state_list, current_traceframe)
4828         (in_readonly_region, traceframe_read_mem)
4829         (fetch_traceframe_registers, traceframe_read_sdata)
4830         (traceframe_read_info, struct fast_tpoint_collect_status)
4831         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4832         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4833         (supply_fast_tracepoint_registers)
4834         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4835         (ipa_tdesc, claim_trampoline_space)
4836         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4837         (agent_mem_read, agent_get_trace_state_variable_value)
4838         (agent_set_trace_state_variable_value, agent_tsv_read)
4839         (agent_mem_read_string, get_raw_reg_func_addr)
4840         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4841         * tracepoint.h: ... this new file.
4842
4843 2013-09-05  Pedro Alves  <palves@redhat.com>
4844
4845         * server.h (perror_with_name, error, fatal, warning, paddress)
4846         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4847         include it.
4848         * utils.h: New file.
4849
4850 2013-09-05  Pedro Alves  <palves@redhat.com>
4851
4852         * server.h (remote_debug, noack_mode, transport_is_reliable)
4853         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4854         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4855         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4856         (write_enn, initialize_async_io, enable_async_io)
4857         (disable_async_io, check_remote_input_interrupt_request)
4858         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4859         (dead_thread_notify, prepare_resume_reply)
4860         (decode_address_to_semicolon, decode_address, decode_m_packet)
4861         (decode_M_packet, decode_X_packet, decode_xfer_write)
4862         (decode_search_memory_packet, unhexify, hexify)
4863         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4864         (look_up_one_symbol, relocate_instruction)
4865         (monitor_output): Move to remote-utils.h, and include it.
4866         * remote-utils.h: New file.
4867
4868 2013-09-05  Pedro Alves  <palves@redhat.com>
4869
4870         * server.h (_): Delete.
4871
4872 2013-09-02  Pedro Alves  <palves@redhat.com>
4873
4874         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4875         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4876         allocated.
4877         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4878
4879 2013-09-02  Pierre Muller  <muller@sourceware.org>
4880
4881         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4882         or WriteProcessMemory complete successfully and handle
4883         ERROR_PARTIAL_COPY error.
4884
4885 2013-09-02  Pedro Alves  <palves@redhat.com>
4886
4887         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4888         error instead of EIO.
4889
4890 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4891
4892         PR server/15604
4893         * linux-low.c: Include filestuff.h.
4894         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4895         * lynx-low.c: Include filestuff.h.
4896         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4897         * server.c: Include filestuff.h.
4898         (main): Call notice_open_fds.
4899         * spu-low.c: Include filestuff.h.
4900         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4901
4902 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4903
4904         * Makefile.in: Explain why ../target and ../nat are not
4905         listed as include file search paths.
4906         (linux-waitpid.o): New object file rule.
4907         * configure.srv (srv_native_linux_obj): New variable.
4908         Replace all occurrences of linux native object files with
4909         $srv_native_linux_obj.
4910         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4911         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4912         (linux_enable_event_reporting): Remove declaration.
4913         (my_waitpid): Moved to common/linux-waitpid.c.
4914         (linux_wait_for_event): Pass ptid when calling
4915         linux_enable_event_reporting.
4916         (linux_supports_tracefork_flag): Remove.
4917         (linux_enable_event_reporting): Likewise.
4918         (linux_tracefork_grandchild): Remove.
4919         (STACK_SIZE): Moved to common/linux-ptrace.c.
4920         (linux_tracefork_child): Remove.
4921         (linux_test_for_tracefork): Remove.
4922         (linux_look_up_symbols): Call linux_supports_traceclone.
4923         (initialize_low): Remove call to linux_test_for_tracefork.
4924         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4925         common/linux-ptrace.h.
4926         (PTRACE_TYPE_ARG4): Likewise.
4927         Include linux-ptrace.h.
4928
4929 2013-08-21  Pedro Alves  <palves@redhat.com>
4930
4931         * config.in: Renegerate.
4932
4933 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4934
4935         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4936         (SFILES): Remove $(srcdir)/common/target-common.c and
4937         add $(srcdir)/target/waitstatus.c.
4938         (OBS): Remove target-common.o and add waitstatus.o.
4939         (server_h): Remove $(srcdir)/../common/target-common.h and
4940         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4941         and $(srcdir)/../target/waitstatus.h.
4942         (target-common.o): Remove.
4943         (waitstatus.o): New target object file.
4944         * target.h: Do not include target-common.h and
4945         include target/resume.h, target/wait.h and
4946         target/waitstatus.h.
4947
4948 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4949
4950         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4951         to PTRACE_TYPE_ARG3.
4952         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4953         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4954         PTRACE_TYPE_ARG4.
4955         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4956         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4957
4958 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4959             Daniel Jacobowitz  <dan@codesourcery.com>
4960             Yao Qi  <yao@codesourcery.com>
4961
4962         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4963         (mips-linux-watch.o): New rule.
4964         (mips_linux_watch_h): New variable.
4965         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4966         srv_tgtobj.
4967         * linux-mips-low.c: Include mips-linux-watch.h.
4968         (struct arch_process_info, struct arch_lwp_info): New.
4969         (update_watch_registers_callback): New function.
4970         (mips_linux_new_process, mips_linux_new_thread) New functions.
4971         (mips_linux_prepare_to_resume, mips_insert_point): New
4972         functions.
4973         (mips_remove_point, mips_stopped_by_watchpoint): New
4974         functions.
4975         (rsp_bp_type_to_target_hw_bp_type): New function.
4976         (mips_stopped_data_address): New function.
4977         (the_low_target): Add watchpoint support functions.
4978
4979 2013-07-27  Yao Qi  <yao@codesourcery.com>
4980
4981         * i386-low.c: Include break-common.h.
4982         (enum target_hw_bp_type): Remove.
4983
4984 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4985
4986         * Makefile.in (SFILES): /common/target-common.c.
4987         (OBS): Add target-common.o.
4988         (server_h): Add $(srcdir)/../common/target-common.h.
4989         (target-common.o): New target.
4990         * server.c (queue_stop_reply_callback): Free
4991         status string after use.
4992         * target.c (target_waitstatus_to_string): Remove.
4993         * target.h: Include target-common.h.
4994         (resume_kind): Likewise.
4995         (target_waitkind): Likewise.
4996         (target_waitstatus): Likewise.
4997         (TARGET_WNOHANG): Likewise.
4998
4999 2013-07-04  Yao Qi  <yao@codesourcery.com>
5000
5001         * Makefile.in (host_alias): Use @host_noncanonical@.
5002         (target_alias): Use @target_noncanonical@.
5003         * configure.ac: Use ACX_NONCANONICAL_TARGET and
5004         ACX_NONCANONICAL_HOST.
5005         * configure: Regenerated.
5006
5007         Revert:
5008         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
5009
5010         * configure.ac (version_host, version_target): Set and AC_SUBST them.
5011         * configure: Rebuild.
5012         * Makefile.in (version_host, version_target): Get from configure.
5013         (version.c): Use $(version_host) and $(version_target).
5014
5015 2013-07-03  Pedro Alves  <palves@redhat.com>
5016
5017         * Makefile.in (config.status): Depend on development.sh.
5018         * acinclude.m4: Include libmcheck.m4.
5019         * configure: Regenerate.
5020
5021 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
5022
5023         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
5024         attribute inside the parentheses.
5025         (winapi_DebugSetProcessKillOnExit): Ditto.
5026         (winapi_DebugBreakProcess): Ditto.
5027         (winapi_GenerateConsoleCtrlEvent): Ditto.
5028
5029 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
5030
5031         * notif.h (notif_event): Add a dummy member to avoid compiler
5032         errors.
5033
5034 2013-07-01  Pedro Alves  <palves@redhat.com>
5035
5036         * hostio.c (HOSTIO_PATH_MAX): Define.
5037         (require_filename, handle_open, handle_unlink, handle_readlink):
5038         Use it.
5039
5040 2013-07-01  Pedro Alves  <palves@redhat.com>
5041
5042         * server.h: Include "pathmax.h".
5043         * linux-low.c: Don't include sys/param.h.
5044         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
5045         MAXPATHLEN.
5046         * win32-low.c: Don't include sys/param.h.
5047         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
5048
5049 2013-07-01  Pedro Alves  <palves@redhat.com>
5050
5051         * event-loop.c: Don't check HAVE_UNISTD_H before including
5052         <unistd.h>.
5053         * gdbreplay.c: Likewise.
5054         * remote-utils.c: Likewise.
5055         * server.c: Likewise.
5056         * configure.ac: Don't check for unistd.h.
5057         * configure: Regenerate.
5058
5059 2013-06-28  Tom Tromey  <tromey@redhat.com>
5060
5061         * Makefile.in (version.c): Use version.in, not
5062         common/version.in.
5063
5064 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
5065
5066         * configure.ac (version_host, version_target): Set and AC_SUBST them.
5067         * configure: Rebuild.
5068         * Makefile.in (version_host, version_target): Get from configure.
5069         (version.c): Use $(version_host) and $(version_target).
5070
5071 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
5072
5073         Fix trace-status to output user name without trailing colon.
5074         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
5075
5076 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
5077
5078         Fix trace-status to output proper start-time and stop-time.
5079         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
5080         output start time and stop time in hex as gdb expects.
5081
5082 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
5083
5084         * tracepoint.c (build_traceframe_info_xml): Output trace state
5085         variables present in the trace buffer.
5086
5087 2013-06-24  Tom Tromey  <tromey@redhat.com>
5088
5089         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
5090         create-version.sh.
5091         (version.o): Remove.
5092         * gdbreplay.c: Include version.h.
5093         (version, host_name): Don't declare.
5094         * server.h: Include version.h.
5095         (version, host_name): Don't declare.
5096
5097 2013-06-12  Pedro Alves  <palves@redhat.com>
5098
5099         * linux-x86-low.c (linux_is_elf64): Delete global.
5100         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
5101         with local linux_pid_exe_is_elf_64_file use.
5102
5103 2013-06-11  Pedro Alves  <palves@redhat.com>
5104
5105         * linux-low.c (regset_disabled, disable_regset): New functions.
5106         (regsets_fetch_inferior_registers)
5107         (regsets_store_inferior_registers): Use them.
5108         (initialize_regsets_info); Don't allocate the disabled_regsets
5109         array here.
5110         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
5111         comment.
5112
5113 2013-06-11  Pedro Alves  <palves@redhat.com>
5114
5115         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
5116         xmalloc.
5117
5118 2013-06-11  Pedro Alves  <palves@redhat.com>
5119
5120         * linux-x86-low.c (initialize_low_arch): Call
5121         init_registers_x32_avx_linux.
5122
5123 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
5124
5125         Fix compatibility with Android Bionic.
5126         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
5127         it is not empty.
5128
5129 2013-06-07  Pedro Alves  <palves@redhat.com>
5130
5131         PR server/14823
5132         * Makefile.in (OBS): Add tdesc.o.
5133         (IPA_OBJS): Add tdesc-ipa.o.
5134         (tdesc-ipa.o): New rule.
5135         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
5136         interface.
5137         * linux-low.c (new_inferior): Delete.
5138         (disabled_regsets, num_regsets): Delete.
5139         (linux_add_process): Adjust to set the new per-process
5140         new_inferior flag.
5141         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
5142         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
5143         was a stop.  When calling arch_setup, switch the current inferior
5144         to the thread that got an event.
5145         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
5146         (regsets_fetch_inferior_registers)
5147         (regsets_store_inferior_registers): New regsets_info parameter.
5148         Adjust to use it.
5149         (linux_register_in_regsets): New regs_info parameter.  Adjust to
5150         use it.
5151         (register_addr, fetch_register, store_register): New usrregs_info
5152         parameter.  Adjust to use it.
5153         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
5154         parameter regs_info.  Adjust to use it.
5155         (linux_fetch_registers): Get the current inferior's regs_info, and
5156         adjust to use it.
5157         (linux_store_registers): Ditto.
5158         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
5159         (initialize_low): Don't initialize the target_regsets here.  Call
5160         initialize_low_arch.
5161         * linux-low.h (target_regsets): Delete declaration.
5162         (struct regsets_info): New.
5163         (struct usrregs_info): New.
5164         (struct regs_info): New.
5165         (struct process_info_private) <new_inferior>: New field.
5166         (struct linux_target_ops): Delete the num_regs, regmap, and
5167         regset_bitmap fields.  New field regs_info.
5168         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
5169         * i387-fp.c (num_xmm_registers): Delete.
5170         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
5171         calls to new interface.
5172         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
5173         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
5174         Infer the number of xmm registers from the regcache's target
5175         description.
5176         * i387-fp.h (num_xmm_registers): Delete.
5177         * inferiors.c (add_thread): Don't install the thread's regcache
5178         here.
5179         * proc-service.c (gregset_info): Fetch the current inferior's
5180         regs_info.  Adjust to use it.
5181         * regcache.c: Include tdesc.h.
5182         (register_bytes, reg_defs, num_registers)
5183         (gdbserver_expedite_regs): Delete.
5184         (get_thread_regcache): If the thread doesn't have a regcache yet,
5185         create one, instead of aborting gdbserver.
5186         (regcache_invalidate_one): Rename to ...
5187         (regcache_invalidate_thread): ... this.
5188         (regcache_invalidate_one): New.
5189         (regcache_invalidate): Only invalidate registers of the current
5190         process.
5191         (init_register_cache): Add target_desc parameter, and use it.
5192         (new_register_cache): Ditto.  Assert the target description has a
5193         non zero registers_size.
5194         (regcache_cpy): Add assertions.  Adjust.
5195         (realloc_register_cache, set_register_cache): Delete.
5196         (registers_to_string, registers_from_string): Adjust.
5197         (find_register_by_name, find_regno, find_register_by_number)
5198         (register_cache_size): Add target_desc parameter, and use it.
5199         (free_register_cache_thread, free_register_cache_thread_one)
5200         (regcache_release, register_cache_size): New.
5201         (register_size): Add target_desc parameter, and use it.
5202         (register_data, supply_register, supply_register_zeroed)
5203         (supply_regblock, supply_register_by_name, collect_register)
5204         (collect_register_as_string, collect_register_by_name): Adjust.
5205         * regcache.h (struct target_desc): Forward declare.
5206         (struct regcache) <tdesc>: New field.
5207         (init_register_cache, new_register_cache): Add target_desc
5208         parameter.
5209         (regcache_invalidate_thread): Declare.
5210         (regcache_invalidate_one): Delete declaration.
5211         (regcache_release): Declare.
5212         (find_register_by_number, register_cache_size, register_size)
5213         (find_regno): Add target_desc parameter.
5214         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
5215         declarations.
5216         * remote-utils.c: Include tdesc.h.
5217         (outreg, prepare_resume_reply): Adjust.
5218         * server.c: Include tdesc.h.
5219         (gdbserver_xmltarget): Delete declaration.
5220         (get_features_xml, process_serial_event): Adjust.
5221         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
5222         declare.
5223         (struct process_info) <tdesc>: New field.
5224         (ipa_tdesc): Declare.
5225         * tdesc.c: New file.
5226         * tdesc.h: New file.
5227         * tracepoint.c: Include tdesc.h.
5228         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
5229         (get_context_regcache): Adjust to pass ipa_tdesc down.
5230         (do_action_at_tracepoint): Adjust to get the register cache size
5231         from the context regcache's description.
5232         (traceframe_walk_blocks): Adjust to get the register cache size
5233         from the current trace frame's description.
5234         (traceframe_get_pc): Adjust to get current trace frame's
5235         description and pass it down.
5236         (gdb_collect): Adjust to get the register cache size from the
5237         IPA's description.
5238         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
5239         (gdbserver_xmltarget): Delete.
5240         (initialize_low_tracepoint): Set the ipa's target description.
5241         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
5242         (initialize_low_tracepoint): Set the ipa's target description.
5243         * linux-x86-low.c: Include tdesc.h.
5244         [__x86_64__] (is_64bit_tdesc): New.
5245         (ps_get_thread_area, x86_get_thread_area): Use it.
5246         (i386_cannot_store_register): Rename to ...
5247         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
5248         (i386_cannot_fetch_register): Rename to ...
5249         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
5250         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
5251         to new interface.
5252         (target_regsets): Rename to ...
5253         (x86_regsets): ... this.
5254         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
5255         interface.
5256         (x86_siginfo_fixup): Use is_64bit_tdesc.
5257         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
5258         (tdesc_x32_avx_linux, tdesc_x32_linux)
5259         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
5260         Declare.
5261         (x86_linux_update_xmltarget): Delete.
5262         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
5263         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
5264         (AMD64_LINUX_USER64_CS): New.
5265         (x86_linux_read_description): New, based on
5266         x86_linux_update_xmltarget.
5267         (same_process_callback): New.
5268         (x86_arch_setup_process_callback): New.
5269         (x86_linux_update_xmltarget): New.
5270         (x86_regsets_info): New.
5271         (amd64_linux_regs_info): New.
5272         (i386_linux_usrregs_info): New.
5273         (i386_linux_regs_info): New.
5274         (x86_linux_regs_info): New.
5275         (x86_arch_setup): Reimplement.
5276         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
5277         (x86_emit_ops): Ditto.
5278         (the_low_target): Adjust.  Install x86_linux_regs_info,
5279         x86_cannot_fetch_register, and x86_cannot_store_register.
5280         (initialize_low_arch): New.
5281         * linux-ia64-low.c (tdesc_ia64): Declare.
5282         (ia64_fetch_register): Adjust.
5283         (ia64_usrregs_info, regs_info): New globals.
5284         (ia64_regs_info): New function.
5285         (the_low_target): Adjust.
5286         (initialize_low_arch): New function.
5287         * linux-sparc-low.c (tdesc_sparc64): Declare.
5288         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
5289         Adjust.
5290         (sparc_arch_setup): New function.
5291         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
5292         (the_low_target): Adjust.
5293         (initialize_low_arch): New function.
5294         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
5295         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
5296         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
5297         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
5298         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
5299         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
5300         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
5301         (tdesc_powerpc_isa205_vsx64l): Declare.
5302         (ppc_cannot_store_register, ppc_collect_ptrace_register)
5303         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
5304         (ppc_set_pc, ppc_get_hwcap): Adjust.
5305         (ppc_usrregs_info): Forward declare.
5306         (!__powerpc64__) ppc_regmap_adjusted: New global.
5307         (ppc_arch_setup): Adjust to the current process'es target
5308         description.
5309         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
5310         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
5311         (ppc_store_evrregset): Adjust.
5312         (target_regsets): Rename to ...
5313         (ppc_regsets): ... this, and make static.
5314         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
5315         (ppc_regs_info): New function.
5316         (the_low_target): Adjust.
5317         (initialize_low_arch): New function.
5318         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
5319         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
5320         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
5321         (tdesc_s390x_linux64v2): Declare.
5322         (s390_collect_ptrace_register, s390_supply_ptrace_register)
5323         (s390_fill_gregset, s390_store_last_break): Adjust.
5324         (target_regsets): Rename to ...
5325         (s390_regsets): ... this, and make static.
5326         (s390_get_pc, s390_set_pc): Adjust.
5327         (s390_get_hwcap): New target_desc parameter, and use it.
5328         [__s390x__] (have_hwcap_s390_high_gprs): New global.
5329         (s390_arch_setup): Adjust to set the current process'es target
5330         description.  Don't adjust the regmap.
5331         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
5332         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
5333         (regs_info_3264): New globals.
5334         (s390_regs_info): New function.
5335         (the_low_target): Adjust.
5336         (initialize_low_arch): New function.
5337         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
5338         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
5339         [__mips64] (init_registers_mips_linux)
5340         (init_registers_mips_dsp_linux): Delete defines.
5341         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
5342         (have_dsp): New global.
5343         (mips_read_description): New, based on mips_arch_setup.
5344         (mips_arch_setup): Reimplement.
5345         (get_usrregs_info): New function.
5346         (mips_cannot_fetch_register, mips_cannot_store_register)
5347         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
5348         (mips_fill_fpregset, mips_store_fpregset): Adjust.
5349         (target_regsets): Rename to ...
5350         (mips_regsets): ... this, and make static.
5351         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
5352         (dsp_regs_info, regs_info): New globals.
5353         (mips_regs_info): New function.
5354         (the_low_target): Adjust.
5355         (initialize_low_arch): New function.
5356         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
5357         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
5358         Declare.
5359         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
5360         (arm_read_description): New, with bits factored from
5361         arm_arch_setup.
5362         (arm_arch_setup): Reimplement.
5363         (target_regsets): Rename to ...
5364         (arm_regsets): ... this, and make static.
5365         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
5366         (arm_regs_info): New function.
5367         (the_low_target): Adjust.
5368         (initialize_low_arch): New function.
5369         * linux-m68k-low.c (tdesc_m68k): Declare.
5370         (target_regsets): Rename to ...
5371         (m68k_regsets): ... this, and make static.
5372         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
5373         (m68k_regs_info): New function.
5374         (m68k_arch_setup): New function.
5375         (the_low_target): Adjust.
5376         (initialize_low_arch): New function.
5377         * linux-sh-low.c (tdesc_sharch): Declare.
5378         (target_regsets): Rename to ...
5379         (sh_regsets): ... this, and make static.
5380         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
5381         (sh_regs_info, sh_arch_setup): New functions.
5382         (the_low_target): Adjust.
5383         (initialize_low_arch): New function.
5384         * linux-bfin-low.c (tdesc_bfin): Declare.
5385         (bfin_arch_setup): New function.
5386         (bfin_usrregs_info, regs_info): New globals.
5387         (bfin_regs_info): New function.
5388         (the_low_target): Adjust.
5389         (initialize_low_arch): New function.
5390         * linux-cris-low.c (tdesc_cris): Declare.
5391         (cris_arch_setup): New function.
5392         (cris_usrregs_info, regs_info): New globals.
5393         (cris_regs_info): New function.
5394         (the_low_target): Adjust.
5395         (initialize_low_arch): New function.
5396         * linux-cris-low.c (tdesc_crisv32): Declare.
5397         (cris_arch_setup): New function.
5398         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
5399         (cris_regs_info): New function.
5400         (the_low_target): Adjust.
5401         (initialize_low_arch): New function.
5402         * linux-m32r-low.c (tdesc_m32r): Declare.
5403         (m32r_arch_setup): New function.
5404         (m32r_usrregs_info, regs_info): New globals.
5405         (m32r_regs_info): Adjust.
5406         (initialize_low_arch): New function.
5407         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
5408         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
5409         (tic6x_usrregs_info): Forward declare.
5410         (tic6x_read_description): New function, based on ...
5411         (tic6x_arch_setup): ... this.  Reimplement.
5412         (target_regsets): Rename to ...
5413         (tic6x_regsets): ... this, and make static.
5414         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
5415         (tic6x_regs_info): New function.
5416         (the_low_target): Adjust.
5417         (initialize_low_arch): New function.
5418         * linux-xtensa-low.c (tdesc_xtensa): Declare.
5419         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
5420         (target_regsets): Rename to ...
5421         (xtensa_regsets): ... this, and make static.
5422         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
5423         globals.
5424         (xtensa_arch_setup, xtensa_regs_info): New functions.
5425         (the_low_target): Adjust.
5426         (initialize_low_arch): New function.
5427         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
5428         (nios2_arch_setup): Set the current process'es tdesc.
5429         (target_regsets): Rename to ...
5430         (nios2_regsets): ... this.
5431         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
5432         (nios2_regs_info): New function.
5433         (the_low_target): Adjust.
5434         (initialize_low_arch): New function.
5435         * linux-aarch64-low.c (tdesc_aarch64): Declare.
5436         (aarch64_arch_setup): Set the current process'es tdesc.
5437         (target_regsets): Rename to ...
5438         (aarch64_regsets): ... this.
5439         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
5440         (aarch64_regs_info): New function.
5441         (the_low_target): Adjust.
5442         (initialize_low_arch): New function.
5443         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
5444         globals.
5445         (target_regsets): Rename to ...
5446         (tile_regsets): ... this.
5447         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
5448         (tile_regs_info): New function.
5449         (tile_arch_setup): Set the current process'es tdesc.
5450         (the_low_target): Adjust.
5451         (initialize_low_arch): New function.
5452         * spu-low.c (tdesc_spu): Declare.
5453         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
5454         * win32-arm-low.c (tdesc_arm): Declare.
5455         (arm_arch_setup): New function.
5456         (the_low_target): Install arm_arch_setup instead of
5457         init_registers_arm.
5458         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
5459         (init_windows_x86): Rename to ...
5460         (i386_arch_setup): ... this.  Set `win32_tdesc'.
5461         (the_low_target): Adjust.
5462         * win32-low.c (win32_tdesc): New global.
5463         (child_add_thread): Don't create the thread cache here.
5464         (do_initial_child_stuff): Set the new process'es tdesc.
5465         * win32-low.h (struct target_desc): Forward declare.
5466         (win32_tdesc): Declare.
5467         * lynx-i386-low.c (tdesc_i386): Declare global.
5468         (lynx_i386_arch_setup): Set `lynx_tdesc'.
5469         * lynx-low.c (lynx_tdesc): New global.
5470         (lynx_add_process): Set the new process'es tdesc.
5471         * lynx-low.h (struct target_desc): Forward declare.
5472         (lynx_tdesc): Declare global.
5473         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
5474         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
5475         * nto-low.c (nto_tdesc): New global.
5476         (do_attach): Set the new process'es tdesc.
5477         * nto-low.h (struct target_desc): Forward declare.
5478         (nto_tdesc): Declare.
5479         * nto-x86-low.c (tdesc_i386): Declare.
5480         (nto_x86_arch_setup): Set `nto_tdesc'.
5481
5482 2013-06-04  Gary Benson  <gbenson@redhat.com>
5483
5484         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
5485         to qSupported response when appropriate.
5486         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
5487         with nonzero-length annex.
5488         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
5489         arguments supplied in annex.
5490
5491 2013-05-31  Doug Evans  <dje@google.com>
5492
5493         PR server/15594
5494         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
5495         64 bits in 64-cross-32 environment.
5496
5497 2013-05-28  Pedro Alves  <palves@redhat.com>
5498
5499         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
5500         (aarch64-without-fpu.c): Delete rule.
5501         * configure.srv (aarch64*-*-linux*): Remove references to
5502         aarch64-without-fpu.o and aarch64-without-fpu.xml.
5503         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
5504         declaration.
5505
5506 2013-05-24  Pedro Alves  <palves@redhat.com>
5507
5508         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
5509         instead of strchr/decode_address.  Error if the range isn't split
5510         with a ','.  Don't assume there's be a ':' in the action.
5511
5512 2013-05-23  Yao Qi  <yao@codesourcery.com>
5513             Pedro Alves  <palves@redhat.com>
5514
5515         * linux-low.c (lwp_in_step_range): New function.
5516         (linux_wait_1): If the thread was range stepping and stopped
5517         outside the stepping range, report the stop to GDB.  Otherwise,
5518         continue stepping.  Add range stepping debug output.
5519         (linux_set_resume_request): Copy the step range from the resume
5520         request to the lwp.
5521         (linux_supports_range_stepping): New.
5522         (linux_target_ops) <supports_range_stepping>: Set to
5523         linux_supports_range_stepping.
5524         * linux-low.h (struct linux_target_ops)
5525         <supports_range_stepping>: New field.
5526         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5527         * linux-x86-low.c (x86_supports_range_stepping): New.
5528         (the_low_target) <supports_range_stepping>: Set to
5529         x86_supports_range_stepping.
5530         * server.c (handle_v_cont): Handle 'r' action.
5531         (handle_v_requests): Append ";r" if the target supports range
5532         stepping.
5533         * target.h (struct thread_resume) <step_range_start,
5534         step_range_end>: New fields.
5535         (struct target_ops) <supports_range_stepping>:
5536         New field.
5537         (target_supports_range_stepping): New macro.
5538
5539 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5540
5541         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5542         confusion in comment.
5543
5544 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5545
5546         * lynx-low.c (struct process_info_private): New type.
5547         (lynx_add_process): New function.
5548         (lynx_create_inferior, lynx_attach): Replace calls to
5549         add_process by calls to lynx_add_process.
5550         (lynx_resume): If PTID is null, then try using
5551         current_process()->private->last_wait_event_ptid.
5552         Add comments.
5553         (lynx_clear_inferiors): Delete.  The contents of that function
5554         has been inlined in lynx_mourn;
5555         (lynx_wait_1): Save the ptid in the process's private data.
5556         (lynx_mourn): Free the process' private data.  Replace call
5557         to lynx_clear_inferiors by call to clear_inferiors.
5558
5559 2013-05-17  Yao Qi  <yao@codesourcery.com>
5560
5561         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5562         the right place.
5563
5564 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5565
5566         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5567         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5568         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5569         PT_TEXT_END_ADDR guards.  Update comments.
5570         (linux_target_op) <read_offsets>: Conditionally define to
5571         linux_read_offsets if the target is UCLIBC and if it defines
5572         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5573
5574 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5575             Andrew Jenner  <andrew@codesourcery.com>
5576
5577         * Makefile.in (SFILES): Add linux-nios2-low.c.
5578         (clean): Add action to delete nios2-linux.c.
5579         (nios2-linux.c): New rule.
5580         * configure.srv: Add nios2*-*-linux*.
5581         * linux-nios2-low.c: New.
5582
5583 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5584
5585         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5586
5587 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5588
5589         PR gdb/15186
5590         * ax.c (ax_printf): Add fflush.
5591
5592 2013-04-22  Tom Tromey  <tromey@redhat.com>
5593
5594         * Makefile.in (SFILES): Add filestuff.c.
5595         (OBS): Add filestuff.o.
5596         (filestuff.o): New target.
5597         * config.in, configure: Rebuild.
5598         * configure.ac: Check for fdwalk, pipe2.
5599
5600 2013-04-17  Pedro Alves  <palves@redhat.com>
5601
5602         * configure.ac (USE_THREAD_DB): Delete variable.
5603         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5604         Don't AC_SUBST USE_THREAD_DB.
5605         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5606         * config.in, configure: Regenerate.
5607
5608 2013-04-16  Pedro Alves  <palves@redhat.com>
5609
5610         * linux-low.h (struct lwp_info) <thread_known>: Move under
5611         the USE_THREAD_DB #ifdef.
5612
5613 2013-04-16  Pedro Alves  <palves@redhat.com>
5614
5615         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5616         (linux-low.o): Delete rule.
5617         * linux-low.h: Always include "gdb_thread_db.h" instead of
5618         conditionally including thread_db.h.
5619         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5620         HAVE_THREAD_DB_H.
5621
5622 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5623
5624         * Makefile.in (install-only): Fix make install regression.
5625
5626 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5627
5628         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5629         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5630         installation.
5631         * gdbserver.1: Remove.
5632
5633 2013-03-22  Pedro Alves  <palves@redhat.com>
5634
5635         * linux-low.c (handle_extended_wait): Don't call
5636         linux_enable_event_reporting.
5637
5638 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5639
5640         PR build/9098:
5641         * Makefile.in (SHELL): Use @SHELL@.
5642
5643 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5644
5645         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5646         compiler warning.
5647
5648 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5649
5650         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5651         Remove extraneous NULL element.
5652
5653 2013-03-13  Yao Qi  <yao@codesourcery.com>
5654
5655         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5656         'V' block in trace frame.
5657
5658 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5659
5660         * target.h (struct target_ops): Add btrace ops.
5661         (target_supports_btrace): New macro.
5662         (target_enable_btrace): New macro.
5663         (target_disable_btrace): New macro.
5664         (target_read_btrace): New macro.
5665         * gdbthread.h (struct thread_info): Add btrace field.
5666         * server.c: Include btrace-common.h.
5667         (handle_btrace_general_set): New function.
5668         (handle_btrace_enable): New function.
5669         (handle_btrace_disable): New function.
5670         (handle_general_set): Call handle_btrace_general_set.
5671         (handle_qxfer_btrace): New function.
5672         (struct qxfer qxfer_packets[]): Add btrace entry.
5673         * inferiors.c (remove_thread): Disable btrace.
5674         * linux-low: Include linux-btrace.h.
5675         (linux_low_enable_btrace): New function.
5676         (linux_low_read_btrace): New function.
5677         (linux_target_ops): Add btrace ops.
5678         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5679         Add srv_linux_btrace=yes.
5680         (x86_64-*-linux*): Add linux-btrace.o.
5681         Add srv_linux_btrace=yes.
5682         * configure.ac: Define HAVE_LINUX_BTRACE.
5683         * config.in: Regenerated.
5684         * configure: Regenerated.
5685
5686 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5687
5688         * server.c (handle_qxfer): Preserve error message if -3 is
5689         returned.
5690         (qxfer): Document the -3 return value.
5691
5692 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5693
5694         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5695         (linux_btrace_h): New variable.
5696         (linux-btrace.o): New rule.
5697
5698 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5699             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5700
5701         * tracepoint.c (trace_buffer_size): New global.
5702         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5703         (init_trace_buffer): Change to one-argument function. Allocate
5704         trace buffer memory.
5705         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5706         handle QTBuffer:size packet.
5707         (cmd_bigqtbuffer_size): New function.
5708         (initialize_tracepoint): Call init_trace_buffer with
5709         DEFAULT_TRACE_BUFFER_SIZE.
5710         * server.c (handle_query): Add QTBuffer:size in the
5711         supported packets.
5712
5713 2013-03-07  Yao Qi  <yao@codesourcery.com>
5714
5715         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5716         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5717         of -1.
5718         (cmd_qtsp): Adjust condition.  Do post increment.
5719         Set cur_action and cur_step_action back to 0.
5720
5721 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5722
5723         PR server/15236
5724         * linux-low.c (linux_write_memory): Return early success if LEN is
5725         zero.
5726
5727 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5728
5729         * configure.srv: Add x86_64-*-cygwin* as target.
5730
5731 2013-02-28  Tom Tromey  <tromey@redhat.com>
5732
5733         * configure.ac: Invoke AC_SYS_LARGEFILE.
5734         * configure, config.in: Rebuild.
5735
5736 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5737
5738         * win32-low.c: Throughout, fix format strings and casts of
5739         printf-like functions to avoid type related warnings on all
5740         platforms.
5741         (get_child_debug_event): Print dwDebugEventCode as hex since
5742         that's how it's usually documented.
5743
5744 2013-02-28  Yao Qi  <yao@codesourcery.com>
5745
5746         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5747         pulongest.
5748
5749 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5750
5751         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5752         (reg-tilegx32.c): New rule.
5753         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5754         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5755         different register info initializer according to elf class.
5756         (init_registers_tilgx32): New function.  The tilegx32 register info
5757         initializer.
5758         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5759         (tile_store_gregset): Likewise.
5760
5761 2013-02-27  Yao Qi  <yao@codesourcery.com>
5762
5763         * server.c (process_point_options): Print debug message when
5764         debug_threads is true.
5765
5766 2013-02-26  Yao Qi  <yao@codesourcery.com>
5767
5768         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5769
5770 2013-02-19  Pedro Alves  <palves@redhat.com>
5771             Kai Tietz <ktietz@redhat.com>
5772
5773         PR gdb/15161
5774
5775         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5776         instead of strtoul to extract address from packet.
5777         (process_serial_event) <'z'>: Likewise.
5778
5779 2013-02-18  Yao Qi  <yao@codesourcery.com>
5780
5781         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5782
5783 2013-02-14  Pedro Alves  <palves@redhat.com>
5784
5785         Plug memory leak.
5786
5787         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5788         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5789
5790 2013-02-14  Pedro Alves  <palves@redhat.com>
5791
5792         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5793
5794 2013-02-14  Pedro Alves  <palves@redhat.com>
5795
5796         * tracepoint.c (save_string): Delete.
5797         (add_tracepoint_action): Use savestring instead of save_string.
5798
5799 2013-02-12  Pedro Alves  <palves@redhat.com>
5800
5801         * linux-xtensa-low.c: Ditto.
5802         * xtensa-xtregs.c: Ditto.
5803
5804 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5805
5806         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5807         thread_db.
5808
5809 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5810
5811         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5812         aarch64_num_wp_regs and aarch64_num_bp_regs to
5813         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5814
5815 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5816
5817         * linux-aarch64-low.c (ps_get_thread_area): Replace
5818         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5819
5820 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5821             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5822             Nigel Stephens  <nigel.stephens@arm.com>
5823             Yufeng Zhang  <yufeng.zhang@arm.com>
5824
5825         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5826         (aarch64.c, aarch64-without-fpu.c): New targets.
5827         * configure.srv (aarch64*-*-linux*): New.
5828         * linux-aarch64-low.c: New file.
5829
5830 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5831
5832         * linux-low.c (handle_extended_wait, linux_create_inferior)
5833         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5834         (dequeue_one_deferred_signal, linux_resume_one_thread)
5835         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5836         (linux_tracefork_grandchild, linux_test_for_tracefork)
5837         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5838         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5839         where the argument is 0.
5840
5841 2013-01-25  Yao Qi  <yao@codesourcery.com>
5842
5843         * event-loop.c: Include "queue.h".
5844         (gdb_event_p): New typedef.
5845         (struct gdb_event) <next_event>: Remove.
5846         (event_queue): Change to QUEUE(gdb_event_p).
5847         (async_queue_event): Remove.
5848         (gdb_event_xfree): New.
5849         (initialize_event_loop): New.
5850         (process_event): Use API from QUEUE.
5851         (wait_for_event): Likewise.
5852         * server.c (main): Call initialize_event_loop.
5853         * server.h (initialize_event_loop): Declare.
5854
5855 2013-01-18  Yao Qi  <yao@codesourcery.com>
5856
5857         * ax.h (struct eval_agent_expr_context): New.
5858         (gdb_eval_agent_expr): Update declaration.
5859         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5860         TFRAME.  Add new argument CTX.
5861         * server.h (struct eval_agent_expr_context): Declare.
5862         (agent_mem_read, agent_tsv_read): Update declaration.
5863         (agent_mem_read_string): Likewise.
5864         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5865         (add_traceframe_block): Add new argument TPOINT.
5866         Increase TPOINT->traceframe_usage.
5867         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5868         eval_tracepoint_agent_expr.
5869         (condition_true_at_tracepoint): Likewise.
5870         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5871         (agent_mem_read_string, agent_tsv_read): Likewise.
5872
5873 2013-01-16  Yao Qi  <yao@codesourcery.com>
5874
5875         * linux-low.c (linux_resume_one_lwp): Don't check
5876         'lwp->bp_reinsert != 0'.
5877
5878 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5879             Pedro Alves  <palves@redhat.com>
5880
5881         * lynx-low.c (ptrace_request_to_str): Define a temporary
5882         macro and use it to simplify this function's implementation.
5883
5884 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5885
5886         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5887         sets errno.
5888
5889 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5890
5891         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5892
5893 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5894
5895         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5896
5897 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5898
5899         * lynx-low.c (lynx_resume): Use the resume_info parameter
5900         to determine the ptid for the lynx_ptrace call, unless
5901         it is equal to minus_one_ptid, in which case we use the
5902         ptid of the current_inferior.
5903         (lynx_wait_1): After having received a thread create/exit
5904         event, resume the inferior's execution using the signaling
5905         thread's ptid, rather than the old ptid.
5906
5907 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5908
5909         * lynx-low.c (lynx_resume): Delete variable ret.
5910
5911 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5912
5913         * gdbreplay.c (gdbreplay_version): Update copyright year.
5914         * server.c (gdbserver_version): Likewise.
5915
5916 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5917
5918         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5919         new thread.
5920
5921 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5922
5923         * lynx-low.c (ptrace_request_to_str): Add handling for
5924         PTRACE_GETTRACESIG.
5925
5926 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5927
5928         * lynx-low.c (lynx_attach): Delete variable new_process.
5929
5930 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5931
5932         * lynx-low.c (lynx_create_inferior): Delete variable
5933         new_process.
5934
5935 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5936
5937         * lynx-low.c (ptrace_request_to_str): Do not handle
5938         PTRACE_GETTHREADLIST if this macro does not exist.
5939
5940 2012-12-15  Yao Qi  <yao@codesourcery.com>
5941
5942         * Makefile.in (OBS): Add notif.o.
5943         * notif.c, notif.h: New.
5944         * server.c: Include "notif.h".
5945         (struct vstop_notif) <next>: Remove.
5946         <base>: New field.
5947         (queue_stop_reply): Update.
5948         (push_event, send_next_stop_reply): Remove.
5949         (discard_queued_stop_replies): Update.
5950         (notif_stop): New variable.
5951         (handle_v_stopped): Remove.
5952         (handle_v_requests): Don't call handle_v_stopped.  Call
5953         handle_ack_notif instead.
5954         (queue_stop_reply_callback): Call notif_event_enque instead
5955         of queue_stop_reply.
5956         (handle_status): Don't call send_next_stop_reply, call
5957         notif_write_event instead.
5958         (kill_inferior_callback): Likewise.
5959         (detach_or_kill_inferior_callback): Likewise.
5960         (main): Call initialize_notif.
5961         (process_serial_event): Call QUEUE_is_empty.
5962         (handle_target_event): Call notif_push instead of push event.
5963         * server.h (push_event): Remove declaration.
5964
5965 2012-12-10  Tom Tromey  <tromey@redhat.com>
5966
5967         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5968         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5969         macros.
5970         (.c.o): Rewrite.
5971         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5972         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5973         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5974         (amd64-linux-ipa.o, ax.o): Rewrite.
5975         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5976         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5977         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5978         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5979         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5980         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5981         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5982         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5983         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5984         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5985         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5986         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5987         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5988         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5989         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5990         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5991         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5992         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5993         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5994         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5995         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5996         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5997         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5998         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5999         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
6000         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
6001         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
6002         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
6003         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
6004         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
6005         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
6006         (reg-tilegx.o): Remove.
6007         (all_object_files): New macro.
6008         Include .deps files.
6009         * aclocal.m4, configure: Rebuild.
6010         * acinclude.m4: Include depstand.m4, lead-dot.m4.
6011         * configure.ac: Invoke ZW_CREATE_DEPDIR,
6012         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
6013
6014 2012-12-05  Tom Tromey  <tromey@redhat.com>
6015
6016         PR gdb/14917:
6017         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
6018
6019 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
6020
6021         * configure.ac: Check for linux/perf_event.h.
6022         * config.in: Regenerated.
6023         * configure: Regenerated.
6024
6025 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
6026
6027         * hostio.c (handle_readlink): Decrease buffer size
6028         parameter passed to readlink by one byte.
6029
6030 2012-11-26  Yao Qi  <yao@codesourcery.com>
6031
6032         * configure.ac (build_warnings): Append '-Wempty-body'.
6033         * configure: Regenerated.
6034         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
6035         body.
6036
6037 2012-11-15  Pierre Muller  <muller@sourceware.org>
6038
6039         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
6040         * config.in: Regenerate.
6041         * configure: Regenerate.
6042         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
6043         Use "gdb_wait.h" header instead of <sys/wait.h> header.
6044         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
6045         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
6046         header.
6047         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
6048         instead of <sys/wait.h> header.
6049         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
6050
6051 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
6052
6053         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
6054         (various make rules): Remove -DGDBSERVER
6055
6056 2012-11-09  Yao Qi  <yao@codesourcery.com>
6057
6058         * spu-low.c (current_ptid): Move it to ..
6059         * gdbthread.h: ... here.  New.
6060         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
6061         * server.c (myresume, process_serial_event): Likewise.
6062         * thread-db.c (thread_db_find_new_threads): Likewise.
6063         * tracepoint.c (run_inferior_command): Likewise.
6064
6065 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
6066
6067         * server.c (handle_search_memory_1): Include access length in
6068         warning message.
6069
6070 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
6071
6072         * linux-crisv32-low.c: Fix compile errors.
6073
6074 2012-09-04  Yao Qi  <yao@codesourcery.com>
6075
6076         * tracepoint.c (cmd_qtsv): Adjust debug message.
6077         Don't check CUR_TPOINT.
6078
6079 2012-08-28  Yao Qi  <yao@codesourcery.com>
6080
6081         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
6082         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
6083         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
6084         Remove declarations of xmalloc, xreallloc, xstrdup and
6085         freeargv.
6086         * Makefile.in (libiberty_h): New.
6087         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
6088         (linux-bfin-low.o): Append dependency 'libiberty.h'.
6089
6090 2012-08-23  Yao Qi  <yao@codesourcery.com>
6091
6092         * server.h: Remove declaration of 'xsnprintf'.
6093
6094 2012-08-22  Keith Seitz  <keiths@redhat.com>
6095
6096         * server.h: Include build-gnulib-gbserver/config.h.
6097         * gdbreplay.c: Likewise.
6098
6099 2012-08-08  Doug Evans  <dje@google.com>
6100
6101         * Makefile.in (SFILES): Add gdb_vecs.c.
6102         (OBS): Add gdb_vecs.o.
6103         (gdb_vecs_h, host_defs_h): New variables.
6104         (thread-db.o): Add $(gdb_vecs_h) dependency.
6105         (gdb_vecs.o): New rule.
6106         * thread-db.c: #include "gdb_vecs.h".
6107         (thread_db_load_search): Use a vector to iterate over path elements.
6108         Handle text appearing after "$pdir".
6109
6110         * configure.ac: Add check for strstr.
6111         * config.in: Regenerate.
6112         * configure: Regenerate.
6113
6114 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
6115
6116         * hostio.c (handle_pread): If pread fails, fall back to attempting
6117         lseek/read.
6118         (handle_pwrite): Likewise for pwrite.
6119
6120 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
6121
6122         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
6123         between unsupported TYPE and unimplementable ADDR/LEN combination.
6124         (arm_insert_point): Act on new return value.
6125
6126 2012-07-31  Pedro Alves  <palves@redhat.com>
6127
6128         * server.c (process_point_options): Only skip tokens if we find
6129         one that is unrecognized.  Don't treat 'X' specially while
6130         skipping unrecognized tokens.
6131
6132 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
6133
6134         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
6135         to 4-byte-align HW breakpoint addresses for Thumb.
6136
6137 2012-07-27  Yao Qi  <yao@codesourcery.com>
6138
6139         PR remote/14161.
6140
6141         * server.h: Declare gdb_agent_about_to_close.
6142         * target.c (kill_inferior): Include "agent.h".
6143         New.  Send command 'kill'.
6144         * target.h (kill_inferior): Removed macro.
6145         * tracepoint.c (gdb_agent_about_to_close): New.
6146         (gdb_agent_helper_thread): Handle command 'close'.
6147         Wait endlessly until the inferior stops.
6148         Install gdb_agent_remove_socket to atexit hook.
6149         (agent_socket_name): New static variable.
6150         (gdb_agent_socket_init): Replace local variable 'name' with
6151         'agent_socket_name'.
6152         (gdb_agent_remove_socket): New.
6153
6154 2012-07-27  Yao Qi  <yao@codesourcery.com>
6155
6156         * server.c (process_point_options): Stop at 'X' when parsing.
6157
6158 2012-07-19  Michael Eager  <eager@eagercon.com>
6159
6160         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
6161         to hw_execute.
6162         * linux-x86-low.c (x86_insert_point, x86_remove_point):
6163         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
6164         hardware breakpoint.
6165
6166 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
6167
6168         * gdbserver/linux-low.c (initialize_low): Call
6169         linux_ptrace_init_warnings.
6170
6171 2012-07-02  Doug Evans  <dje@google.com>
6172
6173         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
6174         pointer to int.
6175
6176 2012-07-02  Stan Shebs  <stan@codesourcery.com>
6177
6178         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
6179         (ax.o): Add it to build rule.
6180         (ax-ipa.o): Ditto.
6181         (OBS): Add format.o.
6182         (IPA_OBS): Add format.o.
6183         * server.c (handle_query): Claim support for breakpoint commands.
6184         (process_point_options): Add command case.
6185         (process_serial_event): Leave running if there are printfs in
6186         effect.
6187         * mem-break.h (any_persistent_commands): Declare.
6188         (add_breakpoint_commands): Declare.
6189         (gdb_no_commands_at_breakpoint): Declare.
6190         (run_breakpoint_commands): Declare.
6191         * mem-break.c (struct point_command_list): New struct.
6192         (struct breakpoint): New field command_list.
6193         (any_persistent_commands): New function.
6194         (add_commands_to_breakpoint): New function.
6195         (add_breakpoint_commands): New function.
6196         (gdb_no_commands_at_breakpoint): New function.
6197         (run_breakpoint_commands): New function.
6198         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
6199         locally.
6200         * ax.c: Include format.h.
6201         (ax_printf): New function.
6202         (gdb_eval_agent_expr): Add printf opcode.
6203
6204 2012-06-13  Yao Qi  <yao@codesourcery.com>
6205
6206         * server.c (start_inferior): Remove duplicated writes to fields
6207         'last_resume_kind' and 'last_status' of 'current_inferior'.
6208
6209 2012-06-12  Yao Qi  <yao@codesourcery.com>
6210             Pedro Alves  <palves@redhat.com>
6211
6212         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
6213         comment.
6214         * server.c (handle_v_cont): Extend comment.
6215
6216 2012-06-11  Yao Qi  <yao@codesourcery.com>
6217
6218         * linux-low.c (linux_attach): Add 'static'.
6219
6220 2012-06-06  Yao Qi  <yao@codesourcery.com>
6221
6222         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
6223
6224 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
6225
6226         Fix gcc -flto compilation warning.
6227         * server.c (main): Make variable multi_mode and attach volatile.
6228
6229 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6230
6231         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
6232         if the platform doesn't know about it.
6233
6234 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
6235
6236         * Makefile.in (SFILES): Add linux-tile-low.c.
6237         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
6238         * configure.srv: Handle tilegx-*-linux*.
6239         * linux-tile-low.c: New file.
6240
6241 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
6242
6243         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
6244
6245 2012-05-24  Pedro Alves  <palves@redhat.com>
6246
6247         PR gdb/7205
6248
6249         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
6250
6251 2012-05-24  Pedro Alves  <palves@redhat.com>
6252
6253         PR gdb/7205
6254
6255         Replace target_signal with gdb_signal throughout.
6256
6257 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
6258
6259         * linux-low.c (linux_store_registers): Avoid the copying sequence
6260         when no data has been retrieved by ptrace.
6261
6262 2012-05-22  Will Deacon  <will.deacon@arm.com>
6263
6264         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
6265         Include asm/ptrace.h.
6266         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
6267         already defined.
6268
6269 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
6270
6271         * linux-low.c (linux_store_registers): Don't re-retrieve data
6272         with ptrace that has already been obtained from /proc.  Always
6273         copy any data retrieved with ptrace to the buffer supplied.
6274
6275 2012-05-11  Yao Qi  <yao@codesourcery.com>
6276             Pedro Alves  <palves@redhat.com>
6277
6278         * linux-low.c (enum stopping_threads_kind): New.
6279         (stopping_threads): Change type to `enum stopping_threads_kind'.
6280         (handle_extended_wait): If stopping and suspending threads, leave
6281         the new_lwp suspended too.
6282         (linux_wait_for_event): Adjust.
6283         (stop_all_lwps): Set `stopping_threads' to
6284         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
6285         whether we're suspending threads or just stopping them.  Assert no
6286         recursion happens.
6287
6288 2012-04-29  Yao Qi  <yao@codesourcery.com>
6289
6290         * server.h: Move some code to ...
6291         * gdbthread.h: ... here.  New.
6292         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
6293         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
6294         (nto-low.o, win32-low.o): Likewise.
6295         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
6296         * regcache.c, remote-utils.c, server.c: Likewise.
6297         * target.c, tracepoint.c, win32-low.c: Likewise.
6298
6299 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6300
6301         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
6302         (PTRACE_ARG4_TYPE): Likewise.
6303         (PTRACE_XFER_TYPE): Likewise.
6304         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
6305         ptrace to PTRACE_ARG3_TYPE.
6306         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
6307         (PTRACE_ARG4_TYPE): Likewise.
6308         (PTRACE_XFER_TYPE): Likewise.
6309         (linux_detach_one_lwp): Cast fourth argument of
6310         ptrace to long then PTRACE_ARG4_TYPE.
6311         (regsets_fetch_inferior_registers): Cast third argument of
6312         ptrace to long then PTRACE_ARG3_TYPE.
6313         (regsets_store_inferior_registers): Likewise.
6314
6315 2012-04-20  Pedro Alves  <palves@redhat.com>
6316
6317         * configure: Regenerate.
6318
6319 2012-04-19  Pedro Alves  <palves@redhat.com>
6320
6321         * Makefile.in (GNULIB_BUILDDIR): New.
6322         (LIBGNU, INCGNU, GNULIB_H): Adjust.
6323         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
6324         (all, install-only, uninstall, clean-info, all-lib, clean): No
6325         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
6326         (maintainer-clean realclean distclean): Use subdir_do.
6327         (subdir_do): New.
6328         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
6329         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
6330         * acinclude.m4: Include acx_configure_dir.m4.
6331         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
6332         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
6333         ACX_CONFIGURE_DIR.
6334         (GNULIB): New.
6335         (GNULIB_STDINT_H): Adjust.
6336         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
6337         * gdbreplay.c: Include build-gnulib/config.h.
6338         * server.h: Likewise.
6339         * aclocal.m4: Regenerate.
6340         * config.in: Regenerate.
6341         * configure: Regenerate.
6342
6343 2012-04-19  Pedro Alves  <palves@redhat.com>
6344
6345         * Makefile.in (LIBGNU, INCGNU): Adjust.
6346         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
6347         (all, install-only, uninstall, clean-info, all-lib, clean)
6348         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
6349         * configure.ac: Adjust AC_OUTPUT output.
6350         * aclocal.m4: Regenerate.
6351         * configure: Regenerate.
6352
6353 2012-04-19  Pedro Alves  <palves@redhat.com>
6354
6355         * Makefile.in (generated_files): New.
6356         (server_h): Remove the explicit dependency on config.h, and depend
6357         on $generated_files.
6358
6359 2012-04-19  Pedro Alves  <palves@redhat.com>
6360
6361         * Makefile.in (INCGNU): Add -Ignulib.
6362
6363 2012-04-19  Pedro Alves  <palves@redhat.com>
6364
6365         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
6366         (INCGNU): ... this, and spell out -I here.
6367         (GNULIB_LIB): Rename to ...
6368         (LIBGNU): ... this.
6369         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
6370
6371 2012-04-19  Pedro Alves  <palves@redhat.com>
6372
6373         * config.in: Regenerate.
6374
6375 2012-04-19  Pedro Alves  <palves@redhat.com>
6376
6377         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
6378         * server.h (memmem): Remove declaration.
6379         * config.in: Regenerate.
6380         * configure: Regenerate.
6381
6382 2012-04-19  Yao Qi  <yao@codesourcery.com>
6383
6384         * Makefile.in (SFILES): Add common/vec.c.
6385         (OBS): Add vec.o.
6386         (vec.o): New rule.
6387
6388 2012-04-19  Yao Qi  <yao@codesourcery.com>
6389
6390         * remote-utils.c (prepare_resume_reply): Replace with macro
6391         target_core_of_thread.
6392         * server.c (handle_qxfer_threads_proper): Likewise.
6393         * target.h (traget_core_of_thread): New macro.
6394
6395 2012-04-18  Pedro Alves  <palves@redhat.com>
6396
6397         * aclocal.m4: Regenerate.
6398         * configure: Regenerate.
6399
6400 2012-04-16  Yao Qi  <yao@codesourcery.com>
6401
6402         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
6403         duplicated on address.
6404
6405 2012-04-16  Yao Qi  <yao@codesourcery.com>
6406
6407         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
6408         (struct tracepoint_action_ops) <send>: New field.
6409         (m_tracepoint_action_send, r_tracepoint_action_send): New.
6410         (agent_expr_send, x_tracepoint_action_send): New.
6411         (l_tracepoint_action_send): New.
6412         (cmd_qtdp): Download and install tracepoint
6413         according to `use_agent'.
6414         (run_inferior_command): Add one more parameter `len'.
6415         Update callers.
6416         (tracepoint_send_agent): New.
6417         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
6418
6419 2012-04-16  Yao Qi  <yao@codesourcery.com>
6420
6421         * tracepoint.c (download_tracepoints): Moved to ...
6422         (cmd_qtstart): ... here.
6423
6424 2012-04-14  Yao Qi  <yao@codesourcery.com>
6425
6426         * tracepoint.c: Include inttypes.h.
6427         (struct collect_memory_action): Use sized types.
6428         (struct tracepoint): Likewise.
6429         (cmd_qtdp, stop_tracing): Update print specifiers.
6430         (cmd_qtp, response_tracepoint): Likewise.
6431         (collect_data_at_tracepoint): Likewise.
6432         (collect_data_at_step): Likewise.
6433
6434 2012-04-14  Yao Qi  <yao@codesourcery.com>
6435
6436         Import gnulib module inttypes.
6437         * aclocal.m4, config.in, configure: Regenerated.
6438
6439 2012-04-14  Yao Qi  <yao@codesourcery.com>
6440
6441         * Makefile.in (maintainer-clean, realclean, distclean): Remove
6442         Makefile and config.status at last.
6443
6444 2012-04-13  Yao Qi  <yao@codesourcery.com>
6445
6446         * tracepoint.c: Include stdint.h unconditionally.
6447
6448 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6449
6450         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
6451         on BFD_HAVE_SYS_PROCFS_TYPE.
6452         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
6453         * configure: Regenerate.
6454         * config.in: Likewise.
6455
6456 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
6457
6458         * Makefile.in (clean): Also remove x32.c x32-linux.c
6459         x32-avx.c x32-avx-linux.c.
6460         (x32.o): New target.
6461         (x32.c): Likewise.
6462         (x32-linux.o): Likewise.
6463         (x32-linux.c): Likewise.
6464         (x32-avx.o): Likewise.
6465         (x32-avx.c): Likewise.
6466         (x32-avx-linux.o): Likewise.
6467         (x32-avx-linux.c): Likewise.
6468
6469         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
6470         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
6471         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
6472         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
6473         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
6474         i386/x32-avx-linux.xml.
6475
6476         * linux-x86-low.c (init_registers_x32_linux): New prototype.
6477         (init_registers_x32_avx_linux): Likwise.
6478         (x86_linux_update_xmltarget): Call init_registers_x32_linux
6479         or init_registers_x32_avx_linux if linux_is_elf64 is false.
6480
6481 2012-04-13  Pedro Alves  <palves@redhat.com>
6482
6483         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
6484         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
6485         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
6486         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
6487         the sub-make.
6488
6489 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6490
6491         * linux-x86-low.c (compat_x32_clock_t): New.
6492         (compat_x32_siginfo_t): Likewise.
6493         (compat_x32_siginfo_from_siginfo): Likewise.
6494         (siginfo_from_compat_x32_siginfo): Likewise.
6495         (linux_is_elf64): Likewise.
6496         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
6497         and siginfo_from_compat_x32_siginfo for x32.
6498         (x86_arch_setup): Set linux_is_elf64.
6499
6500 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6501
6502         PR gdb/13969
6503         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
6504         e_machine field.
6505         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
6506         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
6507         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
6508         compatible with process.
6509
6510 2012-04-12  Yao Qi  <yao@codesourcery.com>
6511
6512         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
6513         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
6514         (install-only, install-info, clean): Handle sub dir gnulib.
6515         (all-lib, am--refresh): New targets.
6516         (memmem.o): Remove target.
6517         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6518         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6519         (AC_REPLACE_FUNCS): Remove memmem.
6520         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6521         (AC_OUTPUT): Generate Makefile in gnulib/.
6522         * aclocal.m4, config.in, configure: Regenerated.
6523
6524 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6525
6526         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6527
6528 2012-04-05  Pedro Alves  <palves@redhat.com>
6529
6530         -Werror=strict-aliasing
6531
6532         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6533         pointer.
6534
6535 2012-04-04  Pedro Alves  <palves@redhat.com>
6536
6537         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6538         (sparc_store_gregset_from_stack, sparc_store_gregset)
6539         (sparc_breakpoint_at): Fix formatting.
6540
6541 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6542
6543         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6544         are available.
6545         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6546         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6547         * config.in: Regenerate.
6548         * configure: Likewise.
6549
6550 2012-03-29  Pedro Alves  <palves@redhat.com>
6551
6552         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6553         Correct ptrace arguments.
6554
6555 2012-03-28  Pedro Alves  <palves@redhat.com>
6556
6557         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6558         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6559         (IA64_FR1_REGNUM): New defines.
6560         (ia64_fetch_register): New.
6561         (the_low_target): Install it.
6562         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6563         field.
6564         * linux-low.c (linux_fetch_registers): Try the
6565         the_low_target.fetch_register hook first.
6566
6567         * linux-arm-low.c (the_low_target): Adjust.
6568         * linux-bfin-low.c (the_low_target): Adjust.
6569         * linux-cris-low.c (the_low_target): Adjust.
6570         * linux-crisv32-low.c (the_low_target): Adjust.
6571         * linux-m32r-low.c (the_low_target): Adjust.
6572         * linux-m68k-low.c (the_low_target): Adjust.
6573         * linux-mips-low.c (the_low_target): Adjust.
6574         * linux-ppc-low.c (the_low_target): Adjust.
6575         * linux-s390-low.c (the_low_target): Adjust.
6576         * linux-sh-low.c (the_low_target): Adjust.
6577         * linux-sparc-low.c (the_low_target): Adjust.
6578         * linux-tic6x-low.c (the_low_target): Adjust.
6579         * linux-x86-low.c (the_low_target): Adjust.
6580         * linux-xtensa-low.c (the_low_target): Adjust.
6581
6582 2012-03-26  Pedro Alves  <palves@redhat.com>
6583
6584         * server.c (handle_qxfer_libraries): Don't bail early if
6585         the_target->qxfer_libraries_svr4 is not NULL.
6586
6587 2012-03-26  Pedro Alves  <palves@redhat.com>
6588
6589         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6590
6591 2012-03-23  Pedro Alves  <palves@redhat.com>
6592
6593         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6594         "library-list-svr4" element's start tag when the the DSO list is
6595         empty.
6596
6597 2012-03-23  Pedro Alves  <palves@redhat.com>
6598
6599         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6600         a variable whose type size is the same as the inferior's pointer
6601         size.
6602
6603 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6604
6605         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6606         struct siginfo.
6607         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6608         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6609         * linux-low.h: Include <signal.h>.
6610         (struct siginfo): Remove forward declaration.
6611         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6612         struct siginfo.
6613
6614 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6615
6616         * .gitignore: Ignore more files.
6617
6618 2012-03-19  Pedro Alves  <palves@redhat.com>
6619             Jan Kratochvil  <jan.kratochvil@redhat.com>
6620
6621         * server.c (cont_thread, general_thread): Add describing comments.
6622         (start_inferior): Clear `cont_thread'.
6623         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6624         of a process.
6625
6626 2012-03-15  Yao Qi  <yao@codesourcery.com>
6627
6628         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6629         handling to ...
6630         (cmd_qtdp): ... here.
6631
6632 2012-03-15  Yao Qi  <yao@codesourcery.com>
6633
6634         * tracepoint.c (struct tracepoint_action_ops): New.
6635         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6636         (m_tracepoint_action_download): New.
6637         (r_tracepoint_action_download): New.
6638         (x_tracepoint_action_download): New.
6639         (l_tracepoint_action_download): New.
6640         (add_tracepoint_action): Install `action->ops' according type.
6641         (download_tracepoint_1): Move code `download' function pointer
6642         of various tracepoint_action_ops.
6643
6644 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6645
6646         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6647         linux_ptrace_attach_warnings.
6648
6649 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6650
6651         * Makefile.in (linux-ptrace.o): New.
6652         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6653         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6654         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6655         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6656         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6657         of these targets.
6658         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6659
6660 2012-03-08  Yao Qi  <yao@codesourcery.com>
6661             Pedro Alves  <palves@redhat.com>
6662
6663         Fix PR server/13392.
6664         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6665         offset of JMP insn.
6666         * tracepoint.c (remove_tracepoint): New.
6667         (cmd_qtdp): Call remove_tracepoint when failed to install.
6668
6669 2012-03-07  Pedro Alves  <palves@redhat.com>
6670
6671         * linux-low.c (get_detach_signal): New.
6672         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6673         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6674         ptrace call.
6675         * server.c (program_signals, program_signals_p): New.
6676         (handle_general_set): Handle QProgramSignals.
6677         * server.h (program_signals, program_signals_p): Declare.
6678
6679 2012-03-05  Pedro Alves  <palves@redhat.com>
6680             Jan Kratochvil  <jan.kratochvil@redhat.com>
6681
6682         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6683         New comment why.
6684
6685 2012-03-03  Yao Qi  <yao@codesourcery.com>
6686
6687         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6688         agent_look_up_symbols.
6689
6690 2012-03-03  Yao Qi  <yao@codesourcery.com>
6691
6692         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6693         (linux-x86-low.o): Likewise.
6694         * server.h: Remove in_process_agent_loaded.
6695         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6696         common/agent.c.
6697         Update callers.
6698
6699 2012-03-03  Yao Qi  <yao@codesourcery.com>
6700
6701         * tracepoint.c (gdb_agent_capability): New global.
6702         (in_process_agent_loaded_ust): Renamed to
6703         `in_process_agent_supports_ust'.
6704         Update callers.
6705         (in_process_agent_supports_ust): Call agent_capability_check.
6706         (clear_installed_tracepoints): Assert that agent supports
6707         agent.
6708
6709 2012-03-03  Yao Qi  <yao@codesourcery.com>
6710
6711         * linux-low.c (linux_supports_agent): New.
6712         (linux_target_ops): Initialize field `supports_agent' with
6713         linux_supports_agent.
6714         * target.h (struct target_ops) <supports_agent>: New.
6715         (target_supports_agent): New macro.
6716         * server.c (handle_general_set): Handle packet 'QAgent'.
6717         (handle_query): Send `QAgent+'.
6718         * Makefile.in (server.o): Depends on agent.h.
6719
6720 2012-03-03  Yao Qi  <yao@codesourcery.com>
6721
6722         * Makefile.in (OBS): Add agent.o.
6723         Add new rule for agent.o.
6724         Track dependence of tracepoint.c on agent.h.
6725         * tracepoint.c (run_inferior_command_1):
6726         (run_inferior_command): Call agent_run_command.
6727         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6728         common/agent.c.
6729         (resume_thread, stop_thread): Likewise.
6730         (gdb_ust_socket_init): Renamed to ...
6731         (gdb_agent_socket_init): ... New.
6732         (gdb_ust_thread): Renamed to ...
6733         (gdb_agent_helper_thread): ... New.
6734         (gdb_ust_init): Move some code to ...
6735         (gdb_agent_init): ... here.  New.
6736         [HAVE_UST]: Call gdb_ust_init.
6737         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6738         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6739         * config.in, configure: Regenerated.
6740
6741 2012-03-02  Pedro Alves  <palves@redhat.com>
6742
6743         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6744         * linux-low.c (struct simple_pid_list): New.
6745         (stopped_pids): New a struct simple_pid_list pointer.
6746         (add_to_pid_list, pull_pid_from_list): New.
6747         (handle_extended_wait): Don't assume the first signal new children
6748         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6749         (linux_wait_for_lwp): Adjust.
6750
6751 2012-03-02  Yao Qi  <yao@codesourcery.com>
6752
6753         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6754         debug log.
6755
6756 2012-03-02  Yao Qi  <yao@codesourcery.com>
6757
6758         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6759         `stop_pc' and `tpoint'.  Update caller.
6760
6761 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6762
6763         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6764         * linux-low.c (use_linux_regsets): New macro.
6765         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6766         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6767         (linux_register_in_regsets): New function.
6768         (usr_fetch_inferior_registers): Skip registers covered by
6769         regsets.
6770         (usr_store_inferior_registers): Likewise.
6771         (usr_fetch_inferior_registers): New macro.
6772         (usr_store_inferior_registers): Likewise.
6773         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6774         (linux_store_registers): Likewise.
6775         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6776         prototype.
6777         (init_registers_mips64_dsp_linux): Likewise.
6778         (init_registers_mips_linux): New macro.
6779         (init_registers_mips_dsp_linux): Likewise.
6780         (mips_dsp_num_regs): Likewise.
6781         (DSP_BASE, DSP_CONTROL): New fallback macros.
6782         (mips_base_regs): New macro.
6783         (mips_regmap): Use it.  Fix the size.
6784         (mips_dsp_regmap): New variable.
6785         (mips_dsp_regset_bitmap): Likewise.
6786         (mips_arch_setup): New function.
6787         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6788         than mips_regmap.
6789         (mips_cannot_store_register): Likewise.
6790         (the_low_target): Update .arch_setup, .num_regs and .regmap
6791         initializers.  Add .regset_bitmap initializer.
6792         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6793         initializer.
6794         * linux-bfin-low.c (the_low_target): Likewise.
6795         * linux-cris-low.c (the_low_target): Likewise.
6796         * linux-crisv32-low.c (the_low_target): Likewise.
6797         * linux-ia64-low.c (the_low_target): Likewise.
6798         * linux-m32r-low.c (the_low_target): Likewise.
6799         * linux-m68k-low.c (the_low_target): Likewise.
6800         * linux-ppc-low.c (the_low_target): Likewise.
6801         * linux-s390-low.c (the_low_target): Likewise.
6802         * linux-sh-low.c (the_low_target): Likewise.
6803         * linux-sparc-low.c (the_low_target): Likewise.
6804         * linux-tic6x-low.c (the_low_target): Likewise.
6805         * linux-x86-low.c (the_low_target): Likewise.
6806         * linux-xtensa-low.c (the_low_target): Likewise.
6807         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6808         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6809         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6810         srv_xmlfiles.
6811         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6812         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6813
6814 2012-02-29  Yao Qi  <yao@codesourcery.com>
6815             Pedro Alves  <palves@redhat.com>
6816
6817         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6818         `step_over_finished' is true.
6819
6820 2012-02-27  Pedro Alves  <palves@redhat.com>
6821
6822         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6823         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6824
6825 2012-02-27  Pedro Alves  <palves@redhat.com>
6826
6827         PR server/9684
6828         * linux-low.c (pid_is_stopped): New.
6829         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6830
6831 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6832
6833         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6834         of conditions.
6835
6836 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6837
6838         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6839
6840 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6841
6842         * server.c (handle_query): Advertise support for target-side
6843         breakpoint condition evaluation.
6844         (process_point_options): New function.
6845         (process_serial_event): When inserting a breakpoint, check for
6846         a target-side condition that should be evaluated.
6847
6848         * mem-break.c: Include regcache.h and ax.h.
6849         (point_cond_list_t): New data structure.
6850         (breakpoint) <cond_list>: New field.
6851         (find_gdb_breakpoint_at): Make non-static.
6852         (delete_gdb_breakpoint_at): Clear any target-side
6853         conditions.
6854         (clear_gdb_breakpoint_conditions): New function.
6855         (add_condition_to_breakpoint): Likewise.
6856         (add_breakpoint_condition): Likewise.
6857         (gdb_condition_true_at_breakpoint): Likewise.
6858         (gdb_breakpoint_here): Return result directly instead
6859         of going through a local variable.
6860
6861         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6862         (clear_gdb_breakpoint_conditions): Likewise.
6863         (add_breakpoint_condition): Likewise.
6864         (gdb_condition_true_at_breakpoint): Likewise.
6865
6866         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6867         (need_step_over_p): Take target-side breakpoint condition into
6868         consideration.
6869
6870 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6871
6872         * server.h: Include tracepoint.h.
6873         (agent_mem_read, agent_get_trace_state_variable_value,
6874         agent_set_trace_state_variable_value,
6875         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6876         get_set_tsv_func_addr): New prototypes.
6877
6878         * ax.h: New include file.
6879         * ax.c: New source file.
6880
6881         * tracepoint.c: Include ax.h.
6882         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6883         agent_expr, eval_result_type): Move to ax.h.
6884         (parse_agent_expr): Rename to ...
6885         (gdb_parse_agent_expr): ... this, make it non-static and move
6886         to ax.h.
6887         (unparse_agent_expr) Rename to ...
6888         (gdb_unparse_agent_expr): ... this, make it non-static and move
6889         to ax.h.
6890         (eval_agent_expr): Rename to ...
6891         (eval_tracepoint_agent_expr): ... this.
6892         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6893         forward declarations.
6894         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6895         (agent_get_trace_state_variable_value): New function.
6896         (agent_set_trace_state_variable_value): New function.
6897         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6898         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6899         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6900         (condition_true_at_tracepoint): Likewise.
6901         (parse_agent_expr): Rename to ...
6902         (gdb_parse_agent_expr): ... this and move to ax.c.
6903         (unparse_agent_expr): Rename to ...
6904         (gdb_unparse_agent_expr): ... this and move to ax.c.
6905         (gdb_agent_op_name): Move to ax.c.
6906         (eval_agent_expr): Rename to ...
6907         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6908         and move to ax.c.
6909         (eval_tracepoint_agent_expr): New function.
6910         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6911         non-static.
6912         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6913         ax.c.
6914         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6915         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6916         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6917         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6918         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6919         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6920         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6921         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6922         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6923         (compile_bytecodes): Remove forward declaration.
6924         (is_goto_target): Move to ax.c.
6925         (compile_bytecodes): Move to ax.c and call
6926         agent_get_trace_state_variable_value (...) and
6927         agent_set_trace_state_variable_value (...).
6928
6929         * Makefile.in: Update ax.c and IPA dependencies.
6930
6931 2012-02-24  Pedro Alves  <palves@redhat.com>
6932
6933         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6934         (cmd_bigqtbuffer_circular): ... this.  Only handle
6935         'QTBuffer:circular:'.
6936         (handle_tracepoint_general_set): Adjust.
6937
6938 2012-02-16  Yao Qi  <yao@codesourcery.com>
6939
6940         * inferiors.c: Move code to ...
6941         * dll.c: .... here.  New.
6942         * server.h: Declare clear_dlls.
6943         * Makefile.in (SFILES): Add dll.c.
6944         (OBS): Add dll.o
6945         (dll.o): New rule.
6946
6947 2012-02-11  Yao Qi  <yao@codesourcery.com>
6948
6949         * server.c: (handle_monitor_command): Add a new parameter
6950         `own_buf'.
6951         (handle_query): Update caller.
6952
6953 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6954
6955         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6956         * configure, config.in: Regenerate.
6957         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6958         is not defined.
6959
6960 2012-02-02  Pedro Alves  <palves@redhat.com>
6961
6962         Try SIGKILL first, then PTRACE_KILL.
6963         * linux-low.c (linux_kill_one_lwp): New.
6964         (linux_kill_one_lwp): Rename to ...
6965         (kill_one_lwp_callback): ... this.  Use the new
6966         linux_kill_one_lwp.
6967
6968 2012-02-02  Pedro Alves  <palves@redhat.com>
6969
6970         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6971         inferior.
6972
6973 2012-01-27  Pedro Alves  <palves@redhat.com>
6974
6975         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6976         (elf_64_file_p): Make static.
6977         (linux_pid_exe_is_elf_64_file): New.
6978         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6979         Delete declarations.
6980         (linux_pid_exe_is_elf_64_file): Declare.
6981         * linux-x86-low.c (x86_arch_setup): Use
6982         linux_pid_exe_is_elf_64_file.
6983
6984 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6985
6986         * linux-low.c (linux_wait_for_event_1): Rename to ...
6987         (linux_wait_for_event): ... here and merge it with former
6988         linux_wait_for_event - new variable wait_ptid, use it.
6989         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6990
6991 2012-01-23  Pedro Alves  <palves@redhat.com>
6992
6993         * server.c (main): Avoid yet another case of infinite loop while
6994         detaching/killing after a longjmp.
6995
6996 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6997
6998         Code cleanup.
6999         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
7000
7001 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
7002
7003         * hostio.c (handle_readlink): New function.
7004         (handle_vFile): Call it to handle "vFile:readlink" packets.
7005
7006 2012-01-20  Pedro Alves  <palves@redhat.com>
7007             Ulrich Weigand  <ulrich.weigand@linaro.org>
7008
7009         * server.c (handle_v_requests): Only support vAttach and vRun to
7010         start multiple processes when in extended protocol mode.
7011
7012 2012-01-17  Pedro Alves  <palves@redhat.com>
7013
7014         * tracepoint.c (initialize_tracepoint): Use mmap instead of
7015         memalign plus mprotect to allocate the scratch buffer.
7016
7017 2012-01-13  Pedro Alves  <palves@redhat.com>
7018
7019         * server.c (attach_inferior): Clear `cont_thread'.
7020
7021 2012-01-13  Pedro Alves  <palves@redhat.com>
7022
7023         * server.c (main): Avoid infinite loop while detaching/killing
7024         after a longjmp.
7025
7026 2012-01-09  Doug Evans  <dje@google.com>
7027
7028         * server.c (start_inferior): Set last_ptid in --wrapper case.
7029
7030 2012-01-06  Yao Qi  <yao@codesourcery.com>
7031
7032         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
7033         defined.
7034         [IN_PROCESS_AGENT] (debug_agent): New global variable.
7035
7036 2012-01-04  Yao Qi  <yao@codesourcery.com>
7037
7038         * tracepoint.c (cmd_qtdp): Print debug message
7039         for static tracepoint.
7040
7041 2012-01-04  Yao Qi  <yao@codesourcery.com>
7042
7043         * tracepoint.c (trace_vdebug): Differentiate debug message
7044         between gdbserver and IPA.
7045
7046 2012-01-03  Yao Qi  <yao@codesourcery.com>
7047
7048         * tracepoint.c (tracepoint_was_hit): Don't collect for
7049         static tracepoint.
7050
7051 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
7052
7053         * terminal.h: Reformat copyright header.
7054
7055 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
7056
7057         * server.c (gdbserver_version): Update copyright year.
7058         * gdbreplay.c (gdbreplay_version): Likewise.
7059
7060 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
7061
7062         * linux-low.c (linux_create_inferior): Put empty if clause for write.
7063
7064         Revert:
7065         2011-12-18  Hui Zhu  <teawater@gmail.com>
7066         * linux-low.c (linux_create_inferior): Save return value to ret.
7067
7068 2011-12-18  Hui Zhu  <teawater@gmail.com>
7069
7070         * linux-low.c (linux_create_inferior): Save return value to ret.
7071
7072 2011-12-16  Doug Evans  <dje@google.com>
7073
7074         * linux-low.c (linux_create_inferior): If stdio connection,
7075         redirect stdin from /dev/null, stdout to stderr.
7076         * remote-utils.c (remote_is_stdio): New static global.
7077         (remote_connection_is_stdio): New function.
7078         (remote_prepare): Handle stdio connection.
7079         (remote_open): Ditto.
7080         (remote_close): Don't close stdin for stdio connections.
7081         (read_prim,write_prim): New functions.  Replace all calls to
7082         read/write to these.
7083         * server.c (main): Watch for "-" argument.  Move call to
7084         remote_prepare before start_inferior.
7085         * server.h (STDIO_CONNECTION_NAME): New macro.
7086         (remote_connection_is_stdio): Declare.
7087
7088         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
7089         in debugging output.
7090
7091 2011-12-15  Yao Qi  <yao@codesourcery.com>
7092
7093         * tracepoint.c: Include sys/syscall.h.
7094         (gdb_ust_thread): Remove preprocessor conditional.
7095
7096 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
7097
7098         * linux-low.c (linux_detach_one_lwp): Call
7099         the_low_target.prepare_to_resume before detaching.
7100
7101 2011-12-14  Yao Qi  <yao@codesourcery.com>
7102
7103         * tracepoint.c (gdb_ust_thread): Don't ignore return value
7104         of write.
7105
7106 2011-12-14  Yao Qi  <yao@codesourcery.com>
7107
7108         * i386-low.c (i386_low_stopped_data_address): Initialize local
7109         variable `control'.
7110
7111 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
7112
7113         PR remote/13492
7114
7115         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
7116         DR_CONTROL unless necessary.  Extend comments.
7117         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
7118         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
7119
7120 2011-12-13  Yao Qi  <yao@codesourcery.com>
7121
7122         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
7123         macros.
7124         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
7125
7126 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
7127
7128         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
7129         Print new debug message for such case.
7130
7131 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7132
7133         Fix overlapping memcpy.
7134         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
7135         the read_inferior_memory transfer.
7136         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
7137         write_inferior_memory transfer.
7138         (set_fast_tracepoint_jump): New variable buf.  Use it for the
7139         read_inferior_memory and write_inferior_memory transfers.
7140         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
7141         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
7142         Use it for the write_inferior_memory transfer.
7143         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
7144         buffers.
7145
7146 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
7147
7148         * linux-low.c (fetch_register, store_register): Make code
7149         consistent, fix formatting.
7150
7151 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
7152
7153         * linux-low.c (usr_store_inferior_registers): Factor out code
7154         to handle individual registers into...
7155         (store_register): ... this new function.
7156
7157 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
7158
7159         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
7160         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
7161         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
7162         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
7163         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
7164         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
7165         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
7166         (srv_xmlfiles): Add new XML files.
7167
7168         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
7169         and <sys/uio.h>.
7170         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
7171         (init_registers_s390_linux32v1): Add prototype.
7172         (init_registers_s390_linux32v2): Likewise.
7173         (init_registers_s390_linux64v1): Likewise.
7174         (init_registers_s390_linux64v2): Likewise.
7175         (init_registers_s390x_linux64v1): Likewise.
7176         (init_registers_s390x_linux64v2): Likewise.
7177         (s390_num_regs): Increment to 52.
7178         (s390_regmap): Add orig_r2 register.
7179         (s390_num_regs_3264): Increment to 68.
7180         (s390_regmap_3264): Add orig_r2 register.
7181         (s390_collect_ptrace_register): Handle orig_r2 register.
7182         (s390_supply_ptrace_register): Likewise.
7183         (s390_fill_last_break): New function.
7184         (s390_store_last_break): Likewise.
7185         (s390_fill_system_call): New function.
7186         (s390_store_system_call): Likewise.
7187         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
7188         register sets.
7189         (s390_check_regset): New function.
7190         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
7191         NT_S390_SYSTEM_CALL regsets and use appropriate description.
7192         Update target_regsets for available register sets.
7193
7194 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
7195             Jan Kratochvil  <jan.kratochvil@redhat.com>
7196
7197         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
7198         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
7199         New.
7200         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
7201         * linux-low.h (struct process_info_private): New member r_debug.
7202         * server.c (handle_qxfer_libraries): Call
7203         the_target->qxfer_libraries_svr4.
7204         (handle_qxfer_libraries_svr4): New function.
7205         (qxfer_packets): New entry "libraries-svr4".
7206         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
7207         * target.h (struct target_ops): New member qxfer_libraries_svr4.
7208         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
7209         PACKET_qXfer_libraries_svr4.
7210
7211 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
7212
7213         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
7214         PSW address/mask between 8-byte and 16-byte formats.
7215         (s390_supply_ptrace_register): Likewise.
7216         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
7217         basic addressing mode bit.
7218
7219 2011-11-24  Stan Shebs  <stan@codesourcery.com>
7220
7221         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
7222
7223 2011-11-17  Stan Shebs  <stan@codesourcery.com>
7224
7225         * tracepoint.c (struct tracepoint): New field traceframe_usage.
7226         (tracing_start_time): New global.
7227         (tracing_stop_time): New global.
7228         (tracing_user_name): New global.
7229         (tracing_notes): New global.
7230         (tracing_stop_note): New global.
7231         (cmd_qtstart): Set traceframe_usage, start_time.
7232         (stop_tracing): Set stop_time.
7233         (cmd_qtstatus): Report additional status.
7234         (cmd_qtp): New function.
7235         (handle_tracepoint_query): Call it.
7236         (cmd_qtnotes): New function.
7237         (handle_tracepoint_general_set): Call it.
7238         (get_timestamp): Rename from tsv_get_timestamp.
7239
7240 2011-11-14  Stan Shebs  <stan@codesourcery.com>
7241             Kwok Cheung Yeung  <kcy@codesourcery.com>
7242
7243         * linux-x86-low.c (small_jump_insn): New.
7244         (i386_install_fast_tracepoint_jump_pad): Add arguments for
7245         trampoline and error message, build a trampoline and issue a small
7246         jump instruction to it.
7247         (x86_install_fast_tracepoint_jump_pad): Add arguments for
7248         trampoline and error message.
7249         (x86_get_min_fast_tracepoint_insn_len): New.
7250         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
7251         * linux-low.h (struct linux_target_ops): Add arguments to
7252         install_fast_tracepoint_jump_pad operation, add new operation.
7253         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
7254         arguments.
7255         (linux_get_min_fast_tracepoint_insn_len): New function.
7256         (linux_target_op): Add new operation.
7257         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
7258         (gdb_trampoline_buffer_end): Ditto.
7259         (gdb_trampoline_buffer_error): Ditto.
7260         (struct ipa_sym_addresses): Add fields for new IPA variables.
7261         (symbol_list): Add entries for new IPA variables.
7262         (struct tracepoint): Add fields to hold the address range of the
7263         trampoline used by the tracepoint.
7264         (trampoline_buffer_head): New static variable.
7265         (trampoline_buffer_tail): Ditto.
7266         (claim_trampoline_space): New function.
7267         (have_fast_tracepoint_trampoline_buffer): New function.
7268         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
7269         structure.
7270         (install_fast_tracepoint): Ditto, also add error buffer argument.
7271         (cmd_qtminftpilen): New function.
7272         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
7273         (fast_tracepoint_from_trampoline_address): New function.
7274         (fast_tracepoint_collecting): Handle trampoline as part of jump
7275         pad space.
7276         (set_trampoline_buffer_space): New function.
7277         (initialize_tracepoint): Initialize new IPA variables.
7278         * target.h (struct target_ops): Add arguments to
7279         install_fast_tracepoint_jump_pad operation, add new
7280         get_min_fast_tracepoint_insn_len operation.
7281         (target_get_min_fast_tracepoint_insn_len): New.
7282         (install_fast_tracepoint_jump_pad): Add arguments.
7283         * server.h (IPA_BUFSIZ): Define.
7284         * linux-i386-ipa.c: Include extra header files.
7285         (initialize_fast_tracepoint_trampoline_buffer): New function.
7286         (initialize_low_tracepoint): Call it.
7287         * server.h (set_trampoline_buffer_space): Declare.
7288         (claim_trampoline_space): Ditto.
7289         (have_fast_tracepoint_trampoline_buffer): Ditto.
7290
7291 2011-11-14  Yao Qi  <yao@codesourcery.com>
7292
7293         * server.c (handle_query): Handle InstallInTrace for qSupported.
7294         * tracepoint.c (add_tracepoint): Sort list.
7295         (install_tracepoint, download_tracepoint): New.
7296         (cmd_qtdp): Call them to install and download tracepoints.
7297         (sort_tracepoints): Removed.
7298         (cmd_qtstart): Update.
7299
7300 2011-11-14  Yao Qi  <yao@codesourcery.com>
7301
7302         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
7303         * mem-break.h: Declare.
7304         * tracepoint.c (cmd_qtstart): Move some code to ...
7305         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
7306         New.
7307         (download_tracepoints): Move some code to ...
7308         (download_tracepoint_1): ... here.  New.
7309
7310 2011-11-08  Yao Qi  <yao@codesourcery.com>
7311
7312         * remote-utils.c (relocate_instruction): A comment fix.
7313
7314 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
7315
7316         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
7317         (i386_dr_low_get_control, i386_dr_low_get_status): Use
7318         dr_status_mirror and dr_control_mirror from debug_reg_state.
7319         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
7320         (i386_initial_stuff): Remove use of deleted globals.
7321         (i386_get_thread_context, i386_set_thread_context,
7322         i386_thread_added): Use dr_status_mirror and dr_control_mirror
7323         from debug_reg_state.
7324
7325 2011-11-05  Yao Qi  <yao@codesourcery.com>
7326
7327         * tracepoint.c (gdb_collect): Loop over tracepoints of same
7328         address as TPOINT's.
7329
7330 2011-11-02  Stan Shebs  <stan@codesourcery.com>
7331
7332         * tracepoint.c (agent_mem_read_string): New function.
7333         (eval_agent_expr): Call it for tracenz.
7334         * server.c (handle_query): Report support for tracenz.
7335
7336 2011-11-02  Yao Qi  <yao@codesourcery.com>
7337
7338         * tracepoint.c (cmd_qtstart): Remove unused local variables.
7339
7340 2011-11-02  Yao Qi  <yao@codesourcery.com>
7341
7342         * target.h: Fix a typo in comment.
7343
7344 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
7345
7346         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
7347         clobber the breakpoints' shadows with fast tracepoint jumps.
7348         * mem-break.h (check_mem_write): Add `myaddr' parameter.
7349         * target.c (write_inferior_memory): Also pass MYADDR down to
7350         check_mem_write.
7351
7352 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
7353
7354         * configure.ac: Check support for personality routine.
7355         * configure: Regenerate.
7356         * config.in: Likewise.
7357         * linux-low.c: Include <sys/personality.h>.
7358         Define ADDR_NO_RANDOMIZE if necessary.
7359         (linux_create_inferior): Disable address space randomization when
7360         forking inferior, if requested.
7361         (linux_supports_disable_randomization): New function.
7362         (linux_target_ops): Install it.
7363         * server.h (disable_randomization): Declare.
7364         * server.c (disable_randomization): New global variable.
7365         (handle_general_set): Handle QDisableRandomization.
7366         (handle_query): Likewise for qSupported.
7367         (main): Support --disable-randomization and --no-disable-randomization
7368         command line arguments.
7369         * target.h (struct target_ops): Add supports_disable_randomization.
7370         (target_supports_disable_randomization): New macro.
7371
7372 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
7373
7374         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
7375         ifdef check.
7376         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
7377         [!PT_GETDSBT] (target_loadmap): New definition.
7378         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
7379         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
7380         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
7381         and PT_GETDSBT to LINUX_LOADMAP.
7382         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
7383         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
7384
7385 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7386
7387         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
7388         (arm_linux_hwbp_cap): New static variable.
7389         (arm_linux_get_hwbp_cap): Replace by ...
7390         (arm_linux_init_hwbp_cap): ... this new function.
7391         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
7392         (arm_linux_get_hw_watchpoint_count): Likewise.
7393         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7394         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
7395         (arm_prepare_to_resume): Use perror_with_name instead of error.
7396
7397 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7398
7399         * linux-arm-low.c: Include <signal.h>.
7400         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
7401         (struct arm_linux_hwbp_cap): New data type.
7402         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
7403         (struct arm_linux_hw_breakpoint): New data type.
7404         (MAX_BPTS, MAX_WPTS): Define.
7405         (struct arch_process_info, struct arch_lwp_info): New data types.
7406         (arm_linux_get_hwbp_cap): New function.
7407         (arm_linux_get_hw_breakpoint_count): Likewise.
7408         (arm_linux_get_hw_watchpoint_count): Likewise.
7409         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7410         (arm_hwbp_control_initialize): Likewise.
7411         (arm_hwbp_control_is_enabled): Likewise.
7412         (arm_hwbp_control_is_initialized): Likewise.
7413         (arm_hwbp_control_disable): Likewise.
7414         (arm_linux_hw_breakpoint_equal): Likewise.
7415         (arm_linux_hw_point_initialize): Likewise.
7416         (struct update_registers_data): New data structure.
7417         (update_registers_callback: New function.
7418         (arm_insert_point): Likewise.
7419         (arm_remove_point): Likewise.
7420         (arm_stopped_by_watchpoint): Likewise.
7421         (arm_stopped_data_address): Likewise.
7422         (arm_new_process): Likewise.
7423         (arm_new_thread): Likewise.
7424         (arm_prepare_to_resume): Likewise.
7425         (the_low_target): Register arm_insert_point, arm_remove_point,
7426         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
7427         arm_new_thread, and arm_prepare_to_resume.
7428
7429 2011-09-15  Stan Shebs  <stan@codesourcery.com>
7430
7431         * server.h (struct emit_ops): Add compare-goto fields.
7432         * tracepoint.c (gdb_agent_op_sizes): New table.
7433         (emit_eq_goto): New function.
7434         (emit_ne_goto): New function.
7435         (emit_lt_goto): New function.
7436         (emit_le_goto): New function.
7437         (emit_gt_goto): New function.
7438         (emit_ge_goto): New function.
7439         (is_goto_target): New function.
7440         (compile_bytecodes): Recognize special cases of compare-goto
7441         combinations and call specialized emitters for them.
7442         * linux-x86-low.c (amd64_emit_eq_goto): New function.
7443         (amd64_emit_ne_goto): New function.
7444         (amd64_emit_lt_goto): New function.
7445         (amd64_emit_le_goto): New function.
7446         (amd64_emit_gt_goto): New function.
7447         (amd64_emit_ge_goto): New function.
7448         (amd64_emit_ops): Add the new functions.
7449         (i386_emit_eq_goto): New function.
7450         (i386_emit_ne_goto): New function.
7451         (i386_emit_lt_goto): New function.
7452         (i386_emit_le_goto): New function.
7453         (i386_emit_gt_goto): New function.
7454         (i386_emit_ge_goto): New function.
7455         (i386_emit_ops): Add the new functions.
7456
7457 2011-09-08  Stan Shebs  <stan@codesourcery.com>
7458
7459         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
7460         (i386_emit_epilogue): Restore %ebx.
7461
7462 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
7463
7464         * server.c (step_thread): Remove definition.
7465         (process_serial_event): Don't handle Hs.
7466         * server.h (step_thread): Remove declaration.
7467         * target.c (set_desired_inferior): Remove use of step_thread.
7468
7469 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7470
7471         * linux-low.c: Include linux-procfs.h.
7472         (linux_attach_lwp_1): Update comments.
7473         (linux_attach): Scan for existing threads when attaching to a
7474         process that is the tgid.
7475         * Makefile.in: Update dependencies.
7476
7477 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7478
7479         * configure.srv: Add linux-procfs.o dependencies.
7480
7481 2011-08-14  Yao Qi  <yao@codesourcery.com>
7482
7483         * target.h (struct target_ops): Fix indent.
7484         * win32-low.c (win32_target_ops): Fix comment.
7485
7486 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
7487             Yao Qi  <yao@codesourcery.com>
7488
7489         * Makefile.in (clean): Remove tic6x-*.c files.
7490         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
7491         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
7492         (tic6x-c64xp-linux.c): Likewise.
7493         * configure.srv: Add support for tic6x-*-uclinux.
7494         * linux-tic6x-low.c: New.
7495         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
7496
7497 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
7498             Yao Qi  <yao@codesourcery.com>
7499
7500         * target.h (struct target_ops): Add read_loadmap.
7501         * linux-low.c (struct target_loadseg): New type.
7502         (struct target_loadmap): New type.
7503         (linux_read_loadmap): New function.
7504         (linux_target_ops): Add linux_read_loadmap.
7505         * server.c (handle_query): Support qXfer:fdpic:read packet.
7506         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
7507         to NULL.
7508
7509 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7510
7511         * win32-low.c: Include <stdint.h>.
7512
7513 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
7514
7515         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7516         to the inferior here.
7517         (i386_remove_aligned_watchpoint): Ditto.
7518         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7519         fit part of the watchpoint in the debug registers.
7520         (i386_update_inferior_debug_regs): New.
7521         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7522         registers, and only update the inferior on success.
7523         (i386_low_remove_watchpoint): Ditto.
7524
7525 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7526
7527         * linux-low.c (compare_ints, unique, list_threads, show_process,
7528         linux_core_of_thread): Delete.
7529         (linux_target_ops): Change linux_core_of_thread to
7530         linux_common_core_of_thread.
7531         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7532         * utils.c (malloc_failure): Change type of argument.
7533         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7534         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7535         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7536         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7537         (IPA_OBJS): Add common-utils-ipa.o.
7538         (ptid_h, linux_osdata_h): New macros.
7539         (server_h): Add common/common-utils.h, common/xml-utils.h,
7540         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7541         common/ptid.h.
7542         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7543         ptid.o, buffer.o): New rules.
7544         (linux-low.o): Add common/linux-osdata.h as a dependency.
7545         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7546         * configure.ac: Add AC_HEADER_DIRENT check.
7547         * config.in: Regenerate.
7548         * configure: Regenerate.
7549         * remote-utils.c (xml_escape_text): Delete.
7550         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7551         buffer_xml_printf): Move to common/buffer.c.
7552         * server.c (main): Remove call to initialize_inferiors.
7553         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7554         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7555         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7556         internal_error, gdb_assert, gdb_assert_fail): Delete.
7557         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7558         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7559         common/buffer.h.
7560         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7561         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7562         initialize_inferiors): Delete.
7563
7564 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7565
7566         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7567         symbol error.
7568
7569 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7570
7571         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7572         assertion.
7573         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7574
7575 2011-05-26  Yao Qi  <yao@codesourcery.com>
7576
7577         * Makefile.in (thread-db.o): Track dependence to
7578         common/gdb_thread_db.h.
7579         * thread-db.c: include gdb_thread_db.h from right place.
7580
7581 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7582
7583         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7584         __FILE__ and __LINE__ to internal_error.
7585
7586 2011-05-13  Doug Evans  <dje@google.com>
7587
7588         * thread-db.c (try_thread_db_load_from_sdir): New function.
7589         (try_thread_db_load_from_dir): New function.
7590         (thread_db_load_search): Handle $sdir, ignore $pdir.
7591         Remove trying of system directories if search of
7592         libthread-db-search-path fails, that is now done via $sdir.
7593
7594 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7595
7596         * server.c (handle_query): Add EnableDisableTracepoints to the list
7597         of supported features.
7598         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7599         tracepoints.
7600         (cmd_qtenable_disable): New.
7601         (cmd_qtstart): Install tracepoints even if disabled.
7602         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7603         receiving a QTEnable or QTDisable packet.
7604         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7605         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7606         tracepoints.
7607         (gdb_probe): Skip data collection if static tracepoint is disabled.
7608
7609 2011-05-10  Doug Evans  <dje@google.com>
7610
7611         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7612
7613 2011-05-04  Doug Evans  <dje@google.com>
7614
7615         * linux-low.c (linux_join): Skip process lookup.
7616         * spu-low.c (spu_join): Ditto.
7617         * server.c (join_inferiors_callback): Delete.
7618         (process_serial_event): For 'D' packet (detach) call join_inferior
7619         directly.
7620
7621 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7622
7623         * README: Don't mention xscale*-*-linux*.
7624         * configure.srv (xscale*-*-linux*): Don't handle target.
7625
7626 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7627
7628         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7629         casting pointers.
7630         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7631         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7632         (i386_emit_void_call_2): Likewise.
7633
7634 2011-04-26  Yao Qi  <yao@codesourcery.com>
7635
7636         * linux-low.c: Move common macros to linux-ptrace.h.
7637         Include linux-ptrace.h.
7638         * Makefile.in (linux_ptrace_h): New.
7639         (linux-low.o): Depends on linux-ptrace.h.
7640
7641 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7642
7643         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7644         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7645         (remote_prepare): New function with most of the TCP code from ...
7646         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7647         setting transport_is_reliable.
7648         * server.c (run_once): New variable.
7649         (gdbserver_usage): Document it.
7650         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7651         the first run if RUN_ONCE.
7652         * server.h (run_once, remote_prepare): New declarations.
7653
7654 2011-04-19  Tom Tromey  <tromey@redhat.com>
7655
7656         * win32-low.c (handle_load_dll): Remove duplicate "the".
7657
7658 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7659
7660         Remove support for old Cygwin 1.5 versions.
7661         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7662         function to avoid warning.
7663         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7664         warning.
7665
7666 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7667
7668         * gdbserver/server.h (Macro _): Define it if not available.
7669
7670 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7671
7672         * hostio.c (handle_close): Remove unnecessary null test.
7673
7674 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7675
7676         * Makefile.in (maintainer-clean realclean distclean): Remove
7677         "make ...  subdir_do" command.
7678
7679 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7680
7681         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7682
7683         * server.c (handle_v_run): Free alloced buffer on early return.
7684
7685 2011-03-09  Yao Qi  <yao@codesourcery.com>
7686
7687         Revert:
7688         2011-03-04  Yao Qi  <yao@codesourcery.com>
7689
7690         * Makefile.in: Remove GNU make feature --directory.
7691
7692         2011-03-05  Yao Qi  <yao@codesourcery.com>
7693
7694         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7695         (subdir_do): New make target.  Copied from gdb/Makefile.
7696         (maintainer-clean, realclean, distclean, clean): Call corresponding
7697         make targets in common/Makefile.
7698
7699         2011-02-11  Yao Qi  <yao@codesourcery.com>
7700
7701         * configure.ac: Call AC_PROG_RANLIB.
7702         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7703         * configure: Regenerate.
7704
7705 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7706
7707         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7708
7709 2011-03-06  Yao Qi  <yao@codesourcery.com>
7710
7711         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7712
7713 2011-03-05  Yao Qi  <yao@codesourcery.com>
7714
7715         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7716         (subdir_do): New make target.  Copied from gdb/Makefile.
7717         (maintainer-clean, realclean, distclean, clean): Call corresponding
7718         make targets in common/Makefile.
7719
7720 2011-03-04  Yao Qi  <yao@codesourcery.com>
7721
7722         * Makefile.in: Remove GNU make feature --directory.
7723
7724 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7725
7726         * server.c (queue_stop_reply): Call xmalloc not malloc.
7727
7728 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7729
7730         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7731
7732 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7733
7734         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7735         (cmd_qtframe): Ditto.
7736         (cmd_qtbuffer): Ditto.
7737         (cmd_bigqtbuffer): Ditto.
7738
7739         * utils.c (decimal2str): Initialize 'width' to nine, then
7740         don't mess with it.
7741
7742 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7743
7744         * hostio.c (require_data): Free *data, not data.
7745
7746 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7747
7748         * hostio.c (require_data): Use free, not xfree.
7749
7750 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7751
7752         * server.c (handle_query): Discard unused value.
7753
7754         * hostio.c (require_data): Free malloc memory before returning
7755         error.
7756
7757 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7758
7759         * linux-low.c (list_threads): Call closedir for dirent.
7760
7761 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7762
7763         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7764         a case statement falls through.
7765
7766         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7767
7768         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7769         in comparison.
7770
7771 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7772
7773         * utils.c (decimal2str): Eliminate dead code and dead param.
7774         (pulongest): Drop dead param from call to decimal2str.
7775         (plongest): Ditto.
7776
7777 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7778
7779         Revert the following patch (not approved yet):
7780         2011-02-21  Hui Zhu  <teawater@gmail.com>
7781         * tracepoint.c (tp_printf): New function.
7782         (eval_agent_expr): Handle gdb_agent_op_printf.
7783
7784 2011-02-21  Hui Zhu  <teawater@gmail.com>
7785
7786         * tracepoint.c (tp_printf): New function.
7787         (eval_agent_expr): Handle gdb_agent_op_printf.
7788
7789 2011-02-18  Tom Tromey  <tromey@redhat.com>
7790
7791         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7792         (tracepoint.o): Likewise.
7793         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7794         (gdb_agent_op_names): Likewise.
7795
7796 2011-02-18  Tom Tromey  <tromey@redhat.com>
7797
7798         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7799         gdb_agent_op_rot>: New constants.
7800         (gdb_agent_op_names): Add pick and roll.
7801         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7802         cases.
7803
7804 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7805
7806         * aclocal.m4: Regenerated with aclocal-1.11.1.
7807
7808 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7809
7810         * server.c (handle_qxfer_traceframe_info): New.
7811         (qxfer_packets): Register "traceframe-info".
7812         (handle_query): Report support for qXfer:traceframe-info:read+.
7813         * tracepoint.c (match_blocktype): New.
7814         (traceframe_find_block_type): Rename to ...
7815         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7816         and use it.
7817         (traceframe_find_block_type): New, reimplemented on top of
7818         traceframe_walk_blocks.
7819         (build_traceframe_info_xml): New.
7820         (traceframe_read_info): New.
7821         * server.h (traceframe_read_info): Declare.
7822
7823 2011-02-11  Yao Qi  <yao@codesourcery.com>
7824
7825         * configure.ac: Call AC_PROG_RANLIB.
7826         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7827         * configure: Regenerate.
7828
7829 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7830
7831         * server.c (gdb_read_memory): Change return semantics to allow
7832         partial transfers.
7833         (handle_search_memory_1): Adjust.
7834         (process_serial_event) <'m' packet>: Handle partial transfers.
7835         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7836
7837 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7838
7839         * regcache.c (init_register_cache): Initialize
7840         regcache->register_status.
7841         (free_register_cache): Release regcache->register_status.
7842         (regcache_cpy): Copy register_status.
7843         (registers_to_string): Print 'x's for unavailable registers.
7844         (supply_register): Mark the register's status valid or
7845         unavailable, depending on whether a buffer was passed in or not.
7846         (supply_register_zeroed): New.
7847         (supply_regblock): Mark the registers' status valid or
7848         unavailable, depending on whether a buffer was passed in or not.
7849         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7850         (struct regcache): New `register_status' field.
7851         (supply_register_zeroed): Declare.
7852         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7853         supply_register_zeroed, rather than passing a NULL buffer to
7854         supply_register.
7855         * tracepoint.c (fetch_traceframe_registers): Update comment.
7856
7857 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7858
7859         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7860         buffer explicit.
7861
7862 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7863
7864         * server.h (decode_xfer_write): Change prototype.
7865         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7866         and don't extract the annex here.
7867         * server.c (decode_xfer_read): Remove `annex' parameter,
7868         and don't extract the annex here.
7869         (decode_xfer): New.
7870         (struct qxfer): New.
7871         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7872         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7873         (handle_qxfer_statictrace): New functions, abstracted out from
7874         handle_query, and made to use the struct qxfer interface.
7875         (handle_threads_qxfer_proper): Rename to ...
7876         (handle_qxfer_threads_proper): ... this.
7877         (handle_threads_qxfer): Rename to ...
7878         (handle_qxfer_threads): ... this.  Adjust.
7879         (qxfer_packets): New array.
7880         (handle_qxfer): New function.
7881         (handle_query): Use handle_qxfer.
7882
7883 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7884
7885         * gdbreplay.c: Shorten lines of >= 80 columns.
7886         * linux-low.c: Ditto.
7887         * linux-ppc-low.c: Ditto.
7888         * linux-s390-low.c: Ditto.
7889         * linux-sparc-low.c: Ditto.
7890         * linux-x86-low.c: Ditto.
7891         * linux-xtensa-low.c: Ditto.
7892         * mem-break.c: Ditto.
7893         * nto-low.c: Ditto.
7894         * regcache.h: Ditto.
7895         * remote-utils.c: Ditto.
7896         * server.c: Ditto.
7897         * server.h: Ditto.
7898         * thread-db.c: Ditto.
7899         * tracepoint.c: Ditto.
7900         * utils.c: Ditto.
7901         * win32-low.h: Ditto.
7902
7903 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7904
7905         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7906         update.
7907
7908 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7909
7910         * server.c (gdbserver_version): Update copyright year in version
7911         output.
7912         * gdbreplay.c (gdbreplay_version): Ditto.
7913
7914 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7915
7916         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7917         * linux-bfin-low.c: New file.
7918         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7919         PT_DATA_ADDR for BFIN targets.
7920         * Makefile.in (SFILES): Add linux-bfin-low.c.
7921         (clean): Remove reg-bfin.c.
7922         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7923         * README: Mention supported Blackfin targets.
7924
7925 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7926
7927         * .gitignore: New file.
7928
7929 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7930
7931         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7932
7933 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7934
7935         * Makefile.in: Add FLAGS_TO_PASS variable.
7936         (install): Remove dependency of install-only and recursively
7937         invoke make for install-only.
7938
7939 2010-10-04  Doug Evans  <dje@google.com>
7940
7941         * Makefile.in (uninstall): Use $(DESTDIR).
7942
7943 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7944
7945         PR gdb/11842
7946
7947         * linux-x86-low.c (compat_siginfo_from_siginfo)
7948         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7949         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7950         si_code < 0.
7951
7952 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7953
7954         * lynx-i386-low.c: New file.
7955         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7956
7957 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7958
7959         * lynx-low.c (ptrace_request_to_str): Remove handling for
7960         request values that have been removed in LynxOS 5.x.
7961
7962 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7963
7964         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7965         <ptrace.h>
7966
7967 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7968
7969         * configure.ac: Add --enable-inprocess-agent option.
7970         * configure: Rebuilt.
7971
7972 2010-09-06  Yao Qi  <yao@codesourcery.com>
7973
7974         * linux-low.c (linux_kill): Remove unused variable.
7975         (linux_stabilize_threads): Likewise.
7976         * server.c (start_inferior): Likewise.
7977         (queue_stop_reply_callback): Likewise.
7978         * tracepoint.c (do_action_at_tracepoint): Likewise.
7979
7980 2010-09-06  Yao Qi  <yao@codesourcery.com>
7981
7982         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7983         on return.
7984
7985 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7986
7987         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7988
7989 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7990
7991         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7992         "$(IPA_DEPFILES)".
7993
7994 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7995
7996         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7997         gdbserver/lynx-ppc-low.c: New files.
7998         * Makefile.in (lynx_low_h): New variable.
7999         (lynx-low.o, lynx-ppc-low.o): New rules.
8000         * configure.ac: On LynxOS, link with -lnetinet.
8001         * configure.srv: Add handling of powerpc-*-lynxos* targets.
8002         * configure: regenerate.
8003
8004 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8005
8006         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
8007         * configure.ac: Add check for vasprintf and vsnprintf.
8008         * configure, config.in: Regenerate.
8009         * server.h (vasprintf, vsnprintf): Add conditional declarations.
8010
8011 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8012
8013         * gdbreplay.c: Move include of alloca.h up, next to include of
8014         malloc.h.
8015         * server.h: Add include of malloc.h.
8016         * mem-break.c: Remove include of malloc.h.
8017         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
8018
8019 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8020
8021         * Makefile.in (memmem.o): Build with -Wno-error.
8022
8023 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8024
8025         * utils.c (xsnprintf): Make non-static.
8026         * server.h: Add xsnprintf declaration.
8027         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
8028         replace calls to snprintf by calls to xsnprintf throughout.
8029
8030 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8031
8032         * configure.ac: Add configure check for alloca.
8033         * configure, config.in: Regenerate.
8034         * server.h: Include alloca.h if it exists.
8035         * gdbreplay.c: Include alloca.h if it exists.
8036
8037 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
8038
8039         * linux-low.c (__SIGRTMIN): Define if not already defined.
8040         (linux_create_inferior): Check for __ANDROID__ rather than
8041         __SIGRTMIN.
8042         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
8043         are already deferred.
8044         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
8045         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
8046         stopped and already has a pending signal to report.
8047         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
8048         a pending signal to report or is moving out of a jump pad.
8049         (linux_init_signals): Check for __ANDROID__ rather than
8050         __SIGRTMIN.
8051
8052 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
8053
8054         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
8055         debug_threads check.  Avoid a linear search when not doing debug
8056         output.
8057
8058 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8059
8060         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
8061         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
8062         (struct file_handler) <fd>: Change type to gdb_fildes_t.
8063         (process_event): Change local fd's type to gdb_fildes_t.
8064         (create_file_handler): Adjust prototype.
8065         (delete_file_handler): Adjust prototype.
8066         (handle_file_event): Adjust prototype.  Use pfildes.
8067         (create_file_event): Adjsut prototype.
8068         * remote-utils.c (remote_desc, listen_desc): Change type to
8069         gdb_fildes_t.
8070         * server.h: New gdb_fildes_t typedef.
8071         [USE_WIN32API]: Include winsock2.h.
8072         (delete_file_handler, add_file_handler): Adjust prototypes.
8073         (pfildes): Declare.
8074         * utils.c (pfildes): New.
8075
8076 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8077
8078         * configure.ac (build_warnings): Add -Wno-char-subscripts.
8079         * configure: Regenerate.
8080
8081 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8082
8083         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
8084         (linux_done_accessing_memory): ... this.
8085         (linux_target_ops): Adjust.
8086         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
8087         * nto-low.c (nto_target_ops): Adjust comment.
8088         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
8089         * spu-low.c (spu_target_ops): Adjust comment.
8090         * target.h (target_ops): Rename unprepare_to_access_memory field
8091         to done_accessing_memory.
8092         (unprepare_to_access_memory): Rename to ...
8093         (done_accessing_memory): ... this.
8094
8095 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8096
8097         * linux-low.c (linux_prepare_to_access_memory): New.
8098         (linux_unprepare_to_access_memory): New.
8099         (linux_target_ops): Install them.
8100         * server.c (read_memory): Rename to ...
8101         (gdb_read_memory): ... this.  Use
8102         prepare_to_access_memory/prepare_to_access_memory.
8103         (write_memory): Rename to ...
8104         (gdb_write_memory): ... this.  Use
8105         prepare_to_access_memory/prepare_to_access_memory.
8106         (handle_search_memory_1): Adjust.
8107         (process_serial_event): Adjust.
8108         * target.h (struct target_ops): New fields
8109         prepare_to_access_memory and unprepare_to_access_memory.
8110         (prepare_to_access_memory, unprepare_to_access_memory): New.
8111         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
8112         prepare_to_access_memory/prepare_to_access_memory.
8113         * nto-low.c (nto_target_ops): Adjust.
8114         * spu-low.c (spu_target_ops): Adjust.
8115         * win32-low.c (win32_target_ops): Adjust.
8116
8117 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8118
8119         * Makefile.in (WARN_CFLAGS): Get it from configure.
8120         (WERROR_CFLAGS): New.
8121         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
8122         * configure.ac: Introduce --enable-werror, which adds -Werror to
8123         the compiler command line.  Enabled by default.  Disable with
8124         --disable-werror.  Add -Wdeclaration-after-statement
8125         Wpointer-arith and -Wformat-nonliteral to warning flags.
8126         * configure: Regenerate.
8127
8128 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8129
8130         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
8131
8132 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8133
8134         * gdbreplay.c (remote_error): New.
8135         (gdbchar): New.
8136         (expect): Use gdbchar.  Check for error reading from GDB.
8137         Clarify sync error output.
8138         (play): Check for errors writing to GDB.
8139         * linux-low.c (sigchld_handler): Really ignore `write' errors.
8140         * remote-utils.c (getpkt): Check for errors writing to the remote
8141         descriptor.
8142
8143 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8144
8145         * linux-low.c (linux_wait_1): Move non-debugging code out of
8146         `debug_threads' control.
8147
8148 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8149
8150         * linux-low.c (linux_wait_1): Don't set last_status here.
8151         * server.c (push_event, queue_stop_reply_callback): Assert we're
8152         not pushing a TARGET_WAITKIND_IGNORE event.
8153         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
8154         (myresume, handle_target_event): Set the thread's last_resume_kind
8155         and last_status from the target returned status.
8156
8157 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8158
8159         PR threads/10729
8160
8161         * linux-x86-low.c (update_debug_registers_callback): New.
8162         (i386_dr_low_set_addr): Use it.
8163         (i386_dr_low_get_addr): New.
8164         (i386_dr_low_set_control): Use update_debug_registers_callback.
8165         (i386_dr_low_get_control): New.
8166         (i386_dr_low_get_status): Adjust.
8167         * linux-low.c (linux_stop_lwp): New.
8168         * linux-low.h (linux_stop_lwp): Declare.
8169
8170         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
8171         argument instead of a i386_debug_reg_state.
8172         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
8173         a i386_debug_reg_state.
8174         (i386_insert_aligned_watchpoint): Adjust.
8175         (i386_remove_aligned_watchpoint): Adjust.
8176         (i386_low_stopped_data_address): Read the debug registers from the
8177         inferior instead of from the mirrors.
8178         * i386-low.h (struct i386_debug_reg_state): Extend comment.
8179         (i386_dr_low_get_addr): Declare.
8180         (i386_dr_low_get_control): Declare.
8181         (i386_dr_low_get_status): Change prototype.
8182
8183         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
8184         (i386_dr_low_get_addr): New.
8185         (i386_dr_low_get_control): New.
8186         (i386_dr_low_get_status): Adjust prototype.  Return
8187         dr_status_mirror.
8188         (i386_initial_stuff): Clear dr_status_mirror and
8189         dr_control_mirror.
8190         (i386_get_thread_context): Adjust.
8191         (i386_set_thread_context): Adjust.
8192         (i386_thread_added): Adjust.
8193
8194 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
8195
8196         * linux-low.h (linux_thread_area): Delete declaration.
8197
8198 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
8199
8200         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
8201         after its termination.
8202
8203 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
8204
8205         * linux-low.c (gdb_wants_lwp_stopped): Delete.
8206         (gdb_wants_all_stopped): Delete.
8207         (linux_wait_1): Don't call them.
8208         * server.c (handle_v_cont): Tag all threads as want-stopped.
8209         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
8210         stopped as "client-wants-stopped".
8211
8212 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
8213
8214         * Makefile.in (signals_h): New.
8215         (server_h): Depend on it.
8216         (server.o): Don't depend on $(signals_def).
8217         (signals.o): Depend on $(signals_def).
8218
8219 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
8220
8221         * Makefile.in (signals_def): New.
8222         (server_h): Append include/gdb/signals.h and signals_def.
8223         (server.o): Append signals_def.
8224
8225 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
8226
8227         * server.c (handle_target_event): Use target_signal_to_host for
8228         resume_info.sig initialization.
8229         * target.h (struct thread_resume) <sig>: New comment.
8230
8231 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
8232
8233         * server.c (handle_query): strcpy() the returned string from paddress()
8234         instead of sprintf().
8235         * utils.c (paddress): Return phex_nz().
8236
8237 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
8238
8239         * server.c (handle_v_cont): Call mourn_inferior if process
8240         just exited.
8241         (myresume): Likewise.
8242
8243 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
8244
8245         Static tracepoints, and integration with UST.
8246
8247         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
8248         * mem-break.c (uninsert_all_breakpoints)
8249         (reinsert_all_breakpoints): New.
8250         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
8251         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
8252         (gdb_agent_ust_loaded, helper_thread_id)
8253         (gdb_agent_helper_thread_id): New macros.
8254         (struct ipa_sym_addresses): Add addr_ust_loaded,
8255         addr_helper_thread_id, addr_cmd_buf.
8256         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
8257         (in_process_agent_loaded_ust): New.
8258         (write_e_ust_not_loaded): New.
8259         (maybe_write_ipa_ust_not_loaded): New.
8260         (struct collect_static_trace_data_action): New.
8261         (enum tracepoint_type) <static_tracepoint>: New.
8262         (struct tracepoint) <handle>: Mention static tracepoints.
8263         (struct static_tracepoint_ctx): New.
8264         (CMD_BUF_SIZE): New.
8265         (add_tracepoint_action): Handle static tracepoint actions.
8266         (unprobe_marker_at): New.
8267         (clear_installed_tracepoints): Handle static tracepoints.
8268         (cmd_qtdp): Handle static tracepoints.
8269         (probe_marker_at): New.
8270         (cmd_qtstart): Handle static tracepoints.
8271         (response_tracepoint): Handle static tracepoints.
8272         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
8273         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
8274         (get_context_regcache): Handle static tracepoints.
8275         (do_action_at_tracepoint): Handle static tracepoint actions.
8276         (traceframe_find_block_type): Handle static trace data blocks.
8277         (traceframe_read_sdata): New.
8278         (download_tracepoints): Download static tracepoint actions.
8279         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
8280         (GDB_PROBE_NAME): New.
8281         (ust_ops): New.
8282         (GET_UST_SYM): New.
8283         (USTF): New.
8284         (dlsym_ust): New.
8285         (ust_marker_to_static_tracepoint): New.
8286         (gdb_probe): New.
8287         (collect_ust_data_at_tracepoint): New.
8288         (gdb_ust_probe): New.
8289         (UNIX_PATH_MAX, SOCK_DIR): New.
8290         (gdb_ust_connect_sync_socket): New.
8291         (resume_thread, stop_thread): New.
8292         (run_inferior_command): New.
8293         (init_named_socket): New.
8294         (gdb_ust_socket_init): New.
8295         (cstr_to_hexstr): New.
8296         (next_st): New.
8297         (first_marker, next_marker): New.
8298         (response_ust_marker): New.
8299         (cmd_qtfstm, cmd_qtsstm): New.
8300         (unprobe_marker_at, probe_marker_at): New.
8301         (cmd_qtstmat, gdb_ust_thread): New.
8302         (gdb_ust_init): New.
8303         (initialize_tracepoint_ftlib): Call gdb_ust_init.
8304         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
8305         (ST_REGENTRY): New.
8306         (x86_64_st_collect_regmap): New.
8307         (X86_64_NUM_ST_COLLECT_GREGS): New.
8308         (AMD64_RIP_REGNUM): New.
8309         (supply_static_tracepoint_registers): New.
8310         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
8311         (ST_REGENTRY): New.
8312         (i386_st_collect_regmap): New.
8313         (i386_NUM_ST_COLLECT_GREGS): New.
8314         (supply_static_tracepoint_registers): New.
8315         * server.c (handle_query): Handle qXfer:statictrace:read.
8316         <qSupported>: Report support for StaticTracepoints, and
8317         qXfer:statictrace:read features.
8318         * server.h (traceframe_read_sdata)
8319         (supply_static_tracepoint_registers): Declare.
8320         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
8321         (unpack_varlen_hex): Include in IPA build.
8322         * Makefile.in (ustlibs, ustinc): New.
8323         (IPA_OBJS): Add remote-utils-ipa.o.
8324         ($(IPA_LIB)): Link -ldl and -lpthread.
8325         (UST_CFLAGS): New.
8326         (IPAGENT_CFLAGS): Add UST_CFLAGS.
8327         * config.in, configure: Regenerate.
8328
8329 2010-06-20  Ian Lance Taylor  <iant@google.com>
8330             Pedro Alves  <pedro@codesourcery.com>
8331
8332         * linux-x86-low.c (always_true): Delete.
8333         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
8334         trying to fool the compiler with always_true.
8335
8336 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
8337
8338         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
8339         conditions in gdbserver.
8340
8341 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
8342
8343         * spu-low.c (spu_read_memory): Wrap around local store limit.
8344         (spu_write_memory): Likewise.
8345
8346 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
8347
8348         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
8349         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
8350         LONGEST uses.
8351         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
8352         uses.
8353         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
8354         uses with LONGEST uses.
8355
8356 2010-06-14  Stan Shebs  <stan@codesourcery.com>
8357             Pedro Alves  <pedro@codesourcery.com>
8358
8359         Bytecode compiler.
8360
8361         * linux-x86-low.c: Include limits.h.
8362         (add_insns): New.
8363         (always_true): New.
8364         (EMIT_ASM): New.
8365         (EMIT_ASM32): New.
8366         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
8367         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
8368         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
8369         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
8370         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
8371         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
8372         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
8373         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
8374         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
8375         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
8376         (amd64_emit_void_call_2): New.
8377         (amd64_emit_ops): New.
8378         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
8379         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
8380         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
8381         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
8382         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
8383         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
8384         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
8385         (i386_emit_call, i386_emit_reg, i386_emit_pop)
8386         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
8387         (i386_emit_stack_adjust, i386_emit_int_call_1)
8388         (i386_emit_void_call_2): New.
8389         (i386_emit_ops): New.
8390         (x86_emit_ops): New.
8391         (the_low_target): Install x86_emit_ops.
8392         * server.h (struct emit_ops): New.
8393         (get_raw_reg_func_addr): Declare.
8394         (current_insn_ptr, emit_error): Declare.
8395         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
8396         (set_trace_state_variable_value): New defines.
8397         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
8398         addr_get_trace_state_variable_value and
8399         addr_set_trace_state_variable_value.
8400         (symbol_list): New fields for get_raw_reg,
8401         get_trace_state_variable_value and set_trace_state_variable_value.
8402         (condfn): New typedef.
8403         (struct tracepoint): New field `compiled_cond'.
8404         (do_action_at_tracepoint): Clear compiled_cond.
8405         (get_trace_state_variable_value, set_trace_state_variable_value):
8406         Export in the IPA.
8407         (condition_true_at_tracepoint): If there's a compiled condition,
8408         run that.
8409         (current_insn_ptr, emit_error): New globals.
8410         (struct bytecode_address): New.
8411         (get_raw_reg_func_addr): New.
8412         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
8413         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
8414         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
8415         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
8416         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
8417         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
8418         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
8419         (compile_tracepoint_condition, compile_bytecodes): New.
8420         * target.h (emit_ops): Forward declare.
8421         (struct target_ops): New field emit_ops.
8422         (target_emit_ops): New.
8423         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
8424         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
8425         * linux-low.c (linux_emit_ops): New.
8426         (linux_target_ops): Install it.
8427         * linux-low.h (struct linux_target_ops): New field emit_ops.
8428
8429 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
8430
8431         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
8432         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
8433
8434 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8435             Stan Shebs  <stan@codesourcery.com>
8436
8437         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
8438         (all): Depend on $(extra_libraries).
8439         (install-only): Install the IPA.
8440         (IPA_OBJS, IPA_LIB): New.
8441         (clean): Remove the IPA lib.
8442         (IPAGENT_CFLAGS): New.
8443         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
8444         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
8445         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
8446         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
8447         * configure.ac: Check for atomic builtins support in the compiler.
8448         (IPA_DEPFILES, extra_libraries): Define.
8449         * configure.srv (ipa_obj): Add description.
8450         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
8451         (i[34567]86-*-linux*): Set ipa_obj.
8452         (x86_64-*-linux*): Set ipa_obj.
8453         * linux-low.c (stabilizing_threads): New.
8454         (supports_fast_tracepoints): New.
8455         (linux_detach): Stabilize threads before detaching.
8456         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
8457         the lwp is either not stabilizing, or is moving out of a jump pad.
8458         (linux_fast_tracepoint_collecting): New.
8459         (maybe_move_out_of_jump_pad): New.
8460         (enqueue_one_deferred_signal): New.
8461         (dequeue_one_deferred_signal): New.
8462         (linux_wait_for_event_1): If moving out of a jump pad, defer
8463         pending signals to later.
8464         (linux_stabilize_threads): New.
8465         (linux_wait_1): Check if threads need moving out of jump pads, and
8466         do it if so.
8467         (stuck_in_jump_pad_callback): New.
8468         (move_out_of_jump_pad_callback): New.
8469         (lwp_running): New.
8470         (linux_resume_one_lwp): Handle moving out of jump pads.
8471         (linux_set_resume_request): Dequeue deferred signals.
8472         (need_step_over_p): Also step over fast tracepoint jumps.
8473         (start_step_over): Also uninsert fast tracepoint jumps.
8474         (finish_step_over): Also reinsert fast tracepoint jumps.
8475         (linux_install_fast_tracepoint_jump): New.
8476         (linux_target_ops): Install linux_stabilize_threads and
8477         linux_install_fast_tracepoint_jump_pad.
8478         * linux-low.h (linux_target_ops) <get_thread_area,
8479         install_fast_tracepoint_jump_pad>: New fields.
8480         (struct lwp_info) <collecting_fast_tracepoint,
8481         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
8482         (linux_get_thread_area): Declare.
8483         * linux-x86-low.c (jump_insn): New.
8484         (x86_get_thread_area): New.
8485         (append_insns): New.
8486         (push_opcode): New.
8487         (amd64_install_fast_tracepoint_jump_pad): New.
8488         (i386_install_fast_tracepoint_jump_pad): New.
8489         (x86_install_fast_tracepoint_jump_pad): New.
8490         (the_low_target): Install x86_get_thread_area and
8491         x86_install_fast_tracepoint_jump_pad.
8492         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
8493         (struct fast_tracepoint_jump): New.
8494         (fast_tracepoint_jump_insn): New.
8495         (fast_tracepoint_jump_shadow): New.
8496         (find_fast_tracepoint_jump_at): New.
8497         (fast_tracepoint_jump_here): New.
8498         (delete_fast_tracepoint_jump): New.
8499         (set_fast_tracepoint_jump): New.
8500         (uninsert_fast_tracepoint_jumps_at): New.
8501         (reinsert_fast_tracepoint_jumps_at): New.
8502         (set_breakpoint_at): Use write_inferior_memory.
8503         (uninsert_raw_breakpoint): Use write_inferior_memory.
8504         (check_mem_read): Mask out fast tracepoint jumps.
8505         (check_mem_write): Mask out fast tracepoint jumps.
8506         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
8507         (set_fast_tracepoint_jump): Declare.
8508         (delete_fast_tracepoint_jump)
8509         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
8510         (reinsert_fast_tracepoint_jumps_at): Declare.
8511         * regcache.c: Don't compile many functions when building the
8512         in-process agent library.
8513         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
8514         the register buffer in the heap.
8515         (free_register_cache): If the register buffer isn't owned by the
8516         regcache, don't free it.
8517         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8518         pre-existing register caches.
8519         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8520         type.
8521         (convert_ascii_to_int): : Constify `from' parameter type.
8522         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8523         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8524         the needed buffer in-place.
8525         (relocate_instruction): New.
8526         * server.c (handle_query) <qSymbols>: If the target supports
8527         tracepoints, give it a chance of looking up symbols.  Report
8528         support for fast tracepoints.
8529         (handle_status): Stabilize threads.
8530         (process_serial_event): Adjust.
8531         * server.h (struct fast_tracepoint_jump): Forward declare.
8532         (struct process_info) <fast_tracepoint_jumps>: New field.
8533         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8534         (decode_X_packet, decode_M_packet): Adjust.
8535         (relocate_instruction): Declare.
8536         (in_process_agent_loaded): Declare.
8537         (tracepoint_look_up_symbols): Declare.
8538         (struct fast_tpoint_collect_status): Declare.
8539         (fast_tracepoint_collecting): Declare.
8540         (force_unlock_trace_buffer): Declare.
8541         (handle_tracepoint_bkpts): Declare.
8542         (initialize_low_tracepoint)
8543         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8544         * target.h (struct target_ops) <stabilize_threads,
8545         install_fast_tracepoint_jump_pad>: New fields.
8546         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8547         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8548         [HAVE_STDINT_H]: Include stdint.h.
8549         (trace_debug_1): Rename to ...
8550         (trace_vdebug): ... this.
8551         (trace_debug): Rename to ...
8552         (trace_debug_1): ... this.  Add `level' parameter.
8553         (trace_debug): New.
8554         (ATTR_USED, ATTR_NOINLINE): New.
8555         (IP_AGENT_EXPORT): New.
8556         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8557         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8558         (about_to_request_buffer_space, trace_buffer_is_full)
8559         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8560         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8561         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8562         (traceframe_write_count, traceframes_created)
8563         (trace_state_variables)
8564         New renaming defines.
8565         (struct ipa_sym_addresses): New.
8566         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8567         (symbol_list): New.
8568         (ipa_sym_addrs): New.
8569         (all_tracepoint_symbols_looked_up): New.
8570         (in_process_agent_loaded): New.
8571         (write_e_ipa_not_loaded): New.
8572         (maybe_write_ipa_not_loaded): New.
8573         (tracepoint_look_up_symbols): New.
8574         (debug_threads) [IN_PROCESS_AGENT]: New.
8575         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8576         (UNKNOWN_SIDE_EFFECTS): New.
8577         (stop_tracing): New.
8578         (flush_trace_buffer): New.
8579         (stop_tracing_bkpt): New.
8580         (flush_trace_buffer_bkpt): New.
8581         (read_inferior_integer): New.
8582         (read_inferior_uinteger): New.
8583         (read_inferior_data_pointer): New.
8584         (write_inferior_data_pointer): New.
8585         (write_inferior_integer): New.
8586         (write_inferior_uinteger): New.
8587         (struct collect_static_trace_data_action): Delete.
8588         (enum tracepoint_type): New.
8589         (struct tracepoint) <type>: New field `type'.
8590         <actions_str, step_actions, step_actions_str>: Only include in
8591         GDBserver.
8592         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8593         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8594         (tracepoints): Use IP_AGENT_EXPORT.
8595         (last_tracepoint): Don't include in the IPA.
8596         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8597         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8598         (alloced_trace_state_variables): New.
8599         (trace_state_variables): Use IP_AGENT_EXPORT.
8600         (traceframe_t): Delete unused variable.
8601         (circular_trace_buffer): Don't include in the IPA.
8602         (trace_buffer_start): Delete.
8603         (struct trace_buffer_control): New.
8604         (trace_buffer_free): Delete.
8605         (struct ipa_trace_buffer_control): New.
8606         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8607         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8608         New.
8609         (trace_buffer_ctrl): New.
8610         (TRACE_BUFFER_CTRL_CURR): New.
8611         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8612         Reimplement as macros.
8613         (trace_buffer_wrap): Delete.
8614         (traceframe_write_count, traceframe_read_count)
8615         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8616         (struct tracepoint_hit_ctx) <type>: New field.
8617         (struct fast_tracepoint_ctx): New.
8618         (memory_barrier): New.
8619         (cmpxchg): New.
8620         (record_tracepoint_error): Update atomically in the IPA.
8621         (clear_inferior_trace_buffer): New.
8622         (about_to_request_buffer_space): New.
8623         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8624         updating the same buffer.
8625         (add_tracepoint): Default the tracepoint's type to trap
8626         tracepoint, and orig_size to -1.
8627         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8628         internal variables.
8629         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8630         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8631         (cmd_qtdp): Handle fast tracepoints.
8632         (cmd_qtdv): Adjust.
8633         (max_jump_pad_size): New.
8634         (gdb_jump_pad_head): New.
8635         (get_jump_space_head): New.
8636         (claim_jump_space): New.
8637         (sort_tracepoints): New.
8638         (MAX_JUMP_SIZE): New.
8639         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8640         IPA.
8641         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8642         support.  Upload fast traceframes, and delete internal IPA
8643         breakpoints.
8644         (stop_tracing_handler): New.
8645         (flush_trace_buffer_handler): New.
8646         (cmd_qtstop): Upload fast tracepoints.
8647         (response_tracepoint): Handle fast tracepoints.
8648         (tracepoint_finished_step): Upload fast traceframes.  Set the
8649         tracepoint hit context's tracepoint type.
8650         (handle_tracepoint_bkpts): New.
8651         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8652         type.  Add comment about fast tracepoints.
8653         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8654         non-existing action_str field.
8655         (get_context_regcache): Handle fast tracepoints.
8656         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8657         to the regcache.
8658         (fast_tracepoint_from_jump_pad_address): New.
8659         (fast_tracepoint_from_ipa_tpoint_address): New.
8660         (collecting_t): New.
8661         (force_unlock_trace_buffer): New.
8662         (fast_tracepoint_collecting): New.
8663         (collecting): New.
8664         (gdb_collect): New.
8665         (write_inferior_data_ptr): New.
8666         (target_tp_heap): New.
8667         (target_malloc): New.
8668         (download_agent_expr): New.
8669         (UALIGN): New.
8670         (download_tracepoints): New.
8671         (download_trace_state_variables): New.
8672         (upload_fast_traceframes): New.
8673         (IPA_FIRST_TRACEFRAME): New.
8674         (IPA_NEXT_TRACEFRAME_1): New.
8675         (IPA_NEXT_TRACEFRAME): New.
8676         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8677         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8678         (gdb_jump_pad_buffer_end): New.
8679         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8680         (initialize_tracepoint): Adjust.
8681         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8682         buffer.  Initialize the low module.
8683         * utils.c (PREFIX, TOOLNAME): New.
8684         (malloc_failure): Use PREFIX.
8685         (error): In the IPA, an error causes an exit.
8686         (fatal, warning): Use PREFIX.
8687         (internal_error): Use TOOLNAME.
8688         (NUMCELLS): Increase to 10.
8689         * configure, config.in: Regenerate.
8690
8691 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8692
8693         * server.c (handle_query) <qSupported>: Do two passes over the
8694         qSupported string to avoid nesting strtok.
8695
8696 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8697
8698         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8699         (CDEPS): New.
8700         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8701         -Wl,--dynamic-list.
8702         * configure: Regenerate.
8703         * proc-service.list: New.
8704
8705 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8706
8707         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8708         New comment.
8709
8710 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8711
8712         * gdbreplay.c (remote_open): Check error return from socket() call by
8713         its equality to -1 not by it being negative.
8714         * remote-utils.c (remote_open): Likewise.
8715
8716 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8717
8718         * config.h: Regenerate.
8719
8720 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8721
8722         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8723         doesn't provide PTRACE_GET_THREAD_AREA.
8724
8725 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8726
8727         * linux-m68k-low.c: Include <asm/ptrace.h>
8728         (ps_get_thread_area): Implement.
8729
8730 2010-05-03  Doug Evans  <dje@google.com>
8731
8732         * event-loop.c (struct callback_event): New struct.
8733         (callback_list): New global.
8734         (append_callback_event, delete_callback_event): New functions.
8735         (process_callback): New function.
8736         (start_event_loop): Call it.
8737         * remote-utils.c (NOT_SCHEDULED): Define.
8738         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8739         moved out of readchar.
8740         (readchar): Rewrite.  Call reschedule before returning.
8741         (reset_readchar): New function.
8742         (remote_close): Call it.
8743         (process_remaining, reschedule): New functions.
8744         * server.h (callback_handler_func): New typedef.
8745         (append_callback_event, delete_callback_event): Declare.
8746
8747 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8748
8749         * proc-service.c (ps_pglobal_lookup): Use
8750         thread_db_look_up_one_symbol.
8751         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8752         parameter.  Use it instead of all_symbols_looked_up.
8753         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8754         field.
8755         (all_symbols_looked_up): Don't declare.
8756         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8757         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8758         field.
8759         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8760         Set all_symbols_looked_up here.
8761         (thread_db_look_up_one_symbol): New.
8762         (thread_db_get_tls_address): Adjust.
8763         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8764         thread_db object on the heap, and tentatively set it in the
8765         process structure.
8766         (thread_db_init): Don't set all_symbols_looked_up here.
8767         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8768
8769 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8770
8771         * linux-low.c (linux_kill, linux_detach): Adjust.
8772         (status_pending_p_callback): Remove redundant statement.  Check
8773         for !TARGET_WAITIKIND_IGNORE, instead of
8774         TARGET_WAITKIND_STOPPED.
8775         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8776         (linux_wait_for_event_1): Adjust.
8777         (linux_cancel_breakpoints): New.
8778         (unsuspend_one_lwp): New.
8779         (unsuspend_all_lwps): New.
8780         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8781         (send_sigstop_callback): Change return type to int, add new
8782         `except' parameter and handle it.
8783         (suspend_and_send_sigstop_callback): New.
8784         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8785         pass them down.  If SUSPEND, also increment the lwp's suspend
8786         count.
8787         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8788         (need_step_over_p): Don't consider suspended LWPs.
8789         (start_step_over): Adjust.
8790         (proceed_one_lwp): Change return type to int, add new `except'
8791         parameter and handle it.
8792         (unsuspend_and_proceed_one_lwp): New.
8793         (proceed_all_lwps): Use find_inferior instead of
8794         for_each_inferior.
8795         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8796         also decrement the suspend count of LWPs.  Pass `except' down,
8797         instead of hacking its suspend count.
8798         (linux_pause_all): Add `freeze' parameter.  Adjust.
8799         (linux_unpause_all): New.
8800         (linux_target_ops): Install linux_unpause_all.
8801         * server.c (handle_status): Adjust.
8802         * target.h (struct target_ops): New fields `unpause_all' and
8803         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8804         (pause_all): Add new `freeze' parameter.
8805         (unpause_all): New.
8806         (cancel_breakpoints): New.
8807         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8808         cancel breakpoints.
8809         (cmd_qtstart): Pause threads.
8810         (stop_tracing): Pause threads, and cancel breakpoints.
8811         * win32-low.c (win32_target_ops): Adjust.
8812
8813 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8814
8815         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8816         the inferior right away from here...
8817         (linux_wait_1): ... to here, and adjust to check the thread's
8818         last_resume_kind instead of the lwp's step or stop_expected flags.
8819
8820 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8821
8822         * README: Use consistent `GDB' and `GDBserver' spellings.
8823
8824 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8825
8826         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8827         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8828         (linux_detach_one_lwp): Assume the lwp is stopped.
8829         (any_thread_of): Delete.
8830         (linux_detach): Stop all lwps here.  Don't blindly delete all
8831         breakpoints.
8832         (delete_lwp_callback): New.
8833         (linux_mourn): Delete all lwps of the process that is gone.
8834         (linux_wait_1): Don't delete the last lwp of the process here.
8835         * mem-break.h (mark_breakpoints_out): Declare.
8836         * mem-break.c (mark_breakpoints_out): New.
8837         (free_all_breakpoints): Use it.
8838         * server.c (handle_target_event): If the process is gone, mark
8839         breakpoints out.
8840         * thread-db.c (struct thread_db) <create_bp>: New field.
8841         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8842         breakpoint reference in the thread_db struct.
8843         (thread_db_load_search): Clear the thread_db object.
8844         (try_thread_db_load_1): Ditto.
8845         (switch_to_process): New.
8846         (disable_thread_event_reporting): Use it.
8847         (remove_thread_event_breakpoints): New.
8848         (thread_db_detach, thread_db_mourn): Use it.
8849
8850 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8851
8852         * linux-low.c (linux_enable_event_reporting): New.
8853         (linux_wait_for_event_1, handle_extended_wait): Use it.
8854
8855 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8856
8857         * linux-low.c (linux_kill_one_lwp, linux_kill)
8858         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8859         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8860         SIGSTOP even if the LWP is stopped.
8861         (send_sigstop_callback): New.
8862         (stop_all_lwps): Use send_sigstop_callback instead.
8863         (linux_resume_one_thread): Adjust.
8864         (proceed_one_lwp): Still proceed an LWP that the client has
8865         requested to stop, if we haven't reported it as stopped yet.  Make
8866         sure that LWPs the client want stopped, have a pending SIGSTOP.
8867
8868 2010-04-26  Doug Evans  <dje@google.com>
8869
8870         * server.c (handle_general_set): Make static.
8871
8872         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8873         Print received char after testing for error/eof instead of before.
8874         (input_interrupt): Tweak comment.
8875
8876 2010-04-23  Doug Evans  <dje@google.com>
8877
8878         * server.c (start_inferior): Print inferior argv if --debug.
8879
8880 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8881
8882         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8883         * nto-x86-low.c: Include server.h
8884
8885 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8886
8887         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8888         be consistent with other sources of this directory.
8889         (init_registers_amd64): Correct name of source file of this function
8890         in the comment.
8891
8892 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8893
8894         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8895         64-bit executables.
8896
8897 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8898
8899         * win32-i386-low.c: Add 64-bit support.
8900         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8901         (init_registers_amd64): Declare.
8902         (mappings): Add 64-bit version of array.
8903         (init_windows_x86): New function.
8904         (the_low_target): Change init_arch field to init_windows_x86.
8905
8906 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8907
8908         * win32-low.c: Adapt to support also 64-bit architecture.
8909         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8910         (get_image_name): Use SIZE_T type for local variable `done'.
8911         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8912         (toolhelp_get_dll_name): Idem.
8913         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8914         Use uintptr_t typecast to avoid warning.
8915         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8916         (handle_exception): Use phex_nz to avoid warning.
8917         (win32_wait): Remove unused local variable `process'.
8918
8919 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8920
8921         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8922         `amd64-avx.o'.
8923
8924 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8925
8926         * configure.ac: Use `ws2_32' library for srv_mingw.
8927         * configure: Regenerate.
8928         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8929         * remote-utils.c: Likewise.
8930
8931 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8932
8933         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8934         if __x86_64__ is defined.
8935
8936 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8937
8938         * configure: Regenerate.
8939
8940 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8941
8942         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8943         * target.h (target_ops): New get_tib_address field.
8944         * win32-low.h (win32_thread_info): Add thread_local_base field.
8945         * win32-low.c (child_add_thread): Add tlb argument.
8946         Set thread_local_base field to TLB.
8947         (get_child_debug_event): Adapt to child_add_thread change.
8948         (win32_get_tib_address): New function.
8949         (win32_target_ops): Set get_tib_address field to
8950         win32_get_tib_address.
8951         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8952
8953 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8954
8955         * linux-low.c (linux_mourn): Also remove the process.
8956         * server.c (handle_target_event): Don't remove the process here.
8957         * nto-low.c (nto_mourn): New.
8958         (nto_target_ops): Install it.
8959         * spu-low.c (spu_mourn): New.
8960         (spu_target_ops): Install it.
8961         * win32-low.c (win32_mourn): New.
8962         (win32_target_ops): Install it.
8963
8964 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8965
8966         * server.h (buffer_xml_printf): Remove redundant `;'.
8967
8968 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8969
8970         * regcache.c (set_register_cache): Invalidate regcaches before
8971         changing the register cache layout.
8972         (regcache_invalidate_one): Allow a NULL regcache.
8973         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8974         regcaches before changing the register cache layout or the target
8975         regsets.
8976
8977 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8978
8979         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8980         variable warning on Linux/x86-64.
8981
8982 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8983
8984         GDBserver disconnected tracing support.
8985
8986         * linux-low.c (linux_remove_process): Delete.
8987         (add_lwp): Don't set last_resume_kind here.
8988         (linux_kill): Use `mourn'.
8989         (linux_detach): Use `thread_db_detach', and `mourn'.
8990         (linux_mourn): New.
8991         (linux_attach_lwp_1): Adjust comment.
8992         (linux_attach): last_resume_kind moved the thread_info; adjust.
8993         (status_pending_p_callback): Adjust.
8994         (linux_wait_for_event_1): Adjust.
8995         (count_events_callback, select_singlestep_lwp_callback)
8996         (select_event_lwp_callback, cancel_breakpoints_callback)
8997         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8998         (proceed_one_lwp): Adjust.
8999         (linux_async): Add debug output.
9000         (linux_thread_stopped): New.
9001         (linux_pause_all): New.
9002         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
9003         linux_pause_all.
9004         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
9005         (thread_db_free): Delete declaration.
9006         (thread_db_detach, thread_db_mourn): Declare.
9007         * thread-db.c (thread_db_init): Use thread_db_mourn.
9008         (thread_db_free): Delete, split in two.
9009         (disable_thread_event_reporting): New.
9010         (thread_db_detach): New.
9011         (thread_db_mourn): New.
9012
9013         * server.h (struct thread_info) <last_resume_kind>: New field.
9014         <attached>: Add comment.
9015         <gdb_detached>: New field.
9016         (handler_func): Change return type to int.
9017         (handle_serial_event, handle_target_event): Ditto.
9018         (gdb_connected): Declare.
9019         (tracing): Delete.
9020         (disconnected_tracing): Declare.
9021         (stop_tracing): Declare.
9022
9023         * server.c (handle_query) <qSupported>: Report support for
9024         disconnected tracing.
9025         (queue_stop_reply_callback): Account for running threads.
9026         (gdb_wants_thread_stopped): New.
9027         (gdb_wants_all_threads_stopped): New.
9028         (gdb_reattached_process): New.
9029         (handle_status): Clear the `gdb_detached' flag of all processes.
9030         In all-stop, stop all threads.
9031         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
9032         (process_serial_event): If the remote connection breaks, or if an
9033         exit was forced with "monitor exit", force an event loop exit.
9034         Handle disconnected tracing on detach.
9035         (handle_serial_event): Adjust.
9036         (handle_target_event): If GDB isn't connected, forward events back
9037         to the inferior, unless the last process exited, in which case,
9038         exit gdbserver.  Adjust interface.
9039
9040         * remote-utils.c (remote_open): Don't block in accept.  Instead
9041         register an event loop source on the listen socket file
9042         descriptor.  Refactor bits into ...
9043         (listen_desc): ... this new global.
9044         (gdb_connected): ... this new function.
9045         (enable_async_notification): ... this new function.
9046         (handle_accept_event): ... this new function.
9047         (remote_close): Clear remote_desc.
9048
9049         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
9050
9051         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
9052         New fields.
9053         (mourn_inferior): Define.
9054         (target_process_qsupported): Avoid the dangling else problem.
9055         (thread_stopped): Define.
9056         (pause_all): Define.
9057         (target_waitstatus_to_string): Declare.
9058         * target.c (target_waitstatus_to_string): New.
9059
9060         * tracepoint.c (tracing): Make extern.
9061         (disconnected_tracing): New.
9062         (stop_tracing): Make extern.  Handle tracing stops due to GDB
9063         disconnecting.
9064         (cmd_qtdisconnected): New.
9065         (cmd_qtstatus): Report disconnected tracing status in trace reply.
9066         (handle_tracepoint_general_set): Handle QTDisconnected.
9067
9068         * event-loop.c (event_handler_func): Change return type to int.
9069         (process_event): Bail out if the event handler wants the event
9070         loop to stop.
9071         (handle_file_event): Ditto.
9072         (start_event_loop): Bail out if the event handler wants the event
9073         loop to stop.
9074
9075         * nto-low.c (nto_target_ops): Adjust.
9076         * spu-low.c (spu_wait): Don't remove the process here.
9077         (spu_target_ops): Adjust.
9078         * win32-low.c (win32_wait): Don't remove the process here.
9079         (win32_target_ops): Adjust.
9080
9081 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
9082
9083         * regcache.c (realloc_register_cache): Invalidate inferior's
9084         regcache before recreating it.
9085
9086 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
9087
9088         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
9089
9090 2010-04-09  Stan Shebs  <stan@codesourcery.com>
9091             Pedro Alves  <pedro@codesourcery.com>
9092
9093         * server.h (LONGEST): New.
9094         (struct thread_info) <while_stepping>: New field.
9095         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
9096         Declare.
9097         (initialize_tracepoint, handle_tracepoint_general_set)
9098         (handle_tracepoint_query, tracepoint_finished_step)
9099         (tracepoint_was_hit, release_while_stepping_state_list):
9100         (current_traceframe): Declare.
9101         * server.c (handle_general_set): Handle tracepoint packets.
9102         (read_memory): New.
9103         (write_memory): New.
9104         (handle_search_memory_1): Use read_memory.
9105         (handle_query): Report support for conditional tracepoints, trace
9106         state variables, and tracepoint sources.  Handle tracepoint
9107         queries.
9108         (main): Initialize the tracepoints module.
9109         (process_serial_event): Handle traceframe reads/writes.
9110
9111         * linux-low.c (handle_tracepoints): New.
9112         (linux_wait_1): Call it.
9113         (linux_resume_one_lwp): Handle while-stepping.
9114         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
9115         (linux_target_ops): Install them.
9116         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
9117         New field.
9118         * linux-x86-low.c (x86_supports_tracepoints): New.
9119         (the_low_target). Install it.
9120
9121         * mem-break.h (delete_breakpoint): Declare.
9122         * mem-break.c (delete_breakpoint): Make external.
9123
9124         * target.h (struct target_ops): Add `supports_tracepoints',
9125         `read_pc', and `write_pc' fields.
9126         (target_supports_tracepoints): Define.
9127         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
9128         (phex_nz): New.
9129
9130         * regcache.h (struct regcache) <registers_owned>: New field.
9131         (init_register_cache, regcache_cpy): Declare.
9132         (regcache_read_pc, regcache_write_pc): Declare.
9133         (register_cache_size): Declare.
9134         (supply_regblock): Declare.
9135         * regcache.c (init_register_cache): New.
9136         (new_register_cache): Use it.
9137         (regcache_cpy): New.
9138         (register_cache_size): New.
9139         (supply_regblock): New.
9140         (regcache_read_pc, regcache_write_pc): New.
9141
9142         * tracepoint.c: New.
9143
9144         * Makefile.in (OBS): Add tracepoint.o.
9145         (tracepoint.o): New rule.
9146
9147 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
9148
9149         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
9150         (i386-mmx.o): New.
9151         (i386-mmx.c): Likewise.
9152         (i386-mmx-linux.o): Likewise.
9153         (i386-mmx-linux.c): Likewise.
9154
9155         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
9156         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
9157         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
9158         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
9159
9160         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
9161         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
9162         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
9163
9164 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
9165
9166         * Makefile.in (clean): Updated.
9167         (i386-avx.o): New.
9168         (i386-avx.c): Likewise.
9169         (i386-avx-linux.o): Likewise.
9170         (i386-avx-linux.c): Likewise.
9171         (amd64-avx.o): Likewise.
9172         (amd64-avx.c): Likewise.
9173         (amd64-avx-linux.o): Likewise.
9174         (amd64-avx-linux.c): Likewise.
9175
9176         * configure.srv (srv_i386_regobj): Add i386-avx.o.
9177         (srv_i386_linux_regobj): Add i386-avx-linux.o.
9178         (srv_amd64_regobj): Add amd64-avx.o.
9179         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
9180         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
9181         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
9182         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
9183         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
9184         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
9185         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
9186
9187         * i387-fp.c: Include "i386-xstate.h".
9188         (i387_xsave): New.
9189         (i387_cache_to_xsave): Likewise.
9190         (i387_xsave_to_cache): Likewise.
9191         (x86_xcr0): Likewise.
9192
9193         * i387-fp.h (i387_cache_to_xsave): Likewise.
9194         (i387_xsave_to_cache): Likewise.
9195         (x86_xcr0): Likewise.
9196
9197         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
9198         * linux-crisv32-low.c (target_regsets): Likewise.
9199         * linux-m68k-low.c (target_regsets): Likewise.
9200         * linux-mips-low.c (target_regsets): Likewise.
9201         * linux-ppc-low.c (target_regsets): Likewise.
9202         * linux-s390-low.c (target_regsets): Likewise.
9203         * linux-sh-low.c (target_regsets): Likewise.
9204         * linux-sparc-low.c (target_regsets): Likewise.
9205         * linux-xtensa-low.c (target_regsets): Likewise.
9206
9207         * linux-low.c: Include <sys/uio.h>.
9208         (regsets_fetch_inferior_registers): Support nt_type.
9209         (regsets_store_inferior_registers): Likewise.
9210         (linux_process_qsupported): New.
9211         (linux_target_ops): Add linux_process_qsupported.
9212
9213         * linux-low.h (regset_info): Add nt_type.
9214         (linux_target_ops): Add process_qsupported.
9215
9216         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
9217         and <sys/uio.h>.
9218         (init_registers_i386_avx_linux): New.
9219         (init_registers_amd64_avx_linux): Likewise.
9220         (xmltarget_i386_linux_no_xml): Likewise.
9221         (xmltarget_amd64_linux_no_xml): Likewise.
9222         (PTRACE_GETREGSET): Likewise.
9223         (PTRACE_SETREGSET): Likewise.
9224         (x86_fill_xstateregset): Likewise.
9225         (x86_store_xstateregset): Likewise.
9226         (use_xml): Likewise.
9227         (x86_linux_update_xmltarget): Likewise.
9228         (x86_linux_process_qsupported): Likewise.
9229         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
9230         (x86_arch_setup): Don't call init_registers_amd64_linux nor
9231         init_registers_i386_linux here.  Call
9232         x86_linux_update_xmltarget.
9233         (the_low_target): Add x86_linux_process_qsupported.
9234
9235         * server.c (handle_query): Call target_process_qsupported.
9236
9237         * target.h (target_ops): Add process_qsupported.
9238         (target_process_qsupported): New.
9239
9240 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
9241
9242         * inferiors.c (add_thread): Set last_status kind to
9243         TARGET_WAITKIND_IGNORE.
9244         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
9245         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
9246         (linux_wait_1): Move `thread' local definition to block that uses
9247         it.  Don't NULL initialize `event_child'.
9248         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
9249         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
9250         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
9251
9252 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9253
9254         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
9255         an extended waitstatus, or by a watchpoint.
9256         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
9257         thread was stepping or has been stopped by a watchpoint.
9258
9259 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9260
9261         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
9262         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
9263         of another, then delete the previous, and validate all
9264         breakpoints.
9265         (validate_inserted_breakpoint): New.
9266         (delete_disabled_breakpoints): New.
9267         (validate_breakpoints): New.
9268         (check_mem_read): Validate breakpoints before trusting their
9269         shadow.  Delete disabled breakpoints.
9270         (check_mem_write): Validate breakpoints before trusting they
9271         should be inserted.  Delete disabled breakpoints.
9272         * mem-break.h (validate_breakpoints):
9273         * server.c (handle_query): Validate breakpoints when we see a
9274         qSymbol query.
9275
9276 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9277
9278         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
9279         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
9280         if we could tell there's a GDB breakpoint at stop_pc.
9281         (need_step_over_p): Don't do a step over if we find a GDB
9282         breakpoint at the resume PC.
9283
9284         * mem-break.c (struct raw_breakpoint): New.
9285         (enum bkpt_type): New type `gdb_breakpoint'.
9286         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
9287         fields.  New field `raw'.
9288         (find_raw_breakpoint_at): New.
9289         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
9290         breakpoint instead.
9291         (set_breakpoint_at): Adjust.
9292         (delete_raw_breakpoint): New.
9293         (release_breakpoint): New.
9294         (delete_breakpoint): Rename to...
9295         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
9296         release_breakpoint.  Return ENOENT.
9297         (delete_breakpoint): Reimplement.
9298         (find_breakpoint_at): Delete.
9299         (find_gdb_breakpoint_at): New.
9300         (delete_breakpoint_at): Delete.
9301         (set_gdb_breakpoint_at): New.
9302         (delete_gdb_breakpoint_at): New.
9303         (gdb_breakpoint_here): New.
9304         (set_reinsert_breakpoint): Use release_breakpoint.
9305         (uninsert_breakpoint): Rename to ...
9306         (uninsert_raw_breakpoint): ... this.
9307         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
9308         (reinsert_raw_breakpoint): Change parameter type to
9309         raw_breakpoint.
9310         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
9311         instead.
9312         (check_breakpoints): Adjust.  Use release_breakpoint.
9313         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
9314         (breakpoint_inserted_here): Ditto.
9315         (check_mem_read): Adjust to iterate over raw breakpoints instead.
9316         Don't trust the breakpoint's shadow if it is not inserted.
9317         (check_mem_write): Adjust to iterate over raw breakpoints instead.
9318         (delete_all_breakpoints): Adjust.
9319         (free_all_breakpoints): Mark all breakpoints as uninserted, and
9320         use delete_breakpoint_1.
9321
9322         * mem-break.h (breakpoints_supported): Delete declaration.
9323         (set_gdb_breakpoint_at): Declare.
9324         (gdb_breakpoint_here): Declare.
9325         (delete_breakpoint_at): Delete.
9326         (delete_gdb_breakpoint_at): Declare.
9327
9328         * server.h (struct raw_breakpoint): Forward declare.
9329         (struct process_info): New field `raw_breakpoints'.
9330
9331         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
9332         breakpoints.
9333
9334 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9335
9336         * linux-low.c (status_pending_p_callback): Fix comment.
9337         (linux_wait_for_event_1): Move most of the internal breakpoint
9338         handling from here...
9339         (linux_wait_1): ... to here.
9340         (count_events_callback): New.
9341         (select_singlestep_lwp_callback): New.
9342         (select_event_lwp_callback): New.
9343         (cancel_breakpoints_callback): New.
9344         (select_event_lwp): New.
9345         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
9346         priority to all LWPs that have had events that should be reported
9347         to the client.  Cancel breakpoints when about to reporting the
9348         event to the client, not while stopping lwps.  No longer cancel
9349         finished single-steps here.
9350         (cancel_finished_single_step): Delete.
9351         (cancel_finished_single_steps): Delete.
9352
9353 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9354
9355         * mem-break.c (enum bkpt_type): New.
9356         (struct breakpoint): New field `type'.
9357         (set_breakpoint_at): Change return type to struct breakpoint
9358         pointer.  Set type to `other_breakpoint' by default.
9359         (delete_breakpoint): Rewrite, supporting more than one breakpoint
9360         in the breakpoint list.
9361         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
9362         (reinsert_breakpoint): Rename to ...
9363         (reinsert_raw_breakpoint): ... this.
9364         (reinsert_breakpoints_at): Adjust.
9365         * mem-break.h (struct breakpoint): Declare.
9366         (set_breakpoint_at): Change return type to struct breakpoint
9367         pointer.
9368
9369 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9370
9371         * server.c (handle_query): Assign, not compare.
9372
9373 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9374
9375         Teach linux gdbserver to step-over-breakpoints.
9376
9377         * linux-low.c (can_hardware_single_step): New.
9378         (supports_breakpoints): New.
9379         (handle_extended_wait): If stopping threads, read the stop pc of
9380         the new cloned LWP.
9381         (get_pc): New.
9382         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
9383         low target doesn't support retrieving the PC.
9384         (add_lwp): Set last_resume_kind to resume_continue.
9385         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
9386         (linux_attach): Don't clear stop_expected.  Set the lwp's
9387         last_resume_kind to resume_stop.
9388         (linux_detach_one_lwp): Don't check for removed breakpoints.
9389         (check_removed_breakpoint): Delete.
9390         (status_pending_p): Rename to ...
9391         (status_pending_p_callback): ... this.  Don't check for removed
9392         breakpoints.  Don't consider threads that are stopped from GDB's
9393         perspective.
9394         (linux_wait_for_lwp): Always read the stop_pc here.
9395         (cancel_breakpoint): New.
9396         (step_over_bkpt): New global.
9397         (linux_wait_for_event_1): Implement stepping over breakpoints.
9398         (gdb_wants_lwp_stopped): New.
9399         (gdb_wants_all_stopped): New.
9400         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
9401         single-step traps here.  Store the thread's last reported target
9402         wait status.
9403         (send_sigstop): Don't clear stop_expected.  Always set it,
9404         instead.
9405         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
9406         (cancel_finished_single_step): New.
9407         (cancel_finished_single_steps): New.
9408         (wait_for_sigstop): Don't cancel finished single-step traps here.
9409         (linux_resume_one_lwp): Don't check for removed breakpoints.
9410         Don't set `step' on non-hardware step archs.
9411         (linux_set_resume_request): Ignore resume_stop requests if already
9412         stopping or stopped.  Set the lwp's last_resume_kind.
9413         (resume_status_pending_p): Don't check for removed breakpoints.
9414         (need_step_over_p): New.
9415         (start_step_over): New.
9416         (finish_step_over): New.
9417         (linux_resume_one_thread): Always queue a sigstop for resume_stop
9418         requests.  Clear the thread's last reported target waitstatus.
9419         Don't use the `suspended' flag.  Don't consider pending breakpoints.
9420         (linux_resume): Start a step-over if necessary.
9421         (proceed_one_lwp): New.
9422         (proceed_all_lwps): New.
9423         (unstop_all_lwps): New.
9424         * linux-low.h (struct lwp_info): Rewrite comment for the
9425         `suspended' flag.  Add the `stop_pc' field.  Delete the
9426         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
9427         Add `'last_resume_kind' and `need_step_over' fields.
9428         * inferiors.c (struct thread_info): Delete, moved elsewhere.
9429         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
9430         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
9431         (set_raw_breakpoint_at): New.
9432         (set_breakpoint_at): Rewrite to use it.
9433         (reinsert_breakpoint_handler): Delete.
9434         (set_reinsert_breakpoint): New.
9435         (reinsert_breakpoint_by_bp): Delete.
9436         (delete_reinsert_breakpoints): New.
9437         (uninsert_breakpoint): Rewrite.
9438         (uninsert_breakpoints_at): New.
9439         (reinsert_breakpoint): Rewrite.
9440         (reinsert_breakpoints_at): New.
9441         (check_breakpoints): Rewrite.
9442         (breakpoint_here): New.
9443         (breakpoint_inserted_here): New.
9444         (check_mem_read): Adjust.
9445         * mem-break.h (breakpoints_supported, breakpoint_here)
9446         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
9447         (reinsert_breakpoint_by_bp): Delete declaration.
9448         (delete_reinsert_breakpoints): Declare.
9449         (reinsert_breakpoint): Delete declaration.
9450         (reinsert_breakpoints_at): Declare.
9451         (uninsert_breakpoint): Delete declaration.
9452         (uninsert_breakpoints_at): Declare.
9453         (check_breakpoints): Adjust prototype.
9454         * server.h: Adjust include order.
9455         (struct thread_info): Declare here.  Add a `last_status' field.
9456
9457 2010-03-23  Michael Snyder  <msnyder@vmware.com>
9458
9459         * server.c (crc32): New function.
9460         (handle_query): Add handling for 'qCRC:' request.
9461
9462 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
9463
9464         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
9465         lwp had been stopped by a watchpoint.
9466
9467 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
9468
9469         * server.h (internal_error): Declare.
9470         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
9471         * utils.c (internal_error): New function.
9472
9473 2010-03-15  Andreas Schwab  <schwab@redhat.com>
9474
9475         * configure.srv: Fix typo setting srv_regobj.
9476
9477 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
9478
9479         * linux-low.c (fetch_register): Avoid passing a non string literal
9480         format to `error'.
9481         (usr_store_inferior_registers): Ditto.
9482
9483 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9484
9485         * linux-low.c (linux_write_memory): Bail out early if peeking
9486         memory failed.
9487
9488 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9489
9490         * linux-low.h (struct lwp_info): New fields
9491         `stopped_by_watchpoint' and `stopped_data_address'.
9492         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
9493         here, and cache them in the lwp object.
9494         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
9495         directly.
9496         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
9497         field.
9498         (linux_stopped_by_watchpoint): Rewrite.
9499         (linux_stopped_data_address): Rewrite.
9500
9501 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
9502
9503         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
9504         switching the current inferior, not before.
9505
9506 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
9507
9508         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
9509         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
9510         i386-linux.c and amd64-linux.c.
9511         (reg-i386.o): Removed.
9512         (reg-i386.c): Likewise.
9513         (reg-i386-linux.o): Likewise.
9514         (reg-i386-linux.c): Likewise.
9515         (reg-x86-64.o): Likewise.
9516         (reg-x86-64.c): Likewise.
9517         (reg-x86-64-linux.o): Likewise.
9518         (reg-x86-64-linux.c): Likewise.
9519         (i386.o): New.
9520         (i386.c): Likewise.
9521         (i386-linux.o): Likewise.
9522         (i386-linux.c): Likewise.
9523         (amd64.o): Likewise.
9524         (amd64.c): Likewise.
9525         (amd64-linux.o): Likewise.
9526         (amd64-linux.c): Likewise.
9527
9528         * configure.srv (srv_i386_regobj): New.
9529         (srv_i386_linux_regobj): Likewise.
9530         (srv_amd64_regobj): Likewise.
9531         (srv_amd64_linux_regobj): Likewise.
9532         (srv_i386_32bit_xmlfiles): Likewise.
9533         (srv_i386_64bit_xmlfiles): Likewise.
9534         (srv_i386_xmlfiles): Likewise.
9535         (srv_amd64_xmlfiles): Likewise.
9536         (srv_i386_linux_xmlfiles): Likewise.
9537         (srv_amd64_linux_xmlfiles): Likewise.
9538         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9539         srv_xmlfiles to $srv_i386_xmlfiles.
9540         (i[34567]86-*-mingw32ce*): Likewise.
9541         (i[34567]86-*-mingw*): Likewise.
9542         (i[34567]86-*-nto*): Likewise.
9543         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9544         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9545         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9546         (x86_64-*-linux*): Likewise.
9547
9548         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9549         (init_registers_amd64_linux): New.
9550         (x86_arch_setup): Replace init_registers_x86_64_linux with
9551         init_registers_amd64_linux.
9552
9553 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9554
9555         * configure.ac: Check for libdl.  If it is not available link against
9556         static libthread_db.
9557         * configure: Regenerate.
9558
9559 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9560
9561         PR9605
9562
9563         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9564         handing a read watchpoint.
9565         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9566
9567 2010-02-12  Doug Evans  <dje@google.com>
9568
9569         * linux-low.c (linux_supports_tracefork_flag): Document.
9570         (linux_look_up_symbols): Add comment.
9571
9572 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9573
9574         * regcache.c (supply_register): Clear regcache if buf is NULL.
9575
9576 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9577             Joel Brobecker  <brobecker@adacore.com>
9578
9579         * inferiors.c (find_inferior): Add function documentation.
9580         (unloaded_dll): Handle the case where the unloaded dll has not
9581         been previously registered in the dll list.
9582
9583 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9584
9585         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9586         (thumb2_breakpoint): New.
9587         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9588
9589 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9590
9591         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9592         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9593         breakpoints.
9594
9595 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9596
9597         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9598
9599 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9600
9601         * linux-s390-low.c (s390_collect_ptrace_register)
9602         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9603
9604 2010-01-21  Doug Evans  <dje@google.com>
9605
9606         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9607         (PTRACE_ARG4_TYPE): New macro.
9608         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9609         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9610         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9611         (usr_store_inferior_registers): Ditto.
9612         (linux_read_memory, linux_write_memory): Ditto.
9613         (linux_test_for_tracefork): Ditto.
9614
9615         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9616         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9617
9618 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9619
9620         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9621         target.
9622
9623 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9624
9625         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9626         prototype to take a regcache.  Adjust.
9627
9628 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9629
9630         * regcache.h (struct thread_info): Forward declare.
9631         (struct regcache): New.
9632         (new_register_cache): Adjust prototype.
9633         (get_thread_regcache): Declare.
9634         (free_register_cache): Adjust prototype.
9635         (registers_to_string, registers_from_string): Ditto.
9636         (supply_register, supply_register_by_name, collect_register)
9637         (collect_register_as_string, collect_register_by_name): Ditto.
9638         * regcache.c (struct inferior_regcache_data): Delete.
9639         (get_regcache): Rename to ...
9640         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9641         fetching registers.
9642         (regcache_invalidate_one): Adjust.
9643         (regcache_invalidate): Fix prototype.
9644         (new_register_cache): Return the new register cache.
9645         (free_register_cache): Change prototype.
9646         (realloc_register_cache): Adjust.
9647         (registers_to_string): Change prototype to take a regcache.  Adjust.
9648         (registers_from_string): Ditto.
9649         (register_data): Ditto.
9650         (supply_register): Ditto.
9651         (supply_register_by_name): Ditto.
9652         (collect_register): Ditto.
9653         (collect_register_as_string): Ditto.
9654         (collect_register_by_name): Ditto.
9655         * server.c (process_serial_event): Adjust.
9656         * linux-low.h (regset_fill_func, regset_store_func): Change
9657         prototype.
9658         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9659         Change prototype.
9660         * linux-low.c (get_stop_pc): Adjust.
9661         (check_removed_breakpoint): Adjust.
9662         (linux_wait_for_event): Adjust.
9663         (linux_resume_one_lwp): Adjust.
9664         (fetch_register): Add regcache parameter.  Adjust.
9665         (usr_store_inferior_registers): Ditto.
9666         (regsets_fetch_inferior_registers): Ditto.
9667         (regsets_store_inferior_registers): Ditto.
9668         (linux_fetch_registers, linux_store_registers): Ditto.
9669         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9670         regcache.  Adjust.
9671         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9672         Ditto.
9673         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9674         prototype to take a regcache.
9675         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9676         * remote-utils.c (convert_ascii_to_int, outreg)
9677         (prepare_resume_reply): Change prototype to take a regcache.
9678         Adjust.
9679         * target.h (struct target_ops) <fetch_registers, store_registers>:
9680         Change prototype to take a regcache.
9681         (fetch_inferior_registers, store_inferior_registers): Change
9682         prototype to take a regcache.  Adjust.
9683         * proc-service.c (ps_lgetregs): Adjust.
9684         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9685         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9686         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9687         take a regcache.  Adjust.
9688         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9689         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9690         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9691         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9692         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9693         (cris_cannot_fetch_register):
9694         (cris_breakpoint_at): Change prototype to take a regcache.
9695         Adjust.
9696         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9697         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9698         to take a regcache.  Adjust.
9699         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9700         Adjust.
9701         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9702         take a regcache.  Adjust.
9703         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9704         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9705         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9706         * linux-mips-low.c (mips_get_pc):
9707         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9708         (mips_reinsert_addr): Adjust.
9709         (mips_collect_register): Change prototype to take a regcache.
9710         Adjust.
9711         (mips_supply_register):
9712         (mips_collect_register_32bit, mips_supply_register_32bit)
9713         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9714         (mips_store_fpregset): Ditto.
9715         * linux-ppc-low.c (ppc_supply_ptrace_register)
9716         (ppc_supply_ptrace_register): Ditto.
9717         (parse_spufs_run): Adjust.
9718         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9719         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9720         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9721         take a regcache.  Adjust.
9722         * linux-s390-low.c (s390_collect_ptrace_register)
9723         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9724         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9725         (s390_arch_setup): Adjust.
9726         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9727         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9728         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9729         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9730         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9731         regcache.  Adjust.
9732         (sparc_breakpoint_at): Adjust.
9733         * linux-xtensa-low.c (xtensa_fill_gregset):
9734         (xtensa_store_gregset):
9735         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9736         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9737         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9738         prototype to take a regcache.  Adjust.
9739         * win32-arm-low.c (arm_fetch_inferior_register)
9740         (arm_store_inferior_register): Change prototype to take a
9741         regcache.  Adjust.
9742         * win32-i386-low.c (i386_fetch_inferior_register)
9743         (i386_store_inferior_register): Change prototype to take a
9744         regcache.  Adjust.
9745         * win32-low.c (child_fetch_inferior_registers)
9746         (child_store_inferior_registers): Change prototype to take a
9747         regcache.  Adjust.
9748         (win32_wait): Adjust.
9749         (win32_fetch_inferior_registers): Change prototype to take a
9750         regcache.  Adjust.
9751         (win32_store_inferior_registers): Adjust.
9752         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9753         store_inferior_register>: Change prototype to take a regcache.
9754
9755 2010-01-20  Doug Evans  <dje@google.com>
9756
9757         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9758         #ifdef.
9759         (linux_wait_for_event1, linux_init_signals): Ditto.
9760         (W_STOPCODE): Provide definition if missing.
9761
9762 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9763
9764         * linux-low.c (linux_core_of_thread): New.
9765         (compare_ints, show_process, list_threads): New.
9766         (linux_qxfer_osdata): Report threads and cores.
9767         (linux_target_op): Register linux_core_of_thread.
9768         * remote-utils.c (prepare_resume_reply): Report the core.
9769         (buffer_xml_printf): Support %d specifier.
9770         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9771         New.
9772         (handle_query): Handle qXfer:threads.  Announce availability
9773         thereof.
9774         * target.h (struct target_ops): New field core_of_thread.
9775
9776 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9777
9778         * Makefile.in (clean): Remove new generated files.
9779         (reg-s390.o, reg-s390.c): Remove rules.
9780         (reg-s390x.o, reg-s390x.c): Likewise.
9781         (s390-linux32.o, s390-linux32.c): Add rules.
9782         (s390-linux64.o, s390-linux64.c): Likewise.
9783         (s390x-linux64.o, s390x-linux64.c): Likewise.
9784         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9785         * linux-s390-low.c: Include <elf.h>.
9786         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9787         (init_registers_s390): Remove prototype.
9788         (init_registers_s390x): Likewise.
9789         (init_registers_s390_linux32): Add prototype.
9790         (init_registers_s390_linux64): Likewise.
9791         (init_registers_s390x_linux64): Likewise.
9792         (s390_num_regs_3264): New define.
9793         (s390_regmap_3264): New global variable.
9794         (s390_cannot_fetch_register): Remove obsolete check.
9795         (s390_cannot_store_register): Likewise.
9796         (s390_collect_ptrace_register): Handle upper/lower register halves.
9797         (s390_supply_ptrace_register): Likewise.
9798         (s390_fill_gregset): Update to register number changes.
9799         (s390_get_hwcap): New routine.
9800         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9801         Install appropriate regmap and register set.
9802
9803 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9804
9805         * server.c (gdbserver_version): Update copyright year to 2010.
9806         * gdbreplay.c (gdbreplay_version): Likewise.
9807
9808 2009-12-28  Doug Evans  <dje@google.com>
9809
9810         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9811         elf/external.h.  Include <elf.h> instead but only if necessary.
9812
9813 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9814
9815         * linux-low.c (linux_remove_process): Remove `detaching'
9816         parameter.  Don't release/detach from thread_db here.
9817         (linux_kill): Release/detach from thread_db here, ...
9818         (linux_detach): ... and here, before actually detaching.
9819         (linux_wait_1): ... and here, when a process exits.
9820         * thread-db.c (any_thread_of): New.
9821         (thread_db_free): Switch the current inferior to a thread of the
9822         passed in process.
9823
9824 2009-12-21  Doug Evans  <dje@google.com>
9825
9826         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9827
9828         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9829         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9830         warning ifndef __NR_tkill.  Move setting of errno there too.
9831         Delete unnecessary resetting of errno after syscall.
9832         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9833
9834         * configure.ac: Check for dladdr.
9835         * config.in: Regenerate.
9836         * configure: Regenerate.
9837         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9838         (try_thread_db_load): Update.
9839
9840         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9841
9842 2009-12-18  Doug Evans  <dje@google.com>
9843
9844         * event-loop.c: Include unistd.h if it exists.
9845
9846         * linux-low.c (my_waitpid): Move definition away from being in
9847         between linux_tracefork_child/linux_test_for_tracefork.
9848
9849         * gdb_proc_service.h (psaddr_t): Fix type.
9850         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9851         signature to match glibc.
9852
9853 2009-12-16  Doug Evans  <dje@google.com>
9854
9855         * linux-low.c (linux_read_memory): Fix argument to read.
9856
9857 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9858
9859         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9860         events, don't leave current_inferior pointing at null.
9861
9862 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9863
9864         * win32-low.c (LOG): Delete.
9865         (OUTMSG): Output to stderr.
9866         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9867         on compile time LOG macro.
9868         (win32_wait): Fix debug output.
9869
9870 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9871
9872         * win32-low.c (win32_add_one_solib): If the dll name is
9873         "ntdll.dll", prepend the system directory to the dll path.
9874
9875 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9876
9877         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9878
9879 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9880             Vladimir Prus  <vladimir@codesourcery.com>
9881
9882         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9883         * configure.ac: Check for __mcoldfire__ and set
9884         gdb_cv_m68k_is_coldfire.
9885         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9886         reg-cf.o and reg-m68k.o.
9887         * configure: Regenerated.
9888
9889 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9890
9891         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9892         Pass it to thread_db_free.
9893         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9894         proper `detaching' argument to linux_remove_process.
9895         * linux-low.h (thread_db_free): Add `detaching' parameter.
9896         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9897         to thread_db_free.
9898         (thread_db_free): Add `detaching' parameter.  Only
9899         call td_ta_clear_event if detaching from process.
9900
9901 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9902
9903         * thread-db.c (thread_db_free): Fix typo.
9904
9905 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9906
9907         PR gdb/10838
9908         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9909
9910 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9911
9912         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9913         with an i686 compiler.
9914         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9915         needed.
9916         * configure: Rebuilt.
9917
9918 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9919
9920         PR gdb/10783
9921
9922         * server.c (handle_search_memory_1): Correct read_addr initialization
9923         in loop for searching subsequent chunks.
9924
9925 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9926
9927         * configure.ac: New --with-libthread-db option.
9928         * thread-db.c: Allow direct dependence on libthread_db.
9929         (thread_db_free): Adjust.
9930         * config.in: Regenerate.
9931         * configure: Likewise.
9932
9933 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9934
9935         PR gdb/10757
9936         * thread-db.c (attach_thread): New function.
9937         (maybe_attach_thread): Return success/failure.
9938         (find_new_threads_callback): Adjust.
9939         (thread_db_find_new_threads): Loop until no new threads.
9940
9941 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9942
9943         * proc-service.c (ps_lgetregs): Formatting.
9944
9945 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9946
9947         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9948         * configure.ac: Adjust.
9949         * linux-low.h (struct process_info_private): Move members to struct
9950         thread_db.
9951         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9952         * linux-low.c (linux_remove_process): Adjust.
9953         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9954         * server.c (handle_query): Move code ...
9955         (handle_monitor_command): ... here. New function.
9956         * target.h (struct target_ops): New member.
9957         * thread-db.c (struct thread_db): New.
9958         (libthread_db_search_path): New variable.
9959         (thread_db_create_event, thread_db_enable_reporting)
9960         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9961         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9962         (try_thread_db_load_1, dladdr_to_soname): New functions.
9963         (try_thread_db_load, thread_db_load_search): New functions.
9964         (thread_db_init): Search for libthread_db.
9965         (thread_db_free): New function.
9966         (thread_db_handle_monitor_command): Likewise.
9967         * config.in: Regenerate.
9968         * configure: Regenerate.
9969
9970 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9971
9972         * spu-low.c (spu_kill): Wait for inferior to terminate.
9973         Call clear_inferiors.
9974         (spu_detach): Call clear_inferiors.
9975
9976 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9977
9978         * aclocal.m4: Regenerate.
9979         * config.in: Likewise.
9980         * configure: Likewise.
9981
9982 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9983
9984         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9985         (parse_spufs_run): New function.
9986         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9987         (ppc_breakpoint_at): Handle SPU breakpoints.
9988
9989 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9990
9991         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9992         (SPUFS_MAGIC): Define.
9993         (spu_enumerate_spu_ids): New function.
9994         (linux_qxfer_spu): New function.
9995         (linux_target_ops): Install linux_qxfer_spu.
9996
9997 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9998
9999         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
10000         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
10001         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
10002         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
10003         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
10004         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
10005         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
10006         (init_registers_powerpc_cell32l): Add prototype.
10007         (init_registers_powerpc_cell64l): Likewise.
10008         (ppc_arch_setup): Detect Cell/B.E. architecture.
10009
10010 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10011
10012         * Makefile.in (datarootdir): New variable.
10013
10014 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
10015
10016         * linux-low.c (linux_write_memory): Update debugging output.
10017         * Makefile.in (clean): Add new descriptions.
10018         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
10019         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
10020         * configure.srv: Add new files for arm*-*-linux*.
10021         * linux-arm-low.c: Add new declarations.
10022         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
10023         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
10024         (HWCAP_VFPv3D16): New.
10025         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
10026         instead of __IWMMXT__.
10027         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
10028         (arm_arch_setup): New.
10029         (target_regsets): Remove #ifdef.  Add VFP regset.
10030         (the_low_target): Use arm_arch_setup.
10031
10032 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
10033
10034         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
10035         the main thread again.
10036
10037 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
10038
10039         Adding Neutrino gdbserver.
10040         * configure: Regenerated.
10041         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
10042         * configure.srv (i[34567]86-*-nto*): New target.
10043         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
10044         * remote-utils.c [__QNX__]: Include sys/iomgr.h
10045         (nto_comctrl) [__QNX__]: New function.
10046         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
10047
10048 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
10049
10050         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
10051         srv_tgtobj.
10052
10053 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
10054             Pedro Alves  <pedro@codesourcery.com>
10055
10056         * win32-i386-low.c (i386_get_thread_context): Handle systems that
10057         don't support CONTEXT_EXTENDED_REGISTERS.
10058         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
10059         (the_low_target): Install them.
10060         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
10061         failing with ERROR_PIPE_NOT_CONNECTED.
10062
10063 2009-06-30  Doug Evans  <dje@google.com>
10064             Pierre Muller  <muller@ics.u-strasbg.fr>
10065
10066         Add h/w watchpoint support to x86-linux, win32-i386.
10067         * Makefile.in (SFILES): Add i386-low.c
10068         (i386_low_h): Define.
10069         (i386-low.o): Add dependencies.
10070         (linux-x86-low.o): Add i386-low.h dependency.
10071         (win32-i386-low.o): Ditto.
10072         * i386-low.c: New file.
10073         * i386-low.h: New file.
10074         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
10075         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
10076         * linux-low.c (linux_add_process): Initialize arch_private.
10077         (linux_remove_process): Free arch_private.
10078         (add_lwp): Initialize arch_private.
10079         (delete_lwp): Free arch_private.
10080         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
10081         provided.
10082         * linux-low.h (process_info_private): New member arch_private.
10083         (lwp_info): New member arch_private.
10084         (linux_target_ops): New members new_process, new_thread,
10085         prepare_to_resume.
10086         (ptid_of): New macro.
10087         * linux-x86-low.c: Include stddef.h, i386-low.h.
10088         (arch_process_info): New struct.
10089         (arch_lwp_info): New struct.
10090         (x86_linux_dr_get, x86_linux_dr_set): New functions.
10091         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
10092         (i386_dr_low_get_status): New function.
10093         (x86_insert_point, x86_remove_point): New functions.
10094         (x86_stopped_by_watchpoint): New function.
10095         (x86_stopped_data_address): New function.
10096         (x86_linux_new_process, x86_linux_new_thread): New functions.
10097         (x86_linux_prepare_to_resume): New function.
10098         (the_low_target): Add entries for insert_point, remove_point,
10099         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
10100         prepare_to_resume.
10101         * server.c (debug_hw_points): New global.
10102         (monitor_show_help): Document set debug-hw-points.
10103         (handle_query): Process "set debug-hw-points".
10104         * server.h (debug_hw_points): Declare.
10105         (paddress): Declare.
10106         * utils.c (NUMCELLS, CELLSIZE): New macros.
10107         (get_sell, xsnprintf, paddress): New functions.
10108         * win32-arm-low.c (the_low_target): Add entries for insert_point,
10109         remove_point, stopped_by_watchpoint, stopped_data_address.
10110         * win32-i386-low.c: Include i386-low.h.
10111         (debug_reg_state): Replaces dr.
10112         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
10113         (i386_dr_low_get_status): New function.
10114         (i386_insert_point, i386_remove_point): New functions.
10115         (i386_stopped_by_watchpoint): New function.
10116         (i386_stopped_data_address): New function.
10117         (i386_initial_stuff): Update.
10118         (get_thread_context,set_thread_context,i386_thread_added): Update.
10119         (the_low_target): Add entries for insert_point,
10120         remove_point, stopped_by_watchpoint, stopped_data_address.
10121         * win32-low.c (win32_insert_watchpoint): New function.
10122         (win32_remove_watchpoint): New function.
10123         (win32_stopped_by_watchpoint): New function.
10124         (win32_stopped_data_address): New function.
10125         (win32_target_ops): Add entries for insert_watchpoint,
10126         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
10127         * win32-low.h (win32_target_ops): New members insert_point,
10128         remove_point, stopped_by_watchpoint, stopped_data_address.
10129
10130 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
10131
10132         * server.c (process_serial_event): Re-return unsupported, not
10133         error, if the type isn't recognized.  Re-allow supporting only
10134         insert or remove packets.  Also call require_running for
10135         breakpoints.  Add missing break statement to default case.  Tidy.
10136         * target.h (struct target_ops): Rename insert_watchpoint to
10137         insert_point, and remove_watchpoint to remove_point.
10138
10139         * linux-low.h (struct linux_target_ops): Likewise.
10140         * linux-low.c (linux_insert_watchpoint): Rename to ...
10141         (linux_insert_point): ... this.  Adjust.
10142         (linux_remove_watchpoint): Rename to ...
10143         (linux_remove_point): ... this.  Adjust.
10144         (linux_target_ops): Adjust.
10145         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
10146         (cris_insert_point): ... this.
10147         (cris_remove_watchpoint): Rename to ...
10148         (cris_remove_point): ... this.
10149         (the_low_target): Adjust.
10150
10151 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
10152
10153         * server.c (handle_v_kill): Pass signal_pid to
10154         kill_inferior if multi_process is zero.
10155
10156 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
10157
10158         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
10159         * target.h (target_ops): Comment for *_watchpoint to make it clear
10160         the functions can get types '0' and '1'.
10161
10162 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
10163
10164         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
10165         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
10166         * regcache.c (get_regcache): Likewise.
10167         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
10168         * win32-low.c (child_fetch_inferior_registers): Remove check for
10169         regno 0.
10170
10171 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
10172             Pedro Alves <pedro@codesourcery.com>
10173
10174         * target.h (struct target_ops) <supports_multi_process>: New
10175         callback.
10176         (target_supports_multi_process): New.
10177         * server.c (handle_query): Even if GDB reports support, only
10178         enable multi-process if the target also supports it.  Report
10179         multi-process support only if the target backend supports it.
10180         * linux-low.c (linux_supports_multi_process): New function.
10181         (linux_target_ops): Install it as target_supports_multi_process
10182         callback.
10183
10184 2009-05-24  Doug Evans  <dje@google.com>
10185
10186         Global renaming of find_thread_pid to find_thread_ptid.
10187         * server.h (find_thread_ptid): Renamed from find_thread_pid.
10188         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
10189         All callers updated.
10190
10191         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
10192         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
10193         directly.
10194
10195         * linux-low.c (get_stop_pc): Print pc if debug_threads.
10196         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
10197         (linux_resume_one_lwp): Ditto.
10198
10199 2009-05-23  Doug Evans  <dje@google.com>
10200
10201         * linux-low.c (linux_resume_one_lwp): Change type of first arg
10202         from struct inferior_list_entry * to struct lwp_info *.
10203         All callers updated.
10204
10205 2009-05-13  Doug Evans  <dje@google.com>
10206
10207         * linux-x86-low.c: Don't include assert.h.
10208         (x86_siginfo_fixup): Use fatal, not assert.
10209         (x86_arch_setup): Fix comment.
10210
10211 2009-05-12  Doug Evans  <dje@google.com>
10212
10213         Biarch support for i386/amd64 gdbserver.
10214         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
10215         Add linux-x86-low.c.
10216         (linux-i386-low.o, linux-x86-64-low.o): Delete.
10217         (linux-x86-low.o): Add.
10218         * linux-x86-64-low.c: Delete.
10219         * linux-i386-low.c: Delete.
10220         * linux-x86-low.c: New file.
10221         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
10222         linux-x86-low.o.
10223         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
10224         linux-x86-low.o.
10225         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
10226         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
10227         (linux_child_pid_to_exec_file): New function.
10228         (elf_64_header_p, elf_64_file_p): New functions.
10229         (siginfo_fixup): New function.
10230         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
10231         give target a chance to convert layout.
10232         * linux-low.h (linux_target_ops): New member siginfo_fixup.
10233         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
10234
10235 2009-05-07  Doug Evans  <dje@google.com>
10236
10237         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
10238         (regsets_store_inferior_registers): Ditto.
10239
10240 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
10241
10242         PR server/10048
10243
10244         * linux-low.c (must_set_ptrace_flags): Delete.
10245         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
10246         of the global.
10247         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
10248         `lwp->must_set_ptrace_flags' instead.
10249         (linux_wait_for_event_1): Set ptrace options here.
10250         (linux_wait_1): ... not here.
10251
10252 2009-04-30  Doug Evans  <dje@google.com>
10253
10254         * inferiors.c (started_inferior_callback): New function.
10255         (attached_inferior_callback): New function.
10256         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
10257         * server.c (print_started_pid, print_attached_pid): New functions.
10258         (detach_or_kill_for_exit): New function.
10259         (main): Call it instead of for_each_inferior (kill_inferior_callback).
10260         * server.h (have_started_inferiors_p): Declare.
10261         (have_attached_inferiors_p): Declare.
10262
10263         * inferiors.c (remove_process): Fix memory leak, free process.
10264         * linux-low.c (linux_remove_process): New function.
10265         (linux_kill): Call it instead of remove_process.
10266         (linux_detach, linux_wait_1): Ditto.
10267
10268 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
10269
10270         * configure.srv: Add x86 Windows CE target.
10271
10272 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
10273
10274         * inferiors.c (get_thread_process): Make global.
10275         * server.h (get_thread_process): Add prototype.
10276         * thread-db.c (find_one_thread): Use get_thread_process
10277         instead of current_process.
10278         (thread_db_get_tls_address): Do not crash if called when
10279         thread layer is not yet initialized.
10280
10281 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
10282
10283         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
10284         * spu-low.c (current_tid): Rename to ...
10285         (current_ptid): ... this.
10286         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
10287         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
10288         ptid_get_lwp (current_ptid) instead of current_tid.
10289         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
10290         instead of current_tid.  Use find_process_pid to verify pid
10291         argument is valid.  Pass proper argument to remove_process.
10292         (spu_thread_alive): Compare current_ptid instead of current_tid.
10293         (spu_resume): Likewise.
10294
10295 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
10296
10297         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
10298         variable.
10299
10300 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10301
10302         Implement the multiprocess extensions, and add linux multiprocess
10303         support.
10304
10305         * server.h (ULONGEST): Declare.
10306         (struct ptid, ptid_t): New.
10307         (minus_one_ptid, null_ptid): Declare.
10308         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
10309         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
10310         (struct inferior_list_entry): Change `id' type from unsigned from
10311         to ptid_t.
10312         (struct sym_cache, struct breakpoint, struct
10313         process_info_private): Forward declare.
10314         (struct process_info): Declare.
10315         (current_process): Declare.
10316         (all_processes): Declare.
10317         (initialize_inferiors): Declare.
10318         (add_thread): Adjust to use ptid_t.
10319         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
10320         (add_process, remove_process, find_thread_pid): Declare.
10321         (find_inferior_id): Adjust to use ptid_t.
10322         (cont_thread, general_thread, step_thread): Change type to ptid_t.
10323         (multi_process): Declare.
10324         (push_event): Adjust to use ptid_t.
10325         (read_ptid, write_ptid): Declare.
10326         (prepare_resume_reply): Adjust to use ptid_t.
10327         (clear_symbol_cache): Declare.
10328         * inferiors.c (all_processes): New.
10329         (null_ptid, minus_one_ptid): New.
10330         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
10331         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
10332         (add_thread): Change unsigned long to ptid.  Remove gdb_id
10333         parameter.  Adjust.
10334         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
10335         (gdb_id_to_thread): Rename to ...
10336         (find_thread_pid): ... this.  Change unsigned long to ptid.
10337         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
10338         (loaded_dll, pull_pid_from_list): Adjust.
10339         (add_process, remove_process, find_process_pid)
10340         (get_thread_process, current_process, initialize_inferiors): New.
10341         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
10342         (struct target_waitstatus) <related_pid>: Ditto.
10343         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
10344         return type to int.
10345         (struct target_ops) <join>: Add `pid' argument.
10346         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
10347         (struct target_ops) <wait>: Add `ptid' field.  Change return type
10348         to ptid.
10349         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
10350         (mywait): Add `ptid' argument.  Change return type to ptid_t.
10351         (target_pid_to_str): Declare.
10352         * target.c (set_desired_inferior): Adjust to use ptids.
10353         (mywait): Add new `ptid' argument.  Adjust.
10354         (target_pid_to_str): New.
10355         * mem-break.h (free_all_breakpoints): Declare.
10356         * mem-break.c (breakpoints): Delelete.
10357         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
10358         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
10359         to use per-process breakpoint list.
10360         (free_all_breakpoints): New.
10361         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
10362         (symbol_cache, all_symbols_looked_up): Delete.
10363         (hexchars): New.
10364         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
10365         read_ptid): New.
10366         (prepare_resume_reply): Change ptid argument's type from unsigned
10367         long to ptid_t.  Adjust.  Implement W;process and X;process.
10368         (free_sym_cache, clear_symbol_cache): New.
10369         (look_up_one_symbol): Adjust to per-process symbol cache.  *
10370         * server.c (cont_thread, general_thread, step_thread): Change type
10371         to ptid_t.
10372         (attached): Delete.
10373         (multi_process): New.
10374         (last_ptid): Change type to ptid_t.
10375         (struct vstop_notif) <ptid>: Change type to ptid_t.
10376         (queue_stop_reply, push_event): Change `ptid' argument's type to
10377         ptid_t.
10378         (discard_queued_stop_replies): Add `pid' argument.
10379         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
10380         changes.  Don't reference the `attached' global.
10381         (attach_inferior): Adjust to mywait interface changes.
10382         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
10383         features.  Handle and report "multiprocess+".  Handle
10384         "qAttached:PID".
10385         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
10386         changes.
10387         (handle_v_kill): New.
10388         (handle_v_stopped): Adjust to use target_pid_to_str.
10389         (handle_v_requests): Allow multiple attaches and runs when
10390         multiprocess extensions are in effect.  Handle "vKill".
10391         (myresume): Adjust to use ptids.
10392         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
10393         (handle_status): Adjust to discard_queued_stop_replies interface
10394         change.
10395         (first_thread_of, kill_inferior_callback)
10396         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
10397         (main): Call initialize_inferiors.  Adjust to use ptids, killing
10398         and detaching from all inferiors.  Handle multiprocess packet
10399         variants.
10400         * linux-low.h: Include gdb_proc_service.h.
10401         (struct process_info_private): New.
10402         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
10403         <lwpid_of>: Use ptid_get_lwp.
10404         (get_lwp_thread): Adjust.
10405         (struct lwp_info): Add `dead' member.
10406         (find_lwp_pid): Declare.
10407         * linux-low.c (thread_db_active): Delete.
10408         (new_inferior): Adjust comment.
10409         (inferior_pid): Delete.
10410         (linux_add_process): New.
10411         (handle_extended_wait): Adjust.
10412         (add_lwp): Change unsigned long to ptid.
10413         (linux_create_inferior): Add process to processes table.  Adjust
10414         to use ptids.  Don't set new_inferior here.
10415         (linux_attach_lwp): Rename to ...
10416         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
10417         it.  Adjust to use ptids.
10418         (linux_attach_lwp): New.
10419         (linux_attach): Add process to processes table.  Don't set
10420         new_inferior here.
10421         (struct counter): New.
10422         (second_thread_of_pid_p, last_thread_of_process_p): New.
10423         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
10424         multiple processes.
10425         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
10426         processes.  Remove process from process table.
10427         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
10428         to multiple processes.
10429         (any_thread_of): New.
10430         (linux_detach): Add `pid' argument, and handle it.  Remove process
10431         from processes table.
10432         (linux_join): Add `pid' argument.  Handle it.
10433         (linux_thread_alive): Change unsighed long argument to ptid_t.
10434         Consider dead lwps as not being alive.
10435         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
10436         threads we're not interested in.
10437         (same_lwp, find_lwp_pid): New.
10438         (linux_wait_for_lwp): Change `pid' argument's type from int to
10439         ptid_t.  Adjust.
10440         (linux_wait_for_event): Rename to ...
10441         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
10442         from int to ptid_t.  Adjust.
10443         (linux_wait_for_event): New.
10444         (linux_wait_1): Add `ptid' argument.  Change return type to
10445         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
10446         that exit from the process table.
10447         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
10448         Adjust.
10449         (mark_lwp_dead): New.
10450         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
10451         stopping all threads, mark its main lwp as dead.
10452         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
10453         ptids.
10454         (fetch_register, usr_store_inferior_registers)
10455         (regsets_fetch_inferior_registers)
10456         (regsets_store_inferior_registers, linux_read_memory)
10457         (linux_write_memory): Inline `inferior_pid'.
10458         (linux_look_up_symbols): Adjust to use per-process
10459         `thread_db_active'.
10460         (linux_request_interrupt): Adjust to use ptids.
10461         (linux_read_auxv): Inline `inferior_pid'.
10462         (initialize_low): Don't reference thread_db_active.
10463         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
10464         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
10465         (ps_getpid): Return the pid of the current inferior.
10466         * thread-db.c (proc_handle, thread_agent): Delete.
10467         (thread_db_create_event, thread_db_enable_reporting): Adjust to
10468         per-process data.
10469         (find_one_thread): Change argument type to ptid_t.  Adjust to
10470         per-process data.
10471         (maybe_attach_thread): Adjust to per-process data and ptids.
10472         (thread_db_find_new_threads): Ditto.
10473         (thread_db_init): Ditto.
10474         * spu-low.c (spu_create_inferior, spu_attach): Add process to
10475         processes table.  Adjust to use ptids.
10476         (spu_kill, spu_detach): Adjust interface.  Remove process from
10477         processes table.
10478         (spu_join, spu_thread_alive): Adjust interface.
10479         (spu_wait): Adjust interface.  Remove process from processes
10480         table.  Adjust to use ptids.
10481         * win32-low.c (current_inferior_tid): Delete.
10482         (current_inferior_ptid): New.
10483         (debug_event_ptid): New.
10484         (thread_rec): Take a ptid.  Adjust.
10485         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
10486         (child_delete_thread): Ditto.
10487         (do_initial_child_stuff): Add `attached' argument.  Add process to
10488         processes table.
10489         (child_fetch_inferior_registers, child_store_inferior_registers):
10490         Adjust.
10491         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
10492         (win32_attach): Pass 1 to do_initial_child_stuff.
10493         (win32_kill): Adjust interface.  Remove process from processes
10494         table.
10495         (win32_detach): Ditto.
10496         (win32_join): Adjust interface.
10497         (win32_thread_alive): Take a ptid.
10498         (win32_resume): Adjust to use ptids.
10499         (get_child_debug_event): Ditto.
10500         (win32_wait): Adjust interface.  Remove exiting process from
10501         processes table.
10502
10503 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10504
10505         Non-stop mode support.
10506
10507         * server.h (non_stop): Declare.
10508         (gdb_client_data, handler_func): Declare.
10509         (delete_file_handler, add_file_handler, start_event_loop):
10510         Declare.
10511         (handle_serial_event, handle_target_event, push_event)
10512         (putpkt_notif): Declare.
10513         * target.h (enum resume_kind): New.
10514         (struct thread_resume): Replace `step' field by `kind' field.
10515         (TARGET_WNOHANG): Define.
10516         (struct target_ops) <wait>: Add `options' argument.
10517         <supports_non_stop, async, start_non_stop>: New fields.
10518         (target_supports_non_stop, target_async): New.
10519         (start_non_stop): Declare.
10520         (mywait): Add `options' argument.
10521         * target.c (mywait): Add `options' argument.  Print child exit
10522         notifications here.
10523         (start_non_stop): New.
10524         * server.c (non_stop, own_buf, mem_buf): New globals.
10525         (struct vstop_notif): New.
10526         (notif_queue): New global.
10527         (queue_stop_reply, push_event, discard_queued_stop_replies)
10528         (send_next_stop_reply): New.
10529         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10530         interface changes.
10531         (attach_inferior): In non-stop mode, don't wait for the target
10532         here.
10533         (handle_general_set): Handle QNonStop.
10534         (handle_query): When handling qC, return the current general
10535         thread, instead of the first thread of the list.
10536         (handle_query): If the backend supports non-stop mode, include
10537         QNonStop+ in the qSupported query response.
10538         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10539         and non-stop mode.
10540         (handle_v_attach, handle_v_run): Handle non-stop mode.
10541         (handle_v_stopped): New.
10542         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10543         (myresume): Adjust to use resume_kind.  Handle non-stop.
10544         (queue_stop_reply_callback): New.
10545         (handle_status): Handle non-stop mode.
10546         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10547         Refactor serial protocol handling from here ...
10548         (process_serial_event): ... to this new function.  When GDB
10549         selects any thread, select one here.  In non-stop mode, wait until
10550         GDB acks all pending events before exiting.
10551         (handle_serial_event, handle_target_event): New.
10552         * remote-utils.c (remote_open): Install remote_desc in the event
10553         loop.
10554         (remote_close): Remove remote_desc from the event loop.
10555         (putpkt_binary): Rename to...
10556         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10557         (putpkt_binary): New as wrapper around putpkt_binary_1.
10558         (putpkt_notif): New.
10559         (prepare_resume_reply): In non-stop mode, don't change the
10560         general_thread.
10561         * event-loop.c: New.
10562         * Makefile.in (OBJ): Add event-loop.o.
10563         (event-loop.o): New rule.
10564
10565         * linux-low.h (pid_of): Moved here.
10566         (lwpid_of): New.
10567         (get_lwp_thread): Use lwpid_of.
10568         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10569         * linux-low.c (pid_of): Delete.
10570         (inferior_pid): Use lwpid_of.
10571         (linux_event_pipe): New.
10572         (target_is_async_p): New.
10573         (delete_lwp): New.
10574         (handle_extended_wait): Use lwpid_of.
10575         (add_lwp): Don't set lwpid field.
10576         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10577         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10578         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10579         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10580         first.  Adjust to linux_wait_for_event interface changes.  Use
10581         lwpid_of.
10582         (linux_detach): Don't delete the main lwp here.
10583         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10584         (status_pending_p): Don't consider explicitly suspended lwps.
10585         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10586         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10587         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10588         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10589         pointer.  Add status pointer argument.  Return a pid instead of a
10590         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10591         changes.  In non-stop mode, don't switch to a random thread.
10592         (linux_wait): Rename to...
10593         (linux_wait_1): ... this.  Add target_options argument, and handle
10594         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10595         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10596         clean exit and signal exit code.  Don't stop all threads in
10597         non-stop mode.  In all-stop mode, only stop all threads when
10598         reporting a stop to GDB.  Handle explicit thread stop requests.
10599         (async_file_flush, async_file_mark): New.
10600         (linux_wait): New.
10601         (send_sigstop): Use lwpid_of.
10602         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10603         interface changes.  In non-stop mode, don't switch to a random
10604         thread.
10605         (linux_resume_one_lwp): Use lwpid_of.
10606         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10607         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10608         non-stop mode, don't look for pending flag in all threads.
10609         (resume_status_pending_p): Don't consider explicitly suspended
10610         threads.
10611         (my_waitpid): Reimplement.  Emulate __WALL.
10612         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10613         Use lwpid_of.
10614         (sigchld_handler, linux_supports_non_stop, linux_async)
10615         (linux_start_non_stop): New.
10616         (linux_target_ops): Register linux_supports_non_stop, linux_async
10617         and linux_start_non_stop.
10618         (initialize_low): Install SIGCHLD handler.
10619         * thread-db.c (thread_db_create_event, find_one_thread)
10620         (thread_db_get_tls_address): Use lwpid_of.
10621         * win32-low.c (win32_detach): Adjust to use resume_kind.
10622         (win32_wait): Add `options' argument.
10623         * spu-low.c (spu_resume): Adjust to use resume_kind.
10624         (spu_wait): Add `options' argument.
10625
10626 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10627
10628         Decouple target code from remote protocol.
10629
10630         * target.h (enum target_waitkind): New.
10631         (struct target_waitstatus): New.
10632         (struct target_ops) <wait>: Return an unsigned long.  Take a
10633         target_waitstatus pointer instead of a char pointer.
10634         (mywait): Likewise.
10635         * target.c (mywait): Change prototype to return an unsigned long.
10636         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10637         * server.h (thread_from_wait, old_thread_from_wait): Delete
10638         declarations.
10639         (prepare_resume_reply): Change prototype to take a
10640         target_waitstatus.
10641         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10642         (last_status, last_ptid): New.
10643         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10644         pid instead of a signal.
10645         (attach_inferior): Remove "status" and "signal" parameters.
10646         Adjust.
10647         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10648         not as an address.
10649         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10650         (handle_v_requests, myresume): Remove "status" and "signal"
10651         parameters.  Adjust.
10652         (handle_status): New.
10653         (main): Delete local `status'.  Adjust.
10654         * remote-utils.c: Include target.h.
10655         (prepare_resume_reply): Change prototype to take a
10656         target_waitstatus.  Adjust.
10657
10658         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10659         interface.
10660         * spu-low.c (spu_wait): Adjust.
10661         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10662         Delete.
10663         (win32_wait): Adjust.
10664
10665 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10666
10667         * target.h (struct thread_resume): Delete leave_stopped member.
10668         (struct target_ops): Add a `n' argument to the `resume' callback.
10669         * server.c (start_inferior): Adjust.
10670         (handle_v_cont, myresume): Adjust.
10671         * linux-low.c (check_removed_breakpoint): Adjust to resume
10672         interface change, and to removed leave_stopped field.
10673         (resume_ptr): Delete.
10674         (struct thread_resume_array): New.
10675         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10676         resume interface change.
10677         (linux_continue_one_thread, linux_queue_one_thread)
10678         (resume_status_pending_p): Check if the resume field is NULL
10679         instead of checking the leave_stopped member.
10680         (linux_resume): Adjust to the target resume interface change.
10681         * spu-low.c (spu_resume): Adjust to the target resume interface
10682         change.
10683         * win32-low.c (win32_detach, win32_resume): Ditto.
10684
10685 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10686
10687         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10688         flag.
10689         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10690         pending.
10691         (linux_continue_one_thread): Only preserve the stepping flag if
10692         there's a pending breakpoint.
10693
10694 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10695
10696         * server.c (main): After the inferior having exited, call
10697         remote_close before exiting gdbserver.
10698
10699 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10700
10701         Fix size of FPSCR in Power 7 processors.
10702         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10703         (PPC_FEATURE_HAS_DFP): New #define.
10704         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10705         size of the FPSCR.
10706
10707 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10708
10709         * server.c (handle_query) Whitespace and formatting.
10710
10711 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10712
10713         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10714         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10715         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10716         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10717         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10718         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10719         Makefile.in, configure.ac: Fix whitespace throughout.
10720         * configure: Regenerate.
10721
10722 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10723
10724         * inferiors.c (find_inferior): Make it safe for the callback
10725         function to delete the currently iterated inferior.
10726
10727 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10728
10729         * Makefile.in (linuw_low_h): Move higher.
10730         (thread-db.o): Depend on $(linux_low_h).
10731
10732 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10733
10734         Rename "process" to "lwp" throughout.
10735
10736         * linux-low.c (all_processes): Rename to...
10737         (all_lwps): ... this.
10738         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10739         (add_process): Rename to ...
10740         (add_lwp): ... this.  Adjust.
10741         (linux_create_inferior): Adjust.
10742         (linux_attach_lwp): Adjust.
10743         (linux_attach): Adjust.
10744         (linux_kill_one_process): Rename to ...
10745         (linux_kill_one_lwp): ... this.  Adjust.
10746         (linux_kill): Adjust.
10747         (linux_detach_one_process): Rename to ...
10748         (linux_detach_one_lwp): ... this.  Adjust.
10749         (linux_detach): Adjust.
10750         (check_removed_breakpoint): Adjust.
10751         (status_pending_p): Adjust.
10752         (linux_wait_for_process): Rename to ...
10753         (linux_wait_for_lwp): ... this.  Adjust.
10754         (linux_wait_for_event): Adjust.
10755         (send_sigstop): Adjust.
10756         (wait_for_sigstop): Adjust.
10757         (stop_all_processes): Rename to ...
10758         (stop_all_lwps): ... this.
10759         (linux_resume_one_process): Rename to ...
10760         (linux_resume_one_lwp): ... this.  Adjust.
10761         (linux_set_resume_request, linux_continue_one_thread)
10762         (linux_queue_one_thread, resume_status_pending_p)
10763         (usr_store_inferior_registers, regsets_store_inferior_registers)
10764         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10765         Adjust.
10766         * linux-low.h (get_process): Rename to ...
10767         (get_lwp): ... this.  Adjust.
10768         (get_thread_process): Rename to ...
10769         (get_thread_lwp): ... this.  Adjust.
10770         (get_process_thread): Rename to ...
10771         (get_lwp_thread): ... this.  Adjust.
10772         (struct process_info): Rename to ...
10773         (struct lwp_info): ... this.
10774         (all_processes): Rename to ...
10775         (all_lwps): ... this.
10776         * proc-service.c (ps_lgetregs): Adjust.
10777         * thread-db.c (thread_db_create_event, find_one_thread)
10778         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10779
10780 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10781
10782         * server.c (handle_query): Handle "qAttached".
10783
10784 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10785
10786         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10787         GPLv3, update license URL.
10788
10789 2009-03-01  Doug Evans  <dje@google.com>
10790
10791         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10792         (server_h): Add gdb_signals.h.
10793         (signals.o): Update.
10794         * server.h (target_signal_from_host,target_signal_to_host_p)
10795         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10796
10797 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10798
10799         * remote-utils.c (getpkt): Also generate remote-debug
10800         information if noack_mode is set.
10801
10802 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10803
10804         * server.c (handle_query): Report qXfer:siginfo:read and
10805         qXfer:siginfo:write as supported and handle them.
10806         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10807         * linux-low.c (linux_xfer_siginfo): New.
10808         (linux_target_ops): Set it.
10809
10810 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10811
10812         * server.c (gdbserver_usage): Mention --remote-debug.
10813         (main): Accept '--remote-debug' switch.
10814
10815 2009-01-18  Doug Evans  <dje@google.com>
10816
10817         * regcache.c (new_register_cache): No need to check result of xcalloc.
10818         * server.c (handle_search_memory): Back out calls to xmalloc,
10819         result is checked and error is returned to user upon failure.
10820         (handle_query): Ditto.  Add more checks for result of malloc.
10821         (handle_v_cont): Check result of malloc, report error back to
10822         user upon failure.
10823         (handle_v_run): Ditto.  Call freeargv.
10824         * server.h (freeargv): Declare.
10825         * utils.c (freeargv): New fn.
10826
10827 2009-01-15  Doug Evans  <dje@google.com>
10828
10829         * gdbreplay.c (perror_with_name): Make arg const char *.
10830         * server.h (target_signal_to_name): Make return type const char *.
10831         * thread-db.c (thread_db_err_str): Make return type const char *.
10832         * utils.c (perror_with_name): Make arg const char *.
10833
10834 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10835
10836         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10837         when handling a EXIT_PROCESS_DEBUG_EVENT.
10838
10839 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10840
10841         * gdbreplay.c (gdbreplay_version): Update copyright year.
10842         * server.c (gdbserver_version): Likewise.
10843
10844 2009-01-05  Doug Evans  <dje@google.com>
10845
10846         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10847         (handle_extended_wait): Improve comment.
10848
10849 2008-12-13  Doug Evans  <dje@google.com>
10850
10851         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10852         * server.h (ATTR_MALLOC): New macro.
10853         (xmalloc,xcalloc,xstrdup): Declare.
10854         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10855         * inferiors.c: Ditto.
10856         * linux-low.c: Ditto.
10857         * mem-break.c: Ditto.
10858         * regcache.c: Ditto.
10859         * remote-utils.c: Ditto.
10860         * server.c: Ditto.
10861         * target.c: Ditto.
10862         * win32-low.c: Ditto.
10863
10864 2008-12-12  Doug Evans  <dje@google.com>
10865
10866         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10867         in debugging printf.
10868
10869         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10870
10871 2008-12-09  Doug Evans  <dje@google.com>
10872
10873         * linux-low.h (struct process_info): Delete member tid, unused.
10874         * thread-db.c (find_one_thread): Update.
10875         (maybe_attach_thread): Update.
10876
10877 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10878
10879         * target.h (struct target_ops): Add qxfer_osdata member.
10880         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10881         and dirent.h.
10882         (linux_qxfer_osdata): New functions.
10883         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10884         callback.
10885         * server.c (handle_query): Handle "qXfer:osdata:read:".
10886         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10887         (buffer_xml_printf): New functions.
10888         * server.h (struct buffer): New.
10889         (buffer_grow_str, buffer_grow_str0): New macros.
10890         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10891         (buffer_xml_printf): Declare.
10892
10893 2008-11-24  Doug Evans  <dje@google.com>
10894
10895         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10896
10897 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10898
10899         * server.c (handle_v_run): Always use the supplied argument list.
10900
10901 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10902
10903         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10904         (xtensa_regmap_table): Add entry for scompare1.
10905
10906 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10907
10908         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10909         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10910         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10911         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10912         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10913         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10914         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10915         XML target descriptions.
10916         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10917         when inferior is running on an ISA 2.05 or later processor.  Add
10918         special case to return offset for full 64-bit slot of FPSCR when
10919         in 32-bits.
10920
10921 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10922
10923         * Makefile.in (SFILES, clean): Added sparc64 files.
10924         (reg-sparc64.o, reg-sparc64.c): New.
10925         * configure.srv (sparc*-*-linux*): New configuration.
10926         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10927         syscall arguments for SPARC.
10928         (regsets_store_inferior_registers): Likewise.
10929         * linux-sparc-low.c: New file.
10930
10931 2008-10-21  Doug Evans  <dje@google.com>
10932
10933         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10934         (READLINE_DIR,READLINE_DEP): Delete.
10935         (INTERNAL_CFLAGS): Update.
10936         (LINTFLAGS): Update.
10937
10938 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10939
10940         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10941         whole argv from the last run, not just argv[0].
10942
10943 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10944
10945         * regcache.c (new_register_cache): Return NULL if the register
10946         cache size isn't known yet.
10947         (free_register_cache): Avoid dereferencing a NULL regcache.
10948
10949 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10950
10951         * configure.srv: Merge MIPS and MIPS64.
10952
10953 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10954
10955         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10956
10957 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10958
10959         * Makefile.in: Add required vsx dependencies.
10960
10961         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10962         Declare init_registers_powerpc_vsx32l.
10963         Declare init_registers_powerpc_vsx64l.
10964         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10965         (ppc_arch_setup): Check for VSX in hwcap.
10966         (ppc_fill_vsxregset): New function.
10967         (ppc_store_vsxregset): New function.
10968         Add new VSX entry in regset_info target_regsets.
10969
10970         * configure.srv: Add new VSX dependencies.
10971
10972 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10973
10974         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10975         (remote_open): Set or clear transport_is_reliable.
10976         (putpkt_binary): Don't expect acks in noack mode.
10977         (getpkt): Don't send ack/nac in noack mode.
10978         * server.c (handle_general_set): Handle QStartNoAckMode.
10979         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10980         qSupported.
10981         (main): Reset noack_mode on every connection.
10982         * server.h (noack_mode): Declare.
10983
10984 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10985
10986         * Makefile.in (GDBREPLAY_OBS): New variable.
10987         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10988
10989 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10990             Daniel Jacobowitz  <dan@codesourcery.com>
10991
10992         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10993         (usr_store_inferior_registers): Likewise.
10994         (regsets_store_inferior_registers): Likewise.
10995
10996 2008-07-31  Rolf Jansen  <rj@surtec.com>
10997             Pedro Alves  <pedro@codesourcery.com>
10998
10999         * configure.ac: Check for memmem declaration.
11000         * server.c [HAVE_MALLOC_H]: Include malloc.h.
11001         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
11002         (disable_packet_qfThreadInfo): Unconditionally compile.
11003         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
11004         * configure, config.in: Regenerate.
11005
11006 2008-07-28  Doug Kwan  <dougkwan@google.com>
11007
11008         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
11009         (linux_write_memory): Remove declaration of errno.
11010
11011 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
11012
11013         * linux-low.c (handle_extended_wait): Do not use "status"
11014         variable uninitialized.
11015
11016 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
11017
11018         * server.c (handle_v_attach): Inhibit reporting dll changes.
11019
11020 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
11021
11022         * remote-utils.c (prepare_resume_reply): If requested, don't
11023         output "thread:TID" in the T stop reply.
11024
11025         * server.c (disable_packet_vCont, disable_packet_Tthread)
11026         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
11027         (handle_query): If requested, disable support for qC, qfThreadInfo
11028         and qsThreadInfo.
11029         (handle_v_requests): If requested, disable support for vCont.
11030         (gdbserver_show_disableable): New.
11031         (main): Handle --disable-packet and --disable-packet=LIST.
11032
11033         * server.h (disable_packet_vCont, disable_packet_Tthread)
11034         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
11035
11036 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
11037
11038         * server.c (gdbserver_usage): Mention --version.
11039
11040 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
11041
11042         * Makefile.in (gdbreplay.o): New rule.
11043
11044 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
11045
11046         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
11047         message, not gdbserver.
11048
11049 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
11050             Nathan Sidwell  <nathan@codesourcery.com>
11051             Joseph Myers  <joseph@codesourcery.com>
11052
11053         * acinclude.m4: Include ../../config/acx.m4.
11054         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
11055         * configure, config.in: Regenerate.
11056         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
11057         * server.c (gdbserver_version): Print PKGVERSION.
11058         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
11059         (main): Adjust gdbserver_usage calls.
11060         * gdbreplay.c (version, host_name): Add declarations.
11061         (gdbreplay_version, gdbreplay_usage): New.
11062         (main): Accept --version and --help options.
11063
11064 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
11065
11066         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
11067         (arm_breakpoint_at): Handle Thumb.
11068         (the_low_target): Add comment.
11069
11070 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
11071
11072         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
11073
11074 2008-05-09  Doug Evans  <dje@google.com>
11075
11076         * server.h (decode_search_memory_packet): Declare.
11077         * remote-utils.c (decode_search_memory_packet): New fn.
11078         * server.c (handle_search_memory_1): New fn.
11079         (handle_search_memory): New fn.
11080         (handle_query): Process qSearch:memory packets.
11081
11082 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
11083
11084         * regcache.c (registers_length): Remove.
11085         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
11086         full register packet.
11087         * regcache.h (registers_length): Remove prototype.
11088         * server.h (PBUFSIZ): Define to 16384.
11089
11090 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
11091
11092         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
11093         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
11094         powerpc-64l.o, and powerpc-altivec64l.o.
11095         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
11096         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
11097         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
11098         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
11099         rs6000/power-linux.xml, and rs6000/power64-linux.xml
11100         to srv_xmlfiles.
11101
11102         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
11103         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
11104         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
11105         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
11106         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
11107         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
11108         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
11109         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
11110         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
11111         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
11112         (clean): Update.
11113
11114         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
11115         (init_registers_powerpc_32l): ... this new prototype.
11116         (init_registers_powerpc_32): Remove, replace by ...
11117         (init_registers_powerpc_altivec32l): ... this new prototype.
11118         (init_registers_powerpc_e500): Remove, replace by ...
11119         (init_registers_powerpc_e500l): ... this new prototype.
11120         (init_registers_ppc64): Remove, replace by ...
11121         (init_registers_powerpc_64l): ... this new prototype.
11122         (init_registers_powerpc_64): Remove, replace by ...
11123         (init_registers_powerpc_altivec64l): ... this new prototype.
11124         (ppc_num_regs): Set to 73.
11125         (PT_ORIG_R3, PT_TRAP): Define if necessary.
11126         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
11127         (ppc_cannot_store_register): Handle orig_r3 and trap.
11128         (ppc_arch_setup): Update init_registers_... calls.
11129         (ppc_fill_gregset): Handle orig_r3 and trap.
11130
11131         * inferiors.c (clear_inferiors): Reset current_inferior.
11132
11133 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
11134
11135         * acinclude.m4: Add override.m4.
11136         * configure: Regenerate.
11137
11138 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
11139
11140         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
11141         initial call to init_register_ppc64.
11142
11143 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
11144
11145         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
11146         single powerpc*-*-linux* case.
11147         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
11148
11149 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
11150
11151         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
11152         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
11153         from reg_xmlfiles.
11154         * linux-ppc-low.c: Include <elf.h>.
11155         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
11156         (ppc_hwcap): New global variable.
11157         (ppc_regmap): Remove __SPE__ #ifdef sections.
11158         (ppc_regmap_e500): New global variable.
11159         (ppc_cannot_store_register): Update __SPE__ special case.
11160         (ppc_get_hwcap): New function.
11161         (ppc_arch_setup): Use it to determine whether inferior supports
11162         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
11163         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
11164         Do not access registers if target does not support AltiVec.
11165         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
11166         Do not access registers if target does not support SPE.
11167         (target_regsets): Unconditionally include AltiVec and SPE regsets.
11168
11169 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
11170
11171         * linux-low.c (disabled_regsets, num_regsets): New.
11172         (use_regsets_p): Delete.
11173         (linux_wait_for_process): Clear disabled_regsets.
11174         (regsets_fetch_inferior_registers): Check and set it.
11175         (regsets_store_inferior_registers): Likewise.
11176         (linux_fetch_registers, linux_store_registers): Do not use
11177         use_regsets_p.
11178         (initialize_low): Allocate disabled_regsets.
11179
11180 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
11181
11182         * Makefile.in (LIBOBJS): New.
11183         (OBS): Use LIBOBJS.
11184         (memmem.o): New rule.
11185         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
11186         * configure: Regenerated.
11187
11188 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
11189
11190         * server.c (handle_query): Never return "unsupported" for
11191         qXfer:features:read queries.
11192
11193 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
11194
11195         * server.c (get_features_xml): Fix inverted condition.
11196         (handle_query): Always support qXfer:feature:read.
11197
11198 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
11199
11200         * server.c (wrapper_argv): New.
11201         (start_inferior): Handle wrapper_argv.  If set, expect an extra
11202         trap.
11203         (gdbserver_usage): Document --wrapper.
11204         (main): Parse --wrapper.
11205
11206 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11207
11208         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
11209         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
11210         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
11211         (ppc_set_pc): Likewise.
11212         (ppc_arch_setup): New function.
11213         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
11214         of collect_register.
11215         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
11216
11217 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11218
11219         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
11220         instead of linux-ppc64-low.o.
11221         * linux-ppc64-low.c: Remove file.
11222         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
11223         (linux-ppc64-low.o): Remove rule.
11224
11225         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
11226         (init_registers_powerpc_64): Likewise.
11227         (ppc_regmap): Conditionally define depending on __powerpc64__.
11228         (ppc_cannot_store_register): Do not special-case "fpscr" when
11229         compiled on __powerpc64__.
11230         (ppc_collect_ptrace_register): New function.
11231         (ppc_supply_ptrace_register): New function.
11232         (ppc_breakpoint): Change type to "unsigned int".
11233         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
11234         (the_low_target): Conditionally provide initializers for the
11235         arch_setup member depending on __powerpc64__.  Install
11236         collect_ptrace_register and supply_ptrace_register members.
11237
11238 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11239
11240         * regcache.h (gdbserver_xmltarget): Add extern declaration.
11241         * server.c (gdbserver_xmltarget): Define.
11242         (get_features_xml): Use it to replace "target.xml" and arch_string.
11243
11244         * configure.srv: Remove srv_xmltarget.  Add XML files that were
11245         mentioned there to srv_xmlfiles instead.  Remove conditional tests
11246         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
11247         srv_xmlfiles and srv_regobj to include all possible choices.
11248         * configure.ac (srv_xmltarget): Remove.
11249         (srv_xmlfiles): Do not add "target.xml".
11250         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
11251         checks for supplementary target information.
11252         * configure: Regenerate.
11253         * Makefile.in (XML_TARGET): Remove.
11254         (target.xml): Remove rule.
11255         (clean): Do not clean up target.xml.
11256         (.PRECIOUS): Do not mention target.xml.
11257
11258         * target.h (struct target_ops): Remove arch_string member.
11259         * linux-low.c (linux_arch_string): Remove.
11260         (linux_target_ops): Remove arch_string initializer.
11261         * linux-low.h (struct linux_target_ops): Remove arch_string member.
11262         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
11263         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
11264         * spu-low.c (spu_arch_string): Remove.
11265         (spu_target_ops): Remove arch_string initializer.
11266         * win32-low.c (win32_arch_string): Remove.
11267         (win32_target_ops): Remove arch_string initializer.
11268         * win32-low.h (struct win32_target_ops): Remove arch_string member.
11269         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
11270         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
11271
11272 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11273
11274         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
11275         by collect_ptrace_register and supply_ptrace_register hooks.
11276         * linux-low.c (fetch_register): Use supply_ptrace_register callback
11277         instead of checking for the_low_target.left_pad_xfer.
11278         (usr_store_inferior_registers): Use collect_ptrace_register callback
11279         instead of checking for the_low_target.left_pad_xfer.
11280
11281         * linux-s390-low.c (s390_collect_ptrace_register): New function.
11282         (s390_supply_ptrace_register): Likewise.
11283         (s390_fill_gregset): Call s390_collect_ptrace_register.
11284         (the_low_target): Update.
11285
11286         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
11287         (ppc_supply_ptrace_register): Likewise.
11288         (the_low_target): Update.
11289
11290         * linux-i386-low.c (the_low_target): Update.
11291         * linux-x86-64-low.c (the_low_target): Update.
11292
11293 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11294
11295         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
11296         reg-s390.o and reg-s390x.o.
11297
11298         * linux-low.c (new_inferior): New global variable.
11299         (linux_create_inferior, linux_attach): Set it.
11300         (linux_wait_for_process): Call the_low_target.arch_setup after the
11301         target has stopped for the first time.
11302         (initialize_low): Do not call the_low_target.arch_setup.
11303
11304         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
11305         (s390_set_pc): Likewise.
11306         (s390_arch_setup): New function.
11307         (the_low_target): Use s390_arch_setup as arch_setup routine.
11308
11309         * regcache.c (realloc_register_cache): New function.
11310         (set_register_cache): Call it for each existing regcache.
11311
11312 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11313
11314         * server.h (init_registers): Remove prototype.
11315
11316         * linux-low.h (struct linux_target_ops): Add arch_setup field.
11317         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
11318         instead of init_registers ().
11319         * linux-arm-low.c (init_registers_arm): Add prototype.
11320         (init_registers_arm_with_iwmmxt): Likewise.
11321         (the_low_target): Add initializer for arch_setup field.
11322         * linux-cris-low.c (init_registers_cris): Add prototype.
11323         (the_low_target): Add initializer for arch_setup field.
11324         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
11325         (the_low_target): Add initializer for arch_setup field.
11326         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
11327         (the_low_target): Add initializer for arch_setup field.
11328         * linux-ia64-low.c (init_registers_ia64): Add prototype.
11329         (the_low_target): Add initializer for arch_setup field.
11330         * linux-m32r-low.c (init_registers_m32r): Add prototype.
11331         (the_low_target): Add initializer for arch_setup field.
11332         * linux-m68k-low.c (init_registers_m68k): Add prototype.
11333         (the_low_target): Add initializer for arch_setup field.
11334         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
11335         (init_registers_mips64_linux): Likewise.
11336         (the_low_target): Add initializer for arch_setup field.
11337         * linux-ppc-low.c (init_registers_ppc): Add prototype.
11338         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
11339         (the_low_target): Add initializer for arch_setup field.
11340         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
11341         (init_registers_powerpc_64): Likewise.
11342         (the_low_target): Add initializer for arch_setup field.
11343         * linux-s390-low.c (init_registers_s390): Add prototype.
11344         (init_registers_s390x): Likewise.
11345         (the_low_target): Add initializer for arch_setup field.
11346         * linux-sh-low.c (init_registers_sh): Add prototype.
11347         (the_low_target): Add initializer for arch_setup field.
11348         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
11349         (the_low_target): Add initializer for arch_setup field.
11350         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
11351         (the_low_target): Add initializer for arch_setup field.
11352
11353         * win32-low.h (struct win32_target_ops): Add arch_setup field.
11354         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
11355         instead of init_registers ().
11356         * win32-arm-low.c (init_registers_arm): Add prototype.
11357         (the_low_target): Add initializer for arch_setup field.
11358         * win32-i386-low.c (init_registers_i386): Add prototype.
11359         (the_low_target): Add initializer for arch_setup field.
11360
11361         * spu-low.c (init_registers_spu): Add prototype.
11362         (initialize_low): Call initialie_registers_spu () instead of
11363         initialize_registers ().
11364
11365 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
11366
11367         * server.c (handle_v_requests): When handling the vRun and vAttach
11368         packets, if already debugging a process, don't kill it.  Return an
11369         error instead.
11370
11371 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
11372
11373         * server.c (handle_query): Correct length check.
11374
11375 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
11376
11377         * win32-low.c (do_initial_child_stuff): Add process handle
11378         parameter.  Set current_process_handle and current_process_id from the
11379         parameters. Clear globals.
11380         (win32_create_inferior): Don't set current_process_handle and
11381         current_process_id here.  Instead pass them on the call to
11382         do_initial_child_stuff.
11383         (win32_attach): Likewise.
11384         (win32_clear_inferiors): New.
11385         (win32_kill): Don't close the current process handle or the
11386         current thread handle here.  Instead call win32_clear_inferiors.
11387         (win32_detach): Don't open a new handle to the process.  Call
11388         win32_clear_inferiors.
11389         (win32_join): Don't rely on current_process_handle; open a new
11390         handle using the process id.
11391         (win32_wait): Call win32_clear_inferiors when the inferior process
11392         has exited.
11393
11394 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
11395
11396         * server.c (monitor_show_help): Add "exit".
11397
11398 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
11399
11400         * Makefile.in (SFILES): Add linux-xtensa-low.c.
11401         (clean): Add reg-xtensa.c.
11402         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
11403         * configure.srv (xtensa*-*-linux*) New target.
11404         * linux-xtensa-low.c: New.
11405         * xtensa-xtregs.c: New.
11406
11407 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
11408
11409         * hostio.c: Don't include errno.h.
11410         (errno_to_fileio_errno): Move to hostio-errno.
11411         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
11412         error number outputting to the target->hostio_last_error callback.
11413         (hostio_packet_error): Use FILEIO_EINVAL directly.
11414         (handle_open, handle_pread, hostio_error, handle_unlink): Update
11415         calls to hostio_error.
11416         * hostio-errno.c: New.
11417         * server.h (hostio_last_error_from_errno): Declare.
11418         * target.h (target_ops): Add hostio_last_error member.
11419         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
11420         as hostio_last_error handler.
11421         * spu-low.c (spu_target_ops): Likewise.
11422         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
11423         (wince_hostio_last_error): New functions.
11424         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
11425         as hostio_last_error handler.
11426         (win32_target_ops) [!_WIN32_WCE]: Register
11427         hostio_last_error_from_errno as hostio_last_error handler.
11428         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
11429         (hostio-errno.o): New rule.
11430         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
11431         * configure.srv (srv_hostio_err_objs): New variable.  Default to
11432         hostio-errno.o.
11433         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
11434         * configure: Regenerate.
11435
11436 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11437
11438         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
11439         (linux_kill, linux_detach): Clean up the process list.
11440         * remote-utils.c (remote_open): Improve port number parsing.
11441         (putpkt_binary, input_interrupt): Only send interrupts if the target
11442         is running.
11443         * server.c (extended_protocol): Make static.
11444         (attached): Define earlier.
11445         (exit_requested, response_needed, program_argv): New variables.
11446         (target_running): New.
11447         (start_inferior): Clear attached here.
11448         (attach_inferior): Set attached here.
11449         (require_running): Define.
11450         (handle_query): Use require_running and target_running.  Implement
11451         "monitor exit".
11452         (handle_v_attach, handle_v_run): New.
11453         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
11454         (gdbserver_usage): Update.
11455         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
11456         --attach along with other options or after the port.  Save
11457         program_argv.  Support no initial program.  Resynchronize
11458         communication with GDB after an error.  Handle "monitor exit".
11459         Use require_running and target_running.  Always allow the extended
11460         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
11461         restart in extended mode.
11462         * README: Refer to the GDB manual.  Update --attach usage.
11463
11464 2007-12-20  Andreas Schwab  <schwab@suse.de>
11465
11466         * linux-low.c (STACK_SIZE): Define.
11467         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
11468         (linux_test_for_tracefork): Likewise.
11469
11470 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
11471
11472         * linux-low.c (linux_wait_for_event): Update messages.  Do not
11473         reinsert auto-delete breakpoints.
11474         * mem-break.c (struct breakpoint): Change return type of handler to
11475         int.
11476         (set_breakpoint_at): Update handler type.
11477         (reinsert_breakpoint_handler): Return 1 instead of calling
11478         delete_breakpoint.
11479         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
11480         setting a new one.
11481         (check_breakpoints): Delete auto-delete breakpoints and return 2.
11482         * mem-break.h (set_breakpoint_at): Update handler type.
11483         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
11484         * win32-low.c (auto_delete_breakpoint): New.
11485         (get_child_debug_event): Use it.
11486
11487 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
11488
11489         * configure.ac: Check for pread and pwrite.
11490         * hostio.c (handle_pread): Fall back to lseek and read.
11491         (handle_pwrite): Fall back to lseek and write.
11492         * config.in, configure: Regenerated.
11493
11494 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
11495
11496         * server.c (myresume): Add own_buf argument.
11497         (main): Update calls.
11498
11499 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
11500
11501         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
11502         * remote-utils.c (remote_open): Do not call disable_async_io.
11503         (block_async_io): Delete.
11504         (unblock_async_io): Make static.
11505         (initialize_async_io): New.
11506         * server.c (handle_v_cont): Handle async I/O here.
11507         (myresume): Likewise.  Move other common resume tasks here...
11508         (main): ... from here.  Call initialize_async_io.  Disable async
11509         I/O before the main loop.
11510         * server.h (initialize_async_io): Declare.
11511         (block_async_io, unblock_async_io): Delete prototypes.
11512         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
11513
11514 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
11515
11516         * remote-utils.c (readchar): Allow binary data in received messages.
11517
11518 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11519
11520         * win32-low.c (attaching): New global.
11521         (win32_create_inferior): Clear the `attaching' global.
11522         (win32_attach): Set the `attaching' global.
11523         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11524         attaching.  Only set a breakpoint at the entry point if not
11525         attaching.
11526
11527 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11528
11529         * server.c (main): Don't report dll events on the initial
11530         connection on attaches.
11531
11532 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11533
11534         * server.c (main): Relax numerical bases supported for the pid of
11535         the --attach command line argument.
11536
11537 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11538
11539         * win32-low.c (win32_attach): Call OpenProcess before
11540         DebugActiveProcess, not after.  Add last error output to error
11541         call.
11542
11543 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11544
11545         * win32-low.c (win32_get_thread_context)
11546         (win32_set_thread_context): New functions.
11547         (thread_rec): Use win32_get_thread_context.
11548         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11549         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11550         field.
11551
11552 2007-12-03  Leo Zayas
11553             Pedro Alves  <pedro_alves@portugalmail.pt>
11554
11555         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11556         global variables.
11557         (child_add_thread): Minor cleanup.
11558         (child_continue): Resume artificially suspended threads before
11559         calling ContinueDebugEvent.
11560         (suspend_one_thread): New.
11561         (fake_breakpoint_event): New.
11562         (get_child_debug_event): Change return type to int.  Check here if
11563         gdb sent an interrupt request.  If a soft interrupt was requested,
11564         fake a breakpoint event.  Return 0 if there is no event to handle,
11565         and 1 otherwise.
11566         (win32_wait): Don't check here if gdb sent an interrupt request.
11567         Ensure there is a valid event to handle.
11568         (win32_request_interrupt): Add soft interruption method as last
11569         resort.
11570
11571 2007-12-03  Leo Zayas
11572             Pedro Alves  <pedro_alves@portugalmail.pt>
11573
11574         * win32-low.h (win32_thread_info): Add descriptions to the
11575         structure members.  Replace `suspend_count' counter by a
11576         `suspended' flag.
11577         * win32-low.c (thread_rec): Update condition of when to get the
11578         context from the inferior.  Rely on ContextFlags being set if it
11579         has already been retrieved.  Only suspend the inferior thread if
11580         we haven't already.  Warn if that fails.
11581         (continue_one_thread): s/suspend_count/suspended/.  Only call
11582         ResumeThread once.  Warn if that fails.
11583
11584 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11585
11586         * win32-low.c (win32_wait): Don't read from the inferior when it
11587         has already exited.
11588
11589 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11590
11591         * Makefile.in (win32_low_h): New variable.
11592         (win32-low.o): Add dependency on $(win32_low_h).
11593         (win32-arm-low.o, win32-i386-low.o): New rules.
11594
11595 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11596
11597         * hostio.c: Correct copyright year.
11598
11599 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11600
11601         * Makefile.in (OBS): Add hostio.o.
11602         (hostio.o): New rule.
11603         * server.h (handle_vFile): Declare.
11604         * hostio.c: New file.
11605         * server.c (handle_v_requests): Take packet_len and new_packet_len
11606         for binary packets.  Call handle_vFile.
11607         (main): Update call to handle_v_requests.
11608
11609 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11610
11611         * linux-low.c: Include <sched.h>.
11612
11613 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11614
11615         * linux-low.c (linux_tracefork_grandchild): New.
11616         (linux_tracefork_child): Use clone.
11617         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11618
11619 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11620
11621         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11622
11623 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11624
11625         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11626
11627 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11628
11629         * inferiors.c (change_inferior_id): Delete.
11630         (add_pid_to_list, pull_pid_from_list): New.
11631         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11632         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11633         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11634         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11635         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11636         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11637         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11638         (using_threads): Always set to 1.
11639         (handle_extended_wait): New.
11640         (add_process): Do not set TID.
11641         (linux_create_inferior): Set must_set_ptrace_flags.
11642         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11643         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11644         (linux_thread_alive): Rename TID argument to LWPID.
11645         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11646         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11647         call to dead_thread_notify.  Call handle_extended_wait.
11648         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11649         (send_sigstop): Delete sigstop_sent.
11650         (wait_for_sigstop): Avoid TID.
11651         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11652         (linux_test_for_tracefork): New.
11653         (linux_lookup_signals): Use thread_db_active and
11654         linux_supports_tracefork_flag.
11655         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11656         * linux-low.h (get_process_thread): Avoid TID.
11657         (struct process_ifo): Move thread_known and tid to the end.  Remove
11658         sigstop_sent.
11659         (linux_attach_lwp, thread_db_init): Update prototypes.
11660         * server.h (change_inferior_id): Delete prototype.
11661         (add_pid_to_list, pull_pid_from_list): New prototypes.
11662         * thread-db.c (thread_db_use_events): New.
11663         (find_first_thread): Rename to...
11664         (find_one_thread): ...this.  Update callers and messages.  Do not
11665         call fatal.  Check thread_db_use_events.  Do not call
11666         change_inferior_id or new_thread_notify.
11667         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11668         (thread_db_init): Set thread_db_use_events.  Check use_events.
11669         * utils.c (fatal, warning): Correct message prefix.
11670
11671 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11672
11673         * Makefile.in (clean): Remove new files.
11674         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11675         (powerpc-64.o, powerpc-64.c): New rules.
11676         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11677         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11678         with SPE.
11679         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11680         SPE targets.
11681         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11682         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11683         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11684         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11685         (target_regsets): Add AltiVec and SPE register sets.
11686         * configure.ac: Check for AltiVec and SPE.
11687         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11688         (ppc_fill_vrregset, ppc_store_vrregset): New.
11689         (target_regsets): Add AltiVec register set.
11690         * configure: Regenerated.
11691
11692 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11693
11694         * linux-low.c (O_LARGEFILE): Define.
11695         (linux_read_memory): Use /proc/PID/mem.
11696         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11697         * configure, config.in: Regenerated.
11698
11699 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11700
11701         * linux-low.c (linux_wait_for_event): Do not pass signals while
11702         single-stepping.
11703
11704 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11705
11706         * win32-low.c (create_process): New.
11707         (win32_create_inferior): Use create_process instead of
11708         CreateProcess.  If create_process failed retry appending an ".exe"
11709         suffix.  Store the GetLastError result immediatelly after
11710         create_process calls and use it on the call to error.
11711
11712 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11713
11714         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11715
11716 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11717
11718         * configure.ac: Switch license to GPLv3.
11719
11720 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11721
11722         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11723
11724 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11725
11726         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11727         typedef.
11728         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11729         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11730         CloseToolhelp32Snapshot.
11731         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11732         CloseToolhelp32Snapshot.
11733
11734 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11735
11736         * server.c (main): Check for inferior exit before main loop.
11737
11738 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11739
11740         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11741         instead of on tmp_desc.
11742
11743 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11744             Daniel Jacobowitz  <dan@codesourcery.com>
11745
11746         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11747         (add_thread): Minor cleanups.
11748         (clear_inferiors): Move lower in the file.  Clear the DLL
11749         list.
11750         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11751         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11752         (xml_escape_text): New.
11753         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11754         for qSupported.
11755         (handle_v_cont): Report errors.
11756         (gdbserver_version): Update.
11757         (main): Correct size of own_buf.  Do not report initial DLL events.
11758         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11759         (unloaded_dll, xml_escape_text): New.
11760         * win32-low.c (enum target_waitkind): Update comments.
11761         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11762         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11763         (win32_EnumProcessModules, win32_GetModuleInformation)
11764         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11765         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11766         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11767         (win32_Module32First, win32_Module32Next, load_toolhelp)
11768         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11769         (get_child_debug_event): Handle DLL events.
11770         (win32_wait): Likewise.
11771
11772 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11773
11774         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11775         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11776
11777 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11778
11779         * win32-low.c (handle_output_debug_string): Ignore event if not
11780         waiting.
11781
11782 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11783
11784         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11785
11786 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11787
11788         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11789
11790 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11791
11792         * inferiors.c (change_inferior_id): Add comment.
11793         * linux-low.c (check_removed_breakpoint): Add an early
11794         prototype.  Improve debug output.
11795         (linux_attach): Doc update.
11796         (linux_detach_one_process, linux_detach): Clean up before releasing
11797         each process.
11798         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11799         * linux-low.h (struct process_info): Doc improvement.
11800         * mem-break.c (delete_all_breakpoints): New.
11801         * mem-break.h (delete_all_breakpoints): New prototype.
11802         * thread-db.c (find_first_thread): New.
11803         (thread_db_create_event): Call it instead of
11804         thread_db_find_new_threads.  Clean up unused variables.
11805         (maybe_attach_thread): Remove first thread handling.
11806         (thread_db_find_new_threads): Use find_first_thread.
11807         (thread_db_get_tls_address): Likewise.
11808
11809 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11810
11811         * thread-db.c (thread_db_find_new_threads): Add prototype.
11812         (thread_db_create_event): Check for the main thread before adding
11813         a new thread.
11814         (maybe_attach_thread): Only enable event reporting if TID == 0.
11815         (thread_db_get_tls_address): Check for new threads.
11816
11817 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11818
11819         * linux-low.c (linux_create_inferior): Try execv before execvp.
11820         * spu-low.c (spu_create_inferior): Likewise.
11821
11822 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11823
11824         * linux-low.c (linux_create_inferior): Change execv to execvp.
11825         * spu-low.c (spu_create_inferior): Likewies.
11826
11827 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11828
11829         * Makefile.in (clean): Clean new files instead of deleted ones.
11830         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11831         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11832         rules.
11833         * configure.srv: Specify XML files and new regformats for MIPS and
11834         MIPS64 GNU/Linux.
11835         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11836         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11837         an entry for the restart register.
11838         (mips_cannot_fetch_register, mips_cannot_store_register)
11839         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11840         register names to match the XML descriptions.
11841         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11842         restart register instead of $0.
11843
11844 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11845             Markus Deuling  <deuling@de.ibm.com>
11846
11847         * remote-utils.c (decode_xfer_write): New function.
11848         * server.h (decode_xfer_write): Add prototype.
11849         * server.c (handle_query): Add PACKET_LEN argument.  Support
11850         qXfer:spu:read and qXfer:spu:write packets.
11851         (main): Pass packet_len to handle_query.
11852         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11853         * target.h (target_ops): Add qxfer_spu.
11854
11855 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11856
11857         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11858         accessing non-seekable spufs files.
11859
11860 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11861
11862         * server.c (handle_query): Add reply for qC packet.
11863
11864 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11865             Leo Zayas  <lerele@champenstudios@com>
11866
11867         * server.h (check_remote_input_interrupt_request): New function.
11868         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11869         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11870         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11871         (check_remote_input_interrupt_request): New function.
11872         * server.h (check_remote_input_interrupt_request): Declare.
11873         * win32-low.c (winapi_DebugBreakProcess,
11874         winapi_GenerateConsoleCtrlEvent): New typedefs.
11875         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11876         to 250 ms.
11877         (win32_wait): Check for remote interrupt request
11878         with check_remote_input_interrupt_request.
11879         (win32_request_interrupt): New function.
11880         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11881
11882 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11883
11884         * win32-low.c (debug_registers_changed,
11885         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11886         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11887         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11888         (thread_rec): Get context using the low target.
11889         (child_add_thread): Call thread_added on the low target,
11890         which does the same thing.
11891         (regptr): Delete.
11892         (do_initial_child_stuff): Remove debug registers references.
11893         Set context using the low target.  Resume threads after
11894         setting the contexts.
11895         (child_continue): Remove dead variable.  Remove debug
11896         registers references.
11897         (child_fetch_inferior_registers): Go through the low target.
11898         (do_child_store_inferior_registers): Remove.
11899         (child_store_inferior_registers): Go through the low target.
11900         (win32_resume): Remove debug registers references.
11901         Set context using the low target.
11902         (handle_exception): Change return type to void.  Don't record
11903         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11904         first chance exception.
11905         (get_child_debug_event): Change return type to void.  Remove
11906         goto loop.  Always return after waiting for debug event.
11907         (win32_wait): Convert to switch statement.  Handle spurious
11908         events.
11909
11910         * win32-i386-low.c (debug_registers_changed,
11911         debug_registers_used): New.
11912         (initial_stuff): Rename to ...
11913         (i386_initial_stuff): ... this.  Clear debug registers
11914         state variables.
11915         (store_debug_registers): Delete.
11916         (i386_get_thread_context): New.
11917         (load_debug_registers): Delete.
11918         (i386_set_thread_context): New.
11919         (i386_thread_added): New.
11920         (single_step): Rename to ...
11921         (i386_single_step): ... this.
11922         (do_fetch_inferior_registers): Rename to ...
11923         (i386_fetch_inferior_register): ... this.
11924         (i386_store_inferior_register): New.
11925         (the_low_target): Adapt to new interface.
11926
11927         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11928         (arm_get_thread_context): New.
11929         (arm_set_thread_context): New.
11930         (regptr): New.
11931         (do_fetch_inferior_registers): Rename to ...
11932         (arm_fetch_inferior_register): ... this.
11933         (arm_store_inferior_register): New.
11934         (arm_wince_breakpoint): Reimplement as unsigned long.
11935         (arm_wince_breakpoint_len): Define.
11936         (the_low_target): Adapt to new interface.
11937
11938         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11939         load_debug_registers.  Add get_thread_context, set_thread_context,
11940         thread_added and store_inferior_register.  Rename
11941         fetch_inferior_registers to fetch_inferior_register.
11942         (regptr): Remove declaration.
11943
11944 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11945
11946         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11947         * spu-low.c (spu_detach): Likewise.
11948
11949 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11950
11951         * target.h (target_ops): Change return type of detach to int.
11952         Add join.
11953         (join_inferior): New.
11954         * server.c (main): Don't skip detach support on mingw32.
11955         If the inferior doesn't support detaching return error.
11956         Call join_inferior instead of using waitpid.
11957         * linux-low.c (linux_join): New.
11958         (linux_target_op): Add linux_join.
11959         * spu-low.c (spu_join): New.
11960         (spu_target_ops): Add spu_join.
11961         * win32-low.c (win32_detach): Adapt to new interface.
11962         Reopen current_process_handle before detaching.  Issue a child
11963         resume before detaching.
11964         (win32_join): New.
11965         (win32_target_op): Add win32_join.
11966
11967 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11968
11969         * win32-low.c (win32-attach): Fix return value.
11970         * target.h (target_ops): Describe ATTACH return values.
11971
11972 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11973
11974         * win32-low.c (GETPROCADDRESS): Define.
11975         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11976         (winapi_DebugSetProcessKillOnExit): Likewise.
11977         (win32_create_inferior): Force usage of ansi CreateProcessA.
11978         (win32_attach): Use GETPROCADDRESS.
11979         (win32_detach): Likewise.
11980
11981 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11982
11983         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11984
11985 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11986
11987         * win32-low.c: Commit leftover changes from 2007-03-29.
11988
11989 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11990
11991         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11992         fields short instead of int.  Add explicit padding.
11993         (i387_cache_to_fsave): Remove unnecessary casts.
11994         (i387_fsave_to_cache): Doc fix.
11995         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11996
11997 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11998
11999         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
12000         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
12001
12002 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
12003
12004         * configure.srv (arm*-*-mingw32ce*): Move near the other
12005         arm targets.
12006
12007 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
12008
12009         * configure.ac: Add errno checking.
12010         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
12011         sys/file.h and malloc.h.
12012         (AC_CHECK_DECLS): Add perror.
12013         (srv_mingwce): Handle.
12014         * configure.srv (i[34567]86-*-cygwin*): Add
12015         win32-i386-low.o to srv_tgtobj.
12016         (i[34567]86-*-mingw*): Likewise.
12017         (arm*-*-mingw32ce*): Add case.
12018         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
12019         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
12020         [__MINGW32CE__] (strerror): New function.
12021         [__MINGW32CE__] (errno): Define to GetLastError.
12022         [__MINGW32CE__] (COUNTOF): New macro.
12023         (remote_open): Remove extra close call.
12024         * mem-break.c (delete_breakpoint_at): New function.
12025         * mem-break.h (delete_breakpoint_at): Declare.
12026         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
12027         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
12028         [USE_WIN32API] (read, write): Add char* casts.
12029         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
12030         * server.h: Include wincecompat.h on Windows CE.
12031         [HAVE_ERRNO_H]: Check.
12032         (perror): Declare if not declared.
12033         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
12034         (perror_with_name): Remove errno declaration.
12035         * wincecompat.h: New.
12036         * wincecompat.c: New.
12037         * win32-low.h: New.
12038         * win32-arm-low.c: New.
12039         * win32-i386-low.c: New.
12040         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
12041         (OUTMSG2): Make it safe.
12042         (_T): New macro.
12043         (COUNTOF): New macro.
12044         (NUM_REGS): Get it from the low target.
12045         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
12046         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
12047         (thread_rec): Let low target handle debug registers.
12048         (child_add_thread): Likewise.
12049         (child_init_thread_list): Likewise.
12050         (continue_one_thread): Likewise.
12051         (regptr): New.
12052         (do_child_fetch_inferior_registers): Move to ...
12053         * win32-i386-low.c: ... here, and rename to ...
12054         (do_fetch_inferior_registers): ... this.
12055         * win32-low.c (child_fetch_inferior_registers):
12056         Go through the low target.
12057         (do_child_store_inferior_registers): Use regptr.
12058         (strwinerror): New function.
12059         (win32_create_inferior): Handle Windows CE.
12060         Use strwinerror instead of strerror on Windows error
12061         codes.  Add program to the error output.
12062         Don't close the main thread handle on Windows CE.
12063         (win32_attach): Use coredll.dll on Windows CE.
12064         (win32_kill): Close current process and current
12065         thread handles.
12066         (win32_detach): Use coredll.dll on Windows CE.
12067         (win32_resume): Let low target handle debug registers, and
12068         step request.
12069         (handle_exception): Add/Remove initial breakpoint.  Avoid
12070         non-existant WSTOPSIG on Windows CE.
12071         (win32_read_inferior_memory): Cast to remove warning.
12072         (win32_arch_string): Go through the low target.
12073         (initialize_low): Call set_breakpoint_data with the low
12074         target's breakpoint.
12075         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
12076         FOP_REGNUM, mappings): Move to ...
12077         * win32-i386-low.c: ... here.
12078         * win32-low.c (win32_thread_info): Move to ...
12079         * win32-low.h: ... here.
12080         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
12081         win32-arm-low.c and wincecompat.c.
12082         (all:): Add $EXEEXT.
12083         (install-only:): Likewise.
12084         (gdbserver:): Likewise.
12085         (gdbreplay:): Likewise.
12086         * config.in: Regenerate.
12087         * configure: Regenerate.
12088
12089 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
12090
12091         * win32-low.c: Rename typedef thread_info to
12092         win32_thread_info throughout.
12093
12094 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
12095
12096         * win32-i386-low.c: Rename to ...
12097         * win32-low.c: ... this.
12098         * configure.srv: Replace win32-i386-low.o with win32-low.o.
12099         * Makefile.in: Likewise.
12100
12101 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
12102
12103         * remote-utils.c (monitor_output): Constify msg parameter.
12104         * server.h (monitor_output): Likewise.
12105         * win32-i386-low.c (handle_output_debug_string): New.
12106         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
12107         handle_output_debug_string.
12108         (get_child_debug_event): Likewise.
12109
12110 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
12111
12112         * server.c (main): Correct strtoul check.
12113
12114 2007-03-27  Jon Ringle  <jon@ringle.org>
12115
12116         * linux-low.c: Check __ARCH_HAS_MMU__ also.
12117
12118 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
12119
12120         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
12121
12122 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
12123
12124         * terminal.h: Check HAVE_SGTTY_H.
12125
12126 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
12127
12128         * remote-utils.c (remote_open): Print out the assigned port number.
12129
12130 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
12131
12132         * remote-utils.c (monitor_output): New function.
12133         * server.c (debug_threads): Define here.
12134         (monitor_show_help): New function.
12135         (handle_query): Handle qRcmd.
12136         (main): Do not handle 'd' packet.
12137         * server.h (debug_threads, remote_debug, monitor_output): Declare.
12138         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
12139         of debug_threads.
12140
12141 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12142
12143         * Makefile.in (EXEEXT): New.
12144         (clean): Use $(EXEEXT).
12145
12146 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12147
12148         * target.h (target_ops): Rename send_signal to request_interrupt,
12149         and remove enum target_signal parameter.
12150         * linux-low.c (linux_request_interrupt): Rename from
12151         linux_send_signal, and always send SIGINT.
12152         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
12153         and always send SIGINT.
12154         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
12155         of send_signal.
12156         (input_interrupt): Likewise.
12157
12158 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12159
12160         * server.c (get_features_xml): Check if target implemented
12161         arch_string.
12162         * win32-i386-low.c (win32_arch_string): New.
12163         (win32_target_ops): Add win32_arch_string as arch_string member.
12164
12165 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
12166
12167         * spu-low.c (spu_arch_string): New.
12168         (spu_target_ops): Add spu_arch_string.
12169
12170 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
12171
12172         * remote-utils.c: Remove HAVE_TERMINAL_H check.
12173         * configure.ac: Do not check for terminal.h.
12174         * configure, config.in: Regenerated.
12175
12176 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12177
12178         * Makefile.in (OBS): Add $(XML_BUILTIN).
12179         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
12180         (clean): Update.
12181         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
12182         (arm-with-iwmmxt.c): New.
12183         * config.in, configure: Regenerate.
12184         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
12185         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
12186         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
12187         (arm*-*-linux*): Add iWMMXt and regset support.
12188         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
12189         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
12190         (arm_store_wmmxregset, target_regsets): New.
12191         * server.c (get_features_xml): Take annex argument.  Check builtin
12192         XML documents.
12193         (handle_query): Handle multiple annexes.
12194
12195 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
12196
12197         * remote-utils.c [USE_WIN32API] (read, write): Define.
12198         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
12199         write.
12200
12201 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
12202
12203         * linux-i386-low.c (the_low_target): Set arch_string.
12204         * linux-x86-64-low.c (the_low_target): Likewise.
12205         * linux-low.c (linux_arch_string): New.
12206         (linux_target_ops): Add it.
12207         * linux-low.h (struct linux_target_ops): Add arch_string.
12208         * server.c (write_qxfer_response): Use const void * for DATA.
12209         (get_features_xml): New.
12210         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
12211         * target.h (struct target_ops): Add arch_string method.
12212
12213 2007-01-03  Denis Pilat  <denis.pilat@st.com>
12214             Daniel Jacobowitz  <dan@codesourcery.com>
12215
12216         * linux-low.c (linux_kill): Handle being called with no threads.
12217         * win32-i386-low.c (win32_kill): Likewise.
12218         (get_child_debug_event): Clear current_process_handle.
12219
12220 2006-12-30  Denis PILAT  <denis.pilat@st.com>
12221             Daniel Jacobowitz  <dan@codesourcery.com>
12222
12223         * remote-utils.c (remote_open): Check the type of specified
12224         serial port devices before opening them.
12225         * server.c (main): Kill the inferior if an error occurs during
12226         the first remote_open.
12227
12228 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
12229
12230         * README: Update supported targets.
12231
12232 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
12233
12234         * Makefile.in (clean): Remove reg-mips64.c.
12235         (reg-mips64.c, reg-mips64.o): New rules.
12236         * configure.srv: Handle mips64.  Include regset support for mips.
12237         * linux-mips-low.c (union mips_register): New.
12238         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
12239         (mips_breakpoint, mips_breakpoint_at): Use int.
12240         (mips_collect_register, mips_supply_register)
12241         (mips_collect_register_32bit, mips_supply_register_32bit)
12242         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
12243         (mips_store_fpregset, target_regsets): New.
12244         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
12245
12246 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
12247
12248         * configure.srv: Add target "spu*-*-*".
12249         * Makefile.in (clean): Remove reg-spu.c.
12250         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
12251         * spu-low.c: New file.
12252
12253 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
12254
12255         * configure.ac: Correct td_thr_tls_get_addr test.
12256         * configure: Regenerated.
12257
12258 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
12259
12260         * linux-low.c (linux_wait_for_event): Reformat.  Use the
12261         pass_signals array.
12262         * remote-utils.c (decode_address_to_semicolon): New.
12263         * server.c (pass_signals, handle_general_set): New.
12264         (handle_query): Mention QPassSignals for qSupported.
12265         (main): Call handle_general_set.
12266         * server.h (pass_signals, decode_address_to_semicolon): New.
12267
12268 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
12269
12270         * server.c (handle_query): Correct error handling for read_auxv.
12271
12272 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
12273
12274         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
12275         and srv_linux_thread_db to yes.
12276         * linux-s390-low.c (s390_fill_gregset): New function.
12277         (target_regsets): Define data structure.
12278
12279 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
12280
12281         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
12282         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
12283         * config.in, configure: Regenerated.
12284         * inferiors.c (gdb_id_to_thread): New function.
12285         (gdb_id_to_thread_id): Use it.
12286         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
12287         * linux-low.h (struct process_info): Add th member.
12288         (thread_db_get_tls_address): New prototype.
12289         * remote-utils.c (decode_address): Make non-static.
12290         * server.c (handle_query): Handle qGetTLSAddr.
12291         * server.h (gdb_id_to_thread, decode_address): New prototypes.
12292         * target.h (struct target_ops): Add get_tls_address.
12293         * thread-db.c (maybe_attach_thread): Save the thread handle.
12294         (thread_db_get_tls_address): New.
12295
12296 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
12297
12298         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
12299         (linux_resume_one_process): Take a siginfo_t *.  Update all
12300         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
12301         (struct pending_signals): Add a siginfo_t.
12302         (linux_wait_for_process): Always set last_status.
12303         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
12304         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
12305         * linux-low.h (struct process_info): Add last_status.
12306
12307 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
12308
12309         * remote-utils.c (try_rle): New function.
12310         (putpkt_binary): Use it.
12311
12312 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
12313
12314         * Makefile.in (clean): Clean reg-x86-64-linux.c.
12315         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
12316         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
12317         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
12318         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
12319         point registers.
12320
12321 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
12322
12323         * server.c (terminal_fd): New variable.
12324         (old_foreground_pgrp): Likewise.
12325         (restore_old_foreground_pgrp): New function.
12326         (start_inferior): Record the terminal file descriptor in terminal_fd
12327         and its original foreground group in old_foreground_pgrp.  Register
12328         restore_old_foreground_pgrp with atexit().
12329
12330 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
12331
12332         * server.c (handle_query): Correct qPart to qXfer.
12333
12334 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
12335
12336         * configure.ac: Check for more headers which are missing on
12337         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
12338         * configure.srv: Add Cygwin and mingw32.
12339         * remote-utils.c: Don't include headers unconditionally which
12340         are missing on mingw32.  Include <winsock.h> for mingw32.
12341         (remote_open): Adjust for mingw32 support.  Flush
12342         standard error after writing to it.
12343         (remote_close, putpkt_binary, input_interrupt, block_async_io)
12344         (unblock_async_io, enable_async_io, disable_async_io)
12345         (readchar, getpkt): Update for Winsock support.
12346         (prepare_resume_reply): Expect a protocol signal number.
12347         * server.c: Disable <sys/wait.h> on mingw32.
12348         (start_inferior): Adjust for mingw32 support.  Flush
12349         standard error after writing to it.
12350         (attach_inferior): Likewise.  Use protocol signal
12351         numbers.
12352         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
12353         and names.
12354         * win32-i386-low.c: New file.
12355         * Makefile.in (XM_CLIBS): Set.
12356         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
12357         (win32-i386-low.o): New dependency rule.
12358         * linux-low.c (linux_wait): Use target signal numbers.
12359         * target.h (struct target_ops): Doc fix.
12360         * server.h (target_signal_to_name): New prototype.
12361         * gdbreplay.c: Don't include headers unconditionally which
12362         are missing on mingw32.  Include <winsock.h> for mingw32.
12363         (remote_close, remote_open): Adjust for Winsock support.
12364         * configure, config.in: Regenerated.
12365
12366 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12367
12368         * server.c (decode_xfer_read, write_qxfer_response): New.
12369         (handle_query): Take a packet length argument.  Handle
12370         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
12371         the qSupported response.
12372         (main): Update call to handle_query.
12373
12374 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
12375
12376         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
12377         (putpkt_binary): Renamed from putpkt and adjusted for binary
12378         data.
12379         (putpkt): New wrapper for putpkt_binary.
12380         (readchar): Don't mask off the high bit.
12381         (decode_X_packet): New function.
12382         * server.c (main): Call putpkt_binary if a handler sets the packet
12383         length.  Save the length of the incoming packet.  Handle 'X'.
12384         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
12385
12386 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
12387
12388         * server.c (handle_query): Handle qSupported.
12389
12390 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12391
12392         * remote-utils.c (all_symbols_looked_up): New variable.
12393         (look_up_one_symbol): Check it.
12394         * server.h (look_up_one_symbol): New declaration.
12395         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
12396
12397 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12398
12399         * Makefile.in (linux-arm-low.o): Update dependencies.
12400         * linux-arm-low.c: Include "gdb_proc_service.h".
12401         (PTRACE_GET_THREAD_AREA): Define.
12402         (ps_get_thread_area): New function.
12403
12404 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
12405
12406         * configure.srv (m68k*-*-uclinux*): New target.
12407         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
12408         (linux_resume_one_process): Remove extraneous cast.
12409         (linux_read_offsets): New.
12410         (linux_target_op): Add linux_read_offsets on mmuless systems.
12411         * server.c (handle_query): Add qOffsets logic.
12412         * target.h (struct target_ops): Add read_offsets.
12413
12414 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12415
12416         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
12417         (PTRACE_GET_THREAD_AREA): Define.
12418         (ps_get_thread_area): New function.
12419         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
12420         (linux-x86-64-low.o): Update.
12421
12422 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12423
12424         * configure.ac: Remove checks for prfpregset_t.
12425         * gdb_proc_service.h: New file.
12426         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
12427         new "gdb_proc_service.h".
12428         * proc-service.c: Likewise.
12429         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
12430         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
12431         * Makefile.in (gdb_proc_service_h): Updated.
12432         * configure, config.in: Regenerated.
12433
12434 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12435
12436         * remote-utils.c (prepare_resume_reply): Move declaration
12437         of gdb_id_from_wait to the top of the block.
12438
12439 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
12440
12441         * linux-low.c (regsets_store_inferior_registers): Read the regset
12442         from the target before filling it.
12443
12444 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12445
12446         * server.c (attach_inferior): Return SIGTRAP for a successful
12447         attach.
12448
12449 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
12450
12451         * Makefile.in (OBS): Add version.o.
12452         (STAGESTUFF): Delete.
12453         (version.o): Add dependencies.
12454         (version.c): Replace rule.
12455         (clean): Remove version.c.
12456         * server.c (gdbserver_version): New.
12457         (gdbserver_usage): Use printf.
12458         (main): Handle --version and --help.
12459         * server.h (version, host_name): Add declarations.
12460
12461 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
12462
12463         * linux-arm-low.c:
12464         * linux-arm-low.c:
12465         * inferiors.c:
12466         * i387-fp.h:
12467         * i387-fp.c:
12468         * gdbreplay.c:
12469         * regcache.c:
12470         * proc-service.c:
12471         * mem-break.h:
12472         * mem-break.c:
12473         * linux-x86-64-low.c:
12474         * linux-sh-low.c:
12475         * linux-s390-low.c:
12476         * linux-ppc64-low.c:
12477         * linux-ppc-low.c:
12478         * linux-mips-low.c:
12479         * linux-m68k-low.c:
12480         * linux-m32r-low.c:
12481         * linux-low.h:
12482         * linux-low.c:
12483         * linux-ia64-low.c:
12484         * linux-i386-low.c:
12485         * linux-crisv32-low.c:
12486         * thread-db.c:
12487         * terminal.h:
12488         * target.h:
12489         * target.c:
12490         * server.h:
12491         * server.c:
12492         * remote-utils.c:
12493         * regcache.h:
12494         * utils.c:
12495         * Makefile.in:
12496         * configure.ac:
12497         * gdbserver.1: Add (C) after Copyright.  Update the FSF
12498         address.
12499
12500 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
12501
12502         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
12503         (arm_breakpoint_at): Recognize both breakpoints.
12504         (the_low_target): Use the correct breakpoint instruction.
12505
12506 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
12507
12508         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
12509         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
12510         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
12511         (the_low_target): Update.
12512
12513 2005-10-25  Andreas Schwab  <schwab@suse.de>
12514
12515         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12516
12517         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12518         (ia64_num_regs): Reduce to 462.
12519
12520 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12521
12522         * acinclude.m4: Correct quoting.
12523         * aclocal.m4: Regenerated.
12524
12525         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12526         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12527         (thread_db_init): Call thread_db_err_str.
12528         * configure.ac: Check for TD_VERSION.
12529         * config.in, configure: Regenerated.
12530
12531 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12532
12533         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12534
12535 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12536
12537         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12538         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12539         * config.in, configure: Regenerated.
12540         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12541         * linux-i386-low.c, linux-m68k-low.c: Update to use
12542         HAVE_PTRACE_GETREGS.
12543         * linux-low.c (regsets_fetch_inferior_registers)
12544         (regsets_store_inferior_registers): Only return 0 if we processed
12545         GENERAL_REGS.
12546         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12547         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12548
12549 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12550
12551         * inferiors.c (struct thread_info): Add gdb_id.
12552         (add_thread): Add gdb_id argument.
12553         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12554         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12555         calls to add_thread.
12556         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12557         * server.c (handle_query): Use thread_to_gdb_id.
12558         (handle_v_cont, main): Use gdb_id_to_thread_id.
12559         * server.h (add_thread): Update prototype.
12560         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12561         prototypes.
12562
12563 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12564
12565         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12566         left-padded registers.
12567         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12568         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12569
12570 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12571
12572         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12573         * configure: Regenerate.
12574         * config.in: Regenerate.
12575         * server.h (NEED_DECLARATION_STRERROR):
12576         Replace with !HAVE_DECL_STRERROR.
12577
12578 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12579
12580         * linux-low.c (linux_wait, linux_send_signal): Don't test
12581         an unsigned long variable for > 0 if it could be MAX_ULONG.
12582         * server.c (myresume): Likewise.
12583         * target.c (set_desired_inferior): Likewise.
12584
12585 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12586
12587         * configure.ac: Simplify and improve check for socklen_t.
12588         * configure, config.in: Regenerate.
12589
12590 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12591
12592         * acconfig.h: Remove.
12593         * configure.ac: Add a test for socklen_t.  Use three-argument
12594         AC_DEFINE throughout.
12595         * config.in: Regenerated using autoheader 2.59.
12596         * configure: Regenerated.
12597
12598         * gdbreplay.c (socklen_t): Provide a default.
12599         (remote_open): Use socklen_t.
12600         * remote-utils.c (socklen_t): Provide a default.
12601         (remote_open): Use socklen_t.
12602         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12603         unsigned char.
12604
12605         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12606         char for buffers.
12607         * linux-low.c (linux_read_memory, linux_write_memory)
12608         (linux_read_auxv): Likewise.
12609         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12610         (check_mem_write): Likewise.
12611         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12612         Likewise.
12613         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12614         (registers_from_string, register_data): Likewise.
12615         * server.c (handle_query, main): Likewise.
12616         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12617         (decode_M_packet): Likewise.
12618         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12619         * target.h (struct target_ops): Update read_memory, write_memory,
12620         and read_auxv.
12621         (read_inferior_memory, write_inferior_memory): Update.
12622         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12623         to unsigned char *.
12624         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12625         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12626         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12627         linux-s390-low.c, linux-sh-low.c: Update for changes in
12628         read_inferior_memory and the_low_target->breakpoint.
12629
12630 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12631
12632         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12633         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12634         * configure.srv: Add powerpc64-*-linux*.
12635         * linux-ppc64-low.c: New file.
12636
12637 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12638
12639         * linux-cris-low.c: New file with support for CRIS.
12640         * linux-crisv32-low.c: Ditto for CRISv32.
12641         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12642         (clean): Add reg-cris.c and reg-crisv32.c.
12643         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12644         reg-crisv32.o, and reg-crisv32.c to make rules.
12645         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12646         recognized targets.
12647
12648 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12649
12650         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12651         of sizeof (PTRACE_XFER_TYPE).
12652         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12653
12654 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12655
12656         * target.h (struct target_ops): Add insert_watchpoint,
12657         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12658         pointers for hardware watchpoint support.
12659         * linux-low.h (struct linux_target_ops): Ditto.
12660         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12661         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12662         to linux_target_ops.
12663         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12664         reply packet.
12665         * server.c (main): Recognize 'Z' and 'z' packets.
12666
12667 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12668
12669         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12670         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12671         (the_low_target): Add new members.
12672
12673 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12674
12675         * proc-service.c (ps_lgetregs): Search all_processes instead of
12676         all_threads.
12677
12678 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12679
12680         * server.c (start_inferior): Change return type to int.
12681         (attach_inferior): Change sigptr to int *.
12682         (handle_v_cont, handle_v_requests): Change signal to int *.
12683         (main): Change signal to int.
12684
12685 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12686
12687         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12688         * configure.srv: Add m32r*-*-linux*.
12689         * linux-m32r-low.c: New file.
12690
12691 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12692
12693         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12694
12695 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12696
12697         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12698         Take unsigned long arguments for PIDs.
12699         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12700         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12701         (wait_for_sigstop, linux_resume_one_process)
12702         (regsets_fetch_inferior_registers, linux_send_signal)
12703         (linux_read_auxv): Likewise.  Update the types of variables holding
12704         PIDs.  Update format string specifiers.
12705         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12706         * remote-utils.c (prepare_resume_reply): Likewise.
12707         * server.c (cont_thread, general_thread, step_thread)
12708         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12709         unsigned long.
12710         (handle_query): Update format specifiers.
12711         (handle_v_cont, main): Use strtoul for thread IDs.
12712         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12713         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12714         (general_thread, step_thread, thread_from_wait)
12715         (old_thread_from_wait): Update.
12716         * target.h (struct thread_resume): Use unsigned long for THREAD.
12717         (struct target_ops): Use unsigned long for arguments to attach and
12718         thread_alive.
12719
12720 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12721
12722         * acinclude.m4: Include bfd/bfd.m4 directly.
12723         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12724         <agriffis@toolchain.org>.
12725         * aclocal.m4, configure: Regenerated.
12726
12727 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12728
12729         * configure.ac: Rename configure.in, require autoconf 2.59.
12730         * configure: Re-generate.
12731
12732 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12733
12734         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12735         LIBS when finished.
12736         * aclocal.m4: Regenerated.
12737         * configure: Regenerated.
12738
12739 2004-11-21  Andreas Schwab  <schwab@suse.de>
12740
12741         * linux-m68k-low.c (m68k_num_gregs): Define.
12742         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12743         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12744         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12745         (m68k_breakpoint_at): New.  Add to the_low_target.
12746
12747         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12748         srv_linux_thread_db to yes.
12749
12750 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12751
12752         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12753         (ARCH_SET_FS): Likewise.
12754         (ARCH_GET_FS): Likewise.
12755         (ARCH_GET_GS): Likewise.
12756
12757 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12758
12759         * linux-i386-low.c (ps_get_thread_area): New.
12760         * linux-x86-64-low.c (ps_get_thread_area): New.
12761         * linux-low.c: Include <sys/syscall.h>.
12762         (linux_kill_one_process): Don't kill the first thread here.
12763         (linux_kill): Kill the first thread here.
12764         (kill_lwp): New function.
12765         (send_sigstop, linux_send_signal): Use it.
12766         * proc-service.c: Clean up #ifdefs.
12767         (fpregset_info): Delete.
12768         (ps_lgetregs): Update and enable implementation.
12769         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12770         implementations.
12771         * remote-utils.c (struct sym_cache, symbol_cache): New.
12772         (input_interrupt): Print a clearer message.
12773         (async_io_enabled): New variable.
12774         (enable_async_io, disable_async_io): Use it.  Update comments.
12775         (look_up_one_symbol): Use the symbol cache.
12776         * thread-db.c (thread_db_look_up_symbols): New function.
12777         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12778
12779 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12780
12781         * configure.in: Test for -rdynamic.
12782         * configure: Regenerated.
12783         * Makefile (INTERNAL_LDFLAGS): New.
12784         (gdbserver, gdbreplay): Use it.
12785
12786 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12787
12788         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12789
12790 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12791
12792         * linux-low.c (linux_wait): Clear all_processes list also.
12793
12794 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12795
12796         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12797         errno.
12798
12799 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12800
12801         * gdbreplay.c, server.h, utils.c: Update copyright years.
12802
12803 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12804
12805         * server.c (main): Print child status or termination signal from
12806         variable 'signal', not 'sig'.
12807
12808 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12809
12810         * linux-low.c (linux_read_memory): Change return type to
12811         int.  Check for and return error from ptrace().
12812         * target.c (read_inferior_memory): Change return type to int.  Pass
12813         back return status from the_target->read_memory().
12814         * target.h (struct target_ops): Adapt *read_memory() prototype.
12815         Update comment.
12816         (read_inferior_memory): Adapt prototype.
12817         * server.c (main): Return an error packet if
12818         read_inferior_memory() returns an error.
12819
12820 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12821
12822         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12823         Unify with other clean targets.
12824
12825 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12826
12827         * server.c (handle_v_cont): Call set_desired_inferior.
12828
12829 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12830
12831         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12832
12833 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12834
12835         * linux-low.c (linux_wait): Unblock async I/O.
12836         (linux_resume): Block and enable async I/O.
12837         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12838         * server.h (block_async_io, unblock_async_io): Add prototypes.
12839
12840 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12841
12842         * remote-utils.c (remote_open): Print a status notice after
12843         opening a TCP port.
12844         * server.c (attach_inferior): Print a status notice after
12845         attaching.
12846
12847 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12848
12849         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12850
12851 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12852
12853         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12854         error packet.
12855         * server.c, target.h: Update copyright years.
12856
12857 2004-02-25  Roland McGrath  <roland@redhat.com>
12858
12859         * target.h (struct target_ops): New member `read_auxv'.
12860         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12861         * linux-low.c (linux_read_auxv): New function.
12862         (linux_target_ops): Initialize `read_auxv' member to that.
12863
12864 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12865
12866         Committed by Jim Blandy  <jimb@redhat.com>.
12867
12868         * linux-s390-low.c (s390_num_regs): Update.
12869         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12870         instead of GPR_SIZE to distiguish s390 and s390x targets.
12871
12872 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12873
12874         * linux-low.c: Update copyright year.
12875         (check_removed_breakpoint): Clear pending_is_breakpoint.
12876         (linux_set_resume_request, linux_queue_one_thread)
12877         (resume_status_pending_p): New functions.
12878         (linux_continue_one_thread): Use process->resume.
12879         (linux_resume): Only resume threads if there are no pending events.
12880         * linux-low.h (struct process_info): Add resume request
12881         pointer.
12882
12883 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12884
12885         * regcache.c (new_register_cache): Clear the allocated register
12886         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12887
12888 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12889
12890         * linux-low.c (linux_resume): Take a struct thread_resume *
12891         argument.
12892         (linux_wait): Update call.
12893         (resume_ptr): New static variable.
12894         (linux_continue_one_thread): Renamed from
12895         linux_continue_one_process.  Use resume_ptr.
12896         (linux_resume): Use linux_continue_one_thread.
12897         * server.c (handle_v_cont, handle_v_requests): New functions.
12898         (myresume): New function.
12899         (main): Handle 'v' case.
12900         * target.h (struct thread_resume): New type.
12901         (struct target_ops): Change argument of "resume" to struct
12902         thread_resume *.
12903         (myresume): Delete macro.
12904
12905 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12906
12907         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12908         (uninstall): Support DESTDIR.
12909
12910 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12911
12912         * configure.srv: Add xscale*linux copy of arm*linux entry.
12913
12914 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12915
12916         * linux-arm-low.c (arm_reinsert_addr): New function.
12917         (the_low_target): Add arm_reinsert_addr.
12918
12919 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12920
12921         * mem-break.c: Remove whitespace at end of file.
12922
12923 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12924
12925         * configure.in: Check whether we need to prototype strerror.
12926         * server.h: Optionally prototype strerror.
12927         * gdbreplay.c (perror_with_name): Use strerror.
12928         * linux-low.c (linux_attach_lwp): Use strerror.
12929         * utils.c (perror_with_name): Use strerror.
12930         * config.in, configure: Regenerated.
12931
12932 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12933
12934         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12935         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12936
12937 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12938
12939         * Makefile.in (SFILES): Update.
12940         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12941         low-sun3.c: Remove files.
12942
12943 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12944
12945         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12946         (linux_detach_one_process, linux_detach): New functions.
12947         (linux_target_ops): Add linux_detach.
12948         * server.c (main): Handle 'D' packet.
12949         * target.h (struct target_ops): Add "detach" member.
12950         (detach_inferior): Define.
12951
12952 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12953
12954         From Kelley Cook  <kelleycook@wideopenwest.com>:
12955         * configure.srv: Accept i[34567]86 variants.
12956
12957 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12958
12959         * linux-low.c (linux_wait_for_event): Correct comment typos.
12960         (linux_resume_one_process): Call check_removed_breakpoint.
12961         (linux_send_signal): New function.
12962         (linux_target_ops): Add linux_send_signal.
12963         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12964         of kill.
12965         * target.h (struct target_ops): Add send_signal.
12966
12967 2003-05-29  Jim Blandy  <jimb@redhat.com>
12968
12969         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12970         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12971         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12972         away part of the register's value.
12973
12974 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12975
12976         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12977         (linux_wait_for_event, linux_init_signals): Likewise.
12978
12979 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12980
12981         * configure.in: Check for stdlib.h.
12982         * configure: Regenerated.
12983         * config.in: Regenerated.
12984
12985 2003-01-04  Andreas Schwab  <schwab@suse.de>
12986
12987         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12988
12989 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12990
12991         * Makefile.in: Remove obsolete code.
12992
12993 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12994
12995         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12996         defined(PT_FPR0_HI).
12997
12998 2002-11-17  Stuart Hughes  <seh@zee2.com>
12999
13000         * linux-arm-low.c (arm_num_regs): Increase.
13001         (arm_regmap): Include status register.
13002
13003 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
13004
13005         * linux-low.c (register_addr): Remove incorrect -1 check.
13006
13007 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
13008
13009         * linux-low.c (linux_create_inferior): Call setpgid.  Return
13010         the new PID.
13011         (unstopped_p, linux_signal_pid): Remove.
13012         (linux_target_ops): Remove linux_signal_pid.
13013         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
13014         global instead of target method.
13015         * target.h (struct target_ops): Remove signal_pid.  Update comment
13016         for create_inferior.
13017         * server.c (signal_pid): New variable.
13018         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
13019         gdbserver.  Set the child to be the foreground process group.
13020         (attach_inferior): Set signal_pid.
13021
13022 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
13023
13024         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
13025
13026 2002-08-20  Jim Blandy  <jimb@redhat.com>
13027
13028         * Makefile.in (LDFLAGS): Allow the configure script to establish a
13029         default for this.
13030
13031 2002-08-01  Andrew Cagney  <cagney@redhat.com>
13032
13033         * Makefile.in: Make chill references obsolete.
13034
13035 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
13036
13037         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
13038         * configure: Regenerate.
13039         * config.in: Regenerate.
13040
13041 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
13042
13043         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
13044         (perror_with_name, remote_close, remote_open, expect, play): Static.
13045
13046 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
13047
13048         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
13049         byte offsets instead of an array of indexes.
13050         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
13051
13052 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
13053
13054         * regcache.c: Add comment.
13055
13056 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
13057
13058         * thread-db.c: New file.
13059         * proc-service.c: New file.
13060         * acinclude.m4: New file.
13061         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
13062         proc-service.o, and thread-db.o.
13063         (linux-low.o): Add USE_THREAD_DB.
13064         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
13065         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
13066         * aclocal.m4: Regenerated.
13067         * config.in: Regenerated.
13068         * configure: Regenerated.
13069         * configure.in: Check for proc_service.h, sys/procfs.h,
13070         thread_db.h, and linux/elf.h headrs.
13071         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
13072         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
13073         Check for -lthread_db and thread support.
13074         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
13075         PowerPC, and SuperH.
13076         * i387-fp.c: Constify arguments.
13077         * i387-fp.h: Likewise.
13078         * inferiors.c: (struct thread_info): Renamed from
13079         `struct inferior_info'.  Remove PID member.  Use generic inferior
13080         list header.  All uses updated.
13081         (inferiors, signal_pid): Removed.
13082         (all_threads): New variable.
13083         (get_thread): Define.
13084         (add_inferior_to_list): New function.
13085         (for_each_inferior): New function.
13086         (change_inferior_id): New function.
13087         (add_inferior): Removed.
13088         (remove_inferior): New function.
13089         (add_thread): New function.
13090         (free_one_thread): New function.
13091         (remove_thread): New function.
13092         (clear_inferiors): Use for_each_inferior and free_one_thread.
13093         (find_inferior): New function.
13094         (find_inferior_id): New function.
13095         (inferior_target_data): Update argument type.
13096         (set_inferior_target_data): Likewise.
13097         (inferior_regcache_data): Likewise.
13098         (set_inferior_regcache_data): Likewise.
13099         * linux-low.c (linux_bp_reinsert): Remove.
13100         (all_processes, stopping_threads, using_thrads)
13101         (struct pending_signals, debug_threads, pid_of): New.
13102         (inferior_pid): Replace with macro.
13103         (struct inferior_linux_data): Remove.
13104         (get_stop_pc, add_process): New functions.
13105         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
13106         Use add_process and add_thread.
13107         (linux_attach_lwp): New function, based on old linux_attach.  Use
13108         add_process and add_thread.  Set stop_expected for new threads.
13109         (linux_attach): New function.
13110         (linux_kill_one_process): New function.
13111         (linux_kill): Kill all LWPs.
13112         (linux_thread_alive): Use find_inferior_id.
13113         (check_removed_breakpoints, status_pending_p): New functions.
13114         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
13115         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
13116         struct for the found process.
13117         (linux_wait_for_event): New function.
13118         (linux_wait): Use it.  Support LWPs.
13119         (send_sigstop, wait_for_sigstop, stop_all_processes)
13120         (linux_resume_one_process, linux_continue_one_process): New functions.
13121         (linux_resume): Support LWPs.
13122         (REGISTER_RAW_SIZE): Remove.
13123         (fetch_register): Use register_size instead.  Call supply_register.
13124         (usr_store_inferior_registers): Likewise.  Call collect_register.
13125         Fix recursive case.
13126         (regsets_fetch_inferior_registers): Improve error message.
13127         (regsets_store_inferior_registers): Add debugging.
13128         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
13129         (unstopped_p, linux_signal_pid): New functions.
13130         (linux_target_ops): Add linux_signal_pid.
13131         (linux_init_signals): New function.
13132         (initialize_low): Call it.  Initialize using_threads.
13133         * regcache.c (inferior_regcache_data): Add valid
13134         flag.
13135         (get_regcache): Fetch registers lazily.  Add fetch argument
13136         and update all callers.
13137         (regcache_invalidate_one, regcache_invalidate): New
13138         functions.
13139         (new_register_cache): Renamed from create_register_cache.
13140         Return the new regcache.
13141         (free_register_cache): Change argument to a void *.
13142         (registers_to_string, registers_from_string): Call get_regcache
13143         with fetch flag set.
13144         (register_data): Make static.  Pass fetch flag to get_regcache.
13145         (supply_register): Call get_regcache with fetch flag clear.
13146         (collect_register): Call get_regcache with fetch flag set.
13147         (collect_register_as_string): New function.
13148         * regcache.h: Update.
13149         * remote-utils.c (putpkt): Flush after debug output and use
13150         stderr.
13151         Handle input interrupts while waiting for an ACK.
13152         (input_interrupt): Use signal_pid method.
13153         (getpkt): Flush after debug output and use stderr.
13154         (outreg): Use collect_register_as_string.
13155         (new_thread_notify, dead_thread_notify): New functions.
13156         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
13157         and general_thread.
13158         (look_up_one_symbol): Flush after debug output.
13159         * server.c (step_thread, server_waiting): New variables.
13160         (start_inferior): Don't use signal_pid.  Update call to mywait.
13161         (attach_inferior): Update call to mywait.
13162         (handle_query): Handle qfThreadInfo and qsThreadInfo.
13163         (main): Don't fetch/store registers explicitly.  Use
13164         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
13165         calls to mywait.
13166         * server.h: Update.
13167         (struct inferior_list, struct_inferior_list_entry): New.
13168         * target.c (set_desired_inferior): New.
13169         (write_inferior_memory): Constify.
13170         (mywait): New function.
13171         * target.h: Update.
13172         (struct target_ops): New signal_pid method.
13173         (mywait): Removed macro, added prototype.
13174
13175         * linux-low.h (regset_func): Removed.
13176         (regset_fill_func, regset_store_func): New.
13177         (enum regset_type): New.
13178         (struct regset_info): Add type field.  Use new operation types.
13179         (struct linux_target_ops): stop_pc renamed to get_pc.
13180         Add decr_pc_after_break and breakpoint_at.
13181         (get_process, get_thread_proess, get_process_thread)
13182         (strut process_info, all_processes, linux_attach_lwp)
13183         (thread_db_init): New.
13184
13185         * linux-arm-low.c (arm_get_pc, arm_set_pc,
13186         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
13187         (the_low_target): Add new members.
13188         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
13189         (i386_store_fpxregset): Constify.
13190         (target_regsets): Add new kind identifier.
13191         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
13192         (i386_set_pc): Add debugging.
13193         (i386_breakpoint_at): New function.
13194         (the_low_target): Add new members.
13195         * linux-mips-low.c (mips_get_pc, mips_set_pc)
13196         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
13197         (mips_breakpoint_at): New.
13198         (the_low_target): Add new members.
13199         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
13200         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
13201         (the_low_target): Add new members.
13202         * linux-sh-low.c (sh_get_pc, sh_set_pc)
13203         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
13204         (the_low_target): Add new members.
13205         * linux-x86-64-low.c (target_regsets): Add new kind
13206         identifier.
13207
13208 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
13209
13210         From Martin Pool <mbp@samba.org>:
13211         * server.c (gdbserver_usage): New function.
13212         (main): Call it.
13213
13214 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
13215
13216         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
13217         stop_at -> stop_pc.
13218
13219 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
13220
13221         * Makefile.in: Remove obsolete code.
13222
13223 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
13224
13225         * linux-low.c (regsets_fetch_inferior_registers),
13226         (regsets_store_inferior_registers): Removed cast to int from
13227         ptrace() calls.
13228         * regcache.h: Added declaration of struct inferior_info.
13229
13230 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
13231
13232         * inferiors.c (struct inferior_info): Add regcache_data.
13233         (add_inferior): Call create_register_cache.
13234         (clear_inferiors): Call free_register_cache.
13235         (inferior_regcache_data, set_inferior_regcache_data): New functions.
13236         * regcache.c (struct inferior_regcache_data): New.
13237         (registers): Remove.
13238         (get_regcache): New function.
13239         (create_register_cache, free_register_cache): New functions.
13240         (set_register_cache): Don't initialize the register cache here.
13241         (registers_to_string, registers_from_string, register_data): Call
13242         get_regcache.
13243         * regcache.h: Add prototypes.
13244         * server.h: Likewise.
13245
13246 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
13247
13248         * mem-break.c: New file.
13249         * mem-break.h: New file.
13250         * Makefile.in: Add mem-break.o rule; update server.h
13251         dependencies.
13252         * inferiors.c (struct inferior_info): Add target_data
13253         member.
13254         (clear_inferiors): Free target_data member if set.
13255         (inferior_target_data, set_inferior_target_data): New functions.
13256         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
13257         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
13258         * linux-low.c (linux_bp_reinsert): New variable.
13259         (struct inferior_linux_data): New.
13260         (linux_create_inferior): Use set_inferior_target_data.
13261         (linux_attach): Likewise.  Call add_inferior.
13262         (linux_wait_for_one_inferior): New function.
13263         (linux_wait): Call it.
13264         (linux_write_memory): Add const.
13265         (initialize_low): Call set_breakpoint_data.
13266         * linux-low.h (struct linux_target_ops): Add breakpoint
13267         handling members.
13268         * server.c (attach_inferior): Remove extra add_inferior
13269         call.
13270         * server.h: Include mem-break.h.  Update inferior.c
13271         prototypes.
13272         * target.c (read_inferior_memory)
13273         (write_inferior_memory): New functions.
13274         * target.h (read_inferior_memory)
13275         (write_inferior_memory): Change macros to prototypes.
13276         (struct target_ops): Update comments.  Add const to write_memory
13277         definition.
13278
13279 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
13280
13281         * linux-low.c (usr_store_inferior_registers): Support
13282         registers which are allowed to fail to store.
13283         * linux-low.h (linux_target_ops): Likewise.
13284         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
13285         (ppc_cannot_store_register): FPSCR may not be storable.
13286
13287 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13288
13289         * server.h: Include <string.h> if HAVE_STRING_H.
13290         * ChangeLog: Correct paths in last ChangeLog entry.
13291
13292 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13293
13294         * linux-low.h: Remove obsolete prototypes.
13295         (struct linux_target_ops): New.
13296         (extern the_low_target): New.
13297         * linux-low.c (num_regs, regmap): Remove declarations.
13298         (register_addr): Use the_low_target explicitly.
13299         (fetch_register): Likewise.
13300         (usr_fetch_inferior_registers): Likewise.
13301         (usr_store_inferior_registers): Likewise.
13302         * linux-arm-low.c (num_regs): Remove.
13303         (arm_num_regs): Define.
13304         (arm_regmap): Renamed from regmap, made static.
13305         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
13306         made static.
13307         (arm_cannot_store_register): Renamed from cannot_store_register,
13308         made static.
13309         (the_low_target): New.
13310         * linux-i386-low.c (num_regs): Remove.
13311         (i386_num_regs): Define.
13312         (i386_regmap): Renamed from regmap, made static.
13313         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
13314         made static.
13315         (i386_cannot_store_register): Renamed from cannot_store_register,
13316         made static.
13317         (the_low_target): New.
13318         * linux-ia64-low.c (num_regs): Remove.
13319         (ia64_num_regs): Define.
13320         (ia64_regmap): Renamed from regmap, made static.
13321         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
13322         made static.
13323         (ia64_cannot_store_register): Renamed from cannot_store_register,
13324         made static.
13325         (the_low_target): New.
13326         * linux-m68k-low.c (num_regs): Remove.
13327         (m68k_num_regs): Define.
13328         (m68k_regmap): Renamed from regmap, made static.
13329         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
13330         made static.
13331         (m68k_cannot_store_register): Renamed from cannot_store_register,
13332         made static.
13333         (the_low_target): New.
13334         * linux-mips-low.c (num_regs): Remove.
13335         (mips_num_regs): Define.
13336         (mips_regmap): Renamed from regmap, made static.
13337         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
13338         made static.
13339         (mips_cannot_store_register): Renamed from cannot_store_register,
13340         made static.
13341         (the_low_target): New.
13342         * linux-ppc-low.c (num_regs): Remove.
13343         (ppc_num_regs): Define.
13344         (ppc_regmap): Renamed from regmap, made static.
13345         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
13346         made static.
13347         (ppc_cannot_store_register): Renamed from cannot_store_register,
13348         made static.
13349         (the_low_target): New.
13350         * linux-s390-low.c (num_regs): Remove.
13351         (s390_num_regs): Define.
13352         (s390_regmap): Renamed from regmap, made static.
13353         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
13354         made static.
13355         (s390_cannot_store_register): Renamed from cannot_store_register,
13356         made static.
13357         (the_low_target): New.
13358         * linux-sh-low.c (num_regs): Remove.
13359         (sh_num_regs): Define.
13360         (sh_regmap): Renamed from regmap, made static.
13361         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
13362         made static.
13363         (sh_cannot_store_register): Renamed from cannot_store_register,
13364         made static.
13365         (the_low_target): New.
13366         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
13367         (the_low_target): New.
13368
13369 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13370
13371         * Makefile.in: Add stamp-h target.
13372         * configure.in: Create stamp-h.
13373         * configure: Regenerated.
13374
13375 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13376
13377         * inferiors.c: New file.
13378         * target.c: New file.
13379         * target.h: New file.
13380         * Makefile.in:  Add target.o and inferiors.o.  Update
13381         dependencies.
13382         * linux-low.c (inferior_pid): New static variable,
13383         moved from server.c.
13384         (linux_create_inferior): Renamed from create_inferior.
13385         Call add_inferior.  Return 0 on success instead of a PID.
13386         (linux_attach): Renamed from myattach.
13387         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
13388         (linux_thread_alive): Renamed from mythread_alive.
13389         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
13390         child dies.
13391         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
13392         (regsets_store_inferior_registers): Correct error message.
13393         Add missing ``return 0''.
13394         (linux_fetch_registers): Renamed from fetch_inferior_registers.
13395         (linux_store_registers): Renamed from store_inferior_registers.
13396         (linux_read_memory): Renamed from read_inferior_memory.
13397         (linux_write_memory): Renamed from write_inferior_memory.
13398         (linux_target_ops): New structure.
13399         (initialize_low): Call set_target_ops ().
13400         * remote-utils.c (unhexify): New function.
13401         (hexify): New function.
13402         (input_interrupt): Send signals to ``signal_pid''.
13403         * server.c (inferior_pid): Remove.
13404         (start_inferior): Update create_inferior call.
13405         (attach_inferior): Call add_inferior.
13406         (handle_query): New function.
13407         (main): Call handle_query for `q' packets.
13408         * server.h: Include "target.h".  Remove obsolete prototypes.
13409         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
13410
13411 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13412
13413         * Makefile.in: Add WARN_CFLAGS.  Update configury
13414         dependencies.
13415         * configure.in: Check for <string.h>
13416         * configure: Regenerate.
13417         * config.in: Regenerate.
13418         * gdbreplay.c: Include needed system headers.
13419         (remote_open): Remove strchr prototype.
13420         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
13421         * regcache.c (supply_register): Change buf argument to const void *.
13422         (supply_register_by_name): Likewise.
13423         (collect_register): Change buf argument to void *.
13424         (collect_register_by_name): Likewise.
13425         * regcache.h: Add missing prototypes.
13426         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
13427         * server.c (handle_query): New function.
13428         (attached): New static variable, moved out of main.
13429         (main): Quiet longjmp clobber warnings.
13430         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
13431         * utils.c (error): Remove NORETURN.
13432         (fatal): Likewise.