gdbserver/s390: Add support for compiled agent expressions.
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2016-03-29  Marcin Kościelnicki  <koriakin@0x04.net>
2
3         PR 18377
4         * linux-s390-low.c (add_insns): New function.
5         (s390_emit_prologue): New function.
6         (s390_emit_epilogue): New function.
7         (s390_emit_add): New function.
8         (s390_emit_sub): New function.
9         (s390_emit_mul): New function.
10         (s390_emit_lsh): New function.
11         (s390_emit_rsh_signed): New function.
12         (s390_emit_rsh_unsigned): New function.
13         (s390_emit_ext): New function.
14         (s390_emit_log_not): New function.
15         (s390_emit_bit_and): New function.
16         (s390_emit_bit_or): New function.
17         (s390_emit_bit_xor): New function.
18         (s390_emit_bit_not): New function.
19         (s390_emit_equal): New function.
20         (s390_emit_less_signed): New function.
21         (s390_emit_less_unsigned): New function.
22         (s390_emit_ref): New function.
23         (s390_emit_if_goto): New function.
24         (s390_emit_goto): New function.
25         (s390_write_goto_address): New function.
26         (s390_emit_litpool): New function.
27         (s390_emit_const): New function.
28         (s390_emit_call): New function.
29         (s390_emit_reg): New function.
30         (s390_emit_pop): New function.
31         (s390_emit_stack_flush): New function.
32         (s390_emit_zero_ext): New function.
33         (s390_emit_swap): New function.
34         (s390_emit_stack_adjust): New function.
35         (s390_emit_set_r2): New function.
36         (s390_emit_int_call_1): New function.
37         (s390_emit_void_call_2): New function.
38         (s390_emit_eq_goto): New function.
39         (s390_emit_ne_goto): New function.
40         (s390_emit_lt_goto): New function.
41         (s390_emit_le_goto): New function.
42         (s390_emit_gt_goto): New function.
43         (s390_emit_ge_goto): New function.
44         (s390x_emit_prologue): New function.
45         (s390x_emit_epilogue): New function.
46         (s390x_emit_add): New function.
47         (s390x_emit_sub): New function.
48         (s390x_emit_mul): New function.
49         (s390x_emit_lsh): New function.
50         (s390x_emit_rsh_signed): New function.
51         (s390x_emit_rsh_unsigned): New function.
52         (s390x_emit_ext): New function.
53         (s390x_emit_log_not): New function.
54         (s390x_emit_bit_and): New function.
55         (s390x_emit_bit_or): New function.
56         (s390x_emit_bit_xor): New function.
57         (s390x_emit_bit_not): New function.
58         (s390x_emit_equal): New function.
59         (s390x_emit_less_signed): New function.
60         (s390x_emit_less_unsigned): New function.
61         (s390x_emit_ref): New function.
62         (s390x_emit_if_goto): New function.
63         (s390x_emit_const): New function.
64         (s390x_emit_call): New function.
65         (s390x_emit_reg): New function.
66         (s390x_emit_pop): New function.
67         (s390x_emit_stack_flush): New function.
68         (s390x_emit_zero_ext): New function.
69         (s390x_emit_swap): New function.
70         (s390x_emit_stack_adjust): New function.
71         (s390x_emit_int_call_1): New function.
72         (s390x_emit_void_call_2): New function.
73         (s390x_emit_eq_goto): New function.
74         (s390x_emit_ne_goto): New function.
75         (s390x_emit_lt_goto): New function.
76         (s390x_emit_le_goto): New function.
77         (s390x_emit_gt_goto): New function.
78         (s390x_emit_ge_goto): New function.
79         (s390_emit_ops): New function.
80         (struct linux_target_ops): Fill in emit_ops hook.
81
82 2016-03-29  Marcin Kościelnicki  <koriakin@0x04.net>
83
84         PR 18377
85         * Makefile.in: Add s390 IPA files.
86         * configure.srv: Build IPA for s390.
87         * linux-s390-ipa.c: New file.
88         * linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h.
89         (init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h.
90         (tdesc_s390_linux32): Likewise.
91         (init_registers_s390_linux32v1): Likewise.
92         (tdesc_s390_linux32v1): Likewise.
93         (init_registers_s390_linux32v2): Likewise.
94         (tdesc_s390_linux32v2): Likewise.
95         (init_registers_s390_linux64): Likewise.
96         (tdesc_s390_linux64): Likewise.
97         (init_registers_s390_linux64v1): Likewise.
98         (tdesc_s390_linux64v1): Likewise.
99         (init_registers_s390_linux64v2): Likewise.
100         (tdesc_s390_linux64v2): Likewise.
101         (init_registers_s390_te_linux64): Likewise.
102         (tdesc_s390_te_linux64): Likewise.
103         (init_registers_s390_vx_linux64): Likewise.
104         (tdesc_s390_vx_linux64): Likewise.
105         (init_registers_s390_tevx_linux64): Likewise.
106         (tdesc_s390_tevx_linux64): Likewise.
107         (init_registers_s390x_linux64): Likewise.
108         (tdesc_s390x_linux64): Likewise.
109         (init_registers_s390x_linux64v1): Likewise.
110         (tdesc_s390x_linux64v1): Likewise.
111         (init_registers_s390x_linux64v2): Likewise.
112         (tdesc_s390x_linux64v2): Likewise.
113         (init_registers_s390x_te_linux64): Likewise.
114         (tdesc_s390x_te_linux64): Likewise.
115         (init_registers_s390x_vx_linux64): Likewise.
116         (tdesc_s390x_vx_linux64): Likewise.
117         (init_registers_s390x_tevx_linux64): Likewise.
118         (tdesc_s390x_tevx_linux64): Likewise.
119         (have_hwcap_s390_vx): New static variable.
120         (s390_arch_setup): Fill have_hwcap_s390_vx.
121         (s390_get_thread_area): New function.
122         (s390_ft_entry_gpr_esa): New const.
123         (s390_ft_entry_gpr_zarch): New const.
124         (s390_ft_entry_misc): New const.
125         (s390_ft_entry_fr): New const.
126         (s390_ft_entry_vr): New const.
127         (s390_ft_main_31): New const.
128         (s390_ft_main_64): New const.
129         (s390_ft_exit_fr): New const.
130         (s390_ft_exit_vr): New const.
131         (s390_ft_exit_misc): New const.
132         (s390_ft_exit_gpr_esa): New const.
133         (s390_ft_exit_gpr_zarch): New const.
134         (append_insns): New function.
135         (s390_relocate_instruction): New function.
136         (s390_install_fast_tracepoint_jump_pad): New function.
137         (s390_get_min_fast_tracepoint_insn_len): New function.
138         (s390_get_ipa_tdesc_idx): New function.
139         (struct linux_target_ops): Wire in the above functions.
140         (initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs.
141         * linux-s390-tdesc.h: New file.
142
143 2016-03-29  Marcin Kościelnicki  <koriakin@0x04.net>
144
145         * linux-s390-low.c (s390_supports_tracepoints): New function.
146         (struct linux_target_ops): Fill supports_tracepoints hook.
147
148 2016-03-18  Yao Qi  <yao.qi@linaro.org>
149
150         * linux-low.c (lwp_signal_can_be_delivered): New function.
151         (linux_resume_one_lwp_throw): Use lwp_signal_can_be_delivered.
152
153 2016-03-18  Yao Qi  <yao.qi@linaro.org>
154
155         * linux-low.c (linux_resume_one_lwp_throw): Set 'signal' to
156         0 if signal is enqueued.  Remove 'signal' from one debugging
157         message.  Move one debugging message to some lines below.
158         Remove code setting 'signal' to 0.
159
160 2016-03-18  Yao Qi  <yao.qi@linaro.org>
161
162         * linux-low.c (linux_low_filter_event): Remove redundant
163         WIFSTOPPED check together with linux_wstatus_maybe_breakpoint.
164
165 2016-03-09  Marcin Kościelnicki  <koriakin@0x04.net>
166
167         * linux-ppc-low.c (ppc_supports_tracepoints): New function.
168         (struct linux_target_ops): Wire in the above.
169
170 2016-03-03  Yao Qi  <yao.qi@linaro.org>
171
172         * linux-low.c: Update comments to start_step_over.
173
174 2016-03-03  Yao Qi  <yao.qi@linaro.org>
175
176         PR server/19736
177         * linux-low.c (handle_extended_wait): Set child suspended
178         if event_lwp->bp_reinsert isn't zero.
179
180 2016-03-02  Yao Qi  <yao.qi@linaro.org>
181
182         * linux-low.c (linux_resume_one_lwp_throw): Replace code with
183         enqueue_pending_signal.
184
185 2016-03-02  Marcin Kościelnicki  <koriakin@0x04.net>
186
187         * tracepoint.c (cmd_qtstart): Only set ipa_tdesc_idx if agent
188         is actually loaded.
189
190 2016-02-25  Marcin Kościelnicki  <koriakin@0x04.net>
191
192         * linux-s390-low.c (s390_num_regs_3264): Define on 31-bit too.
193         (s390_regmap_3264) [!__s390x__]: New global.
194         (s390_collect_ptrace_register): Skip map entries containing -1.
195         (s390_supply_ptrace_register): Ditto.
196         (s390_fill_gprs_high): New function.
197         (s390_store_gprs_high): New function.
198         (s390_regsets): Add NT_S390_HIGH_GPRS.
199         (s390_get_hwcap): Enable on 31-bit.
200         (have_hwcap_s390_high_gprs): Enable on 31-bit.
201         (s390_arch_setup): Enable detection of high GPRs, TDB, VX on 31-bit.
202         Detect NT_S390_HIGH_GPRS.
203         (s390_usrregs_info_3264): Enable on 31-bit.
204         (s390_regs_info): Enable regs_info_3264 on 31-bit.
205         (initialize_low_arch): Initialize s390_regsets_info_3264 on 31-bit.
206
207 2016-02-25  Marcin Kościelnicki  <koriakin@0x04.net>
208
209         PR gdb/13808
210         * Makefile.in: Add i386-*-linux-ipa.o and amd64-*-linux-ipa.o.
211         * configure.srv: Ditto.
212         * linux-aarch64-ipa.c (get_ipa_tdesc): New function.
213         (initialize_low_tracepoint): Remove ipa_tdesc assignment.
214         * linux-amd64-ipa.c: Add "linux-x86-tdesc.h" include.
215         (init_registers_amd64_linux): Remove prototype.
216         (tdesc_amd64_linux): Remove declaration.
217         (get_ipa_tdesc): New function.
218         (initialize_low_tracepoint): Remove ipa_tdesc assignment,
219         initialize remaining tdescs.
220         * linux-i386-ipa.c: Add "linux-x86-tdesc.h" include.
221         (init_registers_i386_linux): Remove prototype.
222         (tdesc_i386_linux): Remove declaration.
223         (get_ipa_tdesc): New function.
224         (initialize_low_tracepoint): Remove ipa_tdesc assignment,
225         initialize remaining tdescs.
226         * linux-low.c (linux_get_ipa_tdesc_idx): New function.
227         (linux_target_ops): wire in linux_get_ipa_tdesc_idx.
228         * linux-low.h (struct linux_target_ops): Add get_ipa_tdesc_idx.
229         * linux-x86-low.c: Move tdesc declarations to linux-x86-tdesc.h.
230         (x86_get_ipa_tdesc_idx): New function.
231         (the_low_target): Wire in x86_get_ipa_tdesc_idx.
232         * linux-x86-tdesc.h: New file.
233         * target.h (struct target_ops): Add get_ipa_tdesc_idx.
234         (target_get_ipa_tdesc_idx): New macro.
235         * tracepoint.c (ipa_tdesc_idx): New macro.
236         (struct ipa_sym_addresses): Add addr_ipa_tdesc_idx.
237         (symbol_list): Add ipa_tdesc_idx.
238         (cmd_qtstart): Write ipa_tdesc_idx in the target.
239         (ipa_tdesc): Remove.
240         (ipa_tdesc_idx): New variable.
241         (get_context_regcache): Use get_ipa_tdesc.
242         (gdb_collect): Ditto.
243         (gdb_probe): Ditto.
244         * tracepoint.h (get_ipa_tdesc): New prototype.
245         (ipa_tdesc): Remove.
246
247 2016-02-24  Pedro Alves  <palves@redhat.com>
248
249         * linux-low.c (check_stopped_by_breakpoint): Rename to ...
250         (save_stop_reason): ... this.  Use GDB_ARCH_IS_TRAP_HWBKPT and
251         handle ambiguous GDB_ARCH_IS_TRAP_BRKPT / GDB_ARCH_IS_TRAP_HWBKPT.
252         Factor out common code between the USE_SIGTRAP_SIGINFO and
253         !USE_SIGTRAP_SIGINFO blocks.
254         (linux_low_filter_event): Call save_stop_reason instead of
255         check_stopped_by_breakpoint and check_stopped_by_watchpoint.
256         Update comments.
257         (linux_wait_1): Update comments.
258
259 2016-02-24  Wei-cheng Wang  <cole945@gmail.com>
260
261         * linux-ppc-low.c (ppc_supports_z_point_type): New function:
262         (ppc_insert_point, ppc_remove_point): Insert/remove z-packet breakpoints.
263         (ppc64_emit_ops_vector): Add target ops - ppc_supports_z_point_type,
264         ppc_insert_point, ppc_remove_point.
265
266 2016-02-17  Marcin Kościelnicki  <koriakin@0x04.net>
267
268         * linux-s390-low.c (s390_supports_z_point_type): New function.
269         (struct linux_target_ops): Wire s390_supports_z_point_type in.
270
271 2016-02-16  Yao Qi  <yao.qi@linaro.org>
272
273         * linux-arm-low.c (get_next_pcs_syscall_next_pc): Remove argument
274         PC.  Get pc from regcache_read_pc.
275
276 2016-02-12  Yao Qi  <yao.qi@linaro.org>
277
278         * linux-aarch64-low.c (aarch64_get_pc): Call linux_get_pc_64bit
279         or linux_get_pc_32bit.
280         (aarch64_set_pc): Call linux_set_pc_64bit or linux_set_pc_32bit.
281
282 2016-02-12  Yao Qi  <yao.qi@linaro.org>
283
284         * linux-arm-low.c (get_next_pcs_ops): Initialize it with
285         arm_linux_get_next_pcs_fixup.
286
287 2016-02-12  Marcin Kościelnicki  <koriakin@0x04.net>
288
289         * tracepoint.c (x_tracepoint_action_download): Change
290         write_inferior_data_ptr to write_inferior_data_pointer.
291         (cmd_qtstart): Likewise.
292         (write_inferior_data_ptr): Remove.
293         (download_agent_expr): Change write_inferior_data_ptr to
294         write_inferior_data_pointer.
295         (download_tracepoint_1): Likewise.
296         (download_tracepoint): Likewise.
297         (download_trace_state_variables): Likewise.
298
299 2016-02-11  Wei-cheng Wang  <cole945@gmail.com>
300             Marcin Kościelnicki  <koriakin@0x04.net>
301
302         * tracepoint.c (struct tracepoint_action_ops): Remove.
303         (struct tracepoint_action): Remove ops.
304         (m_tracepoint_action_download, r_tracepoint_action_download)
305         (x_tracepoint_action_download, l_tracepoint_action_download): Adjust
306         size and offset accordingly.
307         (m_tracepoint_action_ops, r_tracepoint_action_ops)
308         (x_tracepoint_action_ops, l_tracepoint_action_ops): Remove.
309         (tracepoint_action_send, tracepoint_action_download): New functions.
310         Helpers for trace action handlers.
311         (add_tracepoint_action): Remove setup actions ops.
312         (download_tracepoint_1, tracepoint_send_agent): Call helper functions.
313
314 2016-02-10  Yao Qi  <yao.qi@linaro.org>
315
316         * regcache.c (regcache_raw_read_unsigned): Clear *VAL.
317
318 2016-02-09  Simon Marchi  <simon.marchi@ericsson.com>
319
320         * configure.ac: Use AC_CONFIG_FILES instead of passing arguments
321         to AC_OUTPUT.
322         * configure: Regenerate.
323
324 2016-02-09  Simon Marchi  <simon.marchi@ericsson.com>
325
326         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change
327         void * to gdb_byte *.
328         * linux-low.c (siginfo_fixup): Likewise.
329         (linux_xfer_siginfo): Likewise.
330         * linux-low.h (struct linux_target_ops) <siginfo_fixup>:
331         Likewise.
332         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
333
334 2016-02-02  Walfred Tedeschi  <walfred.tedeschi@intel.com>
335
336         * configure.srv (x86_64-*-linux*): Add amd64-linux-siginfo.o
337         to srv_tgtobj.
338         (i[34567]86-*-linux*): Add amd64-linux-siginfo.o
339         to srv_tgtobj.
340         * linux-x86-low.c [__x86_64__]: Include
341         "nat/amd64-linux-siginfo.h".
342         (compat_siginfo_from_siginfo, siginfo_from_compat_siginfo)
343         (compat_x32_siginfo_from_siginfo, siginfo_from_compat_x32_siginfo)
344         (compat_timeval, compat_sigval, compat_x32_clock, cpt_si_pid)
345         (cpt_si_uid, cpt_si_timerid, cpt_si_overrun, cpt_si_status)
346         (cpt_si_utime, cpt_si_stime, cpt_si_ptr, cpt_si_addr, cpt_si_band)
347         (cpt_si_fd, si_timerid, si_overrun): Move from
348         nat/amd64-linux-siginfo.c.
349         * Makefile.in (amd64-linux-siginfo.o:): New rule.
350
351 2016-01-28  Simon Marchi  <simon.marchi@ericsson.com>
352
353         * server.c (skip_to_semicolon):  Remove.
354         (process_point_options): Use strchrnul instead of
355         skip_to_semicolon.
356
357 2016-01-26  Yao Qi  <yao.qi@linaro.org>
358
359         * linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc.
360         * linux-low.c (install_software_single_step_breakpoints): Don't
361         call regcache_read_pc.
362         * linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove
363         argument pc.
364
365 2016-01-26  Yao Qi  <yao.qi@linaro.org>
366
367         * linux-low.c (install_software_single_step_breakpoints): Call
368         regcache_read_pc instead of get_pc.
369
370 2016-01-26  Yao Qi  <yao.qi@linaro.org>
371
372         * remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO.
373         (unblock_async_io): Rename to ...
374         (block_unblock_async_io): ... it.  New function.
375         (enable_async_io): Don't install SIGIO handler.  Unblock it
376         instead.
377         (disable_async_io): Don't ignore SIGIO.  Block it instead.
378         (initialize_async_io): Install SIGIO handler.  Don't call
379         unblock_async_io.
380
381 2016-01-26  Yao Qi  <yao.qi@linaro.org>
382
383         * remote-utils.c (getpkt): If the buffer isn't empty, and the
384         first character is '\003', call *the_target->request_interrupt.
385
386 2016-01-25  Yao Qi  <yao.qi@linaro.org>
387
388         * remote-utils.c (new_thread_notify): Remove.
389         (dead_thread_notify): Likewise.
390         * remote-utils.h (new_thread_notify): Remove declaration.
391         (dead_thread_notify): Likewise.
392
393 2016-01-23  Marcin Kościelnicki  <koriakin@0x04.net>
394
395         * gdb.trace/pending.exp: Fix expected message on continue.
396
397 2016-01-22  Marcin Kościelnicki  <koriakin@0x04.net>
398
399         * tracepoint.c (write_inferior_data_ptr): Cast to uintptr_t, so that
400         it works properly on big-endian machines where sizeof (CORE_ADDR)
401         != sizeof (void *).
402
403 2016-01-21  Pedro Alves  <palves@redhat.com>
404
405         * Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
406         (INTERNAL_CFLAGS_BASE): Use COMPILER_CFLAGS instead of CFLAGS.
407         * configure: Regenerate.
408
409 2016-01-21  Yao Qi  <yao.qi@linaro.org>
410
411         * linux-arm-low.c (arm_sigreturn_next_pc): Add parameter
412         is_thumb and set it according to CPSR saved on the stack.
413         (get_next_pcs_syscall_next_pc): Pass is_thumb to
414         arm_sigreturn_next_pc.
415
416 2016-01-18  Yao Qi  <yao.qi@linaro.org>
417
418         * linux-low.c (linux_set_pc_64bit): New function.
419         (linux_get_pc_64bit): New function.
420         * linux-low.h (linux_set_pc_64bit, linux_get_pc_64bit):
421         Declare.
422         * linux-sparc-low.c (debug_threads): Remove declaration.
423         (sparc_get_pc): Remove.
424         (the_low_target): Use linux_get_pc_64bit instead of
425         sparc_get_pc.
426         * linux-tile-low.c (tile_get_pc, tile_set_pc): Remove.
427         (the_low_target): Use linux_get_pc_64bit and
428         linux_set_pc_64bit.
429
430 2016-01-18  Yao Qi  <yao.qi@linaro.org>
431
432         * linux-arm-low.c (debug_threads): Remove declaration.
433         (arm_get_pc, arm_set_pc): Remove.
434         (the_low_target): Use linux_get_pc_32bit and
435         linux_set_pc_32bit.
436         * linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove.
437         (the_low_target): Use linux_get_pc_32bit and
438         linux_set_pc_32bit.
439         * linux-cris-low.c (debug_threads): Remove declaration.
440         (cris_get_pc, cris_set_pc,): Remove.
441         (the_low_target): Use linux_get_pc_32bit and
442         linux_set_pc_32bit.
443         * linux-crisv32-low.c (debug_threads): Remove declaration.
444         (cris_get_pc, cris_set_pc): Remove.
445         (the_low_target): Use linux_get_pc_32bit and
446         linux_set_pc_32bit.
447         * linux-low.c: Include inttypes.h.
448         (linux_get_pc_32bit, linux_set_pc_32bit): New functions.
449         * linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare.
450         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove.
451         (the_low_target): Use linux_get_pc_32bit and
452         linux_set_pc_32bit.
453         * linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove.
454         (the_low_target): Use linux_get_pc_32bit and
455         linux_set_pc_32bit.
456         * linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove.
457         (the_low_target): Use linux_get_pc_32bit and
458         linux_set_pc_32bit.
459         * linux-sh-low.c (sh_get_pc, sh_set_pc): Remove.
460         (the_low_target): Use linux_get_pc_32bit and
461         linux_set_pc_32bit.
462         * linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove.
463         (the_low_target): Use linux_get_pc_32bit and
464         linux_set_pc_32bit.
465
466 2016-01-18  Gary Benson  <gbenson@redhat.com>
467
468         * configure.ac (AC_FUNC_FORK): New check.
469         * config.in: Regenerate.
470         * configure: Likewise.
471
472 2016-01-14  Yao Qi  <yao.qi@linaro.org>
473
474         * linux-aarch32-low.c (thumb2_breakpoint): Make it static.
475         * linux-aarch32-low.h (thumb2_breakpoint): Remove declaration.
476         * linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to
477         arm_get_next_pcs_ctor.
478
479 2016-01-12  Josh Stone  <jistone@redhat.com>
480             Philippe Waroquiers  <philippe.waroquiers@skynet.be>
481
482         * inferiors.h: Include "gdb_vecs.h".
483         (struct process_info): Add syscalls_to_catch.
484         * inferiors.c (remove_process): Free syscalls_to_catch.
485         * remote-utils.c (prepare_resume_reply): Report syscall_entry and
486         syscall_return stops.
487         * server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define.
488         * server.c (handle_general_set): Handle QCatchSyscalls.
489         (handle_query): Report support for QCatchSyscalls.
490         * target.h (struct target_ops): Add supports_catch_syscall.
491         (target_supports_catch_syscall): New macro.
492         * linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo.
493         (struct lwp_info): Add syscall_state.
494         * linux-low.c (handle_extended_wait): Mark syscall_state as an entry.
495         Maintain syscall_state and syscalls_to_catch across exec.
496         (get_syscall_trapinfo): New function, proxy to the_low_target.
497         (linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD.
498         (linux_low_filter_event): Toggle syscall_state entry/return for
499         syscall traps, and set it ignored for all others.
500         (gdb_catching_syscalls_p): New function.
501         (gdb_catch_this_syscall_p): New function.
502         (linux_wait_1): Handle SYSCALL_SIGTRAP.
503         (linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility.
504         (linux_supports_catch_syscall): New function.
505         (linux_target_ops): Install it.
506         * linux-x86-low.c (x86_get_syscall_trapinfo): New function.
507         (the_low_target): Install it.
508
509 2016-01-12  Mike Frysinger  <vapier@gentoo.org>
510
511         * acinclude.m4: Include new ../warning.m4 file.
512         * configure: Regenerated.
513         * configure.ac: Replace all warning logic with AM_GDB_WARNINGS.
514
515 2016-01-12  Mike Frysinger  <vapier@gentoo.org>
516
517         * ax.c (is_goto_target): Mark static.
518         * linux-low.c (register_addr): Likewise.
519         (linux_fetch_registers, linux_store_registers): Likewise.
520         * mem-break.c (any_persistent_commands): Fix old prototype.
521         (add_commands_to_breakpoint): Mark static.
522         * regcache.c (find_register_by_name): Delete unused func.
523         * remote-utils.c (hex_or_minus_one): Mark static.
524         * server.c (monitor_show_help): Mark static.
525         (handle_query, handle_v_cont, handle_v_attach, handle_v_kill,
526         handle_v_requests): Likewise.
527
528 2016-01-12  Pedro Alves  <palves@redhat.com>
529
530         Remove use of the registered trademark symbol throughout.
531
532 2016-01-08  Yao Qi  <yao.qi@linaro.org>
533
534         * remote-utils.c (getpkt): If c is '\003', call target hook
535         request_interrupt.
536
537 2016-01-06  Yao Qi  <yao.qi@linaro.org>
538
539         * linux-aarch32-low.h (arm_abi_breakpoint): Move to
540         linux-aarch32-low.c.
541         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
542         (arm_breakpoint_len, thumb_breakpoint_len): Likewise.
543         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
544         (thumb2_breakpoint): Declare.
545         * linux-aarch32-low.c (arm_abi_breakpoint): Moved from
546         linux-aarch32-low.h.
547         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
548         (arm_breakpoint_len, thumb_breakpoint_len): Likewise.
549         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
550
551 2016-01-01  Joel Brobecker  <brobecker@adacore.com>
552
553         * gdbreplay.c (gdbreplay_version): Change copyright year in
554         version message.
555         * server.c (gdbserver_version): Likewise.
556
557 2015-12-28  Patrick Palka  <patrick@parcs.ath.cx>
558
559         * server.c (crc32_table): Delete.
560         (crc32): Use libiberty's xcrc32 function.
561
562 2015-12-22  Joel Brobecker  <brobecker@adacore.com>
563
564         * lynx-low.c (lynx_delete_thread_callback): New function.
565         (lynx_mourn): Properly delete our process and all of its
566         threads.  Remove call to clear_inferiors.
567
568 2015-12-22  Joel Brobecker  <brobecker@adacore.com>
569
570         * target.c (thread_search_callback): Add check that
571         the thread_stopped target callback is not NULL before
572         calling it.
573
574 2015-12-21  Yao Qi  <yao.qi@linaro.org>
575
576         * linux-aarch32-low.h [__aarch64__]: Use arm_abi_breakpoint
577         arm breakpoint.
578
579 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
580
581         * server.c (handle_query): Call target_supports_software_single_step.
582
583 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
584
585         * linux-low.c (single_step): New function.
586         (linux_resume_one_lwp_throw): Call single_step.
587         (start_step_over): Likewise.
588
589 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
590
591         * Makefile.in (SFILES): Append arch/arm-linux.c,
592         arch/arm-get-next-pcs.c.
593         (arm-linux.o): New rule.
594         (arm-get-next-pcs.o): New rule.
595         * configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
596         arm-linux.o.
597         * linux-aarch32-low.c (arm_abi_breakpoint): Remove macro.  Moved
598         to linux-aarch32-low.c.
599         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
600         (arm_breakpoint_len, thumb_breakpoint): Likewise.
601         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
602         (thumb2_breakpoint_len): Likewise.
603         (arm_is_thumb_mode): Make non-static.
604         * linux-aarch32-low.h (arm_abi_breakpoint): New macro.  Moved
605         from linux-aarch32-low.c.
606         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
607         (arm_breakpoint_len, thumb_breakpoint): Likewise.
608         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
609         (thumb2_breakpoint_len): Likewise.
610         (arm_is_thumb_mode): New declaration.
611         * linux-arm-low.c: Include arch/arm-linux.h
612         aarch/arm-get-next-pcs.h, sys/syscall.h.
613         (get_next_pcs_ops): New struct.
614         (get_next_pcs_addr_bits_remove): New function.
615         (get_next_pcs_is_thumb): New function.
616         (get_next_pcs_read_memory_unsigned_integer): Likewise.
617         (arm_sigreturn_next_pc): Likewise.
618         (get_next_pcs_syscall_next_pc): Likewise.
619         (arm_gdbserver_get_next_pcs): Likewise.
620         (struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
621         Initialize.
622         * linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
623         * server.h: Include gdb_vecs.h.
624
625 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
626
627         * Makefile.in (SFILES): Append common/common-regcache.c.
628         (OBS): Append common-regcache.o.
629         (common-regcache.o): New rule.
630         * regcache.c (init_register_cache): Initialize cache to
631         REG_UNAVAILABLE.
632         (regcache_raw_read_unsigned): New function.
633         * regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared
634         register_status enum.
635
636 2015-12-18  Antoine Tremblay  <antoine.tremblay@ericsson.com>
637
638         * linux-aarch64-low.c (the_low_targets): Rename
639         breakpoint_reinsert_addr to get_next_pcs.
640         * linux-arm-low.c (the_low_targets): Likewise.
641         * linux-bfin-low.c (the_low_targets): Likewise.
642         * linux-cris-low.c (the_low_targets): Likewise.
643         * linux-crisv32-low.c (the_low_targets): Likewise.
644         * linux-low.c (can_software_single_step): Likewise.
645         (install_software_single_step_breakpoints): New function.
646         (start_step_over): Use install_software_single_step_breakpoints.
647         * linux-low.h: New CORE_ADDR vector.
648         (struct linux_target_ops) Rename breakpoint_reinsert_addr to
649         get_next_pcs.
650         * linux-mips-low.c (the_low_targets): Likewise.
651         * linux-nios2-low.c (the_low_targets): Likewise.
652         * linux-sparc-low.c (the_low_targets): Likewise.
653
654 2015-12-17  Pedro Alves  <palves@redhat.com>
655
656         * linux-low.c (linux_kill_one_lwp): Remove references to
657         LinuxThreads.
658         (kill_lwp): Remove HAVE_TKILL_SYSCALL check.  No longer fall back
659         to 'kill'.
660         (linux_init_signals): Delete.
661         (initialize_low): Adjust.
662         * thread-db.c (thread_db_init): Remove LinuxThreads reference.
663
664 2015-12-16  Pedro Alves  <palves@redhat.com>
665
666         * configure.ac (compiler warning flags): When testing a
667         -Wno-foo option, check whether -Wfoo works instead.
668         * configure: Regenerate.
669
670 2015-12-11  Don Breazeal  <donb@codesourcery.com>
671
672         * server.c (process_serial_event): Don't exit from gdbserver
673         in remote mode if there are still active inferiors.
674
675 2015-12-11  Yao Qi  <yao.qi@linaro.org>
676
677         * linux-aarch64-low.c (aarch64_breakpoint_at): Call
678         arm_breakpoint_at if the process is 32-bit.
679
680 2015-12-11  Yao Qi  <yao.qi@linaro.org>
681
682         * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
683         arm breakpoint.
684
685 2015-12-07  Yao Qi  <yao.qi@linaro.org>
686
687         * configure.srv: Append arm.o to srv_tgtobj for
688         aarch64*-*-linux* target.
689         * linux-aarch32-low.c (arm_abi_breakpoint): New macro.  Moved
690         from linux-arm-low.c.
691         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
692         (arm_breakpoint_len, thumb_breakpoint): Likewise.
693         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
694         (thumb2_breakpoint_len): Likewise.
695         (arm_is_thumb_mode, arm_breakpoint_at): Likewise.
696         (arm_breakpoint_kinds): Likewise.
697         (arm_breakpoint_kind_from_pc): Likewise.
698         (arm_sw_breakpoint_from_kind): Likewise.
699         (arm_breakpoint_kind_from_current_state): Likewise.
700         * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
701         (arm_sw_breakpoint_from_kind): Declare.
702         (arm_breakpoint_kind_from_current_state): Declare.
703         (arm_breakpoint_at): Declare.
704         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
705         arm_sw_breakpoint_from_kind if process is 32-bit.
706         (aarch64_breakpoint_kind_from_pc): New function.
707         (aarch64_breakpoint_kind_from_current_state): New function.
708         (the_low_target): Initialize fields breakpoint_kind_from_pc
709         and breakpoint_kind_from_current_state.
710         * linux-arm-low.c (arm_breakpoint_kinds): Move to
711         linux-aarch32-low.c.
712         (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
713         (arm_breakpoint, arm_breakpoint_len): Likewise.
714         (thumb_breakpoint, thumb_breakpoint_len): Likewise.
715         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
716         (arm_is_thumb_mode): Likewise.
717         (arm_breakpoint_at): Likewise.
718         (arm_breakpoint_kind_from_pc): Likewise.
719         (arm_sw_breakpoint_from_kind): Likewise.
720         (arm_breakpoint_kind_from_current_state): Likewise.
721
722         Revert:
723         2015-08-04  Yao Qi  <yao.qi@linaro.org>
724
725         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
726         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
727         * server.c (extended_protocol): Remove "static".
728         * server.h (extended_protocol): Declare it.
729
730 2015-12-04  Josh Stone  <jistone@redhat.com>
731
732         * target.h (struct target_ops) <arch_setup>: Rename to ...
733         (struct target_ops) <post_create_inferior>: ... this.
734         (target_arch_setup): Rename to ...
735         (target_post_create_inferior): ... this, calling post_create_inferior.
736         * server.c (start_inferior): Update target_arch_setup calls to
737         target_post_create_inferior.
738         * linux-low.c (linux_low_ptrace_options): Forward declare.
739         (linux_arch_setup): Update its comment for general use.
740         (linux_post_create_inferior): New, run arch_setup and setup ptrace.
741         (struct linux_target_ops): Use linux_post_create_inferior.
742         * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
743         to post_create_inferior.
744         * nto-low.c (struct nto_target_ops): Likewise.
745         * spu-low.c (struct spu_target_ops): Likewise.
746         * win32-low.c (struct win32_target_ops): Likewise.
747
748 2015-12-03  Antoine Tremblay  <antoine.tremblay@ericsson.com>
749
750         * linux-arm-low.c: Remove duplicate arch/arm.h include.
751
752 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
753
754         * linux-arm-low.c (arm_reinsert_addr): Remove function.
755         (struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
756         * linux-cris-low.c (cris_reinsert_addr> Remove function.
757         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
758         * linux-crisv32-low.c (cris_reinsert_addr): Remove function.
759         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
760         * linux-mips-low.c (mips_reinsert_addr): Remove function.
761         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
762         * linux-nios2-low.c (nios2_reinsert_addr): Remove function.
763         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
764         * linux-sparc-low.c (sparc_reinsert_addr): Remove function.
765         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
766
767 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
768
769         * linux-low.c (linux_look_up_symbols): Don't call
770         linux_supports_traceclone.
771         * linux-low.h (thread_db_init): Remove use_events argument.
772         * thread-db.c (thread_db_use_event): Remove global variable.
773         (struct thread_db) <td_thr_event_enable_p>: Remove field.
774         (struct thread_db) <td_create_bp>: Remove field.
775         (thread_db_create_event): Remove function.
776         (thread_db_enable_reporting): Likewise.
777         (find_one_thread): Don't check for thread_db_use_events.
778         (attach_thread): Likewise.
779         (thread_db_load_search): Remove td_thr_event_enable_p initialization.
780         (try_thread_db_load_1): Don't check for thread_db_use_events.
781         (thread_db_init): Remove use_events argument and thread events
782         handling.
783         (remove_thread_event_breakpoints): Remove function.
784         (thread_db_detach): Remove call to remove_thred_event_breakpoints.
785
786 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
787
788         * linux-aarch64-low.c (aarch64_supports_hardware_single_step):
789         New function.
790         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
791         * linux-arm-low.c (arm_supports_hardware_single_step): New function.
792         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
793         * linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
794         (struct linux_target_ops) <bfin_supports_hardware_single_step>:
795         Initialize.
796         * linux-crisv32-low.c (cris_supports_hardware_single_step):
797         New function.
798         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
799         * linux-low.c (can_hardware_single_step): Use
800         supports_hardware_single_step.
801         (can_software_single_step): New function.
802         (start_step_over): Call can_software_single_step.
803         (linux_supports_hardware_single_step): New function.
804         (struct target_ops) <supports_software_single_step>: Initialize.
805         * linux-low.h (struct linux_target_ops)
806         <supports_hardware_single_step>: Initialize.
807         * linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
808         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
809         * linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
810         (struct linux_target_ops) <supports_hardware_single_step> Initialize.
811         * linux-s390-low.c (s390_supports_hardware_single_step): New function.
812         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
813         * linux-sh-low.c (sh_supports_hardware_single_step): New function.
814         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
815         * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
816         (struct linux_target_ops) <tic6x_supports_hardware_single_step>:
817         Initialize.
818         * linux-tile-low.c (tile_supports_hardware_single_step): New function.
819         (struct linux_target_ops) <tile_supports_hardware_single_step>:
820         Initialize.
821         * linux-x86-low.c (x86_supports_hardware_single_step) New function.
822         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
823         * linux-xtensa-low.c (xtensa_supports_hardware_single_step):
824         New function.
825         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
826         * target.h (struct target_ops): <supports_software_single_step>:
827         New field.
828         (target_supports_software_single_step): New macro.
829
830 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
831
832         * linux-low.c (linux_wait_1): Fix pc advance condition.
833         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
834         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
835
836 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
837
838         * linux-arm-low.c (arm_is_thumb_mode): New function.
839         (arm_breakpoint_at): Use arm_is_thumb_mode.
840         (arm_breakpoint_kind_from_current_state): New function.
841         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
842         Initialize.
843         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
844         (linux_breakpoint_kind_from_current_state): New function.
845         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
846         * linux-low.h (struct linux_target_ops)
847         <breakpoint_kind_from_current_state>: New field.
848         * target.h (struct target_ops): Likewise.
849         (target_breakpoint_kind_from_current_state): New macro.
850
851 2015-11-30  Pedro Alves  <palves@redhat.com>
852
853         * linux-low.c (linux_resume): Wake up the event loop before
854         returning.
855
856 2015-11-30  Pedro Alves  <palves@redhat.com>
857
858         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
859         check.
860         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
861         to -1.
862         * target.c (struct thread_search): New structure.
863         (thread_search_callback): New function.
864         (prev_general_thread): New global.
865         (prepare_to_access_memory, done_accessing_memory): New functions.
866         * target.h (prepare_to_access_memory, done_accessing_memory):
867         Replace macros with function declarations.
868
869 2015-11-30  Pedro Alves  <palves@redhat.com>
870
871         PR 14618
872         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
873         report TARGET_WAITKIND_NO_RESUMED.
874         * remote-utils.c (prepare_resume_reply): Handle
875         TARGET_WAITKIND_NO_RESUMED.
876         * server.c (report_no_resumed): New global.
877         (handle_query) <qSupported>: Handle "no-resumed+".  Report
878         "no-resumed+" support.
879         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
880         return error if the client doesn't support no-resumed events.
881         (push_stop_notification): New function.
882         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
883         events if the client supports them.
884
885 2015-11-30  Pedro Alves  <palves@redhat.com>
886
887         * linux-low.c (thread_still_has_status_pending_p): Don't check
888         vCont;t here.
889         (lwp_resumed): New function.
890         (status_pending_p_callback): Return early if the LWP is not
891         supposed to be resumed.
892
893 2015-11-30  Pedro Alves  <palves@redhat.com>
894
895         * linux-low.c (handle_extended_wait): Assert that the LWP's
896         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
897         thread create events, leave the new child's status pending.
898         (linux_low_filter_event): If GDB wants to hear about thread exit
899         events, leave the LWP marked dead and don't delete it.
900         (linux_wait_for_event_filtered): Don't check for thread exit.
901         (filter_exit_event): New function.
902         (linux_wait_1): Use it, when returning an exit event.
903         (linux_resume_one_lwp_throw): Assert that the LWP's
904         waitstatus is TARGET_WAITKIND_IGNORE.
905         * remote-utils.c (prepare_resume_reply): Handle
906         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
907         * server.c (report_thread_events): New global.
908         (handle_general_set): Handle QThreadEvents.
909         (handle_query) <qSupported>: Handle and report QThreadEvents+;
910         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
911         TARGET_WAITKIND_THREAD_EXITED.
912         * server.h (report_thread_events): Declare.
913
914 2015-11-30  Pedro Alves  <palves@redhat.com>
915
916         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
917         the thread's last_resume_kind was resume_stop.
918
919 2015-11-30  Pedro Alves  <palves@redhat.com>
920
921         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
922         before returning.
923
924 2015-11-30  Pedro Alves  <palves@redhat.com>
925
926         * server.c (handle_v_requests): Handle vCtrlC.
927
928 2015-11-30  Pedro Alves  <palves@redhat.com>
929
930         * gdbthread.h (find_any_thread_of_pid): Declare.
931         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
932         functions.
933         * server.c (handle_query): If current_thread is NULL, look for
934         another thread of the selected process.
935
936 2015-11-26  Daniel Colascione  <dancol@dancol.org>
937             Simon Marchi  <simon.marchi@ericsson.com>
938
939         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
940         * server.c (handle_qxfer_threads_worker): Refactor to include thread
941         name in reply.
942         * target.h (struct target_ops) <thread_name>: New field.
943         (target_thread_name): New macro.
944
945 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
946
947         * regcache.h (regcache_invalidate_pid): Add declaration.
948         * regcache.c (regcache_invalidate_pid): New function, extracted
949         from regcache_invalidate.
950         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
951         Add trivial documentation comment.
952         * lynx-low.c: Use regcache_invalidate_pid instead of
953         regcache_invalidate.
954
955 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
956
957         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
958         and Elf64_auxv_t if the target is Android.
959
960 2015-11-22  Doug Evans  <xdje42@gmail.com>
961
962         * target.h: #include <sys/types.h>.
963
964 2015-11-19  Pedro Alves  <palves@redhat.com>
965
966         * linux-low.c (linux_process_qsupported): Change prototype.
967         Adjust.
968         * linux-low.h (struct linux_target_ops) <process_qsupported>:
969         Change prototype.
970         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
971         and adjust to loop over all features.
972         * server.c (handle_query) <qSupported>: Adjust to call
973         target_process_qsupported once, passing it a vector of unprocessed
974         features.
975         * target.h (struct target_ops) <process_qsupported>: Change
976         prototype.
977         (target_process_qsupported): Adjust.
978
979 2015-11-19  Pedro Alves  <palves@redhat.com>
980
981         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
982         mode.
983         * configure: Regenerate.
984
985 2015-11-19  Pedro Alves  <palves@redhat.com>
986
987         * configure: Regenerate.
988
989 2015-11-19  Yao Qi  <yao.qi@linaro.org>
990
991         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
992         type to uint32_t.
993
994 2015-11-19  Yao Qi  <yao.qi@linaro.org>
995
996         * linux-aarch64-low.c (enum aarch64_operand_type): New.
997         (struct aarch64_operand): Move enum out.
998
999 2015-11-19  Yao Qi  <yao.qi@linaro.org>
1000
1001         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
1002         struct user_fpsimd_state *.
1003         (aarch64_store_fpregset): Likewise.
1004
1005 2015-11-19  Yao Qi  <yao.qi@linaro.org>
1006
1007         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
1008         struct user_pt_regs *.
1009         (aarch64_store_gregset): Likewise.
1010
1011 2015-11-18  Pedro Alves  <palves@redhat.com>
1012
1013         * Makefile.in (all_object_files): Add $IPA_OBJS.
1014
1015 2015-11-17  Pedro Alves  <palves@redhat.com>
1016
1017         * win32-low.c (win32_resume): Use gdb_signal_from_host,
1018         GDB_SIGNAL_0 and gdb_signal_to_string.
1019
1020 2015-11-17  Pedro Alves  <palves@redhat.com>
1021
1022         * win32-low.c (handle_output_debug_string): Remove parameter.
1023         (win32_kill): Remove our_status local and adjust call to
1024         handle_output_debug_string.
1025         (get_child_debug_event): Adjust call to
1026         handle_output_debug_string.
1027
1028 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1029
1030         * linux-mips-low.c (mips_fill_gregset): Add cast.
1031         (mips_store_gregset): Likewise.
1032         (mips_fill_fpregset): Likewise.
1033         (mips_store_fpregset): Likewise.
1034
1035 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1036
1037         * linux-mips-low.c (mips_add_watchpoint): Rename private to
1038         priv.
1039
1040 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1041
1042         * linux-mips-low.c (mips_linux_new_thread): Change type of
1043         watch_type to enum target_hw_bp_type.
1044
1045 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1046
1047                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
1048                 Change return type to arm_hwbp_type.
1049
1050 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1051
1052         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
1053         (arm_store_gregset): Likewise.
1054         * linux-arm-low.c (arm_get_hwcap): Likewise.
1055         (arm_read_description): Likewise.
1056
1057 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1058
1059         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
1060
1061 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1062
1063         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
1064         (ppc_fill_vsxregset): Likewise.
1065         (ppc_store_vsxregset): Likewise.
1066         (ppc_fill_vrregset): Likewise.
1067         (ppc_store_vrregset): Likewise.
1068         (ppc_fill_evrregset): Likewise.
1069         (ppc_store_evrregset): Likewise.
1070
1071 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
1072
1073         * linux-ppc-low.c (ppc_usrregs_info): Remove
1074         forward-declaration.
1075         (ppc_arch_setup): Move lower in file.
1076
1077 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
1078
1079         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
1080         (ps_pdwrite): Likewise.
1081
1082 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
1083
1084         * linux-arm-low.c (arm_new_thread): Move pointer dereference
1085         to after assert checks.
1086
1087 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
1088
1089         * proc-service.c (ps_pdread): Add/adjust casts.
1090         (ps_pdwrite): Add/adjust casts.
1091
1092 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
1093
1094         * server.c (handle_search_memory_1): Cast return value of
1095         memmem.
1096
1097 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
1098
1099         * server.c (write_qxfer_response): Change type of data to
1100         gdb_byte *.
1101
1102 2015-10-29  Pedro Alves  <palves@redhat.com>
1103
1104         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
1105
1106 2015-10-29  Pedro Alves  <palves@redhat.com>
1107
1108         * tracepoint.c (clear_installed_tracepoints): Add casts.
1109
1110 2015-10-29  Pedro Alves  <palves@redhat.com>
1111
1112         * server.c (handle_v_cont, process_serial_event): Add enum
1113         gdb_signal casts to signal parsing code.
1114
1115 2015-10-29  Pedro Alves  <palves@redhat.com>
1116
1117         * linux-low.h (NULL_REGSET): Define.
1118         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
1119         * linux-arm-low.c (arm_regsets): Likewise.
1120         * linux-crisv32-low.c (cris_regsets): Likewise.
1121         * linux-m68k-low.c (m68k_regsets): Likewise.
1122         * linux-mips-low.c (mips_regsets): Likewise.
1123         * linux-nios2-low.c (nios2_regsets): Likewise.
1124         * linux-ppc-low.c (ppc_regsets): Likewise.
1125         * linux-s390-low.c (s390_regsets): Likewise.
1126         * linux-sh-low.c (sh_regsets): Likewise.
1127         * linux-sparc-low.c (sparc_regsets): Likewise.
1128         * linux-tic6x-low.c (tic6x_regsets): Likewise.
1129         * linux-tile-low.c (tile_regsets): Likewise.
1130         * linux-x86-low.c (x86_regsets): Likewise.
1131         * linux-xtensa-low.c (xtensa_regsets): Likewise.
1132
1133 2015-10-29  Pedro Alves  <palves@redhat.com>
1134
1135         * linux-low.h (NULL_REGSET): Define.
1136         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
1137         * linux-arm-low.c (arm_regsets): Likewise.
1138         * linux-crisv32-low.c (cris_regsets): Likewise.
1139         * linux-m68k-low.c (m68k_regsets): Likewise.
1140         * linux-mips-low.c (mips_regsets): Likewise.
1141         * linux-nios2-low.c (nios2_regsets): Likewise.
1142         * linux-ppc-low.c (ppc_regsets): Likewise.
1143         * linux-s390-low.c (s390_regsets): Likewise.
1144         * linux-sh-low.c (sh_regsets): Likewise.
1145         * linux-sparc-low.c (sparc_regsets): Likewise.
1146         * linux-tic6x-low.c (tic6x_regsets): Likewise.
1147         * linux-tile-low.c (tile_regsets): Likewise.
1148         * linux-x86-low.c (x86_regsets): Likewise.
1149         * linux-xtensa-low.c (xtensa_regsets): Likewise.
1150
1151 2015-10-26  Doug Evans  <dje@google.com>
1152
1153         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
1154
1155 2015-10-26  Doug Evans  <dje@google.com>
1156
1157         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
1158
1159 2015-10-26  Doug Evans  <dje@google.com>
1160
1161         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
1162         for debug_printf.
1163         (attach_thread, find_new_threads_callback): Ditto.
1164
1165 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1166
1167         * mem-break.h (set_breakpoint_data): Remove.
1168
1169 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1170
1171         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
1172         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
1173         (initialize_low): Remove set_breakpoint_data call.
1174         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
1175         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
1176         (initialize_low): Remove set_breakpoint_data call.
1177         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
1178         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
1179         (initialize_low): Remove set_breakpoint_data call.
1180
1181 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1182
1183         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
1184         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
1185         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
1186         * target.h (target_breakpoint_kind_from_pc): New macro.
1187
1188 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1189
1190         * linux-low.c (default_breakpoint_kind_from_pc): New function.
1191         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
1192         the default breakpoint kind.
1193
1194 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1195
1196         * linux-arm-low.c (arm_supports_z_point_type): Add software
1197         breakpoint support.
1198
1199 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1200
1201         * linux-arm-low.c: Refactor breakpoint definitions.
1202         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
1203         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
1204
1205 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1206
1207         * Makefile.in: Add arm.c/o.
1208         * configure.srv: Likewise.
1209         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
1210         (arm_breakpoint_kind_from_pc): New function.
1211         (arm_sw_breakpoint_from_kind): Return proper kind.
1212         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
1213
1214 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1215
1216         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
1217         removal.
1218         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
1219         (struct raw_breakpoint) <size>: Remove.
1220         (struct raw_breakpoint) <kind>: Add.
1221         (bp_size): New function.
1222         (bp_opcode): Likewise.
1223         (find_raw_breakpoint_at): Adjust for kind.
1224         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
1225         (remove_memory_breakpoint): Adjust for kind call bp_size.
1226         (set_raw_breakpoint_at): Adjust for kind.
1227         (set_breakpoint): Likewise.
1228         (set_breakpoint_at): Call breakpoint_kind_from_pc.
1229         (delete_raw_breakpoint): Adjust for kind.
1230         (delete_breakpoint): Likewise.
1231         (find_gdb_breakpoint): Likewise.
1232         (set_gdb_breakpoint_1): Likewise.
1233         (set_gdb_breakpoint): Likewise.
1234         (delete_gdb_breakpoint_1): Likewise.
1235         (delete_gdb_breakpoint): Likewise.
1236         (uninsert_raw_breakpoint): Likewise.
1237         (reinsert_raw_breakpoint): Likewise.
1238         (set_breakpoint_data): Remove.
1239         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
1240         (check_mem_read): Adjust for kind call bp_size.
1241         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
1242         (clone_one_breakpoint): Adjust for kind.
1243         * mem-break.h (set_gdb_breakpoint): Likewise.
1244         (delete_gdb_breakpoint): Likewise.
1245         * server.c (process_serial_event): Likewise.
1246
1247 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1248
1249         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
1250         (struct linux_target_ops) <breakpoint>: Remove.
1251         (struct linux_target_ops) <breakpoint_len>: Remove.
1252         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1253         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1254         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
1255         (arm_sw_breakpoint_from_kind): New function.
1256         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
1257         (struct linux_target_ops) <breakpoint>: Remove.
1258         (struct linux_target_ops) <breakpoint_len>: Remove.
1259         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1260         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1261         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
1262         (struct linux_target_ops) <breakpoint>: Remove.
1263         (struct linux_target_ops) <breakpoint_len>: Remove.
1264         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1265         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1266         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
1267         (struct linux_target_ops) <breakpoint>: Remove.
1268         (struct linux_target_ops) <breakpoint_len>: Remove.
1269         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1270         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1271         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
1272         and sw_breakpoint_from_kind to increment the pc.
1273         (linux_breakpoint_kind_from_pc): New function.
1274         (linux_sw_breakpoint_from_kind): New function.
1275         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
1276         (initialize_low): Call breakpoint_kind_from_pc and
1277         sw_breakpoint_from_kind to replace breakpoint_data/len.
1278         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
1279         New field.
1280         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
1281         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
1282         (struct linux_target_ops) <breakpoint>: Remove.
1283         (struct linux_target_ops) <breakpoint_len>: Remove.
1284         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1285         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1286         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
1287         (struct linux_target_ops) <breakpoint>: Remove.
1288         (struct linux_target_ops) <breakpoint_len>: Remove.
1289         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1290         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1291         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
1292         (struct linux_target_ops) <breakpoint>: Remove.
1293         (struct linux_target_ops) <breakpoint_len>: Remove.
1294         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1295         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1296         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
1297         (struct linux_target_ops) <breakpoint>: Remove.
1298         (struct linux_target_ops) <breakpoint_len>: Remove.
1299         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1300         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1301         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
1302         (struct linux_target_ops) <breakpoint>: Remove.
1303         (struct linux_target_ops) <breakpoint_len>: Remove.
1304         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1305         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1306         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
1307         (struct linux_target_ops) <breakpoint>: Remove.
1308         (struct linux_target_ops) <breakpoint_len>: Remove.
1309         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1310         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1311         * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
1312         (struct linux_target_ops) <breakpoint>: Remove.
1313         (struct linux_target_ops) <breakpoint_len>: Remove.
1314         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1315         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1316         * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
1317         (struct linux_target_ops) <breakpoint>: Remove.
1318         (struct linux_target_ops) <breakpoint_len>: Remove.
1319         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1320         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1321         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
1322         (struct linux_target_ops) <breakpoint>: Remove.
1323         (struct linux_target_ops) <breakpoint_len>: Remove.
1324         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1325         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1326         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
1327         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
1328         (struct linux_target_ops) <breakpoint>: Remove.
1329         (struct linux_target_ops) <breakpoint_len>: Remove.
1330         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1331         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1332         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
1333         (struct linux_target_ops) <breakpoint>: Remove.
1334         (struct linux_target_ops) <breakpoint_len>: Remove.
1335         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
1336         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
1337
1338 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
1339
1340         * linux-cris-low.c (cris_get_pc): Remove void arg.
1341
1342 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
1343
1344         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
1345         variable name.
1346
1347 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
1348
1349         * inferiors.c (thread_pid_matches_callback): New function.
1350         (find_thread_process): New function.
1351         (remove_thread): Reset current_thread.
1352         (remove_process): Assert threads have been removed first.
1353
1354 2015-10-15  Yao Qi  <yao.qi@linaro.org>
1355
1356         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
1357         if it is 3.
1358         (aarch64_remove_point): Likewise.
1359         * regcache.c (regcache_register_size): New function.
1360
1361 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1362
1363         * linux-aarch64-low.c: Update all callers as emit_load_store
1364         is renamed to aarch64_emit_load_store.
1365
1366 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1367
1368         * linux-aarch64-low.c: Update all callers of function renaming
1369         from emit_insn to aarch64_emit_insn.
1370
1371 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1372
1373         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
1374         arch/aarch64-insn.h.
1375         (struct aarch64_memory_operand): Likewise.
1376         (ENCODE): Likewise.
1377         (emit_insn): Move to arch/aarch64-insn.c.
1378         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
1379         (emit_load_store): Move to arch/aarch64-insn.c.
1380         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
1381         (can_encode_int32): Remove.
1382
1383 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1384
1385         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
1386         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
1387         (aarch64_relocate_instruction): Likewise.
1388         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
1389         (struct aarch64_insn_visitor): Likewise.
1390
1391 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1392
1393         * linux-aarch64-low.c (struct aarch64_insn_data): New.
1394         (struct aarch64_insn_visitor): New.
1395         (struct aarch64_insn_relocation_data): New.
1396         (aarch64_ftrace_insn_reloc_b): New function.
1397         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
1398         (aarch64_ftrace_insn_reloc_cb): Likewise.
1399         (aarch64_ftrace_insn_reloc_tb): Likewise.
1400         (aarch64_ftrace_insn_reloc_adr): Likewise.
1401         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
1402         (aarch64_ftrace_insn_reloc_others): Likewise.
1403         (visitor): New.
1404         (aarch64_relocate_instruction): Use visitor.
1405
1406 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1407
1408         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
1409         int.  Add argument buf.
1410         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
1411         aarch64_relocate_instruction.
1412
1413 2015-10-12  Yao Qi  <yao.qi@linaro.org>
1414
1415         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
1416         argument insn.  Remove local variable insn.  Don't call
1417         target_read_uint32.
1418         (aarch64_install_fast_tracepoint_jump_pad): Call
1419         target_read_uint32.
1420
1421 2015-09-30  Yao Qi  <yao.qi@linaro.org>
1422
1423         * linux-aarch64-low.c (emit_movk): Shorten a long line.
1424         (emit_load_store_pair): Likewise.
1425
1426 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
1427
1428         * dll.c (match_dll): Add cast(s).
1429         (unloaded_dll): Likewise.
1430         * linux-low.c (second_thread_of_pid_p): Likewise.
1431         (delete_lwp_callback): Likewise.
1432         (count_events_callback): Likewise.
1433         (select_event_lwp_callback): Likewise.
1434         (linux_set_resume_request): Likewise.
1435         * server.c (accumulate_file_name_length): Likewise.
1436         (emit_dll_description): Likewise.
1437         (handle_qxfer_threads_worker): Likewise.
1438         (visit_actioned_threads): Likewise.
1439         * thread-db.c (any_thread_of): Likewise.
1440         * tracepoint.c (same_process_p): Likewise.
1441         (match_blocktype): Likewise.
1442         (build_traceframe_info_xml): Likewise.
1443
1444 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
1445
1446         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
1447         assignment.
1448         (gdb_unparse_agent_expr): Likewise.
1449         * hostio.c (require_data): Likewise.
1450         (handle_pread): Likewise.
1451         * linux-low.c (disable_regset): Likewise.
1452         (fetch_register): Likewise.
1453         (store_register): Likewise.
1454         (get_dynamic): Likewise.
1455         (linux_qxfer_libraries_svr4): Likewise.
1456         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
1457         (set_fast_tracepoint_jump): Likewise.
1458         (uninsert_fast_tracepoint_jumps_at): Likewise.
1459         (reinsert_fast_tracepoint_jumps_at): Likewise.
1460         (validate_inserted_breakpoint): Likewise.
1461         (clone_agent_expr): Likewise.
1462         * regcache.c (init_register_cache): Likewise.
1463         * remote-utils.c (putpkt_binary_1): Likewise.
1464         (decode_M_packet): Likewise.
1465         (decode_X_packet): Likewise.
1466         (look_up_one_symbol): Likewise.
1467         (relocate_instruction): Likewise.
1468         (monitor_output): Likewise.
1469         * server.c (handle_search_memory): Likewise.
1470         (handle_qxfer_exec_file): Likewise.
1471         (handle_qxfer_libraries): Likewise.
1472         (handle_qxfer): Likewise.
1473         (handle_query): Likewise.
1474         (handle_v_cont): Likewise.
1475         (handle_v_run): Likewise.
1476         (captured_main): Likewise.
1477         * target.c (write_inferior_memory): Likewise.
1478         * thread-db.c (try_thread_db_load_from_dir): Likewise.
1479         * tracepoint.c (init_trace_buffer): Likewise.
1480         (add_tracepoint_action): Likewise.
1481         (add_traceframe): Likewise.
1482         (add_traceframe_block): Likewise.
1483         (cmd_qtdpsrc): Likewise.
1484         (cmd_qtdv): Likewise.
1485         (cmd_qtstatus): Likewise.
1486         (response_source): Likewise.
1487         (response_tsv): Likewise.
1488         (cmd_qtnotes): Likewise.
1489         (gdb_collect): Likewise.
1490         (initialize_tracepoint): Likewise.
1491
1492 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1493
1494         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
1495         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
1496         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
1497         <NOP>: New.
1498         (enum aarch64_condition_codes): New enum.
1499         (w0): New static global.
1500         (fp): Likewise.
1501         (lr): Likewise.
1502         (struct aarch64_memory_operand) <type>: New
1503         MEMORY_OPERAND_POSTINDEX type.
1504         (postindex_memory_operand): New helper function.
1505         (emit_ret): New function.
1506         (emit_load_store_pair): New function, factored out of emit_stp
1507         with support for MEMORY_OPERAND_POSTINDEX.
1508         (emit_stp): Rewrite using emit_load_store_pair.
1509         (emit_ldp): New function.
1510         (emit_load_store): Likewise.
1511         (emit_ldr): Mention post-index instruction in comment.
1512         (emit_ldrh): New function.
1513         (emit_ldrb): New function.
1514         (emit_ldrsw): Mention post-index instruction in comment.
1515         (emit_str): Likewise.
1516         (emit_subs): New function.
1517         (emit_cmp): Likewise.
1518         (emit_and): Likewise.
1519         (emit_orr): Likewise.
1520         (emit_orn): Likewise.
1521         (emit_eor): Likewise.
1522         (emit_mvn): Likewise.
1523         (emit_lslv): Likewise.
1524         (emit_lsrv): Likewise.
1525         (emit_asrv): Likewise.
1526         (emit_mul): Likewise.
1527         (emit_sbfm): Likewise.
1528         (emit_sbfx): Likewise.
1529         (emit_ubfm): Likewise.
1530         (emit_ubfx): Likewise.
1531         (emit_csinc): Likewise.
1532         (emit_cset): Likewise.
1533         (emit_nop): Likewise.
1534         (emit_ops_insns): New helper function.
1535         (emit_pop): Likewise.
1536         (emit_push): Likewise.
1537         (aarch64_emit_prologue): New function.
1538         (aarch64_emit_epilogue): Likewise.
1539         (aarch64_emit_add): Likewise.
1540         (aarch64_emit_sub): Likewise.
1541         (aarch64_emit_mul): Likewise.
1542         (aarch64_emit_lsh): Likewise.
1543         (aarch64_emit_rsh_signed): Likewise.
1544         (aarch64_emit_rsh_unsigned): Likewise.
1545         (aarch64_emit_ext): Likewise.
1546         (aarch64_emit_log_not): Likewise.
1547         (aarch64_emit_bit_and): Likewise.
1548         (aarch64_emit_bit_or): Likewise.
1549         (aarch64_emit_bit_xor): Likewise.
1550         (aarch64_emit_bit_not): Likewise.
1551         (aarch64_emit_equal): Likewise.
1552         (aarch64_emit_less_signed): Likewise.
1553         (aarch64_emit_less_unsigned): Likewise.
1554         (aarch64_emit_ref): Likewise.
1555         (aarch64_emit_if_goto): Likewise.
1556         (aarch64_emit_goto): Likewise.
1557         (aarch64_write_goto_address): Likewise.
1558         (aarch64_emit_const): Likewise.
1559         (aarch64_emit_call): Likewise.
1560         (aarch64_emit_reg): Likewise.
1561         (aarch64_emit_pop): Likewise.
1562         (aarch64_emit_stack_flush): Likewise.
1563         (aarch64_emit_zero_ext): Likewise.
1564         (aarch64_emit_swap): Likewise.
1565         (aarch64_emit_stack_adjust): Likewise.
1566         (aarch64_emit_int_call_1): Likewise.
1567         (aarch64_emit_void_call_2): Likewise.
1568         (aarch64_emit_eq_goto): Likewise.
1569         (aarch64_emit_ne_goto): Likewise.
1570         (aarch64_emit_lt_goto): Likewise.
1571         (aarch64_emit_le_goto): Likewise.
1572         (aarch64_emit_gt_goto): Likewise.
1573         (aarch64_emit_ge_got): Likewise.
1574         (aarch64_emit_ops_impl): New static global variable.
1575         (aarch64_emit_ops): New target function, return
1576         &aarch64_emit_ops_impl.
1577         (struct linux_target_ops): Install it.
1578
1579 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1580
1581         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
1582         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
1583         aarch64-ipa.o.
1584         * linux-aarch64-ipa.c: New file.
1585         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
1586         and endian.h.
1587         (aarch64_get_thread_area): New target method.
1588         (extract_signed_bitfield): New helper function.
1589         (aarch64_decode_ldr_literal): New function.
1590         (enum aarch64_opcodes): New enum.
1591         (struct aarch64_register): New struct.
1592         (struct aarch64_operand): New struct.
1593         (x0): New static global.
1594         (x1): Likewise.
1595         (x2): Likewise.
1596         (x3): Likewise.
1597         (x4): Likewise.
1598         (w2): Likewise.
1599         (ip0): Likewise.
1600         (sp): Likewise.
1601         (xzr): Likewise.
1602         (aarch64_register): New helper function.
1603         (register_operand): Likewise.
1604         (immediate_operand): Likewise.
1605         (struct aarch64_memory_operand): New struct.
1606         (offset_memory_operand): New helper function.
1607         (preindex_memory_operand): Likewise.
1608         (enum aarch64_system_control_registers): New enum.
1609         (ENCODE): New macro.
1610         (emit_insn): New helper function.
1611         (emit_b): New function.
1612         (emit_bcond): Likewise.
1613         (emit_cb): Likewise.
1614         (emit_tb): Likewise.
1615         (emit_blr): Likewise.
1616         (emit_stp): Likewise.
1617         (emit_ldp_q_offset): Likewise.
1618         (emit_stp_q_offset): Likewise.
1619         (emit_load_store): Likewise.
1620         (emit_ldr): Likewise.
1621         (emit_ldrsw): Likewise.
1622         (emit_str): Likewise.
1623         (emit_ldaxr): Likewise.
1624         (emit_stxr): Likewise.
1625         (emit_stlr): Likewise.
1626         (emit_data_processing_reg): Likewise.
1627         (emit_data_processing): Likewise.
1628         (emit_add): Likewise.
1629         (emit_sub): Likewise.
1630         (emit_mov): Likewise.
1631         (emit_movk): Likewise.
1632         (emit_mov_addr): Likewise.
1633         (emit_mrs): Likewise.
1634         (emit_msr): Likewise.
1635         (emit_sevl): Likewise.
1636         (emit_wfe): Likewise.
1637         (append_insns): Likewise.
1638         (can_encode_int32_in): New helper function.
1639         (aarch64_relocate_instruction): New function.
1640         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
1641         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
1642         (struct linux_target_ops): Install aarch64_get_thread_area,
1643         aarch64_install_fast_tracepoint_jump_pad and
1644         aarch64_get_min_fast_tracepoint_insn_len.
1645
1646 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
1647
1648         * Makefile.in (aarch64-insn.o): New rule.
1649         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
1650
1651 2015-09-21  Yao Qi  <yao.qi@linaro.org>
1652
1653         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
1654
1655 2015-09-21  Yao Qi  <yao.qi@linaro.org>
1656
1657         * tracepoint.c (max_jump_pad_size): Remove.
1658
1659 2015-09-18  Yao Qi  <yao.qi@linaro.org>
1660
1661         * linux-aarch64-low.c: Don't include sys/uio.h.
1662         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
1663
1664 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
1665
1666         * tracepoint.c (eval_result_type): Change prototype.
1667         (condition_true_at_tracepoint): Fix argument to compiled_cond.
1668
1669 2015-09-15  Pedro Alves  <palves@redhat.com>
1670
1671         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
1672         Check whether to report exec events instead of checking whether
1673         multiprocess is enabled.
1674
1675 2015-09-15  Pedro Alves  <palves@redhat.com>
1676
1677         PR remote/18965
1678         * remote-utils.c (prepare_resume_reply): Merge
1679         TARGET_WAITKIND_VFORK_DONE switch case with the
1680         TARGET_WAITKIND_FORKED case.
1681
1682 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1683
1684         * server.c (handle_query): Check string comparison using
1685         "else if" instead of "if".
1686
1687 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1688
1689         * server.c (vCont_supported): New global variable.
1690         (handle_query): Set vCont_supported to 1 if "vContSupported+"
1691         matches.  Append ";vContSupported+" to own_buf.
1692         (handle_v_requests): Append ";s;S" to own_buf if target supports
1693         hardware single step or vCont_supported is false.
1694         (capture_main): Set vCont_supported to zero.
1695
1696 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1697
1698         * linux-low.c (linux_supports_conditional_breakpoints): Rename
1699         it to ...
1700         (linux_supports_hardware_single_step): ... New function.
1701         (linux_target_ops): Update.
1702         * lynx-low.c (lynx_target_ops): Set field
1703         supports_hardware_single_step to target_can_do_hardware_single_step.
1704         * nto-low.c (nto_target_ops): Likewise.
1705         * spu-low.c (spu_target_ops): Likewise.
1706         * win32-low.c (win32_target_ops): Likewise.
1707         * target.c (target_can_do_hardware_single_step): New function.
1708         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1709         Remove.  <supports_hardware_single_step>: New field.
1710         (target_supports_conditional_breakpoints): Remove.
1711         (target_supports_hardware_single_step): New macro.
1712         (target_can_do_hardware_single_step): Declare.
1713         * server.c (handle_query): Use target_supports_hardware_single_step
1714         instead of target_supports_conditional_breakpoints.
1715
1716 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1717
1718         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
1719         function.
1720         (struct linux_target_ops the_low_target): Install
1721         aarch64_linux_siginfo_fixup.
1722
1723 2015-09-11  Don Breazeal  <donb@codesourcery.com>
1724             Luis Machado  <lgustavo@codesourcery.com>
1725
1726         * linux-low.c (linux_mourn): Static declaration.
1727         (linux_arch_setup): Move in front of
1728         handle_extended_wait.
1729         (linux_arch_setup_thread): New function.
1730         (handle_extended_wait): Handle exec events.  Call
1731         linux_arch_setup_thread.  Make event_lwp argument a
1732         pointer-to-a-pointer.
1733         (check_zombie_leaders): Do not check stopped threads.
1734         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
1735         (linux_low_filter_event): Add lwp and thread for exec'ing
1736         non-leader thread if leader thread has been deleted.
1737         Refactor code into linux_arch_setup_thread and call it.
1738         Pass child lwp pointer by reference to handle_extended_wait.
1739         (linux_wait_for_event_filtered): Update comment.
1740         (linux_wait_1): Prevent clobbering exec event status.
1741         (linux_supports_exec_events): New function.
1742         (linux_target_ops) <supports_exec_events>: Initialize new member.
1743         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
1744         new member.
1745         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
1746         * server.c (report_exec_events): New global variable.
1747         (handle_query): Handle qSupported query for exec-events feature.
1748         (captured_main): Initialize report_exec_events.
1749         * server.h (report_exec_events): Declare new global variable.
1750         * target.h (struct target_ops) <supports_exec_events>: New
1751         member.
1752         (target_supports_exec_events): New macro.
1753         * win32-low.c (win32_target_ops) <supports_exec_events>:
1754         Initialize new member.
1755
1756 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
1757
1758         * linux-low.c (linux_low_enable_btrace): Remove.
1759         (linux_target_ops): Replace linux_low_enable_btrace with
1760         linux_enable_btrace.
1761
1762 2015-09-03  Yao Qi  <yao.qi@linaro.org>
1763
1764         * linux-aarch64-low.c (aarch64_insert_point): Call
1765         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
1766         returns true.
1767
1768 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1769
1770         * linux-low.c (check_stopped_by_breakpoint): Use
1771         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
1772
1773 2015-08-27  Pedro Alves  <palves@redhat.com>
1774
1775         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
1776
1777 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
1778
1779         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
1780         the XNEW-family equivalent.
1781         (compile_bytecodes): Likewise.
1782         * dll.c (loaded_dll): Likewise.
1783         * event-loop.c (append_callback_event): Likewise.
1784         (create_file_handler): Likewise.
1785         (create_file_event): Likewise.
1786         * hostio.c (handle_open): Likewise.
1787         * inferiors.c (add_thread): Likewise.
1788         (add_process): Likewise.
1789         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
1790         * linux-arm-low.c (arm_new_process): Likewise.
1791         (arm_new_thread): Likewise.
1792         * linux-low.c (add_to_pid_list): Likewise.
1793         (linux_add_process): Likewise.
1794         (handle_extended_wait): Likewise.
1795         (add_lwp): Likewise.
1796         (enqueue_one_deferred_signal): Likewise.
1797         (enqueue_pending_signal): Likewise.
1798         (linux_resume_one_lwp_throw): Likewise.
1799         (linux_resume_one_thread): Likewise.
1800         (linux_read_memory): Likewise.
1801         (linux_write_memory): Likewise.
1802         * linux-mips-low.c (mips_linux_new_process): Likewise.
1803         (mips_linux_new_thread): Likewise.
1804         (mips_add_watchpoint): Likewise.
1805         * linux-x86-low.c (initialize_low_arch): Likewise.
1806         * lynx-low.c (lynx_add_process): Likewise.
1807         * mem-break.c (set_raw_breakpoint_at): Likewise.
1808         (set_breakpoint): Likewise.
1809         (add_condition_to_breakpoint): Likewise.
1810         (add_commands_to_breakpoint): Likewise.
1811         (clone_agent_expr): Likewise.
1812         (clone_one_breakpoint): Likewise.
1813         * regcache.c (new_register_cache): Likewise.
1814         * remote-utils.c (look_up_one_symbol): Likewise.
1815         * server.c (queue_stop_reply): Likewise.
1816         (start_inferior): Likewise.
1817         (queue_stop_reply_callback): Likewise.
1818         (handle_target_event): Likewise.
1819         * spu-low.c (fetch_ppc_memory): Likewise.
1820         (store_ppc_memory): Likewise.
1821         * target.c (set_target_ops): Likewise.
1822         * thread-db.c (thread_db_load_search): Likewise.
1823         (try_thread_db_load_1): Likewise.
1824         * tracepoint.c (add_tracepoint): Likewise.
1825         (add_tracepoint_action): Likewise.
1826         (create_trace_state_variable): Likewise.
1827         (cmd_qtdpsrc): Likewise.
1828         (cmd_qtro): Likewise.
1829         (add_while_stepping_state): Likewise.
1830         * win32-low.c (child_add_thread): Likewise.
1831         (get_image_name): Likewise.
1832
1833 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1834
1835         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1836
1837 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1838
1839         * Makefile.in (aarch64-linux.o): New rule.
1840         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1841         srv_tgtobj.
1842         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1843         (aarch64_init_debug_reg_state): Make it extern.
1844         (aarch64_linux_prepare_to_resume): Remove.
1845
1846 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1847
1848         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1849         lwp_arch_private_info and ptid_of_lwp.
1850
1851 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1852
1853         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1854         Find proc_info by find_process_pid.  All callers updated.
1855
1856 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1857
1858         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1859         Remove.
1860         (debug_reg_change_callback): Remove.
1861         (aarch64_notify_debug_reg_change): Remove.
1862
1863 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1864
1865         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1866         Call current_lwp_ptid.
1867
1868 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1869
1870         * linux-aarch64-low.c (debug_reg_change_callback): Use
1871         debug_printf.
1872
1873 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1874
1875         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1876
1877 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1878
1879         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1880
1881 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1882
1883         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1884         the code.
1885
1886 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1887
1888         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1889         Remove.
1890         (debug_reg_change_callback): Remove argument entry and add argument
1891         lwp.  Remove local variable thread.  Don't print thread id in the
1892         debugging output.  Don't check whether pid of thread equals to pid.
1893         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1894         iterate_over_lwps instead find_inferior.
1895
1896 2015-08-24  Pedro Alves  <palves@redhat.com>
1897
1898         * inferiors.c (get_first_process): New function.
1899         * inferiors.h (get_first_process): New declaration.
1900         * remote-utils.c (read_ptid): Default to the first process in the
1901         list, instead of to the current thread's process.
1902
1903 2015-08-24  Pedro Alves  <palves@redhat.com>
1904
1905         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1906         * event-loop.c: Likewise.
1907         * remote-utils.c: Likewise.
1908         * tracepoint.c: Likewise.
1909
1910 2015-08-24  Pedro Alves  <palves@redhat.com>
1911
1912         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1913         ptid_get_lwp.
1914
1915 2015-08-21  Pedro Alves  <palves@redhat.com>
1916
1917         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1918         instead of literal 1.
1919
1920 2015-08-21  Pedro Alves  <palves@redhat.com>
1921
1922         * tdesc.c (default_description): Explicitly zero-initialize.
1923
1924 2015-08-21  Pedro Alves  <palves@redhat.com>
1925
1926         PR gdb/18749
1927         * inferiors.c (remove_thread): Discard any pending stop reply for
1928         this thread.
1929         * server.c (remove_all_on_match_pid): Rename to ...
1930         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1931         instead of a pid.
1932         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1933         extern.
1934         (handle_v_kill, kill_inferior_callback, captured_main)
1935         (process_serial_event): Adjust.
1936         * server.h (discard_queued_stop_replies): Declare.
1937
1938 2015-08-21  Pedro Alves  <palves@redhat.com>
1939
1940         * linux-low.c (wait_for_sigstop): Always switch to no thread
1941         selected if the previously current thread dies.
1942         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1943         process instead of the current thread's.
1944         * remote-utils.c (input_interrupt): Don't check if there's no
1945         current thread.
1946         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1947         current thread to the general thread fails, error out.
1948         (handle_qxfer_auxv, handle_qxfer_libraries)
1949         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1950         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1951         (handle_query): Check if there's a thread selected instead of
1952         checking whether there's any thread in the thread list.
1953         (handle_qxfer_threads, handle_qxfer_btrace)
1954         (handle_qxfer_btrace_conf): Don't error out early if there's no
1955         thread in the thread list.
1956         (handle_v_cont, myresume): Don't set the current thread to the
1957         continue thread.
1958         (process_serial_event) <Hg handling>: Also set thread_id if the
1959         previous general thread is still alive.
1960         (process_serial_event) <g/G handling>: If setting the current
1961         thread to the general thread fails, error out.
1962         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1963         thread's lwp instead of the current thread's.
1964         * target.c (set_desired_thread): If the desired thread was not
1965         found, leave the current thread pointing to NULL.  Return an int
1966         (boolean) indicating success.
1967         * target.h (set_desired_thread): Change return type to int.
1968
1969 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1970
1971         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1972         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1973         #includes.
1974         (ps_get_thread_area): New function.
1975
1976 2015-08-19  Gary Benson  <gbenson@redhat.com>
1977
1978         * hostio.c (handle_pread): Do not attempt to read more data
1979         than hostio_reply_with_data can fit in a packet.
1980
1981 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1982
1983         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1984
1985 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1986
1987         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1988
1989 2015-08-06  Pedro Alves  <palves@redhat.com>
1990
1991         * tracepoint.c (expr_eval_result): Now an int.
1992
1993 2015-08-06  Pedro Alves  <palves@redhat.com>
1994
1995         * gdbthread.h (struct regcache): Forward declare.
1996         (struct thread_info) <regcache_data>: Now a struct regcache
1997         pointer.
1998         * inferiors.c (inferior_regcache_data)
1999         (set_inferior_regcache_data): Now work with struct regcache
2000         pointers.
2001         * inferiors.h (struct regcache): Forward declare.
2002         (inferior_regcache_data, set_inferior_regcache_data): Now work
2003         with struct regcache pointers.
2004         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
2005         (free_register_cache_thread): Remove struct regcache pointer
2006         casts.
2007
2008 2015-08-06  Pedro Alves  <palves@redhat.com>
2009
2010         * server.c (captured_main): On error, print the exception message
2011         to stderr, and if run_once is set, throw a quit.
2012
2013 2015-08-06  Pedro Alves  <palves@redhat.com>
2014
2015         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
2016         the current thread.
2017
2018 2015-08-06  Pedro Alves  <palves@redhat.com>
2019
2020         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
2021         reading beyond the passed in buffer length.
2022
2023 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
2024
2025         * tracepoint.c (symbol_list) <required>: Remove.
2026
2027 2015-08-06  Pedro Alves  <palves@redhat.com>
2028
2029         * linux-low.c (handle_extended_wait): Set the fork child's suspend
2030         count if stopping and suspending threads.
2031         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
2032         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
2033         (linux_detach): Complete an ongoing step-over.
2034         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
2035         throughout.
2036         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
2037         (linux_wait_1): If passing a signal to the inferior after
2038         finishing a step-over, unsuspend and re-resume all lwps.  If we
2039         see a single-step event but the thread should be continuing, don't
2040         pass the trap to gdb.
2041         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
2042         internal_error instead of gdb_assert.
2043         (enqueue_pending_signal): New function.
2044         (check_ptrace_stopped_lwp_gone): Add debug output.
2045         (start_step_over): Use internal_error instead of gdb_assert.
2046         (complete_ongoing_step_over): New function.
2047         (linux_resume_one_thread): Don't resume a suspended thread.
2048         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
2049         it stepping.
2050
2051 2015-08-06  Pedro Alves  <palves@redhat.com>
2052
2053         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
2054         (linux_thread_alive): Use lwp_is_marked_dead.
2055         (extended_event_reported): Delete.
2056         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
2057         instead of extended_event_reported.
2058         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
2059         as well.
2060         (lwp_is_marked_dead): New function.
2061         (lwp_running): Use lwp_is_marked_dead.
2062         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
2063         comment.
2064
2065 2015-08-06  Pedro Alves  <palves@redhat.com>
2066
2067         * linux-low.c (linux_wait_1): Move fork event output out of the
2068         !report_to_gdb check.  Pass event_child->waitstatus to
2069         target_waitstatus_to_string instead of ourstatus.
2070
2071 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2072
2073         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
2074         if current_thread is 32 bit.
2075
2076 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2077
2078         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
2079         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
2080         * server.c (extended_protocol): Remove "static".
2081         * server.h (extended_protocol): Declare it.
2082
2083 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2084
2085         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
2086         both aarch64 and aarch32.
2087         (aarch64_set_pc): Likewise.
2088
2089 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2090
2091         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
2092         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
2093         arm-with-neon.xml to srv_xmlfiles.
2094         * linux-aarch64-low.c: Include linux-aarch32-low.h.
2095         (is_64bit_tdesc): New function.
2096         (aarch64_linux_read_description): New function.
2097         (aarch64_arch_setup): Call aarch64_linux_read_description.
2098         (regs_info): Rename to regs_info_aarch64.
2099         (aarch64_regs_info): Return right regs_info.
2100         (initialize_low_arch): Call initialize_low_arch_aarch32.
2101
2102 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2103
2104         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
2105         * linux-aarch32-low.c: New file.
2106         * linux-aarch32-low.h: New file.
2107         * linux-arm-low.c (arm_fill_gregset): Move it to
2108         linux-aarch32-low.c.
2109         (arm_store_gregset): Likewise.
2110         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
2111         (arm_store_vfpregset): Call arm_store_vfpregset_num.
2112         (arm_arch_setup): Check if PTRACE_GETREGSET works.
2113         (regs_info): Rename to regs_info_arm.
2114         (arm_regs_info): Return regs_info_aarch32 if
2115         have_ptrace_getregset is 1 and target description is
2116         arm_with_neon or arm_with_vfpv3.
2117         (initialize_low_arch): Don't call init_registers_arm_with_neon.
2118         Call initialize_low_arch_aarch32 instead.
2119
2120 2015-08-04  Yao Qi  <yao.qi@linaro.org>
2121
2122         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
2123         * linux-low.c: ... here.
2124         * linux-low.h (have_ptrace_getregset): Declare it.
2125
2126 2015-08-04  Pedro Alves  <palves@redhat.com>
2127
2128         * thread-db.c (struct thread_db): Use new typedefs.
2129         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
2130         CHK calls.
2131         (disable_thread_event_reporting): Cast result of dlsym to
2132         destination function pointer type.
2133         (thread_db_mourn): Use td_ta_delete_ftype.
2134
2135 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
2136
2137         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
2138         arch variant.
2139         (CDX_BREAKPOINT): Define for R2.
2140         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
2141         (the_low_target): Add comments.
2142
2143 2015-07-30  Yao Qi  <yao.qi@linaro.org>
2144
2145         * linux-arm-low.c (arm_hwcap): Remove it.
2146         (arm_read_description): New local variable arm_hwcap.  Don't
2147         set arm_hwcap to zero.
2148
2149 2015-07-30  Yao Qi  <yao.qi@linaro.org>
2150
2151         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
2152         Use regcache->tdesc instead.
2153         (arm_store_wmmxregset): Likewise.
2154         (arm_fill_vfpregset): Likewise.
2155         (arm_store_vfpregset): Likewise.
2156
2157 2015-07-30  Yao Qi  <yao.qi@linaro.org>
2158
2159         * linux-arm-low.c: Include arch/arm.h.
2160         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
2161         (arm_store_gregset): Likewise.
2162
2163 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
2164
2165         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
2166         ptrace's 4th parameter.
2167
2168 2015-07-27  Yao Qi  <yao.qi@linaro.org>
2169
2170         * configure.srv (case aarch64*-*-linux*): Don't set
2171         srv_linux_usrregs.
2172
2173 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
2174
2175         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
2176         sys/ptrace.h.
2177         * linux-arm-low.c: Likewise.
2178         * linux-cris-low.c: Likewise.
2179         * linux-crisv32-low.c: Likewise.
2180         * linux-low.c: Likewise.
2181         * linux-m68k-low.c: Likewise.
2182         * linux-mips-low.c: Likewise.
2183         * linux-nios2-low.c: Likewise.
2184         * linux-s390-low.c: Likewise.
2185         * linux-sparc-low.c: Likewise.
2186         * linux-tic6x-low.c: Likewise.
2187         * linux-tile-low.c: Likewise.
2188         * linux-x86-low.c: Likewise.
2189
2190 2015-07-24  Pedro Alves  <palves@redhat.com>
2191
2192         * config.in: Regenerate.
2193         * configure: Regenerate.
2194
2195 2015-07-24  Pedro Alves  <palves@redhat.com>
2196
2197         * acinclude.m4: Include ../ptrace.m4.
2198         * configure.ac: Call GDB_AC_PTRACE.
2199         * config.in, configure: Regenerate.
2200
2201 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2202
2203         * linux-low.c (linux_create_inferior): Remove setting to
2204         proc->priv->new_inferior.
2205         (linux_attach): Likewise.
2206         (linux_low_filter_event): Likewise.
2207         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
2208
2209 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2210
2211         * linux-low.c (linux_arch_setup): New function.
2212         (linux_low_filter_event): If proc->tdesc is NULL and
2213         proc->attached is true, call the_low_target.arch_setup.
2214         Otherwise, keep status pending, and return.
2215         (linux_resume_one_lwp_throw): Don't call get_pc if
2216         thread->while_stepping isn't NULL.  Don't call
2217         get_thread_regcache if proc->tdesc is NULL.
2218         (need_step_over_p): Return 0 if proc->tdesc is NULL.
2219         (linux_target_ops): Install arch_setup.
2220         * server.c (start_inferior): Call the_target->arch_setup.
2221         * target.h (struct target_ops) <arch_setup>: New field.
2222         (target_arch_setup): New marco.
2223         * lynx-low.c (lynx_target_ops): Update.
2224         * nto-low.c (nto_target_ops): Update.
2225         * spu-low.c (spu_target_ops): Update.
2226         * win32-low.c (win32_target_ops): Update.
2227
2228 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2229
2230         * linux-low.c (linux_add_process): Don't set
2231         proc->priv->new_inferior.
2232         (linux_create_inferior): Set proc->priv->new_inferior to 1.
2233         (linux_attach): Likewise.
2234
2235 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2236
2237         * server.c (start_inferior): Code refactor.
2238
2239 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2240
2241         * server.c (process_serial_event): Set general_thread.
2242
2243 2015-07-21  Yao Qi  <yao.qi@linaro.org>
2244
2245         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
2246         aarch64_linux_get_debug_reg_capacity.
2247
2248 2015-07-17  Yao Qi  <yao.qi@linaro.org>
2249
2250         * Makefile.in (aarch64-linux-hw-point.o): New rule.
2251         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
2252         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
2253         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
2254         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
2255         (AARCH64_HWP_ALIGNMENT): Likewise.
2256         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
2257         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
2258         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
2259         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
2260         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
2261         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
2262         (struct aarch64_debug_reg_state): Likewise.
2263         (struct arch_lwp_info): Likewise.
2264         (aarch64_align_watchpoint): Likewise.
2265         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
2266         (aarch64_watchpoint_length): Likewise.
2267         (aarch64_point_encode_ctrl_reg): Likewise
2268         (aarch64_point_is_aligned): Likewise.
2269         (aarch64_align_watchpoint): Likewise.
2270         (aarch64_linux_set_debug_regs):
2271         (aarch64_dr_state_insert_one_point): Likewise.
2272         (aarch64_dr_state_remove_one_point): Likewise.
2273         (aarch64_handle_breakpoint): Likewise.
2274         (aarch64_handle_aligned_watchpoint): Likewise.
2275         (aarch64_handle_unaligned_watchpoint): Likewise.
2276         (aarch64_handle_watchpoint): Likewise.
2277
2278 2015-07-17  Yao Qi  <yao.qi@linaro.org>
2279
2280         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
2281         and don't aarch64_get_debug_reg_state.  All callers update.
2282         (aarch64_handle_aligned_watchpoint): Likewise.
2283         (aarch64_handle_unaligned_watchpoint): Likewise.
2284         (aarch64_handle_watchpoint): Likewise.
2285         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
2286         (aarch64_remove_point): Likewise.
2287
2288 2015-07-17  Yao Qi  <yao.qi@linaro.org>
2289
2290         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
2291         debug_printf.
2292         (aarch64_handle_unaligned_watchpoint): Likewise.
2293
2294 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
2295
2296         Revert the previous 3 commits:
2297         Move gdb_regex* to common/
2298         Move linux_find_memory_regions_full & co.
2299         gdbserver build-id attribute generator
2300
2301 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
2302             Jan Kratochvil  <jan.kratochvil@redhat.com>
2303
2304         gdbserver build-id attribute generator.
2305         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
2306         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
2307         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
2308         (find_phdr): New.
2309         (get_dynamic): Use find_pdhr to traverse program headers.
2310         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
2311         (compare_mapping_entry_range, struct find_memory_region_callback_data)
2312         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
2313         (get_hex_build_id): New.
2314         (linux_qxfer_libraries_svr4): Add optional build-id attribute
2315         to reply XML document.
2316
2317 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
2318             Jan Kratochvil  <jan.kratochvil@redhat.com>
2319
2320         * target.c: Include target/target-utils.h and fcntl.h.
2321         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
2322         (target_fileio_read_stralloc): New functions.
2323
2324 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
2325
2326         * Makefile.in (OBS): Add gdb_regex.o.
2327         (gdb_regex.o): New.
2328         * config.in: Rebuilt.
2329         * configure: Rebuilt.
2330
2331 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
2332             Jan Kratochvil  <jan.kratochvil@redhat.com>
2333
2334         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
2335         * Makefile.in (OBS): Add target-utils.o.
2336         (linux-maps.o, target-utils.o): New.
2337         * configure.srv (srv_linux_obj): Add linux-maps.o.
2338
2339 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
2340
2341         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
2342         function, return 1.
2343         (the_low_target): Install it.
2344
2345 2015-07-14  Pedro Alves  <palves@redhat.com>
2346
2347         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
2348         Instead, ignore ECHILD, and throw an error for other errnos.
2349
2350 2015-07-10  Pedro Alves  <palves@redhat.com>
2351
2352         * event-loop.c (struct callback_event) <data>: Change type to
2353         gdb_client_data instance instead of gdb_client_data pointer.
2354         (append_callback_event): Adjust.
2355
2356 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
2357
2358         * linux-aarch64-low.c: Add comments for each linux_target_ops
2359         method.  Remove comments already covered in target_ops and
2360         linux_target_ops definitions.
2361         (the_low_target): Add comments for each unimplemented method.
2362
2363 2015-07-09  Yao Qi  <yao.qi@linaro.org>
2364
2365         * linux-aarch64-low.c (aarch64_regmap): Remove.
2366         (aarch64_usrregs_info): Remove.
2367         (regs_info): Set field usrregs to NULL.
2368
2369 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
2370
2371         * linux-low.c: Include "rsp-low.h"
2372         (linux_low_encode_pt_config, linux_low_encode_raw): New.
2373         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
2374         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
2375         (handle_btrace_enable_pt): New.
2376         (handle_btrace_general_set): Support "pt".
2377         (handle_btrace_conf_general_set): Support "pt:size".
2378
2379 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
2380
2381         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
2382         Z_PACKET_SW_BP.
2383
2384 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
2385
2386         * linux-aarch64-low.c: Remove comment about endianness.
2387         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
2388         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
2389         memcmp.
2390
2391 2015-06-24  Gary Benson  <gbenson@redhat.com>
2392
2393         * linux-i386-ipa.c (stdint.h): Do not include.
2394         * lynx-i386-low.c (stdint.h): Likewise.
2395         * lynx-ppc-low.c (stdint.h): Likewise.
2396         * mem-break.c (stdint.h): Likewise.
2397         * thread-db.c (stdint.h): Likewise.
2398         * tracepoint.c (stdint.h): Likewise.
2399         * win32-low.c (stdint.h): Likewise.
2400
2401 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
2402
2403         * server.c (write_qxfer_response): Update call to
2404         remote_escape_output.
2405
2406 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
2407             Jan Kratochvil  <jan.kratochvil@redhat.com>
2408
2409         Merge multiple hex conversions.
2410         * gdbreplay.c (tohex): Rename to 'fromhex'.
2411         (logchar): Use fromhex.
2412
2413 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
2414
2415         * server.c (handle_qxfer_libraries): Set `version' attribute for
2416         <library-list>.
2417
2418 2015-06-10  Gary Benson  <gbenson@redhat.com>
2419
2420         * target.h (struct target_ops) <multifs_open>: New field.
2421         <multifs_unlink>: Likewise.
2422         <multifs_readlink>: Likewise.
2423         * linux-low.c (nat/linux-namespaces.h): New include.
2424         (linux_target_ops): Initialize the_target->multifs_open,
2425         the_target->multifs_unlink and the_target->multifs_readlink.
2426         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
2427         * hostio.c (hostio_fs_pid): New static variable.
2428         (hostio_handle_new_gdb_connection): New function.
2429         (handle_setfs): Likewise.
2430         (handle_open): Use the_target->multifs_open as appropriate.
2431         (handle_unlink): Use the_target->multifs_unlink as appropriate.
2432         (handle_readlink): Use the_target->multifs_readlink as
2433         appropriate.
2434         (handle_vFile): Handle vFile:setfs packets.
2435         * server.c (handle_query): Call hostio_handle_new_gdb_connection
2436         after target_handle_new_gdb_connection.
2437
2438 2015-06-10  Gary Benson  <gbenson@redhat.com>
2439
2440         * configure.ac (AC_CHECK_FUNCS): Add setns.
2441         * config.in: Regenerate.
2442         * configure: Likewise.
2443         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
2444         (linux-namespaces.o): New rule.
2445         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
2446
2447 2015-06-09  Gary Benson <gbenson@redhat.com>
2448
2449         * hostio.c (handle_open): Process mode argument with
2450         fileio_to_host_mode.
2451
2452 2015-06-01  Yao Qi  <yao.qi@linaro.org>
2453
2454         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
2455         * linux-x86-low.c: Likewise.
2456
2457 2015-05-28  Don Breazeal  <donb@codesourcery.com>
2458
2459         * linux-low.c (handle_extended_wait): Initialize
2460         thread_info.last_resume_kind for new fork children.
2461
2462 2015-05-15  Pedro Alves  <palves@redhat.com>
2463
2464         * target.h (target_handle_new_gdb_connection): Rewrite using if
2465         wrapped in do/while.
2466
2467 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
2468
2469         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
2470         * configure, config.in: Regenerate.
2471         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
2472         Declare typedef.
2473
2474 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2475
2476         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
2477         PTRACE_EVENT_VFORK_DONE.
2478         (linux_low_ptrace_options, extended_event_reported): Add vfork
2479         events.
2480         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
2481         and "vforkdone" for RSP 'T' Stop Reply Packet.
2482         * server.h (report_vfork_events): Declare
2483         global variable.
2484
2485 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2486
2487         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
2488         (the_low_target) <new_fork>: Initialize new member.
2489         * linux-arm-low.c (arm_new_fork): New function.
2490         (the_low_target) <new_fork>: Initialize new member.
2491         * linux-low.c (handle_extended_wait): Call new target function
2492         new_fork.
2493         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
2494         * linux-mips-low.c (mips_add_watchpoint): New function
2495         extracted from mips_insert_point.
2496         (the_low_target) <new_fork>: Initialize new member.
2497         (mips_linux_new_fork): New function.
2498         (mips_insert_point): Call mips_add_watchpoint.
2499         * linux-x86-low.c (x86_linux_new_fork): New function.
2500         (the_low_target) <new_fork>: Initialize new member.
2501
2502 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2503
2504         * linux-low.c (handle_extended_wait): Implement return value,
2505         rename argument 'event_child' to 'event_lwp', handle
2506         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
2507         (linux_low_ptrace_options): New function.
2508         (linux_low_filter_event): Call linux_low_ptrace_options,
2509         use different argument fo linux_enable_event_reporting,
2510         use return value from handle_extended_wait.
2511         (extended_event_reported): New function.
2512         (linux_wait_1): Call extended_event_reported and set
2513         status to report fork events.
2514         (linux_write_memory): Add pid to debug message.
2515         (reset_lwp_ptrace_options_callback): New function.
2516         (linux_handle_new_gdb_connection): New function.
2517         (linux_target_ops): Initialize new structure member.
2518         * linux-low.h (struct lwp_info) <waitstatus>: New member.
2519         * lynx-low.c: Initialize new structure member.
2520         * remote-utils.c (prepare_resume_reply): Implement stop reason
2521         "fork" for "T" stop message.
2522         * server.c (handle_query): Call handle_new_gdb_connection.
2523         * server.h (report_fork_events): Declare global flag.
2524         * target.h (struct target_ops) <handle_new_gdb_connection>:
2525         New member.
2526         (target_handle_new_gdb_connection): New macro.
2527         * win32-low.c: Initialize new structure member.
2528
2529 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2530
2531         * mem-break.c (APPEND_TO_LIST): Define macro.
2532         (clone_agent_expr): New function.
2533         (clone_one_breakpoint): New function.
2534         (clone_all_breakpoints): New function.
2535         * mem-break.h: Declare new functions.
2536
2537 2015-05-12  Don Breazeal  <donb@codesourcery.com>
2538
2539         * linux-low.c (linux_supports_fork_events): New function.
2540         (linux_supports_vfork_events): New function.
2541         (linux_target_ops): Initialize new structure members.
2542         (initialize_low): Call linux_check_ptrace_features.
2543         * lynx-low.c (lynx_target_ops): Initialize new structure
2544         members.
2545         * server.c (report_fork_events, report_vfork_events):
2546         New global flags.
2547         (handle_query): Add new features to qSupported packet and
2548         response.
2549         (captured_main): Initialize new global variables.
2550         * target.h (struct target_ops) <supports_fork_events>:
2551         New member.
2552         <supports_vfork_events>: New member.
2553         (target_supports_fork_events): New macro.
2554         (target_supports_vfork_events): New macro.
2555         * win32-low.c (win32_target_ops): Initialize new structure
2556         members.
2557
2558 2015-05-12  Gary Benson <gbenson@redhat.com>
2559
2560         * server.c (handle_qxfer_exec_file): Use current process
2561         if annex is empty.
2562
2563 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
2564
2565         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
2566         Remove HAVE_PTRACE_GETREGS conditionals.
2567         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
2568         instead of PTRACE_GETREGS and PTRACE_SETREGS.
2569
2570 2015-05-08  Yao Qi  <yao.qi@linaro.org>
2571
2572         * linux-low.c (linux_supports_conditional_breakpoints): New
2573         function.
2574         (linux_target_ops): Install new target method.
2575         * lynx-low.c (lynx_target_ops): Install NULL hook for
2576         supports_conditional_breakpoints.
2577         * nto-low.c (nto_target_ops): Likewise.
2578         * spu-low.c (spu_target_ops): Likewise.
2579         * win32-low.c (win32_target_ops): Likewise.
2580         * server.c (handle_query): Check
2581         target_supports_conditional_breakpoints.
2582         * target.h (struct target_ops) <supports_conditional_breakpoints>:
2583         New field.
2584         (target_supports_conditional_breakpoints): New macro.
2585
2586 2015-05-06  Pedro Alves  <palves@redhat.com>
2587
2588         PR server/18081
2589         * server.c (start_inferior): If the process exits, mourn it.
2590
2591 2015-04-21  Gary Benson <gbenson@redhat.com>
2592
2593         * hostio.c (fileio_open_flags_to_host): Factored out to
2594         fileio_to_host_openflags in common/fileio.c.  Single use
2595         updated.
2596
2597 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
2598
2599         * linux-xtensa-low.c (xtensa_fill_gregset)
2600         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
2601         XCHAL_HAVE_LOOP.
2602
2603 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
2604
2605         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
2606         (regs_info): Replace usrregs pointer with NULL.
2607
2608 2015-04-17  Gary Benson  <gbenson@redhat.com>
2609
2610         * target.h (struct target_ops) <pid_to_exec_file>: New field.
2611         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
2612         * server.c (handle_qxfer_exec_file): New function.
2613         (qxfer_packets): Add exec-file entry.
2614         (handle_query): Report qXfer:exec-file:read as supported packet.
2615
2616 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
2617
2618         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
2619
2620 2015-04-09  Gary Benson <gbenson@redhat.com>
2621
2622         * hostio-errno.c (errno_to_fileio_error): Remove function.
2623         Update caller to use remote_fileio_to_fio_error.
2624
2625 2015-04-09  Yao Qi  <yao.qi@linaro.org>
2626
2627         * linux-low.c (linux_insert_point): Call
2628         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
2629         (linux_remove_point): Call remove_memory_breakpoint if type is
2630         raw_bkpt_type_sw.
2631         * linux-x86-low.c (x86_insert_point): Don't call
2632         insert_memory_breakpoint.
2633         (x86_remove_point): Don't call remove_memory_breakpoint.
2634
2635 2015-04-01  Pedro Alves  <palves@redhat.com>
2636             Cleber Rosa  <crosa@redhat.com>
2637
2638         * server.c (gdbserver_usage): Reorganize and extend the usage
2639         message.
2640
2641 2015-03-24  Pedro Alves  <palves@redhat.com>
2642
2643         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
2644         output.  Also dump TRAP_TRACE.
2645         (linux_low_filter_event): In debug output, distinguish a
2646         resume_stop SIGSTOP from a delayed SIGSTOP.
2647
2648 2015-03-24  Gary Benson  <gbenson@redhat.com>
2649
2650         * linux-x86-low.c (x86_linux_new_thread): Moved to
2651         nat/x86-linux.c.
2652         (x86_linux_prepare_to_resume): Likewise.
2653
2654 2015-03-24  Gary Benson  <gbenson@redhat.com>
2655
2656         * Makefile.in (x86-linux-dregs.o): New rule.
2657         * configure.srv: Add x86-linux-dregs.o to relevant targets.
2658         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
2659         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
2660         (x86_linux_dr_get): Likewise.
2661         (x86_linux_dr_set): Likewise.
2662         (update_debug_registers_callback): Likewise.
2663         (x86_linux_dr_set_addr): Likewise.
2664         (x86_linux_dr_get_addr): Likewise.
2665         (x86_linux_dr_set_control): Likewise.
2666         (x86_linux_dr_get_control): Likewise.
2667         (x86_linux_dr_get_status): Likewise.
2668         (x86_linux_update_debug_registers): Likewise.
2669
2670 2015-03-24  Gary Benson  <gbenson@redhat.com>
2671
2672         * linux-x86-low.c (x86_linux_update_debug_registers):
2673         New function, factored out from...
2674         (x86_linux_prepare_to_resume): ...this.
2675
2676 2015-03-24  Gary Benson  <gbenson@redhat.com>
2677
2678         * linux-x86-low.c (x86_linux_dr_get): Update comments.
2679         (x86_linux_dr_set): Likewise.
2680         (update_debug_registers_callback): Likewise.
2681         (x86_linux_dr_set_addr): Likewise.
2682         (x86_linux_dr_get_addr): Likewise.
2683         (x86_linux_dr_set_control): Likewise.
2684         (x86_linux_dr_get_control): Likewise.
2685         (x86_linux_dr_get_status): Likewise.
2686         (x86_linux_prepare_to_resume): Likewise.
2687
2688 2015-03-24  Gary Benson  <gbenson@redhat.com>
2689
2690         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
2691         Use perror_with_name.  Pass string through gettext.
2692         (x86_linux_dr_set): Likewise.
2693
2694 2015-03-24  Gary Benson  <gbenson@redhat.com>
2695
2696         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
2697         (x86_linux_dr_set_addr): ...this.
2698         (x86_dr_low_get_addr): Rename to...
2699         (x86_linux_dr_get_addr): ...this.
2700         (x86_dr_low_set_control): Rename to...
2701         (x86_linux_dr_set_control): ...this.
2702         (x86_dr_low_get_control): Rename to...
2703         (x86_linux_dr_get_control): ...this.
2704         (x86_dr_low_get_status): Rename to...
2705         (x86_linux_dr_get_status): ...this.
2706         (x86_dr_low): Update with new function names.
2707
2708 2015-03-24  Gary Benson  <gbenson@redhat.com>
2709
2710         * Makefile.in (x86-linux.o): New rule.
2711         * configure.srv: Add x86-linux.o to relevant targets.
2712         * linux-low.c (lwp_set_arch_private_info): New function.
2713         (lwp_arch_private_info): Likewise.
2714         * linux-x86-low.c: Include nat/x86-linux.h.
2715         (arch_lwp_info): Removed structure.
2716         (update_debug_registers_callback):
2717         Use lwp_set_debug_registers_changed.
2718         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
2719         and lwp_set_debug_registers_changed.
2720         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2721
2722 2015-03-24  Gary Benson  <gbenson@redhat.com>
2723
2724         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
2725         * linux-arm-low.c (arm_new_thread): Likewise.
2726         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
2727         * linux-mips-low.c (mips_linux_new_thread): Likewise.
2728         * linux-x86-low.c (x86_linux_new_thread): Likewise.
2729         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
2730
2731 2015-03-24  Gary Benson  <gbenson@redhat.com>
2732
2733         * linux-low.c (ptid_of_lwp): New function.
2734         (lwp_is_stopped): Likewise.
2735         (lwp_stop_reason): Likewise.
2736         * linux-x86-low.c (update_debug_registers_callback):
2737         Use lwp_is_stopped.
2738         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
2739         lwp_stop_reason.
2740
2741 2015-03-24  Gary Benson  <gbenson@redhat.com>
2742
2743         * linux-low.h (linux_stop_lwp): Remove declaration.
2744
2745 2015-03-24  Gary Benson  <gbenson@redhat.com>
2746
2747         * linux-low.h: Include nat/linux-nat.h.
2748         * linux-low.c (iterate_over_lwps_args): New structure.
2749         (iterate_over_lwps_filter): New function.
2750         (iterate_over_lwps): Likewise.
2751         * linux-x86-low.c (update_debug_registers_callback):
2752         Update signature to what iterate_over_lwps expects.
2753         Remove PID check that iterate_over_lwps now performs.
2754         (x86_dr_low_set_addr): Use iterate_over_lwps.
2755         (x86_dr_low_set_control): Likewise.
2756
2757 2015-03-24  Gary Benson  <gbenson@redhat.com>
2758
2759         * linux-x86-low.c (x86_debug_reg_state): New function.
2760         (x86_linux_prepare_to_resume): Use the above.
2761
2762 2015-03-24  Gary Benson  <gbenson@redhat.com>
2763
2764         * linux-low.c (current_lwp_ptid): New function.
2765         * linux-x86-low.c: Include nat/linux-nat.h.
2766         (x86_dr_low_get_addr): Use current_lwp_ptid.
2767         (x86_dr_low_get_control): Likewise.
2768         (x86_dr_low_get_status): Likewise.
2769
2770 2015-03-20  Pedro Alves  <palves@redhat.com>
2771
2772         * tracepoint.c (cmd_qtstatus): Make "str" const.
2773
2774 2015-03-20  Pedro Alves  <palves@redhat.com>
2775
2776         * server.c (handle_general_set): Make "req_str" const.
2777
2778 2015-03-19  Pedro Alves  <palves@redhat.com>
2779
2780         * linux-low.c (linux_resume_one_lwp): Rename to ...
2781         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
2782         instead call perror_with_name.
2783         (check_ptrace_stopped_lwp_gone): New function.
2784         (linux_resume_one_lwp): Reimplement as wrapper around
2785         linux_resume_one_lwp_throw that swallows errors if the LWP is
2786         gone.
2787
2788 2015-03-19  Pedro Alves  <palves@redhat.com>
2789
2790         * linux-low.c (count_events_callback, select_event_lwp_callback):
2791         No longer check whether the thread has resume_stop as last resume
2792         kind.
2793
2794 2015-03-19 Pedro Alves  <palves@redhat.com>
2795
2796         * linux-low.c (count_events_callback, select_event_lwp_callback):
2797         Use the lwp's status_pending_p field, not the thread's.
2798
2799 2015-03-19  Pedro Alves  <palves@redhat.com>
2800
2801         * linux-low.c (select_event_lwp_callback): Update comments to
2802         no longer mention SIGTRAP.
2803
2804 2015-03-18  Gary Benson  <gbenson@redhat.com>
2805
2806         * server.c (handle_query): Do not report vFile:fstat as supported.
2807
2808 2015-03-11  Gary Benson  <gbenson@redhat.com>
2809
2810         * hostio.c (sys/types.h): New include.
2811         (sys/stat.h): Likewise.
2812         (common-remote-fileio.h): Likewise.
2813         (handle_fstat): New function.
2814         (handle_vFile): Handle vFile:fstat packets.
2815
2816 2015-03-11  Gary Benson  <gbenson@redhat.com>
2817
2818         * configure.ac (AC_CHECK_MEMBERS): Add checks for
2819         struct stat.st_blocks and struct stat.st_blksize.
2820         * configure: Regenerate.
2821         * config.in: Likewise.
2822         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
2823         (OBS): Add common-remote-fileio.o.
2824         (common-remote-fileio.o): New rule.
2825
2826 2015-03-09  Pedro Alves  <palves@redhat.com>
2827
2828         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2829         'struct sockaddr' pointer in 'accept' call.
2830
2831 2015-03-09  Pedro Alves  <palves@redhat.com>
2832
2833         Revert:
2834         2015-03-07  Pedro Alves  <palves@redhat.com>
2835         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2836         or <winsock2.h> here.  Instead include "gdb_socket.h".
2837         (remote_open): Use union gdb_sockaddr_u.
2838         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2839         or <winsock2.h> here.  Instead include "gdb_socket.h".
2840         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2841         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2842         or <sys/un.h>.
2843         (init_named_socket, gdb_agent_helper_thread): Use union
2844         gdb_sockaddr_u.
2845
2846 2015-03-07  Pedro Alves  <palves@redhat.com>
2847
2848         * configure.ac (build_warnings): Move
2849         -Wdeclaration-after-statement to the C-specific set.
2850         * configure: Regenerate.
2851
2852 2015-03-07  Pedro Alves  <palves@redhat.com>
2853
2854         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2855         or <winsock2.h> here.  Instead include "gdb_socket.h".
2856         (remote_open): Use union gdb_sockaddr_u.
2857         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2858         or <winsock2.h> here.  Instead include "gdb_socket.h".
2859         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2860         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2861         or <sys/un.h>.
2862         (init_named_socket, gdb_agent_helper_thread): Use union
2863         gdb_sockaddr_u.
2864
2865 2015-03-07  Pedro Alves  <palves@redhat.com>
2866
2867         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2868         instead.
2869
2870 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2871
2872         * linux-aarch64-low.c (aarch64_insert_point): Use
2873         show_debug_regs as a boolean.
2874         (aarch64_remove_point): Likewise.
2875
2876 2015-03-05  Pedro Alves  <palves@redhat.com>
2877
2878         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2879         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2880         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2881         * nto-low.c (nto_target_ops): Likewise.
2882         * spu-low.c (spu_target_ops): Likewise.
2883         * win32-low.c (win32_target_ops): Likewise.
2884
2885 2015-03-04  Pedro Alves  <palves@redhat.com>
2886
2887         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2888         Decide whether a breakpoint triggered based on the SIGTRAP's
2889         siginfo.si_code.
2890         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2891         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2892         (linux_low_filter_event): Check for breakpoints before checking
2893         watchpoints.
2894         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2895         siginfo.si_code.
2896         (linux_stopped_by_sw_breakpoint)
2897         (linux_supports_stopped_by_sw_breakpoint)
2898         (linux_stopped_by_hw_breakpoint)
2899         (linux_supports_stopped_by_hw_breakpoint): New functions.
2900         (linux_target_ops): Install new target methods.
2901
2902 2015-03-04  Pedro Alves  <palves@redhat.com>
2903
2904         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2905         * server.c (swbreak_feature, hwbreak_feature): New globals.
2906         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2907         (captured_main): Clear swbreak_feature and hwbreak_feature.
2908         * server.h (swbreak_feature, hwbreak_feature): Declare.
2909         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2910         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2911         supports_stopped_by_hw_breakpoint>: New fields.
2912         (target_supports_stopped_by_sw_breakpoint)
2913         (target_stopped_by_sw_breakpoint)
2914         (target_supports_stopped_by_hw_breakpoint)
2915         (target_stopped_by_hw_breakpoint): Declare.
2916
2917 2015-03-04  Pedro Alves  <palves@redhat.com>
2918
2919         enum lwp_stop_reason -> enum target_stop_reason
2920         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2921         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2922         (linux_wait_1, stuck_in_jump_pad_callback)
2923         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2924         (linux_stopped_by_watchpoint):
2925         * linux-low.h (enum lwp_stop_reason): Delete.
2926         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2927         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2928
2929 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2930
2931         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2932
2933 2015-03-03  Gary Benson  <gbenson@redhat.com>
2934
2935         * hostio.c (handle_vFile): Fix prefix lengths.
2936
2937 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2938
2939         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2940         ptr_bits.
2941
2942 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2943
2944         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2945         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2946         (clean): Add "rm -f" for above C files.
2947         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2948         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2949         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2950         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2951         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2952         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2953         (init_registers_s390x_vx_linux64)
2954         (init_registers_s390x_tevx_linux64)
2955         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2956         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2957         declarations.
2958         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2959         (s390_store_vxrs_high): New functions.
2960         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2961         NT_S390_VXRS_HIGH.
2962         (s390_arch_setup): Add logic for selecting one of the new target
2963         descriptions.  Activate the new vector regsets if applicable.
2964         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2965         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2966         and init_registers_s390x_tevx_linux64.
2967
2968 2015-03-01  Pedro Alves  <palves@redhat.com>
2969
2970         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2971         parameter.
2972
2973 2015-02-27  Pedro Alves  <palves@redhat.com>
2974
2975         * linux-x86-low.c (u_debugreg_offset): New function.
2976         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2977
2978 2015-02-27  Pedro Alves  <palves@redhat.com>
2979
2980         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2981         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2982         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2983         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2984         (ps_lsetfpregs, ps_getpid)
2985         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2986         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2987         (ps_lsetxregs, ps_plog): Declare.
2988
2989 2015-02-27  Pedro Alves  <palves@redhat.com>
2990
2991         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2992         IP_AGENT_EXPORT_FUNC.
2993         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2994         IP_AGENT_EXPORT_FUNC.
2995         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2996         (IP_AGENT_EXPORT): Delete.
2997         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2998         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2999         (gdb_trampoline_buffer_error, collecting, gdb_collect)
3000         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
3001         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
3002         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
3003         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
3004         (traceframe_read_count, traceframe_write_count)
3005         (traceframes_created, trace_state_variables, get_raw_reg)
3006         (get_trace_state_variable_value, set_trace_state_variable_value)
3007         (ust_loaded, helper_thread_id, cmd_buf): Use
3008         IPA_SYM_EXPORTED_NAME.
3009         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
3010         (tracepoints) Use IP_AGENT_EXPORT_VAR.
3011         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
3012         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
3013         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
3014         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
3015         EXTERN_C_PUSH/EXTERN_C_POP.
3016         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
3017         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
3018         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
3019         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
3020         (traceframe_write_count, traceframe_read_count)
3021         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
3022         (about_to_request_buffer_space, get_trace_state_variable_value)
3023         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
3024         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
3025         EXTERN_C_PUSH/EXTERN_C_POP.
3026         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
3027         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
3028         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
3029         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
3030         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
3031         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
3032         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
3033         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
3034         Define.
3035         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
3036         (IP_AGENT_EXPORT_VAR_DECL): Define.
3037         (tracing): Declare.
3038         (gdb_agent_get_raw_reg): Declare.
3039
3040 2015-02-27  Tom Tromey  <tromey@redhat.com>
3041             Pedro Alves  <palves@redhat.com>
3042
3043         Rename symbols whose names are reserved C++ keywords throughout.
3044
3045 2015-02-27  Pedro Alves  <palves@redhat.com>
3046
3047         * Makefile.in (COMPILER): New, get it from autoconf.
3048         (CXX): Get from autoconf instead.
3049         (COMPILE.pre): Use COMPILER.
3050         (CC-LD): Rename to ...
3051         (CC_LD): ... this.  Use COMPILER.
3052         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
3053         (CXX_FOR_TARGET): Default to g++ instead of gcc.
3054         * acinclude.m4: Include build-with-cxx.m4.
3055         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
3056         Disable -Werror by default if building in C++ mode.
3057         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
3058         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
3059         the C++ compiler.  Save/restore CXXFLAGS too.
3060         * configure: Regenerate.
3061
3062 2015-02-27  Pedro Alves  <palves@redhat.com>
3063
3064         * acinclude.m4: Include libiberty.m4.
3065         * configure.ac: Call libiberty_INIT.
3066         * config.in, configure: Regenerate.
3067
3068 2015-02-26  Pedro Alves  <palves@redhat.com>
3069
3070         * linux-low.c (linux_wait_1): When incrementing the PC past a
3071         program breakpoint always use the_low_target.breakpoint_len as
3072         increment, rather than the maximum between that and
3073         the_low_target.decr_pc_after_break.
3074
3075 2015-02-23  Pedro Alves  <palves@redhat.com>
3076
3077         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
3078         thread was doing a step-over; always adjust the PC if
3079         we stepped over a permanent breakpoint.
3080         (linux_wait_1): If we stepped over breakpoint that was on top of a
3081         permanent breakpoint, manually advance the PC past it.
3082
3083 2015-02-23  Pedro Alves  <palves@redhat.com>
3084
3085         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
3086         modes.
3087         (x86_fill_gregset, x86_store_gregset): Use it when handling
3088         $orig_eax.
3089
3090 2015-02-20  Pedro Alves  <palves@redhat.com>
3091
3092         * thread-db.c: Include "nat/linux-procfs.h".
3093         (thread_db_init): Skip listing new threads if the kernel supports
3094         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
3095
3096 2015-02-20  Pedro Alves  <palves@redhat.com>
3097
3098         * linux-low.c (status_pending_p_callback): Use ptid_match.
3099
3100 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
3101
3102         PR breakpoints/16812
3103         * linux-low.c (wstatus_maybe_breakpoint): Remove.
3104         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
3105         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
3106
3107 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
3108
3109         PR breakpoints/15956
3110         * tracepoint.c (cmd_qtinit): Add check for current_thread.
3111
3112 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
3113
3114         * linux-low.c (linux_low_btrace_conf): Print size.
3115         * server.c (handle_btrace_conf_general_set): New.
3116         (hanle_general_set): Call handle_btrace_conf_general_set.
3117         (handle_query): Report Qbtrace-conf:bts:size as supported.
3118
3119 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
3120
3121         * linux-low.c (linux_low_enable_btrace): Update parameters.
3122         (linux_low_btrace_conf): New.
3123         (linux_target_ops)<to_btrace_conf>: Initialize.
3124         * server.c (current_btrace_conf): New.
3125         (handle_btrace_enable): Rename to ...
3126         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
3127         to target_enable_btrace.  Update comment.  Update users.
3128         (handle_qxfer_btrace_conf): New.
3129         (qxfer_packets): Add btrace-conf entry.
3130         (handle_query): Report qXfer:btrace-conf:read as supported packet.
3131         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
3132         (target_ops)<read_btrace_conf>: New.
3133         (target_enable_btrace): Update parameters.
3134         (target_read_btrace_conf): New.
3135
3136 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
3137
3138         * server.c (handle_btrace_general_set): Remove call to
3139         target_supports_btrace.
3140         (supported_btrace_packets): New.
3141         (handle_query): Call supported_btrace_packets.
3142         * target.h: include btrace-common.h.
3143         (btrace_target_info): Removed.
3144         (supports_btrace, target_supports_btrace): Update parameters.
3145
3146 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
3147
3148         * Makefile.in (SFILES): Add common/btrace-common.c.
3149         (OBS): Add common/btrace-common.o.
3150         (btrace-common.o): Add build rules.
3151         * linux-low: Include btrace-common.h.
3152         (linux_low_read_btrace): Use struct btrace_data.  Call
3153         btrace_data_init and btrace_data_fini.
3154
3155 2015-02-06  Pedro Alves  <palves@redhat.com>
3156
3157         * thread-db.c (find_new_threads_callback): Add debug output.
3158
3159 2015-02-04  Pedro Alves  <palves@redhat.com>
3160
3161         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
3162         (resume_stopped_resumed_lwps): New function.
3163         (linux_wait_for_event_filtered): Use it.
3164
3165 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
3166
3167         * Makefile.in (SFILES): Add linux-personality.c.
3168         (linux-personality.o): New rule.
3169         * configure.srv (srv_linux_obj): Add linux-personality.o to the
3170         list of objects to be built.
3171         * linux-low.c: Include nat/linux-personality.h.
3172         (linux_create_inferior): Remove code to disable address space
3173         randomization (moved to ../nat/linux-personality.c).  Create
3174         cleanup to disable address space randomization.
3175
3176 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
3177
3178         * Makefile.in (posix-strerror.o): New rule.
3179         (mingw-strerror.o): Likewise.
3180         * configure: Regenerated.
3181         * configure.ac: Source file ../common/common.host.  Initialize new
3182         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
3183
3184 2015-01-14  Yao Qi  <yao@codesourcery.com>
3185
3186         * Makefile.in (SFILES): Add nat/ppc-linux.c.
3187         (ppc-linux.o): New rule.
3188         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
3189         * configure.ac: AC_CHECK_FUNCS(getauxval).
3190         * config.in: Re-generated.
3191         * configure: Re-generated.
3192         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
3193         ppc64_64bit_inferior_p
3194
3195 2015-01-14  Yao Qi  <yao@codesourcery.com>
3196
3197         * linux-ppc-low.c: Include "nat/ppc-linux.h".
3198          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
3199         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
3200         (PT_ORIG_R3, PT_TRAP): Likewise.
3201         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
3202         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
3203         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
3204
3205 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
3206
3207         * i387-fp.c (i387_cache_to_xsave): In look over
3208         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
3209         zmmh_low_space field by use of zmmh_high_space.
3210
3211 2015-01-09  Pedro Alves  <palves@redhat.com>
3212
3213         * linux-low.c (step_over_bkpt): Move higher up in the file.
3214         (handle_extended_wait): Don't store the stop_pc here.
3215         (get_stop_pc): Adjust comments and rename to ...
3216         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
3217         stopped for a software breakpoint or hardware breakpoint.
3218         (thread_still_has_status_pending_p): New function.
3219         (status_pending_p_callback): Use
3220         thread_still_has_status_pending_p.  If the event is no longer
3221         interesting, resume the LWP.
3222         (handle_tracepoints): Add assert.
3223         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
3224         (wstatus_maybe_breakpoint): New function.
3225         (cancel_breakpoint): Delete function.
3226         (check_stopped_by_watchpoint): New function, factored out from
3227         linux_low_filter_event.
3228         (lp_status_maybe_breakpoint): Delete function.
3229         (linux_low_filter_event): Remove filter_ptid argument.
3230         Leave thread group exits pending here.  Store the LWP's stop PC.
3231         Always leave events pending.
3232         (linux_wait_for_event_filtered): Pull all events out of the
3233         kernel, and leave them all pending.
3234         (count_events_callback, select_event_lwp_callback): Consider all
3235         events.
3236         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
3237         (select_event_lwp): Only give preference to the stepping LWP in
3238         all-stop mode.  Adjust comments.
3239         (ignore_event): New function.
3240         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
3241         references to cancel_breakpoints.  Adjust to renames.  Also give
3242         equal priority to all LWPs that have had events in non-stop mode.
3243         If reporting a software breakpoint event, unadjust the LWP's PC.
3244         (linux_wait): If linux_wait_1 returned an ignored event, retry.
3245         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
3246         Adjust.
3247         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
3248         (resume_status_pending_p): Use thread_still_has_status_pending_p.
3249         (linux_stopped_by_watchpoint): Adjust.
3250         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
3251         * linux-low.h (enum lwp_stop_reason): New.
3252         (struct lwp_info) <stop_pc>: Adjust comment.
3253         <stopped_by_watchpoint>: Delete field.
3254         <stop_reason>: New field.
3255         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
3256         * mem-break.c (software_breakpoint_inserted_here)
3257         (hardware_breakpoint_inserted_here): New function.
3258         * mem-break.h (software_breakpoint_inserted_here)
3259         (hardware_breakpoint_inserted_here): Declare.
3260         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
3261         (cancel_breakpoints): Delete.
3262         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
3263         (upload_fast_traceframes): Remove references to
3264         cancel_breakpoints.
3265
3266 2015-01-09  Pedro Alves  <palves@redhat.com>
3267
3268         * thread-db.c (find_new_threads_callback): Ignore thread if the
3269         kernel thread ID is -1.
3270
3271 2015-01-09  Pedro Alves  <palves@redhat.com>
3272
3273         * linux-low.c (linux_attach_fail_reason_string): Move to
3274         nat/linux-ptrace.c, and rename.
3275         (linux_attach_lwp): Update comment.
3276         (attach_proc_task_lwp_callback): New function.
3277         (linux_attach): Adjust to rename and use
3278         linux_proc_attach_tgid_threads.
3279         (linux_attach_fail_reason_string): Delete declaration.
3280
3281 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
3282
3283         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
3284         * server.c (gdbserver_version): Likewise.
3285
3286 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
3287
3288         * remote-utils.c: Include ctype.h.
3289         (input_interrupt): Explicitly handle the case when the char
3290         received is the NUL byte.  Improve the printing of non-ASCII
3291         characters.
3292
3293 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
3294
3295         * linux-low.c (linux_low_filter_event): Update call to
3296         linux_enable_event_reporting following the addition of
3297         a new parameter to that function.
3298
3299 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
3300
3301         PR server/17457
3302         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
3303         (AARCH64_FPCR_REGNO): Likewise.
3304         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
3305         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
3306         (aarch64_store_fpregset): Likewise.
3307
3308 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
3309
3310         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
3311         Remove FIXME comment about assumption about N.
3312
3313 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
3314
3315         * configure.ac: If large-file support is disabled in GDBserver,
3316         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
3317         * configure: Regenerate.
3318
3319 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3320
3321         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
3322         warning upon ENODATA from ptrace.
3323         * linux-s390-low.c (s390_store_tdb): New.
3324         (s390_regsets): Add regset for NT_S390_TDB.
3325
3326 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3327
3328         * linux-low.c (regsets_store_inferior_registers): Skip regsets
3329         without a fill_function.
3330         * linux-s390-low.c (s390_fill_last_break): Remove.
3331         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
3332         (s390_arch_setup): Use regset's size instead of fill_function for
3333         loop end condition.
3334
3335 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3336
3337         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
3338         the regset's store function when ptrace returned an error.
3339         * regcache.c (get_thread_regcache): Invalidate register cache
3340         before fetching inferior's registers.
3341
3342 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3343
3344         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
3345         while-loop as for-loop.
3346         (regsets_store_inferior_registers): Likewise.
3347
3348 2014-11-28  Yao Qi  <yao@codesourcery.com>
3349
3350         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
3351         * config.in, configure: Re-generate.
3352         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
3353         is defined.
3354
3355 2014-11-21  Yao Qi  <yao@codesourcery.com>
3356
3357         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
3358         (AC_CHECK_HEADERS): Remove malloc.h.
3359         * configure: Re-generated.
3360         * config.in: Re-generated.
3361         * server.h: Don't include alloca.h and malloc.h.
3362         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
3363         Don't include malloc.h.
3364
3365 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
3366
3367         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
3368         corresponding ERRNO check in same block.
3369
3370 2014-11-12  Pedro Alves  <palves@redhat.com>
3371
3372         * server.c (cont_thread): Update comment.
3373         (start_inferior, attach_inferior): No longer clear cont_thread.
3374         (handle_v_cont): No longer set cont_thread.
3375         (captured_main): Clear cont_thread each time a GDB connects.
3376
3377 2014-11-12  Pedro Alves  <palves@redhat.com>
3378
3379         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
3380         thread, and don't resume all threads if the Hc thread has exited.
3381
3382 2014-11-12  Pedro Alves  <palves@redhat.com>
3383
3384         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
3385         the process group instead of to a specific LWP.
3386
3387 2014-10-15  Pedro Alves  <palves@redhat.com>
3388
3389         PR server/17487
3390         * win32-arm-low.c (arm_set_thread_context): Remove current_event
3391         parameter.
3392         (arm_set_thread_context): Delete.
3393         (the_low_target): Adjust.
3394         * win32-i386-low.c (debug_registers_changed)
3395         (debug_registers_used): Delete.
3396         (update_debug_registers_callback): New function.
3397         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
3398         needing to update their debug registers.
3399         (win32_get_current_dr): New function.
3400         (x86_dr_low_get_addr, x86_dr_low_get_control)
3401         (x86_dr_low_get_status): Fetch the debug register from the thread
3402         record's context.
3403         (i386_initial_stuff): Adjust.
3404         (i386_get_thread_context): Remove current_event parameter.  Don't
3405         clear debug_registers_changed nor copy DR values to
3406         debug_reg_state.
3407         (i386_set_thread_context): Delete.
3408         (i386_prepare_to_resume): New function.
3409         (i386_thread_added): Mark the thread as needing to update irs
3410         debug registers.
3411         (the_low_target): Remove i386_set_thread_context and install
3412         i386_prepare_to_resume.
3413         * win32-low.c (win32_get_thread_context): Adjust.
3414         (win32_set_thread_context): Use SetThreadContext
3415         directly.
3416         (win32_prepare_to_resume): New function.
3417         (win32_require_context): New function, factored out from ...
3418         (thread_rec): ... this.
3419         (continue_one_thread): Call win32_prepare_to_resume on each thread
3420         we're about to continue.
3421         (win32_resume): Call win32_prepare_to_resume on the event thread.
3422         * win32-low.h (struct win32_thread_info)
3423         <debug_registers_changed>: New field.
3424         (struct win32_target_ops): Change prototype of set_thread_context,
3425         delete set_thread_context and add prepare_to_resume.
3426         (win32_require_context): New declaration.
3427
3428 2014-10-08  Gary Benson  <gbenson@redhat.com>
3429
3430         * server.h: Do not include common-exceptions.h.
3431
3432 2014-10-08  Gary Benson  <gbenson@redhat.com>
3433
3434         * server.h: Do not include cleanups.h.
3435
3436 2014-09-30  James Hogan  <james.hogan@imgtec.com>
3437
3438         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
3439         mips64-dsp-linux.c.
3440
3441 2014-09-23  Yao Qi  <yao@codesourcery.com>
3442
3443         * linux-low.c (lp_status_maybe_breakpoint): New function.
3444         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
3445         (count_events_callback): Likewise.
3446         (select_event_lwp_callback): Likewise.
3447         (cancel_breakpoints_callback): Likewise.
3448
3449 2014-09-19  Don Breazeal  <donb@codesourcery.com>
3450
3451         * linux-low.c (handle_extended_wait): Call
3452         linux_ptrace_get_extended_event.
3453         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
3454         linux_is_extended_waitstatus.
3455
3456 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
3457
3458         * Makefile.in (CPPFLAGS): Define.
3459         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
3460         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
3461
3462 2014-09-16  Gary Benson  <gbenson@redhat.com>
3463
3464         * inferiors.h (current_inferior): Renamed as...
3465         (current_thread): New variable.  All uses updated.
3466         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
3467         (maybe_move_out_of_jump_pad): Likewise.
3468         (cancel_breakpoint): Likewise.
3469         (linux_low_filter_event): Likewise.
3470         (wait_for_sigstop): Likewise.
3471         (linux_resume_one_lwp): Likewise.
3472         (need_step_over_p): Likewise.
3473         (start_step_over): Likewise.
3474         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
3475         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
3476         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
3477         and save_inferior as saved_thread.
3478         * regcache.c (get_thread_regcache): Renamed saved_inferior as
3479         saved_thread.
3480         (regcache_invalidate_thread): Likewise.
3481         * remote-utils.c (prepare_resume_reply): Likewise.
3482         * thread-db.c (thread_db_get_tls_address): Likewise.
3483         (disable_thread_event_reporting): Likewise.
3484         (remove_thread_event_breakpoints): Likewise.
3485         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
3486         as saved_thread.
3487         * target.h (set_desired_inferior): Renamed as...
3488         (set_desired_thread): New declaration.  All uses updated.
3489         * server.c (myresume): Updated comment to reference thread instead
3490         of inferior.
3491         (handle_serial_event): Likewise.
3492         (handle_target_event): Likewise.
3493
3494 2014-09-12  Tom Tromey  <tromey@redhat.com>
3495             Gary Benson  <gbenson@redhat.com>
3496
3497         * regcache.h: Include common-regcache.h.
3498         (regcache_read_pc): Don't declare.
3499         * regcache.c (get_thread_regcache_for_ptid): New function.
3500
3501 2014-09-11  Tom Tromey  <tromey@redhat.com>
3502             Gary Benson  <gbenson@redhat.com>
3503
3504         * symbol.c: New file.
3505         * Makefile.in (SFILES): Add symbol.c.
3506         (OBS): Add symbol.o.
3507
3508 2014-09-11  Gary Benson  <gbenson@redhat.com>
3509
3510         * target.c (target_stop_ptid, target_continue_ptid): New
3511         functions.
3512
3513 2014-09-11  Tom Tromey  <tromey@redhat.com>
3514             Gary Benson  <gbenson@redhat.com>
3515
3516         * target.h: Include target/target.h.
3517         * target.c (target_read_memory, target_read_uint32)
3518         (target_write_memory): New functions.
3519
3520 2014-09-11  Gary Benson  <gbenson@redhat.com>
3521
3522         * server.h (debug_hw_points): Don't declare.
3523         * server.c (debug_hw_points): Don't define.  Replace all uses
3524         with show_debug_regs.
3525         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
3526         all uses with show_debug_regs.
3527
3528 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
3529
3530         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
3531         endianness into account.
3532         (ppc_supply_ptrace_register): Likewise.
3533
3534 2014-09-03  James Hogan  <james.hogan@imgtec.com>
3535
3536         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
3537         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
3538
3539 2014-09-03  Gary Benson  <gbenson@redhat.com>
3540
3541         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
3542         ALL_DEBUG_ADDRESS_REGISTERS.
3543
3544 2014-09-02  Gary Benson  <gbenson@redhat.com>
3545
3546         * i386-low.h: Renamed as...
3547         * x86-low.h: New file.  All type, function and variable name
3548         prefixes changed from "i386_" to "x86_".  All references updated.
3549         * i386-low.c: Renamed as...
3550         * x86-low.c: New file.  All type, function and variable name
3551         prefixes changed from "i386_" to "x86_".  All references updated.
3552
3553 2014-09-02  Gary Benson  <gbenson@redhat.com>
3554
3555         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
3556         (x86_linux_new_thread): Likewise.
3557
3558 2014-08-29  Gary Benson  <gbenson@redhat.com>
3559
3560         * server.h (setjmp.h): Do not include.
3561         (toplevel): Do not declare.
3562         (common-exceptions.h): Include.
3563         (cleanups.h): Likewise.
3564         * server.c (toplevel): Do not define.
3565         (exit_code): New static global.
3566         (detach_or_kill_for_exit_cleanup): New function.
3567         (main): New function.  Original main renamed to...
3568         (captured_main): New function.
3569         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
3570
3571 2014-08-29  Gary Benson  <gbenson@redhat.com>
3572
3573         * Makefile.in (SFILES): Add common/common-exceptions.c.
3574         (OBS): Add common-exceptions.o.
3575         (common-exceptions.o): New rule.
3576         * utils.c (prepare_to_throw_exception): New function.
3577
3578 2014-08-29  Gary Benson  <gbenson@redhat.com>
3579
3580         * config.in: Regenerate.
3581         * configure: Likewise.
3582
3583 2014-08-29  Gary Benson  <gbenson@redhat.com>
3584
3585         * Makefile.in (SFILES): Add common/cleanups.c.
3586         (OBS): cleanups.o.
3587         (cleanups.o): New rule.
3588
3589 2014-08-29  Gary Benson  <gbenson@redhat.com>
3590
3591         * utils.c (internal_vwarning): New function.
3592
3593 2014-08-28  Gary Benson  <gbenson@redhat.com>
3594
3595         * utils.h (fatal): Remove declaration.
3596         * utils.c (fatal): Remove function.
3597
3598 2014-08-28  Gary Benson  <gbenson@redhat.com>
3599
3600         * tracepoint.c (gdb_agent_init): Replace fatal with
3601         perror_with_name.
3602         (initialize_tracepoint): Likewise.
3603
3604 2014-08-28  Gary Benson  <gbenson@redhat.com>
3605
3606         * remote-utils.c (remote_prepare): Replace fatal with error.
3607
3608 2014-08-28  Gary Benson  <gbenson@redhat.com>
3609
3610         * linux-low.c (linux_async): Replace fatal with warning.
3611         Tidy up and return.
3612         (linux_start_non_stop): Return -1 if linux_async failed.
3613
3614 2014-08-28  Gary Benson  <gbenson@redhat.com>
3615
3616         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
3617         gdb_assert.
3618         (i386_dr_low_get_addr): Remove vague comment.
3619         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
3620         gdb_assert.
3621
3622 2014-08-28  Gary Benson  <gbenson@redhat.com>
3623
3624         * inferiors.c (get_thread_process): Replace check with gdb_assert.
3625         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
3626         internal_error.
3627         (linux_resume_one_lwp): Likewise.
3628         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
3629         gdb_assert.
3630         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
3631         with internal_error.
3632         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
3633         (init_register_cache): Replace fatal with gdb_assert_not_reached.
3634         (find_register_by_name): Replace fatal with internal_error.
3635         (find_regno): Likewise.
3636         * tdesc.c (init_target_desc): Replace check with gdb_assert.
3637         * thread-db.c (thread_db_create_event): Likewise.
3638         (thread_db_load_search): Likewise.
3639         (try_thread_db_load_1): Likewise.
3640         * tracepoint.c (get_jump_space_head): Replace fatal with
3641         internal_error.
3642         (claim_trampoline_space): Likewise.
3643         (have_fast_tracepoint_trampoline_buffer): Likewise.
3644         (cmd_qtstart): Likewise.
3645         (stop_tracing): Likewise.
3646         (fast_tracepoint_collecting): Likewise.
3647         (target_malloc): Likewise.
3648         (download_tracepoint): Likewise.
3649         (download_trace_state_variables): Replace check with gdb_assert.
3650         (upload_fast_traceframes): Replace fatal with internal_error.
3651
3652 2014-08-19  Tom Tromey  <tromey@redhat.com>
3653             Gary Benson  <gbenson@redhat.com>
3654
3655         * Makefile.in (SFILES): Add common/common-debug.c.
3656         (OBS): Add common-debug.o.
3657         (common-debug.o): New rule.
3658         * debug.h (debug_printf): Don't declare.
3659         * debug.c (debug_printf): Renamed and rewritten as...
3660         (debug_vprintf): New function.
3661
3662 2014-08-19  Gary Benson  <gbenson@redhat.com>
3663
3664         * utils.h: Do not include print-utils.h.
3665
3666 2014-08-19  Tom Tromey  <tromey@redhat.com>
3667             Gary Benson  <gbenson@redhat.com>
3668
3669         * server.h: Add static assertion.
3670         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
3671
3672 2014-08-19  Tom Tromey  <tromey@redhat.com>
3673             Gary Benson  <gbenson@redhat.com>
3674
3675         * Makefile.in (SFILES): Add common/errors.c.
3676         (OBS): Add errors.o.
3677         (IPA_OBS): Add errors-ipa.o.
3678         (errors.o): New rule.
3679         (errors-ipa.o): Likewise.
3680         * utils.h (perror_with_name, error, warning): Don't declare.
3681         * utils.c (warning): Renamed and rewritten as...
3682         (vwarning): New function.
3683         (error): Renamed and rewritten as...
3684         (verror): New function.
3685         (internal_error): Renamed and rewritten as...
3686         (internal_verror): New function.
3687
3688 2014-08-07  Gary Benson  <gbenson@redhat.com>
3689
3690         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
3691         * configure: Regenerate.
3692         * config.in: Likewise.
3693         * server.h: Do not include errno.h.
3694         * event-loop.c: Likewise.
3695         * hostio-errno.c: Likewise.
3696         * linux-low.c: Likewise.
3697         * remote-utils.c: Likewise.
3698         * spu-low.c: Likewise.
3699         * utils.c: Likewise.
3700         * gdbreplay.c: Unconditionally include errno.h.
3701
3702 2014-08-07  Gary Benson  <gbenson@redhat.com>
3703
3704         * server.h: Do not include string.h.
3705         * event-loop.c: Likewise.
3706         * linux-low.c: Likewise.
3707         * regcache.c: Likewise.
3708         * remote-utils.c: Likewise.
3709         * spu-low.c: Likewise.
3710         * utils.c: Likewise.
3711
3712 2014-08-07  Gary Benson  <gbenson@redhat.com>
3713
3714         * server.h: Do not include gdb_assert.h.
3715
3716 2014-08-07  Gary Benson  <gbenson@redhat.com>
3717
3718         * server.h: Do not include common-utils.h.
3719
3720 2014-08-07  Gary Benson  <gbenson@redhat.com>
3721
3722         * server.h: Do not include ptid.h.
3723         * notif.h: Likewise.
3724
3725 2014-08-07  Gary Benson  <gbenson@redhat.com>
3726
3727         * server.h: Do not include gdb_locale.h.
3728
3729 2014-08-07  Gary Benson  <gbenson@redhat.com>
3730
3731         * server.h: Do not include gdb/signals.h.
3732         * win32-low.c: Likewise.
3733
3734 2014-08-07  Gary Benson  <gbenson@redhat.com>
3735
3736         * server.h: Do not include pathmax.h.
3737
3738 2014-08-07  Gary Benson  <gbenson@redhat.com>
3739
3740         * server.h: Do not include libiberty.h.
3741         * linux-bfin-low.c: Likewise.
3742
3743 2014-08-07  Gary Benson  <gbenson@redhat.com>
3744
3745         * server.h: Do not include ansidecl.h.
3746
3747 2014-08-07  Gary Benson  <gbenson@redhat.com>
3748
3749         * linux-x86-low.c: Do not include stddef.h.
3750         * lynx-ppc-low.c: Likewise.
3751         * tracepoint.c: Likewise.
3752
3753 2014-08-07  Gary Benson  <gbenson@redhat.com>
3754
3755         * server.h: Do not include stdarg.h.
3756         * nto-low.c: Likewise.
3757
3758 2014-08-07  Gary Benson  <gbenson@redhat.com>
3759
3760         * server.h: Do not include stdlib.h.
3761         * inferiors.c: Likewise.
3762         * linux-low.c: Likewise.
3763         * regcache.c: Likewise.
3764         * spu-low.c: Likewise.
3765         * tracepoint.c: Likewise.
3766         * utils.c: Likewise.
3767
3768 2014-08-07  Gary Benson  <gbenson@redhat.com>
3769
3770         * server.h: Do not include stdio.h.
3771         * linux-low.c: Likewise.
3772         * remote-utils.c: Likewise.
3773         * spu-low.c: Likewise.
3774         * utils.c: Likewise.
3775         * wincecompat.c: Likewise.
3776
3777 2014-08-06  Gary Benson  <gbenson@redhat.com>
3778
3779         * regcache.c (init_register_cache): Move conditionals inside if.
3780
3781 2014-08-06  Gary Benson  <gbenson@redhat.com>
3782
3783         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
3784
3785 2014-07-31  Gary Benson  <gbenson@redhat.com>
3786
3787         * ax.h: Do not include server.h.
3788         * gdbthread.h: Likewise.
3789         * lynx-low.h: Likewise.
3790         * notif.h: Likewise.
3791
3792 2014-07-30  Gary Benson  <gbenson@redhat.com>
3793
3794         * server.h: Include common-defs.h.
3795         Do not include config.h or build-gnulib-gdbserver/config.h.
3796
3797 2014-07-30  Gary Benson  <gbenson@redhat.com>
3798
3799         * hostio-errno.c: Move server.h to top of includes list.
3800         * inferiors.c: Likewise.
3801         * linux-x86-low.c: Likewise.
3802         * notif.c: Include server.h.
3803
3804 2014-07-24  Tom Tromey  <tromey@redhat.com>
3805             Gary Benson  <gbenson@redhat.com>
3806
3807         * server.h (CORE_ADDR): Now unsigned.
3808
3809 2014-07-16  Pedro Alves  <palves@redhat.com>
3810
3811         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
3812
3813 2014-07-15  Pedro Alves  <palves@redhat.com>
3814
3815         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
3816         copy.
3817
3818 2014-07-11  Pedro Alves  <palves@redhat.com>
3819
3820         * linux-low.c (kill_wait_lwp): New function, based on
3821         kill_one_lwp_callback, but use my_waitpid directly.
3822         (kill_one_lwp_callback, linux_kill): Use it.
3823
3824 2014-06-23  Pedro Alves  <palves@redhat.com>
3825
3826         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
3827         before setting DR0..DR3.
3828
3829 2014-06-20  Gary Benson  <gbenson@redhat.com>
3830
3831         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3832         * configure: Regenerated.
3833         * config.in: Likewise.
3834
3835 2014-06-20  Gary Benson  <gbenson@redhat.com>
3836
3837         * Makefile.in (SFILES): Update locations for files moved
3838         from common to nat.
3839         (object file files): Reordered.
3840
3841 2014-06-20  Gary Benson  <gbenson@redhat.com>
3842
3843         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3844         (i386_dr_low_set_addr): Likewise.
3845         (i386_dr_low_get_addr): Likewise.
3846         (i386_dr_low_can_set_control): Likewise.
3847         (i386_dr_low_set_control): Likewise.
3848         (i386_dr_low_get_control): Likewise.
3849         (i386_dr_low_get_status): Likewise.
3850         (i386_get_debug_register_length): Likewise.
3851         * linux-x86-low.c (i386_dr_low_set_addr):
3852         Changed signature.  Made static.
3853         (i386_dr_low_get_addr): Likewise.
3854         (i386_dr_low_set_control): Likewise.
3855         (i386_dr_low_get_control): Likewise.
3856         (i386_dr_low_get_status): Likewise.
3857         (i386_dr_low): New global variable.
3858         * win32-i386-low.c (i386_dr_low_set_addr):
3859         Changed signature.  Made static.
3860         (i386_dr_low_get_addr): Likewise.
3861         (i386_dr_low_set_control): Likewise.
3862         (i386_dr_low_get_control): Likewise.
3863         (i386_dr_low_get_status): Likewise.
3864         (i386_dr_low): New global variable.
3865
3866 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3867
3868         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3869         * Makefile.in (AR, AR_FLAGS): Define.
3870         * configure: Regenerate.
3871
3872 2014-06-19  Gary Benson  <gbenson@redhat.com>
3873
3874         * Makefile.in (i386-dregs.o): New rule.
3875         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3876         * i386-low.c (target.h): Remove include.
3877         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3878         (DR_CONTROL_SHIFT): Likewise.
3879         (DR_CONTROL_SIZE): Likewise.
3880         (DR_RW_EXECUTE): Likewise.
3881         (DR_RW_WRITE): Likewise.
3882         (DR_RW_READ): Likewise.
3883         (DR_RW_IORW): Likewise.
3884         (DR_LEN_1): Likewise.
3885         (DR_LEN_2): Likewise.
3886         (DR_LEN_4): Likewise.
3887         (DR_LEN_8): Likewise.
3888         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3889         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3890         (DR_ENABLE_SIZE): Likewise.
3891         (DR_LOCAL_SLOWDOWN): Likewise.
3892         (DR_GLOBAL_SLOWDOWN): Likewise.
3893         (DR_CONTROL_RESERVED): Likewise.
3894         (I386_DR_CONTROL_MASK): Likewise.
3895         (I386_DR_VACANT): Likewise.
3896         (I386_DR_LOCAL_ENABLE): Likewise.
3897         (I386_DR_GLOBAL_ENABLE): Likewise.
3898         (I386_DR_DISABLE): Likewise.
3899         (I386_DR_SET_RW_LEN): Likewise.
3900         (I386_DR_GET_RW_LEN): Likewise.
3901         (I386_DR_WATCH_HIT): Likewise.
3902         (i386_wp_op_t): Likewise.
3903         (i386_show_dr): Likewise.
3904         (i386_length_and_rw_bits): Likewise.
3905         (i386_insert_aligned_watchpoint): Likewise.
3906         (i386_remove_aligned_watchpoint): Likewise.
3907         (i386_handle_nonaligned_watchpoint): Likewise.
3908         i386_update_inferior_debug_regs(): Likewise.
3909         (i386_dr_insert_watchpoint): Likewise.
3910         (i386_dr_remove_watchpoint): Likewise.
3911         (i386_dr_region_ok_for_watchpoint): Likewise.
3912         (i386_dr_stopped_data_address): Likewise.
3913         (i386_dr_stopped_by_watchpoint): Likewise.
3914
3915 2014-06-19  Gary Benson  <gbenson@redhat.com>
3916
3917         * i386-low.c (i386_dr_show): Renamed to
3918         i386_show_dr and made static.  All uses updated.
3919         (i386_dr_length_and_rw_bits): Renamed to
3920         i386_length_and_rw_bits and made static.
3921         All uses updated.
3922         (i386_dr_insert_aligned_watchpoint): Renamed to
3923         i386_insert_aligned_watchpoint and made static.
3924         All uses updated.
3925         (i386_dr_remove_aligned_watchpoint): Renamed to
3926         i386_remove_aligned_watchpoint and made static.
3927         All uses updated.
3928         (i386_dr_update_inferior_debug_regs): Renamed to
3929         i386_update_inferior_debug_regs and made static.
3930         All uses updated.
3931
3932 2014-06-18  Gary Benson  <gbenson@redhat.com>
3933
3934         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3935         (i386_dr_low_can_set_control): Likewise.
3936         (i386_get_debug_register_length): Likewise.
3937         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3938         (i386_dr_low_can_set_control): Likewise.
3939         (i386_get_debug_register_length): Likewise.
3940
3941 2014-06-17  Gary Benson  <gbenson@redhat.com>
3942
3943         * i386-low.h (i386-dregs.h): New include.
3944         (DR_FIRSTADDR): Now in i386-dregs.h.
3945         (DR_LASTADDR): Likewise.
3946         (DR_NADDR): Likewise.
3947         (DR_STATUS): Likewise.
3948         (DR_CONTROL): Likewise.
3949         (i386_debug_reg_state): Likewise.
3950         (i386_dr_insert_watchpoint): Likewise.
3951         (i386_dr_remove_watchpoint): Likewise.
3952         (i386_dr_region_ok_for_watchpoint): Likewise.
3953         (i386_dr_stopped_data_address): Likewise.
3954         (i386_dr_stopped_by_watchpoint): Likewise.
3955         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3956
3957 2014-06-18  Gary Benson  <gbenson@redhat.com>
3958
3959         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3960         i386_dr_insert_watchpoint.
3961         (i386_low_remove_watchpoint): Renamed to
3962         i386_dr_remove_watchpoint.
3963         (i386_low_region_ok_for_watchpoint): Renamed to
3964         i386_dr_region_ok_for_watchpoint.
3965         (i386_low_stopped_data_address): Renamed to
3966         i386_dr_stopped_data_address.
3967         (i386_low_stopped_by_watchpoint): Renamed to
3968         i386_dr_stopped_by_watchpoint.
3969         * i386-low.c (i386_show_dr): Renamed to
3970         i386_dr_show and made nonstatic.  All uses updated.
3971         (i386_length_and_rw_bits): Renamed to
3972         i386_dr_length_and_rw_bits and made nonstatic.
3973         All uses updated.
3974         (i386_insert_aligned_watchpoint): Renamed to
3975         i386_dr_insert_aligned_watchpoint and made nonstatic.
3976         All uses updated.
3977         (i386_remove_aligned_watchpoint): Renamed to
3978         i386_dr_remove_aligned_watchpoint and made nonstatic.
3979         All uses updated.
3980         (i386_update_inferior_debug_regs): Renamed to
3981         i386_dr_update_inferior_debug_regs and made nonstatic.
3982         All uses updated.
3983         (i386_low_insert_watchpoint): Renamed to
3984         i386_dr_insert_watchpoint.  All uses updated.
3985         (i386_low_remove_watchpoint): Renamed to
3986         i386_dr_remove_watchpoint.  All uses updated.
3987         (i386_low_region_ok_for_watchpoint): Renamed to
3988         i386_dr_region_ok_for_watchpoint.  All uses updated.
3989         (i386_low_stopped_data_address): Renamed to
3990         i386_dr_stopped_data_address.  All uses updated.
3991         (i386_low_stopped_by_watchpoint): Renamed to
3992         i386_dr_stopped_by_watchpoint.  All uses updated.
3993
3994 2014-06-18  Gary Benson  <gbenson@redhat.com>
3995
3996         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3997         (i386_dr_low_can_set_control): Likewise.
3998         (i386_insert_aligned_watchpoint): New check.
3999
4000 2014-06-18  Gary Benson  <gbenson@redhat.com>
4001
4002         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
4003         Renamed to state.
4004
4005 2014-06-18  Gary Benson  <gbenson@redhat.com>
4006
4007         * i386-low.c (i386_length_and_rw_bits): Use internal_error
4008         instead of fatal and error.
4009         (i386_handle_nonaligned_watchpoint): Likewise.
4010
4011 2014-06-18  Gary Benson  <gbenson@redhat.com>
4012
4013         * i386-low.c (i386_get_debug_register_length): New macro.
4014         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
4015         (i386_show_dr): Use debug_printf instead of fprintf.  Use
4016         phex to format values.
4017
4018 2014-06-18  Gary Benson  <gbenson@redhat.com>
4019
4020         * i386-low.h: Comment changes.
4021         * i386-low.c: Likewise.
4022
4023 2014-06-18  Gary Benson  <gbenson@redhat.com>
4024
4025         * i386-low.c: Whitespace changes.
4026
4027 2014-06-12  Tom Tromey  <tromey@redhat.com>
4028
4029         * utils.c (freeargv): Remove.
4030
4031 2014-06-12  Tom Tromey  <tromey@redhat.com>
4032
4033         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
4034         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
4035         (parse_debug_format_options): Likewise.
4036         (gdbserver_usage): Likewise.
4037         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
4038         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
4039         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
4040         against libiberty.
4041         ($(LIBGNU)): Depend on libiberty.
4042         (all-lib): Recurse into all subdirs.
4043         (install-only): Invoke "install" target in subdirs.
4044         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
4045         targets.
4046         * configure: Rebuild.
4047         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
4048         for vasprintf, vsnprintf, or gettimeofday.
4049         * configure.srv: Don't add safe-ctype.o or lbasename.o to
4050         srv_tgtobj.
4051
4052 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
4053
4054         * development.sh: Delete.
4055         * Makefile.in (config.status): Adjust dependency on development.sh.
4056         * configure.ac: Adjust development.sh source call.
4057         * configure: Regenerate.
4058
4059 2014-06-02  Pedro Alves  <palves@redhat.com>
4060
4061         * ax.c (gdb_free_agent_expr): New function.
4062         * ax.h (gdb_free_agent_expr): New declaration.
4063         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
4064         list.
4065         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
4066         static.
4067         (clear_breakpoint_conditions_and_commands): New function.
4068         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
4069         (clear_breakpoint_conditions_and_commands): New declaration.
4070
4071 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
4072
4073         * linux-aarch64-low.c (asm/ptrace.h): Include.
4074
4075 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
4076
4077         Fix TLS access for -static -pthread.
4078         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
4079         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
4080         (thread_db_load_search, try_thread_db_load_1): Initialize it.
4081
4082 2014-05-20  Pedro Alves  <palves@redhat.com>
4083
4084         * linux-aarch64-low.c (aarch64_insert_point)
4085         (aarch64_remove_point): No longer check whether the type is
4086         supported here.  Adjust to new interface.
4087         (the_low_target): Install aarch64_supports_z_point_type as
4088         supports_z_point_type method.
4089         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
4090         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
4091         instead of a Z packet char.  Adjust.
4092         (arm_supports_z_point_type): New function.
4093         (arm_insert_point, arm_remove_point): Adjust to new interface.
4094         (the_low_target): Install arm_supports_z_point_type.
4095         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
4096         (cris_insert_point, cris_remove_point): Adjust to new interface.
4097         Don't check whether the type is supported here.
4098         (the_low_target): Install cris_supports_z_point_type.
4099         * linux-low.c (linux_supports_z_point_type): New function.
4100         (linux_insert_point, linux_remove_point): Adjust to new interface.
4101         * linux-low.h (struct linux_target_ops) <insert_point,
4102         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
4103         raw_breakpoint pointer parameter.
4104         <supports_z_point_type>: New method.
4105         * linux-mips-low.c (mips_supports_z_point_type): New function.
4106         (mips_insert_point, mips_remove_point): Adjust to new interface.
4107         Use mips_supports_z_point_type.
4108         (the_low_target): Install mips_supports_z_point_type.
4109         * linux-ppc-low.c (the_low_target): Install NULL as
4110         supports_z_point_type method.
4111         * linux-s390-low.c (the_low_target): Install NULL as
4112         supports_z_point_type method.
4113         * linux-sparc-low.c (the_low_target): Install NULL as
4114         supports_z_point_type method.
4115         * linux-x86-low.c (x86_supports_z_point_type): New function.
4116         (x86_insert_point): Adjust to new insert_point interface.  Use
4117         insert_memory_breakpoint.  Adjust to new
4118         i386_low_insert_watchpoint interface.
4119         (x86_remove_point): Adjust to remove_point interface.  Use
4120         remove_memory_breakpoint.  Adjust to new
4121         i386_low_remove_watchpoint interface.
4122         (the_low_target): Install x86_supports_z_point_type.
4123         * lynx-low.c (lynx_target_ops): Install NULL as
4124         supports_z_point_type callback.
4125         * nto-low.c (nto_supports_z_point_type): New.
4126         (nto_insert_point, nto_remove_point): Adjust to new interface.
4127         (nto_target_ops): Install nto_supports_z_point_type.
4128         * mem-break.c: Adjust intro comment.
4129         (struct raw_breakpoint) <raw_type, size>: New fields.
4130         <inserted>: Update comment.
4131         <shlib_disabled>: Delete field.
4132         (enum bkpt_type) <gdb_breakpoint>: Delete value.
4133         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
4134         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
4135         (raw_bkpt_type_to_target_hw_bp_type): New function.
4136         (find_enabled_raw_code_breakpoint_at): New function.
4137         (find_raw_breakpoint_at): New type and size parameters.  Use them.
4138         (insert_memory_breakpoint): New function, based off
4139         set_raw_breakpoint_at.
4140         (remove_memory_breakpoint): New function.
4141         (set_raw_breakpoint_at): Reimplement.
4142         (set_breakpoint): New, based on set_breakpoint_at.
4143         (set_breakpoint_at): Reimplement.
4144         (delete_raw_breakpoint): Go through the_target->remove_point
4145         instead of assuming memory breakpoints.
4146         (find_gdb_breakpoint_at): Delete.
4147         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
4148         (find_gdb_breakpoint): New function.
4149         (set_gdb_breakpoint_at): Delete.
4150         (z_type_supported): New function.
4151         (set_gdb_breakpoint_1): New function, loosely based off
4152         set_gdb_breakpoint_at.
4153         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
4154         (delete_gdb_breakpoint_at): Delete.
4155         (delete_gdb_breakpoint_1): New function, loosely based off
4156         delete_gdb_breakpoint_at.
4157         (delete_gdb_breakpoint): New function.
4158         (clear_gdb_breakpoint_conditions): Rename to ...
4159         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
4160         breakpoint.
4161         (add_condition_to_breakpoint): Make static.
4162         (add_breakpoint_condition): Take a struct breakpoint pointer
4163         instead of an address.  Adjust.
4164         (gdb_condition_true_at_breakpoint): Rename to ...
4165         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
4166         z_type parameter.
4167         (gdb_condition_true_at_breakpoint): Reimplement.
4168         (add_breakpoint_commands): Take a struct breakpoint pointer
4169         instead of an address.  Adjust.
4170         (gdb_no_commands_at_breakpoint): Rename to ...
4171         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
4172         parameter.  Return true if no breakpoint was found.  Change debug
4173         output.
4174         (gdb_no_commands_at_breakpoint): Reimplement.
4175         (run_breakpoint_commands): Rename to ...
4176         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
4177         and change return type to boolean.
4178         (run_breakpoint_commands): New function.
4179         (gdb_breakpoint_here): Also check for Z1 breakpoints.
4180         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
4181         breakpoint.  Go through the_target->remove_point instead of
4182         assuming memory breakpoint.
4183         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
4184         software and hardware breakpoints.
4185         (reinsert_raw_breakpoint): Go through the_target->insert_point
4186         instead of assuming memory breakpoint.
4187         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
4188         software and hardware breakpoints.
4189         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
4190         Check both software and hardware breakpoints.
4191         (validate_inserted_breakpoint): Assert the breakpoint is a
4192         software breakpoint.  Set the inserted flag to -1 instead of
4193         setting shlib_disabled.
4194         (delete_disabled_breakpoints): Adjust.
4195         (validate_breakpoints): Only validate software breakpoints.
4196         Adjust to inserted flag change.
4197         (check_mem_read, check_mem_write): Skip breakpoint types other
4198         than software breakpoints.  Adjust to inserted flag change.
4199         * mem-break.h (enum raw_bkpt_type): New enum.
4200         (raw_breakpoint, struct process_info): Forward declare.
4201         (Z_packet_to_target_hw_bp_type): Delete declaration.
4202         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
4203         (set_gdb_breakpoint, delete_gdb_breakpoint)
4204         (clear_breakpoint_conditions): New declarations.
4205         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
4206         (breakpoint_inserted_here): Update comment.
4207         (add_breakpoint_condition, add_breakpoint_commands): Replace
4208         address parameter with a breakpoint pointer parameter.
4209         (gdb_breakpoint_here): Update comment.
4210         (delete_gdb_breakpoint_at): Delete.
4211         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
4212         * server.c (process_point_options): Take a struct breakpoint
4213         pointer instead of an address.  Adjust.
4214         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
4215         delete_gdb_breakpoint.
4216         * spu-low.c (spu_target_ops): Install NULL as
4217         supports_z_point_type method.
4218         * target.h: Include mem-break.h.
4219         (struct target_ops) <prepare_to_access_memory>: Update comment.
4220         <supports_z_point_type>: New field.
4221         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
4222         instead of a char.  Also take a raw breakpoint pointer.
4223         * win32-arm-low.c (the_low_target): Install NULL as
4224         supports_z_point_type.
4225         * win32-i386-low.c (i386_supports_z_point_type): New function.
4226         (i386_insert_point, i386_remove_point): Adjust to new interface.
4227         (the_low_target): Install i386_supports_z_point_type.
4228         * win32-low.c (win32_supports_z_point_type): New function.
4229         (win32_insert_point, win32_remove_point): Adjust to new interface.
4230         (win32_target_ops): Install win32_supports_z_point_type.
4231         * win32-low.h (struct win32_target_ops):
4232         <supports_z_point_type>: New method.
4233         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
4234         instead of a char.  Also take a raw breakpoint pointer.
4235
4236 2014-05-20  Pedro Alves  <palves@redhat.com>
4237
4238         * mem-break.h: Include break-common.h.
4239         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
4240         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
4241         (Z_packet_to_target_hw_bp_type): New declaration.
4242         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
4243         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
4244         (Z_PACKET_ACCESS_WP): Delete macros.
4245         (Z_packet_to_hw_type): Delete function.
4246         * i386-low.h: Don't include break-common.h here.
4247         (Z_packet_to_hw_type): Delete declaration.
4248         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
4249         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
4250         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
4251         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
4252         * linux-aarch64-low.c: Don't include break-common.h here.
4253         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
4254         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
4255         (Z_packet_to_target_hw_bp_type): Delete function.
4256         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
4257         function.
4258         (mips_insert_point, mips_remove_point): Use
4259         Z_packet_to_target_hw_bp_type.
4260
4261 2014-05-20  Pedro Alves  <palves@redhat.com>
4262
4263         * linux-aarch64-low.c: Include break-common.h.
4264         (enum target_point_type): Delete.
4265         (Z_packet_to_point_type): Rename to ...
4266         (Z_packet_to_target_hw_bp_type): ... this, and return a
4267         target_hw_bp_type instead.
4268         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
4269         instead of an enum target_point_type.
4270         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
4271         breakpoint type.
4272         (aarch64_dr_state_insert_one_point)
4273         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
4274         (aarch64_handle_aligned_watchpoint)
4275         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
4276         Take an enum target_hw_bp_type instead of an enum
4277         target_point_type.
4278         (aarch64_supports_z_point_type): New function.
4279         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
4280         use Z_packet_to_target_hw_bp_type.
4281
4282 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
4283
4284         * configure.ac: Only use -Werror by default when DEVELOPMENT
4285         is true.
4286         * configure: Regenerate.
4287
4288 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
4289
4290         Fix gdbserver qGetTLSAddr for x86_64 -m32.
4291         * linux-x86-low.c (X86_64_USER_REGS): New.
4292         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
4293
4294 2014-04-28  Yao Qi  <yao@codesourcery.com>
4295
4296         * Makefile.in (i386-avx512.c): Fix the typo of generated file
4297         name.
4298
4299 2014-04-25  Pedro Alves  <palves@redhat.com>
4300
4301         PR server/16255
4302         * linux-low.c (linux_attach_fail_reason_string): New function.
4303         (linux_attach_lwp): Delete.
4304         (linux_attach_lwp_1): Rename to ...
4305         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
4306         argument.  Remove "initial" parameter.  Return int instead of
4307         void.  Don't error or warn here.
4308         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
4309         failure to attach to the tgid.  Call warning when failing to
4310         attach to an lwp.
4311         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
4312         argument.  Remove "initial" parameter.  Return int instead of
4313         void.  Don't error or warn here.
4314         (linux_attach_fail_reason_string): New declaration.
4315         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
4316         interface change.  Use linux_attach_fail_reason_string.
4317
4318 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
4319             Walfred Tedeschi  <walfred.tedeschi@intel.com>
4320
4321         * Makefile.in: Added rules to handle new files
4322         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
4323         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
4324         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
4325         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
4326         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
4327         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
4328         x32-avx512-linux.o.
4329         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
4330         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
4331         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
4332         i386/x32-avx512.xml.
4333         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
4334         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
4335         i386/x32-avx512-linux.xml.
4336         * i387-fp.c (num_avx512_k_registers): New constant for number
4337         of K registers.
4338         (num_avx512_zmmh_low_registers): New constant for number of
4339         lower ZMM registers (0-15).
4340         (num_avx512_zmmh_high_registers): New constant for number of
4341         higher ZMM registers (16-31).
4342         (num_avx512_ymmh_registers): New contant for number of higher
4343         YMM registers (ymm16-31 added by avx521 on x86_64).
4344         (num_avx512_xmm_registers): New constant for number of higher
4345         XMM registers (xmm16-31 added by AVX512 on x86_64).
4346         (struct i387_xsave): Add space for AVX512 registers.
4347         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
4348         Add code to handle AVX512 registers.
4349         (i387_xsave_to_cache): Add code to handle AVX512 registers.
4350         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
4351         prototypei from generated file.
4352         (tdesc_amd64_avx512_linux): Likewise.
4353         (init_registers_x32_avx512_linux): Likewise.
4354         (tdesc_x32_avx512_linux): Likewise.
4355         (init_registers_i386_avx512_linux): Likewise.
4356         (tdesc_i386_avx512_linux): Likewise.
4357         (x86_64_regmap): Add AVX512 registers.
4358         (x86_linux_read_description): Add code to handle AVX512 XSTATE
4359         mask.
4360         (initialize_low_arch): Add code to initialize AVX512 registers.
4361
4362 2014-04-23  Pedro Alves  <palves@redhat.com>
4363
4364         * mem-break.c (find_gdb_breakpoint_at): Make static.
4365         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
4366
4367 2014-04-23  Pedro Alves  <palves@redhat.com>
4368
4369         * i386-low.c: Don't include break-common.h here.
4370         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
4371         prototype to take target_hw_bp_type as argument instead of a Z
4372         packet char.
4373         * i386-low.h: Include break-common.h here.
4374         (Z_packet_to_hw_type): Declare.
4375         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
4376         prototypes.
4377         * linux-x86-low.c (x86_insert_point): Convert the packet number to
4378         a target_hw_bp_type before calling i386_low_insert_watchpoint.
4379         (x86_remove_point): Convert the packet number to a
4380         target_hw_bp_type before calling i386_low_remove_watchpoint.
4381         * win32-i386-low.c (i386_insert_point): Convert the packet number
4382         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
4383         (i386_remove_point): Convert the packet number to a
4384         target_hw_bp_type before calling i386_low_remove_watchpoint.
4385
4386 2014-04-23  Pedro Alves  <palves@redhat.com>
4387
4388         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
4389
4390 2014-04-10  Pedro Alves  <palves@redhat.com>
4391
4392         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
4393         Check if the condition or command is NULL before checking if the
4394         breakpoint is known.  On success, return true.
4395         * mem-break.h (add_breakpoint_condition): Document return.
4396         (add_breakpoint_commands): Add describing comment.
4397         * server.c (skip_to_semicolon): New function.
4398         (process_point_options): Use it.
4399
4400 2014-04-09  Pedro Alves  <palves@redhat.com>
4401
4402         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
4403         to lwpid_of.
4404
4405 2014-02-27  Pedro Alves  <palves@redhat.com>
4406
4407         PR 12702
4408         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
4409         macros.
4410         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
4411         output.
4412         (last_thread_of_process_p): Take a PID argument instead of a
4413         thread pointer.
4414         (linux_wait_for_lwp): Delete.
4415         (num_lwps, check_zombie_leaders, not_stopped_callback): New
4416         functions.
4417         (linux_low_filter_event): New function, party factored out from
4418         linux_wait_for_event.
4419         (linux_wait_for_event): Rename to ...
4420         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
4421         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
4422         sigsuspend.  Check for zombie leaders.
4423         (linux_wait_for_event): Reimplement as wrapper around
4424         linux_wait_for_event_filtered.
4425         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
4426         a normal or signal exit is seen, it's the whole process exiting.
4427         (wait_for_sigstop): No longer a for_each_inferior callback.
4428         Rewrite on top of linux_wait_for_event_filtered.
4429         (stop_all_lwps): Call wait_for_sigstop directly.
4430         * server.c (resume, handle_target_event): Handle
4431         TARGET_WAITKIND_NO_RESUMED.
4432
4433 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4434
4435         * win32-low.c (psapi_get_dll_name,
4436         * win32_CreateToolhelp32Snapshot): Delete.
4437         (win32_CreateToolhelp32Snapshot, win32_Module32First)
4438         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
4439         Delete.
4440         (handle_load_dll): Add function description.
4441         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
4442
4443 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4444
4445         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
4446         Add comment.
4447         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
4448         base address when calling win32_add_one_solib.
4449         (handle_load_dll): Delete local variable load_addr.
4450         Remove 0x1000 offset applied to DLL base address when calling
4451         win32_add_one_solib.
4452         (handle_unload_dll): Add comment.
4453
4454 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
4455
4456         * win32-low.c (win32_add_all_dlls): Renames
4457         win32_ensure_ntdll_loaded.  Rewrite function documentation.
4458         Adjust implementation to always load all DLLs.
4459         Add 0x1000 offset to DLL base address when calling
4460         win32_add_one_solib.
4461         (child_initialization_done): New static global.
4462         (do_initial_child_stuff): Set child_initialization_done to
4463         zero during child initialization, and 1 after.  Replace call
4464         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
4465         Add comment.
4466         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
4467         (handle_unload_dll): Add function documentation.
4468         (get_child_debug_event): Ignore load and unload DLL events
4469         during child initialization.
4470
4471 2014-02-20  Doug Evans  <dje@google.com>
4472
4473         Remove global all_lwps.
4474         * inferiors.h (ptid_of): Move here from linux-low.h.
4475         (pid_of, lwpid_of): Ditto.
4476         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
4477         parameter is a struct thread_info * now.
4478         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
4479         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
4480         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
4481         directly.
4482         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
4483         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
4484         * linux-arm-low.c (update_registers_callback): Update, "entry"
4485         parameter is a struct thread_info * now.
4486         Fetch lwpid from current_inferior directly.
4487         (arm_insert_point): Pass &all_threads to find_inferior instead of
4488         &all_lwps.
4489         (arm_remove_point): Ditto.
4490         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
4491         (arm_prepare_to_resume): Fetch pid from thread.
4492         (arm_read_description): Fetch lwpid from current_inferior directly.
4493         * linux-low.c (all_lwps): Delete.
4494         (delete_lwp): Delete call to remove_inferior.
4495         (handle_extended_wait): Fetch lwpid from thread.
4496         (add_lwp): Don't set lwp->entry.id.  Remove call to
4497         add_inferior_to_list.
4498         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
4499         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
4500         (kill_one_lwp_callback): Ditto.
4501         (linux_kill): Don't dereference NULL pointer.
4502         Fetch ptid,lwpid from thread.
4503         (get_detach_signal): Fetch ptid from thread.
4504         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
4505         Simplify call to regcache_invalidate_thread.
4506         (delete_lwp_callback): Update, "entry" parameter is a
4507         struct thread_info * now.  Fetch pid from thread.
4508         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
4509         (status_pending_p_callback): Update, "entry" parameter is a
4510         struct thread_info * now.  Fetch ptid from thread.
4511         (find_lwp_pid): Update, "entry" parameter is a
4512         struct thread_info * now.
4513         (linux_wait_for_lwp): Fetch pid from thread.
4514         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
4515         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
4516         (enqueue_one_deferred_signal): Fetch lwpid from thread.
4517         (dequeue_one_deferred_signal): Ditto.
4518         (cancel_breakpoint): Fetch ptid from current_inferior.
4519         (linux_wait_for_event): Pass &all_threads to find_inferior,
4520         not &all_lwps.  Fetch ptid, lwpid from thread.
4521         (count_events_callback): Update, "entry" parameter is a
4522         struct thread_info * now.
4523         (select_singlestep_lwp_callback): Ditto.
4524         (select_event_lwp_callback): Ditto.
4525         (cancel_breakpoints_callback): Ditto.
4526         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
4527         not &all_lwps.
4528         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
4529         (unsuspend_one_lwp): Update, "entry" parameter is a
4530         struct thread_info * now.
4531         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
4532         not &all_lwps.
4533         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
4534         Fetch lwpid from thread, not lwp.
4535         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
4536         Pass &all_threads to find_inferior, not &all_lwps.
4537         (send_sigstop): Fetch lwpid from thread, not lwp.
4538         (send_sigstop_callback): Update, "entry" parameter is a
4539         struct thread_info * now.
4540         (suspend_and_send_sigstop_callback): Ditto.
4541         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
4542         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
4543         struct thread_info * now.
4544         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
4545         from thread, lwp.
4546         (lwp_running): Update, "entry" parameter is a
4547         struct thread_info * now.
4548         (stop_all_lwps): Fetch ptid from thread.
4549         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
4550         (linux_resume_one_lwp): Fetch lwpid from thread.
4551         (linux_set_resume_request): Update, "entry" parameter is a
4552         struct thread_info * now.  Fetch pid, lwpid from thread.
4553         (resume_status_pending_p): Update, "entry" parameter is a
4554         struct thread_info * now.
4555         (need_step_over_p): Ditto.  Fetch lwpid from thread.
4556         (start_step_over): Fetch lwpid from thread.
4557         (linux_resume_one_thread): Update, "entry" parameter is a
4558         struct thread_info * now.  Fetch lwpid from thread.
4559         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
4560         (proceed_one_lwp): Update, "entry" parameter is a
4561         struct thread_info * now.  Fetch lwpid from thread.
4562         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
4563         struct thread_info * now.
4564         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
4565         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
4566         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
4567         directly.
4568         (regsets_store_inferior_registers): Ditto.
4569         (fetch_register, store_register): Ditto.
4570         (linux_read_memory, linux_write_memory): Ditto.
4571         (linux_request_interrupt): Ditto.
4572         (linux_read_auxv): Ditto.
4573         (linux_xfer_siginfo): Ditto.
4574         (linux_qxfer_spu): Ditto.
4575         (linux_qxfer_libraries_svr4): Ditto.
4576         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
4577         moved to inferiors.h.
4578         (get_lwp): Delete.
4579         (get_thread_lwp): Update.
4580         (struct lwp_info): Delete member "entry".  Simplify comment for
4581         member "thread".
4582         (all_lwps): Delete.
4583         * linux-mips-low.c (mips_read_description): Fetch lwpid from
4584         current_inferior directly.
4585         (update_watch_registers_callback): Update, "entry" parameter is a
4586         struct thread_info * now.  Fetch pid from thread.
4587         (mips_linux_prepare_to_resume): Fetch ptid from thread.
4588         (mips_insert_point): Fetch lwpid from current_inferior.
4589         Pass &all_threads to find_inferior, not &all_lwps.
4590         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
4591         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
4592         directly.
4593         (mips_stopped_data_address): Ditto.
4594         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
4595         directly.
4596         * linux-tile-low.c (tile_arch_setup): Ditto.
4597         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
4598         (update_debug_registers_callback): Update, "entry" parameter is a
4599         struct thread_info * now.  Fetch pid from thread.
4600         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
4601         Pass &all_threads to find_inferior, not &all_lwps.
4602         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
4603         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
4604         Pass &all_threads to find_inferior, not &all_lwps.
4605         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
4606         (i386_dr_low_get_status): Ditto.
4607         (x86_linux_prepare_to_resume): Fetch ptid from thread.
4608         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
4609         (x86_linux_read_description): Ditto.
4610         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
4611
4612 2014-02-20  Doug Evans  <dje@google.com>
4613
4614         * inferiors.c (get_first_inferior): Fix buglet.
4615
4616 2014-02-19  Doug Evans  <dje@google.com>
4617
4618         * gdbthread.h (add_thread): Change result type to struct thread_info *.
4619         * inferiors.c (add_thread): Change result type to struct thread_info *.
4620         All callers updated.
4621         (add_lwp): Call add_thread here instead of in callers.
4622         All callers updated.
4623         * linux-low.h (get_lwp_thread): Rewrite.
4624         (struct lwp_info): New member "thread".
4625
4626 2014-02-19  Doug Evans  <dje@google.com>
4627
4628         * linux-low.c (add_lwp): Change result to struct lwp_info *.
4629         All callers updated.
4630
4631 2014-02-19  Doug Evans  <dje@google.com>
4632
4633         * inferiors.c (add_thread): Fix whitespace.
4634
4635 2014-02-19  Doug Evans  <dje@google.com>
4636
4637         * dll.c (clear_dlls): Replace accessing list implemention details
4638         with API function.
4639         * gdbthread.h (get_first_thread): Declare.
4640         * inferiors.c (for_each_inferior_with_data): New function.
4641         (get_first_thread): New function.
4642         (find_thread_ptid): Simplify.
4643         (get_first_inferior): New function.
4644         (clear_list): Delete.
4645         (one_inferior_p): New function.
4646         (clear_inferior_list): New function.
4647         (clear_inferiors): Update.
4648         * inferiors.h (for_each_inferior_with_data): Declare.
4649         (clear_inferior_list): Declare.
4650         (one_inferior_p): Declare.
4651         (get_first_inferior): Declare.
4652         * linux-low.c (linux_wait_for_event): Replace accessing list
4653         implemention details with API function.
4654         * server.c (target_running): Ditto.
4655         (accumulate_file_name_length): New function.
4656         (emit_dll_description): New function.
4657         (handle_qxfer_libraries): Replace accessing list implemention
4658         details with API function.
4659         (handle_qxfer_threads_worker): New function.
4660         (handle_qxfer_threads_proper): Replace accessing list implemention
4661         details with API function.
4662         (handle_query): Ditto.
4663         (visit_actioned_threads_callback_ftype): New typedef.
4664         (visit_actioned_threads_data): New struct.
4665         (visit_actioned_threads): Rewrite to be find_inferior callback.
4666         (resume): Call find_inferior.
4667         (handle_status): Replace accessing list implemention
4668         details with API function.
4669         (process_serial_event): Replace accessing list implemention details
4670         with API function.
4671         * target.c (set_desired_inferior): Replace accessing list implemention
4672         details with API function.
4673         * tracepoint.c (same_process_p): New function.
4674         (gdb_agent_about_to_close): Replace accessing list implemention
4675         details with API function.
4676         * win32-low.c (child_delete_thread): Replace accessing list
4677         implemention details with API function.
4678         (match_dll_by_basename): New function.
4679         (dll_is_loaded_by_basename): New function.
4680         (win32_ensure_ntdll_loaded): Replace accessing list implemention
4681         details call to dll_is_loaded_by_basename.
4682
4683 2014-02-19  Doug Evans  <dje@google.com>
4684
4685         * dll.h (struct dll_info): Add comment.
4686         * gdbthread.h (struct thread_info): Add comment.
4687         (current_ptid): Simplify.
4688         * inferiors.c (add_process): Update.
4689         (remove_process): Update.
4690         * inferiors.h (struct process_info): Rename member "head" to "entry".
4691         * linux-low.c (delete_lwp): Update.
4692         (add_lwp): Update.
4693         (last_thread_of_process_p): Update.
4694         (kill_one_lwp_callback, linux_kill): Update.
4695         (status_pending_p_callback): Update.
4696         (wait_for_sigstop): Update.  Simplify read of ptid.
4697         (start_step_over): Update.
4698         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
4699         (get_lwp_thread): Update.
4700         (struct lwp_info): Rename member "head" to "entry".
4701         * regcache.h (inferior_list_entry): Delete.
4702         * server.c (kill_inferior_callback): Update.
4703         (detach_or_kill_inferior_callback): Update.
4704         (print_started_pid): Update.
4705         (print_attached_pid): Update.
4706         (process_serial_event): Simplify read of ptid.
4707         * thread-db.c (thread_db_create_event): Update.
4708         (thread_db_get_tls_address): Update.
4709         * win32-low.c (current_inferior_ptid): Simplify.
4710
4711 2014-02-19  Tom Tromey  <tromey@redhat.com>
4712
4713         * target.h (struct target_ops) <supports_btrace>: Add target_ops
4714         argument.
4715         (target_supports_btrace): Update.
4716
4717 2014-02-14  Yao Qi  <yao@codesourcery.com>
4718
4719         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
4720         (rsp-low-ipa.o): New target.
4721
4722 2014-02-12  Tom Tromey  <tromey@redhat.com>
4723
4724         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
4725         convert_ascii_to_int.
4726         * regcache.c (registers_to_string): Likewise.
4727         * remote-utils.c (decode_M_packet): Likewise.
4728         * server.c (process_serial_event): Likewise.
4729
4730 2014-02-12  Tom Tromey  <tromey@redhat.com>
4731
4732         * server.c (handle_query, handle_v_run): Use hex2bin, not
4733         unhexify.
4734         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
4735
4736 2014-02-12  Tom Tromey  <tromey@redhat.com>
4737
4738         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
4739         convert_int_to_ascii.
4740         * regcache.c (registers_to_string, collect_register_as_string):
4741         Likewise.
4742         * remote-utils.c (look_up_one_symbol, relocate_instruction):
4743         Likewise.
4744         * server.c (process_serial_event): Likewise.
4745         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
4746         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
4747
4748 2014-02-12  Tom Tromey  <tromey@redhat.com>
4749
4750         * remote-utils.c (look_up_one_symbol, monitor_output): Use
4751         bin2hex, not hexify.
4752         * tracepoint.c (cmd_qtstatus): Likewise.
4753
4754 2014-02-12  Tom Tromey  <tromey@redhat.com>
4755
4756         * remote-utils.c (monitor_output): Pass explicit length to
4757         hexify.
4758
4759 2014-02-12  Tom Tromey  <tromey@redhat.com>
4760
4761         * tracepoint.c: Include rsp-low.h.
4762         * server.c: Include rsp-low.h.
4763         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
4764         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
4765         declare.
4766         * remote-utils.c: Include rsp-low.h.
4767         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
4768         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
4769         (convert_int_to_ascii, convert_ascii_to_int): Move to
4770         common/rsp-low.c.
4771         * regcache.c: Include rsp-low.h.
4772         * ax.c: Include rsp-low.h.
4773         * Makefile.in (SFILES): Add common/rsp-low.c.
4774         (OBS): Add rsp-low.o.
4775         (rsp-low.o): New target.
4776
4777 2014-02-12  Tom Tromey  <tromey@redhat.com>
4778
4779         * utils.h (pulongest, plongest, phex_nz): Don't declare.
4780         Include print-utils.h.
4781         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
4782         (plongest, thirty_two, phex_nz): Remove.
4783         * Makefile.in (SFILES): Add common/print-utils.c.
4784         (OBS): Add print-utils.o.
4785         (print-utils-ipa.o): New target.
4786         (print-utils.o): New target.
4787         (IPA_OBJS): Add print-utils-ipa.o.
4788
4789 2014-02-06  Tom Tromey  <tromey@redhat.com>
4790
4791         * Makefile.in (SFILES): Fix indentation.
4792
4793 2014-02-05  Doug Evans  <dje@google.com>
4794
4795         * linux-low.c (linux_wait_for_event): Improve comment.
4796         (linux_wait_1): Keep current_inferior in sync with event_child.
4797
4798 2014-01-22  Doug Evans  <dje@google.com>
4799
4800         * gdbthread.h (gdb_id_to_thread): Delete, unused.
4801
4802 2014-01-22  Doug Evans  <dje@google.com>
4803
4804         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
4805         * configure: Regenerate.
4806         * config.in: Regenerate.
4807         * Makefile.in (SFILES): Add debug.c.
4808         (OBS): Add debug.o.
4809         * debug.c: New file.
4810         * debug.h: New file.
4811         * linux-aarch64-low.c (*): Update all debugging printfs to use
4812         debug_printf instead of fprintf.
4813         * linux-arm-low.c (*): Ditto.
4814         * linux-cris-low.c (*): Ditto.
4815         * linux-crisv32-low.c (*): Ditto.
4816         * linux-m32r-low.c (*): Ditto.
4817         * linux-sparc-low.c (*): Ditto.
4818         * linux-x86.c (*): Ditto.
4819         * linux-low.c (*): Ditto.
4820         (linux_wait_1): Add calls to debug_enter, debug_exit.
4821         (linux_wait): Remove redundant debugging printf.
4822         (stop_all_lwps): Add calls to debug_enter, debug_exit.
4823         (linux_resume, unstop_all_lwps): Ditto.
4824         * mem-break.c (*): Update all debugging printfs to use
4825         debug_printf instead of fprintf.
4826         * remote-utils.c (*): Ditto.
4827         * thread-db.c (*): Ditto.
4828         * server.c #include <ctype.h>, "gdb_vecs.h".
4829         (debug_threads): Moved to debug.c.
4830         (*): Update all debugging printfs to use debug_printf instead of
4831         fprintf.
4832         (start_inferior): Replace call to fflush with call to debug_flush.
4833         (monitor_show_help): Mention set debug-format.
4834         (parse_debug_format_options): New function.
4835         (handle_monitor_command): Handle "monitor set debug-format".
4836         (gdbserver_usage): Mention --debug-format.
4837         (main): Parse --debug-format.
4838         * server.h (debug_threads): Declaration moved to debug.h.
4839         #include "debug.h".
4840         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4841         trace_debug_1 that uses debug_printf.
4842         (tracepoint_look_up_symbols): Update all debugging printfs to use
4843         debug_printf instead of fprintf.
4844
4845 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4846
4847         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4848         sys/ptrace.h.
4849
4850 2014-01-17  Pedro Alves  <palves@redhat.com>
4851
4852         PR build/16445
4853         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4854         defined after including gdb_proc_service.h.
4855
4856 2014-01-16  Doug Evans  <dje@google.com>
4857
4858         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4859         (match_dll): Use it.
4860
4861 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4862
4863         * target.h (target_ops) <read_btrace>: Change parameters and
4864         return type to allow error reporting.
4865         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4866         trace reading errors on.
4867         * linux-low.c (linux_low_read_btrace): Pass trace reading
4868         errors on.
4869         (linux_low_disable_btrace): New.
4870
4871 2014-01-15  Doug Evans  <dje@google.com>
4872
4873         * inferiors.c (thread_id_to_gdb_id): Delete.
4874         * inferiors.h (thread_id_to_gdb_id): Delete.
4875
4876 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4877
4878         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4879         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4880         versions.
4881
4882 2014-01-08  Pedro Alves  <palves@redhat.com>
4883
4884         * server.c (handle_status): Don't discard previous queued stop
4885         replies or thread's pending status here.
4886         (main) <disconnection>: Do it here instead.
4887
4888 2014-01-08  Pedro Alves  <palves@redhat.com>
4889
4890         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4891         * server.c (visit_actioned_threads, handle_pending_status): New
4892         function.
4893         (handle_v_cont): Factor out parts to ...
4894         (resume): ... this new function.  If in all-stop, and a thread
4895         being resumed has a pending status, report it without actually
4896         resuming.
4897         (myresume): Adjust to use the new 'resume' function.
4898         (clear_pending_status_callback, set_pending_status_callback)
4899         (find_status_pending_thread_callback): New functions.
4900         (handle_status): Handle the case of multiple threads having
4901         interesting statuses to report.  Report threads' real last signal
4902         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4903         with an interesting thread to report the status for, instead of
4904         always reporting the status of the first thread.
4905
4906 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4907
4908         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4909         * gdbreplay.c (gdbreplay_version): Likewise.
4910
4911 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4912
4913         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4914         iov.iov_len with the real length in use.
4915
4916 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4917
4918         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4919         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4920         for all targets that use win32-low.c.
4921         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4922         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4923
4924 2013-12-13  Pedro Alves  <palves@redhat.com>
4925
4926         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4927         if equal to TARGET_WAITKIND_LOADED.
4928         * win32-low.c (cached_status): New static global.
4929         (win32_wait): Add declaration.
4930         (do_initial_child_stuff): Flush all initial pending debug events
4931         up to the initial breakpoint.
4932         (win32_wait): If CACHED_STATUS was set, return that instead
4933         of doing a real wait.  Remove the code resuming the execution
4934         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4935         during the initial phase.  Also remove the code changing
4936         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4937         TARGET_WAITKIND_STOPPED.
4938
4939 2013-12-11  Yao Qi  <yao@codesourcery.com>
4940
4941         * notif.c (handle_notif_ack): Return 0 if no notification
4942         matches.
4943
4944 2013-11-20  Doug Evans  <dje@google.com>
4945
4946         * linux-low.c (linux_set_resume_request): Fix comment.
4947
4948 2013-11-20  Doug Evans  <dje@google.com>
4949
4950         * linux-low.c (resume_status_pending_p): Tweak comment.
4951
4952 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4953
4954         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4955         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4956         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4957         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4958         (srv_amd64_regobj): Add amd64-mpx.o.
4959         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4960         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4961         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4962         * i387-fp.c (num_pl_bnd_register) Added constant.
4963         (num_pl_bnd_cfg_registers) Added constant.
4964         (struct i387_xsave) Added reserved area and MPX fields.
4965         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4966         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4967         function.
4968         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4969         (init_registers_amd64_mpx_linux): Declare new function.
4970         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4971         (x86_64_regmap): Add MPX registers.
4972         (x86_linux_read_description): Add MPX case.
4973         (initialize_low_arch): Initialize MPX targets.
4974
4975 2013-11-18  Tom Tromey  <tromey@redhat.com>
4976
4977         * configure: Rebuild.
4978         * configure.ac: Don't check for stdlib.h.
4979         * gdbreplay.c: Unconditionally include stdlib.h.
4980
4981 2013-11-18  Tom Tromey  <tromey@redhat.com>
4982
4983         * config.in: Rebuild.
4984         * configure: Rebuild.
4985         * configure.ac: Don't use AC_HEADER_DIRENT.
4986
4987 2013-11-18  Tom Tromey  <tromey@redhat.com>
4988
4989         * server.h: Don't check HAVE_STRING_H.
4990         * gdbreplay.c: Don't check HAVE_STRING_H.
4991         * configure: Rebuild.
4992
4993 2013-11-18  Tom Tromey  <tromey@redhat.com>
4994
4995         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4996         LIBGNU.
4997
4998 2013-11-08  Tom Tromey  <tromey@redhat.com>
4999
5000         * configure, config.in: Rebuild.
5001         * configure.ac: Remove unused configury.
5002
5003 2013-11-08  Tom Tromey  <tromey@redhat.com>
5004
5005         * acinclude.m4: Include common.m4, codeset.m4.
5006         * configure, config.in: Rebuild.
5007         * configure.ac: Use GDB_AC_COMMON.
5008
5009 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
5010
5011         * linux-s390-low.c (HWCAP_S390_TE): New define.
5012         (s390_arch_setup): Consider the TE field in the HWCAP for
5013         determining 'have_regset_tdb'.
5014
5015 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
5016
5017         PR gdb/16014
5018         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
5019         call to sizeof.
5020
5021 2013-10-02  Pedro Alves  <palves@redhat.com>
5022
5023         * server.c (process_serial_event): Don't output "GDBserver
5024         exiting" if GDB is connected through stdio.
5025         * target.c (mywait): Likewise, be silent if GDB is connected
5026         through stdio.
5027
5028 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
5029
5030         * lynx-low.c (lynx_add_threads_after_attach): New function.
5031         (lynx_attach): Remove call to add_thread.  Add call to
5032         lynx_add_threads_after_attach instead.
5033
5034 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
5035
5036         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
5037         * config.in, configure: Regenerated.
5038
5039 2013-09-18  Yao Qi  <yao@codesourcery.com>
5040
5041         PR server/15959
5042         * server.c (start_inferior): Clear 'resume_info'.
5043
5044 2013-09-16  Jiong Wang  <jiwang@tilera.com>
5045
5046         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
5047         for each register.
5048
5049 2013-09-16  Jiong Wang  <jiwang@tilera.com>
5050
5051         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
5052         linux-tile-low.o to srv_tgtobj.
5053
5054 2013-09-16  Will Newton  <will.newton@linaro.org>
5055
5056         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
5057         out regs.
5058
5059 2013-09-06  Pedro Alves  <palves@redhat.com>
5060
5061         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
5062         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
5063         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
5064         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
5065         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
5066         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
5067
5068 2013-09-06  Pedro Alves  <palves@redhat.com>
5069
5070         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
5071         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
5072
5073 2013-09-06  Pedro Alves  <palves@redhat.com>
5074
5075         * linux-amd64-ipa.c: Include tracepoint.h.
5076         * linux-i386-ipa.c: Include tracepoint.h.
5077
5078 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
5079
5080         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
5081         (ps_get_thread_area): New function.
5082
5083 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
5084
5085         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
5086         (initialize_low_arch): Call init_registers_crisv32 rather than
5087         init_register_crisv32.
5088
5089 2013-09-05  Pedro Alves  <palves@redhat.com>
5090
5091         * server.h (handle_vFile, hostio_last_error_from_errno): Move
5092         to ...
5093         * hostio.h: ... this new file.
5094         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
5095         win32-low.c: Include hostio.h.
5096
5097 2013-09-05  Pedro Alves  <palves@redhat.com>
5098
5099         * server.h (gdb_client_data, handler_func, callback_handler_func)
5100         (delete_file_handler, add_file_handler, append_callback_event)
5101         (delete_callback_event, start_event_loop, initialize_event_loop):
5102         Move to event-loop.h and include it.
5103         * event-loop.h: New file.
5104
5105 2013-09-05  Pedro Alves  <palves@redhat.com>
5106
5107         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
5108         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
5109         (loaded_dll, unloaded_dll): Move to ...
5110         * dll.h: ... this new file.
5111         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
5112
5113 2013-09-05  Pedro Alves  <palves@redhat.com>
5114
5115         * server.h (current_process, get_thread_process, all_processes)
5116         (add_inferior_to_list, for_each_inferior, current_inferior)
5117         (remove_inferior, add_process, remove_process, find_process_pid)
5118         (have_started_inferiors_p, have_attached_inferiors_p)
5119         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
5120         (clear_inferiors, find_inferior, find_inferior_id)
5121         (inferior_target_data, set_inferior_target_data)
5122         (inferior_regcache_data, set_inferior_regcache_data): Move to
5123         inferiors.h, and include it.
5124         * inferiors.h: New file.
5125
5126 2013-09-05  Pedro Alves  <palves@redhat.com>
5127
5128         * server.h (struct emit_ops, current_insn_ptr, emit_error):
5129         Move ...
5130         * ax.h: ... here.
5131
5132 2013-09-05  Pedro Alves  <palves@redhat.com>
5133
5134         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
5135         tracepoint.h.
5136         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
5137         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
5138         (handle_tracepoint_general_set, handle_tracepoint_query)
5139         (tracepoint_finished_step, tracepoint_was_hit)
5140         (release_while_stepping_state_list, current_traceframe)
5141         (in_readonly_region, traceframe_read_mem)
5142         (fetch_traceframe_registers, traceframe_read_sdata)
5143         (traceframe_read_info, struct fast_tpoint_collect_status)
5144         (fast_tracepoint_collecting, force_unlock_trace_buffer)
5145         (handle_tracepoit_bkpts, initialize_low_tracepoint)
5146         (supply_fast_tracepoint_registers)
5147         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
5148         (ipa_tdesc, claim_trampoline_space)
5149         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
5150         (agent_mem_read, agent_get_trace_state_variable_value)
5151         (agent_set_trace_state_variable_value, agent_tsv_read)
5152         (agent_mem_read_string, get_raw_reg_func_addr)
5153         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
5154         * tracepoint.h: ... this new file.
5155
5156 2013-09-05  Pedro Alves  <palves@redhat.com>
5157
5158         * server.h (perror_with_name, error, fatal, warning, paddress)
5159         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
5160         include it.
5161         * utils.h: New file.
5162
5163 2013-09-05  Pedro Alves  <palves@redhat.com>
5164
5165         * server.h (remote_debug, noack_mode, transport_is_reliable)
5166         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
5167         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
5168         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
5169         (write_enn, initialize_async_io, enable_async_io)
5170         (disable_async_io, check_remote_input_interrupt_request)
5171         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
5172         (dead_thread_notify, prepare_resume_reply)
5173         (decode_address_to_semicolon, decode_address, decode_m_packet)
5174         (decode_M_packet, decode_X_packet, decode_xfer_write)
5175         (decode_search_memory_packet, unhexify, hexify)
5176         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
5177         (look_up_one_symbol, relocate_instruction)
5178         (monitor_output): Move to remote-utils.h, and include it.
5179         * remote-utils.h: New file.
5180
5181 2013-09-05  Pedro Alves  <palves@redhat.com>
5182
5183         * server.h (_): Delete.
5184
5185 2013-09-02  Pedro Alves  <palves@redhat.com>
5186
5187         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
5188         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
5189         allocated.
5190         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
5191
5192 2013-09-02  Pierre Muller  <muller@sourceware.org>
5193
5194         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
5195         or WriteProcessMemory complete successfully and handle
5196         ERROR_PARTIAL_COPY error.
5197
5198 2013-09-02  Pedro Alves  <palves@redhat.com>
5199
5200         * server.c (gdb_read_memory): Return -1 on traceframe memory read
5201         error instead of EIO.
5202
5203 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5204
5205         PR server/15604
5206         * linux-low.c: Include filestuff.h.
5207         (linux_create_inferior) <pid == 0>: Call close_most_fds.
5208         * lynx-low.c: Include filestuff.h.
5209         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
5210         * server.c: Include filestuff.h.
5211         (main): Call notice_open_fds.
5212         * spu-low.c: Include filestuff.h.
5213         (spu_create_inferior) <pid == 0>: Call close_most_fds.
5214
5215 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
5216
5217         * Makefile.in: Explain why ../target and ../nat are not
5218         listed as include file search paths.
5219         (linux-waitpid.o): New object file rule.
5220         * configure.srv (srv_native_linux_obj): New variable.
5221         Replace all occurrences of linux native object files with
5222         $srv_native_linux_obj.
5223         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
5224         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
5225         (linux_enable_event_reporting): Remove declaration.
5226         (my_waitpid): Moved to common/linux-waitpid.c.
5227         (linux_wait_for_event): Pass ptid when calling
5228         linux_enable_event_reporting.
5229         (linux_supports_tracefork_flag): Remove.
5230         (linux_enable_event_reporting): Likewise.
5231         (linux_tracefork_grandchild): Remove.
5232         (STACK_SIZE): Moved to common/linux-ptrace.c.
5233         (linux_tracefork_child): Remove.
5234         (linux_test_for_tracefork): Remove.
5235         (linux_look_up_symbols): Call linux_supports_traceclone.
5236         (initialize_low): Remove call to linux_test_for_tracefork.
5237         * linux-low.h (PTRACE_TYPE_ARG3): Move to
5238         common/linux-ptrace.h.
5239         (PTRACE_TYPE_ARG4): Likewise.
5240         Include linux-ptrace.h.
5241
5242 2013-08-21  Pedro Alves  <palves@redhat.com>
5243
5244         * config.in: Renegerate.
5245
5246 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
5247
5248         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
5249         (SFILES): Remove $(srcdir)/common/target-common.c and
5250         add $(srcdir)/target/waitstatus.c.
5251         (OBS): Remove target-common.o and add waitstatus.o.
5252         (server_h): Remove $(srcdir)/../common/target-common.h and
5253         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
5254         and $(srcdir)/../target/waitstatus.h.
5255         (target-common.o): Remove.
5256         (waitstatus.o): New target object file.
5257         * target.h: Do not include target-common.h and
5258         include target/resume.h, target/wait.h and
5259         target/waitstatus.h.
5260
5261 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
5262
5263         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
5264         to PTRACE_TYPE_ARG3.
5265         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
5266         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
5267         PTRACE_TYPE_ARG4.
5268         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
5269         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
5270
5271 2013-07-27  Jie Zhang  <jie@codesourcery.com>
5272             Daniel Jacobowitz  <dan@codesourcery.com>
5273             Yao Qi  <yao@codesourcery.com>
5274
5275         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
5276         (mips-linux-watch.o): New rule.
5277         (mips_linux_watch_h): New variable.
5278         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
5279         srv_tgtobj.
5280         * linux-mips-low.c: Include mips-linux-watch.h.
5281         (struct arch_process_info, struct arch_lwp_info): New.
5282         (update_watch_registers_callback): New function.
5283         (mips_linux_new_process, mips_linux_new_thread) New functions.
5284         (mips_linux_prepare_to_resume, mips_insert_point): New
5285         functions.
5286         (mips_remove_point, mips_stopped_by_watchpoint): New
5287         functions.
5288         (rsp_bp_type_to_target_hw_bp_type): New function.
5289         (mips_stopped_data_address): New function.
5290         (the_low_target): Add watchpoint support functions.
5291
5292 2013-07-27  Yao Qi  <yao@codesourcery.com>
5293
5294         * i386-low.c: Include break-common.h.
5295         (enum target_hw_bp_type): Remove.
5296
5297 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
5298
5299         * Makefile.in (SFILES): /common/target-common.c.
5300         (OBS): Add target-common.o.
5301         (server_h): Add $(srcdir)/../common/target-common.h.
5302         (target-common.o): New target.
5303         * server.c (queue_stop_reply_callback): Free
5304         status string after use.
5305         * target.c (target_waitstatus_to_string): Remove.
5306         * target.h: Include target-common.h.
5307         (resume_kind): Likewise.
5308         (target_waitkind): Likewise.
5309         (target_waitstatus): Likewise.
5310         (TARGET_WNOHANG): Likewise.
5311
5312 2013-07-04  Yao Qi  <yao@codesourcery.com>
5313
5314         * Makefile.in (host_alias): Use @host_noncanonical@.
5315         (target_alias): Use @target_noncanonical@.
5316         * configure.ac: Use ACX_NONCANONICAL_TARGET and
5317         ACX_NONCANONICAL_HOST.
5318         * configure: Regenerated.
5319
5320         Revert:
5321         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
5322
5323         * configure.ac (version_host, version_target): Set and AC_SUBST them.
5324         * configure: Rebuild.
5325         * Makefile.in (version_host, version_target): Get from configure.
5326         (version.c): Use $(version_host) and $(version_target).
5327
5328 2013-07-03  Pedro Alves  <palves@redhat.com>
5329
5330         * Makefile.in (config.status): Depend on development.sh.
5331         * acinclude.m4: Include libmcheck.m4.
5332         * configure: Regenerate.
5333
5334 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
5335
5336         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
5337         attribute inside the parentheses.
5338         (winapi_DebugSetProcessKillOnExit): Ditto.
5339         (winapi_DebugBreakProcess): Ditto.
5340         (winapi_GenerateConsoleCtrlEvent): Ditto.
5341
5342 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
5343
5344         * notif.h (notif_event): Add a dummy member to avoid compiler
5345         errors.
5346
5347 2013-07-01  Pedro Alves  <palves@redhat.com>
5348
5349         * hostio.c (HOSTIO_PATH_MAX): Define.
5350         (require_filename, handle_open, handle_unlink, handle_readlink):
5351         Use it.
5352
5353 2013-07-01  Pedro Alves  <palves@redhat.com>
5354
5355         * server.h: Include "pathmax.h".
5356         * linux-low.c: Don't include sys/param.h.
5357         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
5358         MAXPATHLEN.
5359         * win32-low.c: Don't include sys/param.h.
5360         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
5361
5362 2013-07-01  Pedro Alves  <palves@redhat.com>
5363
5364         * event-loop.c: Don't check HAVE_UNISTD_H before including
5365         <unistd.h>.
5366         * gdbreplay.c: Likewise.
5367         * remote-utils.c: Likewise.
5368         * server.c: Likewise.
5369         * configure.ac: Don't check for unistd.h.
5370         * configure: Regenerate.
5371
5372 2013-06-28  Tom Tromey  <tromey@redhat.com>
5373
5374         * Makefile.in (version.c): Use version.in, not
5375         common/version.in.
5376
5377 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
5378
5379         * configure.ac (version_host, version_target): Set and AC_SUBST them.
5380         * configure: Rebuild.
5381         * Makefile.in (version_host, version_target): Get from configure.
5382         (version.c): Use $(version_host) and $(version_target).
5383
5384 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
5385
5386         Fix trace-status to output user name without trailing colon.
5387         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
5388
5389 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
5390
5391         Fix trace-status to output proper start-time and stop-time.
5392         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
5393         output start time and stop time in hex as gdb expects.
5394
5395 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
5396
5397         * tracepoint.c (build_traceframe_info_xml): Output trace state
5398         variables present in the trace buffer.
5399
5400 2013-06-24  Tom Tromey  <tromey@redhat.com>
5401
5402         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
5403         create-version.sh.
5404         (version.o): Remove.
5405         * gdbreplay.c: Include version.h.
5406         (version, host_name): Don't declare.
5407         * server.h: Include version.h.
5408         (version, host_name): Don't declare.
5409
5410 2013-06-12  Pedro Alves  <palves@redhat.com>
5411
5412         * linux-x86-low.c (linux_is_elf64): Delete global.
5413         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
5414         with local linux_pid_exe_is_elf_64_file use.
5415
5416 2013-06-11  Pedro Alves  <palves@redhat.com>
5417
5418         * linux-low.c (regset_disabled, disable_regset): New functions.
5419         (regsets_fetch_inferior_registers)
5420         (regsets_store_inferior_registers): Use them.
5421         (initialize_regsets_info); Don't allocate the disabled_regsets
5422         array here.
5423         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
5424         comment.
5425
5426 2013-06-11  Pedro Alves  <palves@redhat.com>
5427
5428         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
5429         xmalloc.
5430
5431 2013-06-11  Pedro Alves  <palves@redhat.com>
5432
5433         * linux-x86-low.c (initialize_low_arch): Call
5434         init_registers_x32_avx_linux.
5435
5436 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
5437
5438         Fix compatibility with Android Bionic.
5439         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
5440         it is not empty.
5441
5442 2013-06-07  Pedro Alves  <palves@redhat.com>
5443
5444         PR server/14823
5445         * Makefile.in (OBS): Add tdesc.o.
5446         (IPA_OBJS): Add tdesc-ipa.o.
5447         (tdesc-ipa.o): New rule.
5448         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
5449         interface.
5450         * linux-low.c (new_inferior): Delete.
5451         (disabled_regsets, num_regsets): Delete.
5452         (linux_add_process): Adjust to set the new per-process
5453         new_inferior flag.
5454         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
5455         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
5456         was a stop.  When calling arch_setup, switch the current inferior
5457         to the thread that got an event.
5458         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
5459         (regsets_fetch_inferior_registers)
5460         (regsets_store_inferior_registers): New regsets_info parameter.
5461         Adjust to use it.
5462         (linux_register_in_regsets): New regs_info parameter.  Adjust to
5463         use it.
5464         (register_addr, fetch_register, store_register): New usrregs_info
5465         parameter.  Adjust to use it.
5466         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
5467         parameter regs_info.  Adjust to use it.
5468         (linux_fetch_registers): Get the current inferior's regs_info, and
5469         adjust to use it.
5470         (linux_store_registers): Ditto.
5471         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
5472         (initialize_low): Don't initialize the target_regsets here.  Call
5473         initialize_low_arch.
5474         * linux-low.h (target_regsets): Delete declaration.
5475         (struct regsets_info): New.
5476         (struct usrregs_info): New.
5477         (struct regs_info): New.
5478         (struct process_info_private) <new_inferior>: New field.
5479         (struct linux_target_ops): Delete the num_regs, regmap, and
5480         regset_bitmap fields.  New field regs_info.
5481         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
5482         * i387-fp.c (num_xmm_registers): Delete.
5483         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
5484         calls to new interface.
5485         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
5486         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
5487         Infer the number of xmm registers from the regcache's target
5488         description.
5489         * i387-fp.h (num_xmm_registers): Delete.
5490         * inferiors.c (add_thread): Don't install the thread's regcache
5491         here.
5492         * proc-service.c (gregset_info): Fetch the current inferior's
5493         regs_info.  Adjust to use it.
5494         * regcache.c: Include tdesc.h.
5495         (register_bytes, reg_defs, num_registers)
5496         (gdbserver_expedite_regs): Delete.
5497         (get_thread_regcache): If the thread doesn't have a regcache yet,
5498         create one, instead of aborting gdbserver.
5499         (regcache_invalidate_one): Rename to ...
5500         (regcache_invalidate_thread): ... this.
5501         (regcache_invalidate_one): New.
5502         (regcache_invalidate): Only invalidate registers of the current
5503         process.
5504         (init_register_cache): Add target_desc parameter, and use it.
5505         (new_register_cache): Ditto.  Assert the target description has a
5506         non zero registers_size.
5507         (regcache_cpy): Add assertions.  Adjust.
5508         (realloc_register_cache, set_register_cache): Delete.
5509         (registers_to_string, registers_from_string): Adjust.
5510         (find_register_by_name, find_regno, find_register_by_number)
5511         (register_cache_size): Add target_desc parameter, and use it.
5512         (free_register_cache_thread, free_register_cache_thread_one)
5513         (regcache_release, register_cache_size): New.
5514         (register_size): Add target_desc parameter, and use it.
5515         (register_data, supply_register, supply_register_zeroed)
5516         (supply_regblock, supply_register_by_name, collect_register)
5517         (collect_register_as_string, collect_register_by_name): Adjust.
5518         * regcache.h (struct target_desc): Forward declare.
5519         (struct regcache) <tdesc>: New field.
5520         (init_register_cache, new_register_cache): Add target_desc
5521         parameter.
5522         (regcache_invalidate_thread): Declare.
5523         (regcache_invalidate_one): Delete declaration.
5524         (regcache_release): Declare.
5525         (find_register_by_number, register_cache_size, register_size)
5526         (find_regno): Add target_desc parameter.
5527         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
5528         declarations.
5529         * remote-utils.c: Include tdesc.h.
5530         (outreg, prepare_resume_reply): Adjust.
5531         * server.c: Include tdesc.h.
5532         (gdbserver_xmltarget): Delete declaration.
5533         (get_features_xml, process_serial_event): Adjust.
5534         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
5535         declare.
5536         (struct process_info) <tdesc>: New field.
5537         (ipa_tdesc): Declare.
5538         * tdesc.c: New file.
5539         * tdesc.h: New file.
5540         * tracepoint.c: Include tdesc.h.
5541         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
5542         (get_context_regcache): Adjust to pass ipa_tdesc down.
5543         (do_action_at_tracepoint): Adjust to get the register cache size
5544         from the context regcache's description.
5545         (traceframe_walk_blocks): Adjust to get the register cache size
5546         from the current trace frame's description.
5547         (traceframe_get_pc): Adjust to get current trace frame's
5548         description and pass it down.
5549         (gdb_collect): Adjust to get the register cache size from the
5550         IPA's description.
5551         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
5552         (gdbserver_xmltarget): Delete.
5553         (initialize_low_tracepoint): Set the ipa's target description.
5554         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
5555         (initialize_low_tracepoint): Set the ipa's target description.
5556         * linux-x86-low.c: Include tdesc.h.
5557         [__x86_64__] (is_64bit_tdesc): New.
5558         (ps_get_thread_area, x86_get_thread_area): Use it.
5559         (i386_cannot_store_register): Rename to ...
5560         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
5561         (i386_cannot_fetch_register): Rename to ...
5562         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
5563         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
5564         to new interface.
5565         (target_regsets): Rename to ...
5566         (x86_regsets): ... this.
5567         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
5568         interface.
5569         (x86_siginfo_fixup): Use is_64bit_tdesc.
5570         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
5571         (tdesc_x32_avx_linux, tdesc_x32_linux)
5572         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
5573         Declare.
5574         (x86_linux_update_xmltarget): Delete.
5575         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
5576         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
5577         (AMD64_LINUX_USER64_CS): New.
5578         (x86_linux_read_description): New, based on
5579         x86_linux_update_xmltarget.
5580         (same_process_callback): New.
5581         (x86_arch_setup_process_callback): New.
5582         (x86_linux_update_xmltarget): New.
5583         (x86_regsets_info): New.
5584         (amd64_linux_regs_info): New.
5585         (i386_linux_usrregs_info): New.
5586         (i386_linux_regs_info): New.
5587         (x86_linux_regs_info): New.
5588         (x86_arch_setup): Reimplement.
5589         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
5590         (x86_emit_ops): Ditto.
5591         (the_low_target): Adjust.  Install x86_linux_regs_info,
5592         x86_cannot_fetch_register, and x86_cannot_store_register.
5593         (initialize_low_arch): New.
5594         * linux-ia64-low.c (tdesc_ia64): Declare.
5595         (ia64_fetch_register): Adjust.
5596         (ia64_usrregs_info, regs_info): New globals.
5597         (ia64_regs_info): New function.
5598         (the_low_target): Adjust.
5599         (initialize_low_arch): New function.
5600         * linux-sparc-low.c (tdesc_sparc64): Declare.
5601         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
5602         Adjust.
5603         (sparc_arch_setup): New function.
5604         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
5605         (the_low_target): Adjust.
5606         (initialize_low_arch): New function.
5607         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
5608         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
5609         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
5610         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
5611         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
5612         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
5613         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
5614         (tdesc_powerpc_isa205_vsx64l): Declare.
5615         (ppc_cannot_store_register, ppc_collect_ptrace_register)
5616         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
5617         (ppc_set_pc, ppc_get_hwcap): Adjust.
5618         (ppc_usrregs_info): Forward declare.
5619         (!__powerpc64__) ppc_regmap_adjusted: New global.
5620         (ppc_arch_setup): Adjust to the current process'es target
5621         description.
5622         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
5623         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
5624         (ppc_store_evrregset): Adjust.
5625         (target_regsets): Rename to ...
5626         (ppc_regsets): ... this, and make static.
5627         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
5628         (ppc_regs_info): New function.
5629         (the_low_target): Adjust.
5630         (initialize_low_arch): New function.
5631         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
5632         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
5633         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
5634         (tdesc_s390x_linux64v2): Declare.
5635         (s390_collect_ptrace_register, s390_supply_ptrace_register)
5636         (s390_fill_gregset, s390_store_last_break): Adjust.
5637         (target_regsets): Rename to ...
5638         (s390_regsets): ... this, and make static.
5639         (s390_get_pc, s390_set_pc): Adjust.
5640         (s390_get_hwcap): New target_desc parameter, and use it.
5641         [__s390x__] (have_hwcap_s390_high_gprs): New global.
5642         (s390_arch_setup): Adjust to set the current process'es target
5643         description.  Don't adjust the regmap.
5644         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
5645         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
5646         (regs_info_3264): New globals.
5647         (s390_regs_info): New function.
5648         (the_low_target): Adjust.
5649         (initialize_low_arch): New function.
5650         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
5651         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
5652         [__mips64] (init_registers_mips_linux)
5653         (init_registers_mips_dsp_linux): Delete defines.
5654         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
5655         (have_dsp): New global.
5656         (mips_read_description): New, based on mips_arch_setup.
5657         (mips_arch_setup): Reimplement.
5658         (get_usrregs_info): New function.
5659         (mips_cannot_fetch_register, mips_cannot_store_register)
5660         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
5661         (mips_fill_fpregset, mips_store_fpregset): Adjust.
5662         (target_regsets): Rename to ...
5663         (mips_regsets): ... this, and make static.
5664         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
5665         (dsp_regs_info, regs_info): New globals.
5666         (mips_regs_info): New function.
5667         (the_low_target): Adjust.
5668         (initialize_low_arch): New function.
5669         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
5670         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
5671         Declare.
5672         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
5673         (arm_read_description): New, with bits factored from
5674         arm_arch_setup.
5675         (arm_arch_setup): Reimplement.
5676         (target_regsets): Rename to ...
5677         (arm_regsets): ... this, and make static.
5678         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
5679         (arm_regs_info): New function.
5680         (the_low_target): Adjust.
5681         (initialize_low_arch): New function.
5682         * linux-m68k-low.c (tdesc_m68k): Declare.
5683         (target_regsets): Rename to ...
5684         (m68k_regsets): ... this, and make static.
5685         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
5686         (m68k_regs_info): New function.
5687         (m68k_arch_setup): New function.
5688         (the_low_target): Adjust.
5689         (initialize_low_arch): New function.
5690         * linux-sh-low.c (tdesc_sharch): Declare.
5691         (target_regsets): Rename to ...
5692         (sh_regsets): ... this, and make static.
5693         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
5694         (sh_regs_info, sh_arch_setup): New functions.
5695         (the_low_target): Adjust.
5696         (initialize_low_arch): New function.
5697         * linux-bfin-low.c (tdesc_bfin): Declare.
5698         (bfin_arch_setup): New function.
5699         (bfin_usrregs_info, regs_info): New globals.
5700         (bfin_regs_info): New function.
5701         (the_low_target): Adjust.
5702         (initialize_low_arch): New function.
5703         * linux-cris-low.c (tdesc_cris): Declare.
5704         (cris_arch_setup): New function.
5705         (cris_usrregs_info, regs_info): New globals.
5706         (cris_regs_info): New function.
5707         (the_low_target): Adjust.
5708         (initialize_low_arch): New function.
5709         * linux-cris-low.c (tdesc_crisv32): Declare.
5710         (cris_arch_setup): New function.
5711         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
5712         (cris_regs_info): New function.
5713         (the_low_target): Adjust.
5714         (initialize_low_arch): New function.
5715         * linux-m32r-low.c (tdesc_m32r): Declare.
5716         (m32r_arch_setup): New function.
5717         (m32r_usrregs_info, regs_info): New globals.
5718         (m32r_regs_info): Adjust.
5719         (initialize_low_arch): New function.
5720         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
5721         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
5722         (tic6x_usrregs_info): Forward declare.
5723         (tic6x_read_description): New function, based on ...
5724         (tic6x_arch_setup): ... this.  Reimplement.
5725         (target_regsets): Rename to ...
5726         (tic6x_regsets): ... this, and make static.
5727         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
5728         (tic6x_regs_info): New function.
5729         (the_low_target): Adjust.
5730         (initialize_low_arch): New function.
5731         * linux-xtensa-low.c (tdesc_xtensa): Declare.
5732         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
5733         (target_regsets): Rename to ...
5734         (xtensa_regsets): ... this, and make static.
5735         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
5736         globals.
5737         (xtensa_arch_setup, xtensa_regs_info): New functions.
5738         (the_low_target): Adjust.
5739         (initialize_low_arch): New function.
5740         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
5741         (nios2_arch_setup): Set the current process'es tdesc.
5742         (target_regsets): Rename to ...
5743         (nios2_regsets): ... this.
5744         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
5745         (nios2_regs_info): New function.
5746         (the_low_target): Adjust.
5747         (initialize_low_arch): New function.
5748         * linux-aarch64-low.c (tdesc_aarch64): Declare.
5749         (aarch64_arch_setup): Set the current process'es tdesc.
5750         (target_regsets): Rename to ...
5751         (aarch64_regsets): ... this.
5752         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
5753         (aarch64_regs_info): New function.
5754         (the_low_target): Adjust.
5755         (initialize_low_arch): New function.
5756         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
5757         globals.
5758         (target_regsets): Rename to ...
5759         (tile_regsets): ... this.
5760         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
5761         (tile_regs_info): New function.
5762         (tile_arch_setup): Set the current process'es tdesc.
5763         (the_low_target): Adjust.
5764         (initialize_low_arch): New function.
5765         * spu-low.c (tdesc_spu): Declare.
5766         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
5767         * win32-arm-low.c (tdesc_arm): Declare.
5768         (arm_arch_setup): New function.
5769         (the_low_target): Install arm_arch_setup instead of
5770         init_registers_arm.
5771         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
5772         (init_windows_x86): Rename to ...
5773         (i386_arch_setup): ... this.  Set `win32_tdesc'.
5774         (the_low_target): Adjust.
5775         * win32-low.c (win32_tdesc): New global.
5776         (child_add_thread): Don't create the thread cache here.
5777         (do_initial_child_stuff): Set the new process'es tdesc.
5778         * win32-low.h (struct target_desc): Forward declare.
5779         (win32_tdesc): Declare.
5780         * lynx-i386-low.c (tdesc_i386): Declare global.
5781         (lynx_i386_arch_setup): Set `lynx_tdesc'.
5782         * lynx-low.c (lynx_tdesc): New global.
5783         (lynx_add_process): Set the new process'es tdesc.
5784         * lynx-low.h (struct target_desc): Forward declare.
5785         (lynx_tdesc): Declare global.
5786         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
5787         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
5788         * nto-low.c (nto_tdesc): New global.
5789         (do_attach): Set the new process'es tdesc.
5790         * nto-low.h (struct target_desc): Forward declare.
5791         (nto_tdesc): Declare.
5792         * nto-x86-low.c (tdesc_i386): Declare.
5793         (nto_x86_arch_setup): Set `nto_tdesc'.
5794
5795 2013-06-04  Gary Benson  <gbenson@redhat.com>
5796
5797         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
5798         to qSupported response when appropriate.
5799         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
5800         with nonzero-length annex.
5801         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
5802         arguments supplied in annex.
5803
5804 2013-05-31  Doug Evans  <dje@google.com>
5805
5806         PR server/15594
5807         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
5808         64 bits in 64-cross-32 environment.
5809
5810 2013-05-28  Pedro Alves  <palves@redhat.com>
5811
5812         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
5813         (aarch64-without-fpu.c): Delete rule.
5814         * configure.srv (aarch64*-*-linux*): Remove references to
5815         aarch64-without-fpu.o and aarch64-without-fpu.xml.
5816         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
5817         declaration.
5818
5819 2013-05-24  Pedro Alves  <palves@redhat.com>
5820
5821         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
5822         instead of strchr/decode_address.  Error if the range isn't split
5823         with a ','.  Don't assume there's be a ':' in the action.
5824
5825 2013-05-23  Yao Qi  <yao@codesourcery.com>
5826             Pedro Alves  <palves@redhat.com>
5827
5828         * linux-low.c (lwp_in_step_range): New function.
5829         (linux_wait_1): If the thread was range stepping and stopped
5830         outside the stepping range, report the stop to GDB.  Otherwise,
5831         continue stepping.  Add range stepping debug output.
5832         (linux_set_resume_request): Copy the step range from the resume
5833         request to the lwp.
5834         (linux_supports_range_stepping): New.
5835         (linux_target_ops) <supports_range_stepping>: Set to
5836         linux_supports_range_stepping.
5837         * linux-low.h (struct linux_target_ops)
5838         <supports_range_stepping>: New field.
5839         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5840         * linux-x86-low.c (x86_supports_range_stepping): New.
5841         (the_low_target) <supports_range_stepping>: Set to
5842         x86_supports_range_stepping.
5843         * server.c (handle_v_cont): Handle 'r' action.
5844         (handle_v_requests): Append ";r" if the target supports range
5845         stepping.
5846         * target.h (struct thread_resume) <step_range_start,
5847         step_range_end>: New fields.
5848         (struct target_ops) <supports_range_stepping>:
5849         New field.
5850         (target_supports_range_stepping): New macro.
5851
5852 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5853
5854         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5855         confusion in comment.
5856
5857 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5858
5859         * lynx-low.c (struct process_info_private): New type.
5860         (lynx_add_process): New function.
5861         (lynx_create_inferior, lynx_attach): Replace calls to
5862         add_process by calls to lynx_add_process.
5863         (lynx_resume): If PTID is null, then try using
5864         current_process()->private->last_wait_event_ptid.
5865         Add comments.
5866         (lynx_clear_inferiors): Delete.  The contents of that function
5867         has been inlined in lynx_mourn;
5868         (lynx_wait_1): Save the ptid in the process's private data.
5869         (lynx_mourn): Free the process' private data.  Replace call
5870         to lynx_clear_inferiors by call to clear_inferiors.
5871
5872 2013-05-17  Yao Qi  <yao@codesourcery.com>
5873
5874         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5875         the right place.
5876
5877 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5878
5879         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5880         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5881         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5882         PT_TEXT_END_ADDR guards.  Update comments.
5883         (linux_target_op) <read_offsets>: Conditionally define to
5884         linux_read_offsets if the target is UCLIBC and if it defines
5885         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5886
5887 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5888             Andrew Jenner  <andrew@codesourcery.com>
5889
5890         * Makefile.in (SFILES): Add linux-nios2-low.c.
5891         (clean): Add action to delete nios2-linux.c.
5892         (nios2-linux.c): New rule.
5893         * configure.srv: Add nios2*-*-linux*.
5894         * linux-nios2-low.c: New.
5895
5896 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5897
5898         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5899
5900 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5901
5902         PR gdb/15186
5903         * ax.c (ax_printf): Add fflush.
5904
5905 2013-04-22  Tom Tromey  <tromey@redhat.com>
5906
5907         * Makefile.in (SFILES): Add filestuff.c.
5908         (OBS): Add filestuff.o.
5909         (filestuff.o): New target.
5910         * config.in, configure: Rebuild.
5911         * configure.ac: Check for fdwalk, pipe2.
5912
5913 2013-04-17  Pedro Alves  <palves@redhat.com>
5914
5915         * configure.ac (USE_THREAD_DB): Delete variable.
5916         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5917         Don't AC_SUBST USE_THREAD_DB.
5918         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5919         * config.in, configure: Regenerate.
5920
5921 2013-04-16  Pedro Alves  <palves@redhat.com>
5922
5923         * linux-low.h (struct lwp_info) <thread_known>: Move under
5924         the USE_THREAD_DB #ifdef.
5925
5926 2013-04-16  Pedro Alves  <palves@redhat.com>
5927
5928         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5929         (linux-low.o): Delete rule.
5930         * linux-low.h: Always include "gdb_thread_db.h" instead of
5931         conditionally including thread_db.h.
5932         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5933         HAVE_THREAD_DB_H.
5934
5935 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5936
5937         * Makefile.in (install-only): Fix make install regression.
5938
5939 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5940
5941         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5942         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5943         installation.
5944         * gdbserver.1: Remove.
5945
5946 2013-03-22  Pedro Alves  <palves@redhat.com>
5947
5948         * linux-low.c (handle_extended_wait): Don't call
5949         linux_enable_event_reporting.
5950
5951 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5952
5953         PR build/9098:
5954         * Makefile.in (SHELL): Use @SHELL@.
5955
5956 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5957
5958         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5959         compiler warning.
5960
5961 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5962
5963         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5964         Remove extraneous NULL element.
5965
5966 2013-03-13  Yao Qi  <yao@codesourcery.com>
5967
5968         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5969         'V' block in trace frame.
5970
5971 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5972
5973         * target.h (struct target_ops): Add btrace ops.
5974         (target_supports_btrace): New macro.
5975         (target_enable_btrace): New macro.
5976         (target_disable_btrace): New macro.
5977         (target_read_btrace): New macro.
5978         * gdbthread.h (struct thread_info): Add btrace field.
5979         * server.c: Include btrace-common.h.
5980         (handle_btrace_general_set): New function.
5981         (handle_btrace_enable): New function.
5982         (handle_btrace_disable): New function.
5983         (handle_general_set): Call handle_btrace_general_set.
5984         (handle_qxfer_btrace): New function.
5985         (struct qxfer qxfer_packets[]): Add btrace entry.
5986         * inferiors.c (remove_thread): Disable btrace.
5987         * linux-low: Include linux-btrace.h.
5988         (linux_low_enable_btrace): New function.
5989         (linux_low_read_btrace): New function.
5990         (linux_target_ops): Add btrace ops.
5991         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5992         Add srv_linux_btrace=yes.
5993         (x86_64-*-linux*): Add linux-btrace.o.
5994         Add srv_linux_btrace=yes.
5995         * configure.ac: Define HAVE_LINUX_BTRACE.
5996         * config.in: Regenerated.
5997         * configure: Regenerated.
5998
5999 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
6000
6001         * server.c (handle_qxfer): Preserve error message if -3 is
6002         returned.
6003         (qxfer): Document the -3 return value.
6004
6005 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
6006
6007         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
6008         (linux_btrace_h): New variable.
6009         (linux-btrace.o): New rule.
6010
6011 2013-03-08  Stan Shebs  <stan@codesourcery.com>
6012             Hafiz Abid Qadeer  <abidh@codesourcery.com>
6013
6014         * tracepoint.c (trace_buffer_size): New global.
6015         (DEFAULT_TRACE_BUFFER_SIZE): New define.
6016         (init_trace_buffer): Change to one-argument function. Allocate
6017         trace buffer memory.
6018         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
6019         handle QTBuffer:size packet.
6020         (cmd_bigqtbuffer_size): New function.
6021         (initialize_tracepoint): Call init_trace_buffer with
6022         DEFAULT_TRACE_BUFFER_SIZE.
6023         * server.c (handle_query): Add QTBuffer:size in the
6024         supported packets.
6025
6026 2013-03-07  Yao Qi  <yao@codesourcery.com>
6027
6028         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
6029         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
6030         of -1.
6031         (cmd_qtsp): Adjust condition.  Do post increment.
6032         Set cur_action and cur_step_action back to 0.
6033
6034 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
6035
6036         PR server/15236
6037         * linux-low.c (linux_write_memory): Return early success if LEN is
6038         zero.
6039
6040 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
6041
6042         * configure.srv: Add x86_64-*-cygwin* as target.
6043
6044 2013-02-28  Tom Tromey  <tromey@redhat.com>
6045
6046         * configure.ac: Invoke AC_SYS_LARGEFILE.
6047         * configure, config.in: Rebuild.
6048
6049 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
6050
6051         * win32-low.c: Throughout, fix format strings and casts of
6052         printf-like functions to avoid type related warnings on all
6053         platforms.
6054         (get_child_debug_event): Print dwDebugEventCode as hex since
6055         that's how it's usually documented.
6056
6057 2013-02-28  Yao Qi  <yao@codesourcery.com>
6058
6059         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
6060         pulongest.
6061
6062 2013-02-27  Jiong Wang  <jiwang@tilera.com>
6063
6064         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
6065         (reg-tilegx32.c): New rule.
6066         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
6067         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
6068         different register info initializer according to elf class.
6069         (init_registers_tilgx32): New function.  The tilegx32 register info
6070         initializer.
6071         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
6072         (tile_store_gregset): Likewise.
6073
6074 2013-02-27  Yao Qi  <yao@codesourcery.com>
6075
6076         * server.c (process_point_options): Print debug message when
6077         debug_threads is true.
6078
6079 2013-02-26  Yao Qi  <yao@codesourcery.com>
6080
6081         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
6082
6083 2013-02-19  Pedro Alves  <palves@redhat.com>
6084             Kai Tietz <ktietz@redhat.com>
6085
6086         PR gdb/15161
6087
6088         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
6089         instead of strtoul to extract address from packet.
6090         (process_serial_event) <'z'>: Likewise.
6091
6092 2013-02-18  Yao Qi  <yao@codesourcery.com>
6093
6094         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
6095
6096 2013-02-14  Pedro Alves  <palves@redhat.com>
6097
6098         Plug memory leak.
6099
6100         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
6101         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
6102
6103 2013-02-14  Pedro Alves  <palves@redhat.com>
6104
6105         * tracepoint.c (cmd_qtdpsrc): Use savestring.
6106
6107 2013-02-14  Pedro Alves  <palves@redhat.com>
6108
6109         * tracepoint.c (save_string): Delete.
6110         (add_tracepoint_action): Use savestring instead of save_string.
6111
6112 2013-02-12  Pedro Alves  <palves@redhat.com>
6113
6114         * linux-xtensa-low.c: Ditto.
6115         * xtensa-xtregs.c: Ditto.
6116
6117 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
6118
6119         * thread-db.c (thread_db_get_tls_address): NULL pointer check
6120         thread_db.
6121
6122 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
6123
6124         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
6125         aarch64_num_wp_regs and aarch64_num_bp_regs to
6126         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
6127
6128 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
6129
6130         * linux-aarch64-low.c (ps_get_thread_area): Replace
6131         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
6132
6133 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
6134             Marcus Shawcroft  <marcus.shawcroft@arm.com>
6135             Nigel Stephens  <nigel.stephens@arm.com>
6136             Yufeng Zhang  <yufeng.zhang@arm.com>
6137
6138         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
6139         (aarch64.c, aarch64-without-fpu.c): New targets.
6140         * configure.srv (aarch64*-*-linux*): New.
6141         * linux-aarch64-low.c: New file.
6142
6143 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
6144
6145         * linux-low.c (handle_extended_wait, linux_create_inferior)
6146         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
6147         (dequeue_one_deferred_signal, linux_resume_one_thread)
6148         (fetch_register, linux_write_memory, linux_enable_event_reporting)
6149         (linux_tracefork_grandchild, linux_test_for_tracefork)
6150         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
6151         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
6152         where the argument is 0.
6153
6154 2013-01-25  Yao Qi  <yao@codesourcery.com>
6155
6156         * event-loop.c: Include "queue.h".
6157         (gdb_event_p): New typedef.
6158         (struct gdb_event) <next_event>: Remove.
6159         (event_queue): Change to QUEUE(gdb_event_p).
6160         (async_queue_event): Remove.
6161         (gdb_event_xfree): New.
6162         (initialize_event_loop): New.
6163         (process_event): Use API from QUEUE.
6164         (wait_for_event): Likewise.
6165         * server.c (main): Call initialize_event_loop.
6166         * server.h (initialize_event_loop): Declare.
6167
6168 2013-01-18  Yao Qi  <yao@codesourcery.com>
6169
6170         * ax.h (struct eval_agent_expr_context): New.
6171         (gdb_eval_agent_expr): Update declaration.
6172         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
6173         TFRAME.  Add new argument CTX.
6174         * server.h (struct eval_agent_expr_context): Declare.
6175         (agent_mem_read, agent_tsv_read): Update declaration.
6176         (agent_mem_read_string): Likewise.
6177         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
6178         (add_traceframe_block): Add new argument TPOINT.
6179         Increase TPOINT->traceframe_usage.
6180         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
6181         eval_tracepoint_agent_expr.
6182         (condition_true_at_tracepoint): Likewise.
6183         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
6184         (agent_mem_read_string, agent_tsv_read): Likewise.
6185
6186 2013-01-16  Yao Qi  <yao@codesourcery.com>
6187
6188         * linux-low.c (linux_resume_one_lwp): Don't check
6189         'lwp->bp_reinsert != 0'.
6190
6191 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6192             Pedro Alves  <palves@redhat.com>
6193
6194         * lynx-low.c (ptrace_request_to_str): Define a temporary
6195         macro and use it to simplify this function's implementation.
6196
6197 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6198
6199         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
6200         sets errno.
6201
6202 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6203
6204         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
6205
6206 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6207
6208         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
6209
6210 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6211
6212         * lynx-low.c (lynx_resume): Use the resume_info parameter
6213         to determine the ptid for the lynx_ptrace call, unless
6214         it is equal to minus_one_ptid, in which case we use the
6215         ptid of the current_inferior.
6216         (lynx_wait_1): After having received a thread create/exit
6217         event, resume the inferior's execution using the signaling
6218         thread's ptid, rather than the old ptid.
6219
6220 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
6221
6222         * lynx-low.c (lynx_resume): Delete variable ret.
6223
6224 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
6225
6226         * gdbreplay.c (gdbreplay_version): Update copyright year.
6227         * server.c (gdbserver_version): Likewise.
6228
6229 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
6230
6231         * lynx-low.c (lynx_wait_1): Add debug trace before adding
6232         new thread.
6233
6234 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
6235
6236         * lynx-low.c (ptrace_request_to_str): Add handling for
6237         PTRACE_GETTRACESIG.
6238
6239 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
6240
6241         * lynx-low.c (lynx_attach): Delete variable new_process.
6242
6243 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
6244
6245         * lynx-low.c (lynx_create_inferior): Delete variable
6246         new_process.
6247
6248 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
6249
6250         * lynx-low.c (ptrace_request_to_str): Do not handle
6251         PTRACE_GETTHREADLIST if this macro does not exist.
6252
6253 2012-12-15  Yao Qi  <yao@codesourcery.com>
6254
6255         * Makefile.in (OBS): Add notif.o.
6256         * notif.c, notif.h: New.
6257         * server.c: Include "notif.h".
6258         (struct vstop_notif) <next>: Remove.
6259         <base>: New field.
6260         (queue_stop_reply): Update.
6261         (push_event, send_next_stop_reply): Remove.
6262         (discard_queued_stop_replies): Update.
6263         (notif_stop): New variable.
6264         (handle_v_stopped): Remove.
6265         (handle_v_requests): Don't call handle_v_stopped.  Call
6266         handle_ack_notif instead.
6267         (queue_stop_reply_callback): Call notif_event_enque instead
6268         of queue_stop_reply.
6269         (handle_status): Don't call send_next_stop_reply, call
6270         notif_write_event instead.
6271         (kill_inferior_callback): Likewise.
6272         (detach_or_kill_inferior_callback): Likewise.
6273         (main): Call initialize_notif.
6274         (process_serial_event): Call QUEUE_is_empty.
6275         (handle_target_event): Call notif_push instead of push event.
6276         * server.h (push_event): Remove declaration.
6277
6278 2012-12-10  Tom Tromey  <tromey@redhat.com>
6279
6280         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
6281         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
6282         macros.
6283         (.c.o): Rewrite.
6284         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
6285         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
6286         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
6287         (amd64-linux-ipa.o, ax.o): Rewrite.
6288         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
6289         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
6290         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
6291         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
6292         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
6293         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
6294         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
6295         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
6296         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
6297         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
6298         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
6299         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
6300         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
6301         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
6302         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
6303         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
6304         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
6305         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
6306         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
6307         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
6308         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
6309         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
6310         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
6311         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
6312         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
6313         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
6314         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
6315         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
6316         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
6317         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
6318         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
6319         (reg-tilegx.o): Remove.
6320         (all_object_files): New macro.
6321         Include .deps files.
6322         * aclocal.m4, configure: Rebuild.
6323         * acinclude.m4: Include depstand.m4, lead-dot.m4.
6324         * configure.ac: Invoke ZW_CREATE_DEPDIR,
6325         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
6326
6327 2012-12-05  Tom Tromey  <tromey@redhat.com>
6328
6329         PR gdb/14917:
6330         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
6331
6332 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
6333
6334         * configure.ac: Check for linux/perf_event.h.
6335         * config.in: Regenerated.
6336         * configure: Regenerated.
6337
6338 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
6339
6340         * hostio.c (handle_readlink): Decrease buffer size
6341         parameter passed to readlink by one byte.
6342
6343 2012-11-26  Yao Qi  <yao@codesourcery.com>
6344
6345         * configure.ac (build_warnings): Append '-Wempty-body'.
6346         * configure: Regenerated.
6347         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
6348         body.
6349
6350 2012-11-15  Pierre Muller  <muller@sourceware.org>
6351
6352         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
6353         * config.in: Regenerate.
6354         * configure: Regenerate.
6355         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
6356         Use "gdb_wait.h" header instead of <sys/wait.h> header.
6357         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
6358         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
6359         header.
6360         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
6361         instead of <sys/wait.h> header.
6362         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
6363
6364 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
6365
6366         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
6367         (various make rules): Remove -DGDBSERVER
6368
6369 2012-11-09  Yao Qi  <yao@codesourcery.com>
6370
6371         * spu-low.c (current_ptid): Move it to ..
6372         * gdbthread.h: ... here.  New.
6373         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
6374         * server.c (myresume, process_serial_event): Likewise.
6375         * thread-db.c (thread_db_find_new_threads): Likewise.
6376         * tracepoint.c (run_inferior_command): Likewise.
6377
6378 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
6379
6380         * server.c (handle_search_memory_1): Include access length in
6381         warning message.
6382
6383 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
6384
6385         * linux-crisv32-low.c: Fix compile errors.
6386
6387 2012-09-04  Yao Qi  <yao@codesourcery.com>
6388
6389         * tracepoint.c (cmd_qtsv): Adjust debug message.
6390         Don't check CUR_TPOINT.
6391
6392 2012-08-28  Yao Qi  <yao@codesourcery.com>
6393
6394         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
6395         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
6396         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
6397         Remove declarations of xmalloc, xreallloc, xstrdup and
6398         freeargv.
6399         * Makefile.in (libiberty_h): New.
6400         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
6401         (linux-bfin-low.o): Append dependency 'libiberty.h'.
6402
6403 2012-08-23  Yao Qi  <yao@codesourcery.com>
6404
6405         * server.h: Remove declaration of 'xsnprintf'.
6406
6407 2012-08-22  Keith Seitz  <keiths@redhat.com>
6408
6409         * server.h: Include build-gnulib-gbserver/config.h.
6410         * gdbreplay.c: Likewise.
6411
6412 2012-08-08  Doug Evans  <dje@google.com>
6413
6414         * Makefile.in (SFILES): Add gdb_vecs.c.
6415         (OBS): Add gdb_vecs.o.
6416         (gdb_vecs_h, host_defs_h): New variables.
6417         (thread-db.o): Add $(gdb_vecs_h) dependency.
6418         (gdb_vecs.o): New rule.
6419         * thread-db.c: #include "gdb_vecs.h".
6420         (thread_db_load_search): Use a vector to iterate over path elements.
6421         Handle text appearing after "$pdir".
6422
6423         * configure.ac: Add check for strstr.
6424         * config.in: Regenerate.
6425         * configure: Regenerate.
6426
6427 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
6428
6429         * hostio.c (handle_pread): If pread fails, fall back to attempting
6430         lseek/read.
6431         (handle_pwrite): Likewise for pwrite.
6432
6433 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
6434
6435         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
6436         between unsupported TYPE and unimplementable ADDR/LEN combination.
6437         (arm_insert_point): Act on new return value.
6438
6439 2012-07-31  Pedro Alves  <palves@redhat.com>
6440
6441         * server.c (process_point_options): Only skip tokens if we find
6442         one that is unrecognized.  Don't treat 'X' specially while
6443         skipping unrecognized tokens.
6444
6445 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
6446
6447         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
6448         to 4-byte-align HW breakpoint addresses for Thumb.
6449
6450 2012-07-27  Yao Qi  <yao@codesourcery.com>
6451
6452         PR remote/14161.
6453
6454         * server.h: Declare gdb_agent_about_to_close.
6455         * target.c (kill_inferior): Include "agent.h".
6456         New.  Send command 'kill'.
6457         * target.h (kill_inferior): Removed macro.
6458         * tracepoint.c (gdb_agent_about_to_close): New.
6459         (gdb_agent_helper_thread): Handle command 'close'.
6460         Wait endlessly until the inferior stops.
6461         Install gdb_agent_remove_socket to atexit hook.
6462         (agent_socket_name): New static variable.
6463         (gdb_agent_socket_init): Replace local variable 'name' with
6464         'agent_socket_name'.
6465         (gdb_agent_remove_socket): New.
6466
6467 2012-07-27  Yao Qi  <yao@codesourcery.com>
6468
6469         * server.c (process_point_options): Stop at 'X' when parsing.
6470
6471 2012-07-19  Michael Eager  <eager@eagercon.com>
6472
6473         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
6474         to hw_execute.
6475         * linux-x86-low.c (x86_insert_point, x86_remove_point):
6476         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
6477         hardware breakpoint.
6478
6479 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
6480
6481         * gdbserver/linux-low.c (initialize_low): Call
6482         linux_ptrace_init_warnings.
6483
6484 2012-07-02  Doug Evans  <dje@google.com>
6485
6486         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
6487         pointer to int.
6488
6489 2012-07-02  Stan Shebs  <stan@codesourcery.com>
6490
6491         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
6492         (ax.o): Add it to build rule.
6493         (ax-ipa.o): Ditto.
6494         (OBS): Add format.o.
6495         (IPA_OBS): Add format.o.
6496         * server.c (handle_query): Claim support for breakpoint commands.
6497         (process_point_options): Add command case.
6498         (process_serial_event): Leave running if there are printfs in
6499         effect.
6500         * mem-break.h (any_persistent_commands): Declare.
6501         (add_breakpoint_commands): Declare.
6502         (gdb_no_commands_at_breakpoint): Declare.
6503         (run_breakpoint_commands): Declare.
6504         * mem-break.c (struct point_command_list): New struct.
6505         (struct breakpoint): New field command_list.
6506         (any_persistent_commands): New function.
6507         (add_commands_to_breakpoint): New function.
6508         (add_breakpoint_commands): New function.
6509         (gdb_no_commands_at_breakpoint): New function.
6510         (run_breakpoint_commands): New function.
6511         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
6512         locally.
6513         * ax.c: Include format.h.
6514         (ax_printf): New function.
6515         (gdb_eval_agent_expr): Add printf opcode.
6516
6517 2012-06-13  Yao Qi  <yao@codesourcery.com>
6518
6519         * server.c (start_inferior): Remove duplicated writes to fields
6520         'last_resume_kind' and 'last_status' of 'current_inferior'.
6521
6522 2012-06-12  Yao Qi  <yao@codesourcery.com>
6523             Pedro Alves  <palves@redhat.com>
6524
6525         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
6526         comment.
6527         * server.c (handle_v_cont): Extend comment.
6528
6529 2012-06-11  Yao Qi  <yao@codesourcery.com>
6530
6531         * linux-low.c (linux_attach): Add 'static'.
6532
6533 2012-06-06  Yao Qi  <yao@codesourcery.com>
6534
6535         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
6536
6537 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
6538
6539         Fix gcc -flto compilation warning.
6540         * server.c (main): Make variable multi_mode and attach volatile.
6541
6542 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6543
6544         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
6545         if the platform doesn't know about it.
6546
6547 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
6548
6549         * Makefile.in (SFILES): Add linux-tile-low.c.
6550         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
6551         * configure.srv: Handle tilegx-*-linux*.
6552         * linux-tile-low.c: New file.
6553
6554 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
6555
6556         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
6557
6558 2012-05-24  Pedro Alves  <palves@redhat.com>
6559
6560         PR gdb/7205
6561
6562         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
6563
6564 2012-05-24  Pedro Alves  <palves@redhat.com>
6565
6566         PR gdb/7205
6567
6568         Replace target_signal with gdb_signal throughout.
6569
6570 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
6571
6572         * linux-low.c (linux_store_registers): Avoid the copying sequence
6573         when no data has been retrieved by ptrace.
6574
6575 2012-05-22  Will Deacon  <will.deacon@arm.com>
6576
6577         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
6578         Include asm/ptrace.h.
6579         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
6580         already defined.
6581
6582 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
6583
6584         * linux-low.c (linux_store_registers): Don't re-retrieve data
6585         with ptrace that has already been obtained from /proc.  Always
6586         copy any data retrieved with ptrace to the buffer supplied.
6587
6588 2012-05-11  Yao Qi  <yao@codesourcery.com>
6589             Pedro Alves  <palves@redhat.com>
6590
6591         * linux-low.c (enum stopping_threads_kind): New.
6592         (stopping_threads): Change type to `enum stopping_threads_kind'.
6593         (handle_extended_wait): If stopping and suspending threads, leave
6594         the new_lwp suspended too.
6595         (linux_wait_for_event): Adjust.
6596         (stop_all_lwps): Set `stopping_threads' to
6597         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
6598         whether we're suspending threads or just stopping them.  Assert no
6599         recursion happens.
6600
6601 2012-04-29  Yao Qi  <yao@codesourcery.com>
6602
6603         * server.h: Move some code to ...
6604         * gdbthread.h: ... here.  New.
6605         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
6606         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
6607         (nto-low.o, win32-low.o): Likewise.
6608         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
6609         * regcache.c, remote-utils.c, server.c: Likewise.
6610         * target.c, tracepoint.c, win32-low.c: Likewise.
6611
6612 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6613
6614         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
6615         (PTRACE_ARG4_TYPE): Likewise.
6616         (PTRACE_XFER_TYPE): Likewise.
6617         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
6618         ptrace to PTRACE_ARG3_TYPE.
6619         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
6620         (PTRACE_ARG4_TYPE): Likewise.
6621         (PTRACE_XFER_TYPE): Likewise.
6622         (linux_detach_one_lwp): Cast fourth argument of
6623         ptrace to long then PTRACE_ARG4_TYPE.
6624         (regsets_fetch_inferior_registers): Cast third argument of
6625         ptrace to long then PTRACE_ARG3_TYPE.
6626         (regsets_store_inferior_registers): Likewise.
6627
6628 2012-04-20  Pedro Alves  <palves@redhat.com>
6629
6630         * configure: Regenerate.
6631
6632 2012-04-19  Pedro Alves  <palves@redhat.com>
6633
6634         * Makefile.in (GNULIB_BUILDDIR): New.
6635         (LIBGNU, INCGNU, GNULIB_H): Adjust.
6636         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
6637         (all, install-only, uninstall, clean-info, all-lib, clean): No
6638         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
6639         (maintainer-clean realclean distclean): Use subdir_do.
6640         (subdir_do): New.
6641         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
6642         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
6643         * acinclude.m4: Include acx_configure_dir.m4.
6644         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
6645         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
6646         ACX_CONFIGURE_DIR.
6647         (GNULIB): New.
6648         (GNULIB_STDINT_H): Adjust.
6649         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
6650         * gdbreplay.c: Include build-gnulib/config.h.
6651         * server.h: Likewise.
6652         * aclocal.m4: Regenerate.
6653         * config.in: Regenerate.
6654         * configure: Regenerate.
6655
6656 2012-04-19  Pedro Alves  <palves@redhat.com>
6657
6658         * Makefile.in (LIBGNU, INCGNU): Adjust.
6659         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
6660         (all, install-only, uninstall, clean-info, all-lib, clean)
6661         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
6662         * configure.ac: Adjust AC_OUTPUT output.
6663         * aclocal.m4: Regenerate.
6664         * configure: Regenerate.
6665
6666 2012-04-19  Pedro Alves  <palves@redhat.com>
6667
6668         * Makefile.in (generated_files): New.
6669         (server_h): Remove the explicit dependency on config.h, and depend
6670         on $generated_files.
6671
6672 2012-04-19  Pedro Alves  <palves@redhat.com>
6673
6674         * Makefile.in (INCGNU): Add -Ignulib.
6675
6676 2012-04-19  Pedro Alves  <palves@redhat.com>
6677
6678         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
6679         (INCGNU): ... this, and spell out -I here.
6680         (GNULIB_LIB): Rename to ...
6681         (LIBGNU): ... this.
6682         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
6683
6684 2012-04-19  Pedro Alves  <palves@redhat.com>
6685
6686         * config.in: Regenerate.
6687
6688 2012-04-19  Pedro Alves  <palves@redhat.com>
6689
6690         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
6691         * server.h (memmem): Remove declaration.
6692         * config.in: Regenerate.
6693         * configure: Regenerate.
6694
6695 2012-04-19  Yao Qi  <yao@codesourcery.com>
6696
6697         * Makefile.in (SFILES): Add common/vec.c.
6698         (OBS): Add vec.o.
6699         (vec.o): New rule.
6700
6701 2012-04-19  Yao Qi  <yao@codesourcery.com>
6702
6703         * remote-utils.c (prepare_resume_reply): Replace with macro
6704         target_core_of_thread.
6705         * server.c (handle_qxfer_threads_proper): Likewise.
6706         * target.h (traget_core_of_thread): New macro.
6707
6708 2012-04-18  Pedro Alves  <palves@redhat.com>
6709
6710         * aclocal.m4: Regenerate.
6711         * configure: Regenerate.
6712
6713 2012-04-16  Yao Qi  <yao@codesourcery.com>
6714
6715         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
6716         duplicated on address.
6717
6718 2012-04-16  Yao Qi  <yao@codesourcery.com>
6719
6720         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
6721         (struct tracepoint_action_ops) <send>: New field.
6722         (m_tracepoint_action_send, r_tracepoint_action_send): New.
6723         (agent_expr_send, x_tracepoint_action_send): New.
6724         (l_tracepoint_action_send): New.
6725         (cmd_qtdp): Download and install tracepoint
6726         according to `use_agent'.
6727         (run_inferior_command): Add one more parameter `len'.
6728         Update callers.
6729         (tracepoint_send_agent): New.
6730         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
6731
6732 2012-04-16  Yao Qi  <yao@codesourcery.com>
6733
6734         * tracepoint.c (download_tracepoints): Moved to ...
6735         (cmd_qtstart): ... here.
6736
6737 2012-04-14  Yao Qi  <yao@codesourcery.com>
6738
6739         * tracepoint.c: Include inttypes.h.
6740         (struct collect_memory_action): Use sized types.
6741         (struct tracepoint): Likewise.
6742         (cmd_qtdp, stop_tracing): Update print specifiers.
6743         (cmd_qtp, response_tracepoint): Likewise.
6744         (collect_data_at_tracepoint): Likewise.
6745         (collect_data_at_step): Likewise.
6746
6747 2012-04-14  Yao Qi  <yao@codesourcery.com>
6748
6749         Import gnulib module inttypes.
6750         * aclocal.m4, config.in, configure: Regenerated.
6751
6752 2012-04-14  Yao Qi  <yao@codesourcery.com>
6753
6754         * Makefile.in (maintainer-clean, realclean, distclean): Remove
6755         Makefile and config.status at last.
6756
6757 2012-04-13  Yao Qi  <yao@codesourcery.com>
6758
6759         * tracepoint.c: Include stdint.h unconditionally.
6760
6761 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6762
6763         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
6764         on BFD_HAVE_SYS_PROCFS_TYPE.
6765         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
6766         * configure: Regenerate.
6767         * config.in: Likewise.
6768
6769 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
6770
6771         * Makefile.in (clean): Also remove x32.c x32-linux.c
6772         x32-avx.c x32-avx-linux.c.
6773         (x32.o): New target.
6774         (x32.c): Likewise.
6775         (x32-linux.o): Likewise.
6776         (x32-linux.c): Likewise.
6777         (x32-avx.o): Likewise.
6778         (x32-avx.c): Likewise.
6779         (x32-avx-linux.o): Likewise.
6780         (x32-avx-linux.c): Likewise.
6781
6782         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
6783         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
6784         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
6785         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
6786         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
6787         i386/x32-avx-linux.xml.
6788
6789         * linux-x86-low.c (init_registers_x32_linux): New prototype.
6790         (init_registers_x32_avx_linux): Likwise.
6791         (x86_linux_update_xmltarget): Call init_registers_x32_linux
6792         or init_registers_x32_avx_linux if linux_is_elf64 is false.
6793
6794 2012-04-13  Pedro Alves  <palves@redhat.com>
6795
6796         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
6797         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
6798         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
6799         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
6800         the sub-make.
6801
6802 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6803
6804         * linux-x86-low.c (compat_x32_clock_t): New.
6805         (compat_x32_siginfo_t): Likewise.
6806         (compat_x32_siginfo_from_siginfo): Likewise.
6807         (siginfo_from_compat_x32_siginfo): Likewise.
6808         (linux_is_elf64): Likewise.
6809         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
6810         and siginfo_from_compat_x32_siginfo for x32.
6811         (x86_arch_setup): Set linux_is_elf64.
6812
6813 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6814
6815         PR gdb/13969
6816         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
6817         e_machine field.
6818         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
6819         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
6820         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
6821         compatible with process.
6822
6823 2012-04-12  Yao Qi  <yao@codesourcery.com>
6824
6825         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
6826         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
6827         (install-only, install-info, clean): Handle sub dir gnulib.
6828         (all-lib, am--refresh): New targets.
6829         (memmem.o): Remove target.
6830         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6831         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6832         (AC_REPLACE_FUNCS): Remove memmem.
6833         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6834         (AC_OUTPUT): Generate Makefile in gnulib/.
6835         * aclocal.m4, config.in, configure: Regenerated.
6836
6837 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6838
6839         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6840
6841 2012-04-05  Pedro Alves  <palves@redhat.com>
6842
6843         -Werror=strict-aliasing
6844
6845         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6846         pointer.
6847
6848 2012-04-04  Pedro Alves  <palves@redhat.com>
6849
6850         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6851         (sparc_store_gregset_from_stack, sparc_store_gregset)
6852         (sparc_breakpoint_at): Fix formatting.
6853
6854 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6855
6856         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6857         are available.
6858         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6859         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6860         * config.in: Regenerate.
6861         * configure: Likewise.
6862
6863 2012-03-29  Pedro Alves  <palves@redhat.com>
6864
6865         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6866         Correct ptrace arguments.
6867
6868 2012-03-28  Pedro Alves  <palves@redhat.com>
6869
6870         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6871         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6872         (IA64_FR1_REGNUM): New defines.
6873         (ia64_fetch_register): New.
6874         (the_low_target): Install it.
6875         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6876         field.
6877         * linux-low.c (linux_fetch_registers): Try the
6878         the_low_target.fetch_register hook first.
6879
6880         * linux-arm-low.c (the_low_target): Adjust.
6881         * linux-bfin-low.c (the_low_target): Adjust.
6882         * linux-cris-low.c (the_low_target): Adjust.
6883         * linux-crisv32-low.c (the_low_target): Adjust.
6884         * linux-m32r-low.c (the_low_target): Adjust.
6885         * linux-m68k-low.c (the_low_target): Adjust.
6886         * linux-mips-low.c (the_low_target): Adjust.
6887         * linux-ppc-low.c (the_low_target): Adjust.
6888         * linux-s390-low.c (the_low_target): Adjust.
6889         * linux-sh-low.c (the_low_target): Adjust.
6890         * linux-sparc-low.c (the_low_target): Adjust.
6891         * linux-tic6x-low.c (the_low_target): Adjust.
6892         * linux-x86-low.c (the_low_target): Adjust.
6893         * linux-xtensa-low.c (the_low_target): Adjust.
6894
6895 2012-03-26  Pedro Alves  <palves@redhat.com>
6896
6897         * server.c (handle_qxfer_libraries): Don't bail early if
6898         the_target->qxfer_libraries_svr4 is not NULL.
6899
6900 2012-03-26  Pedro Alves  <palves@redhat.com>
6901
6902         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6903
6904 2012-03-23  Pedro Alves  <palves@redhat.com>
6905
6906         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6907         "library-list-svr4" element's start tag when the the DSO list is
6908         empty.
6909
6910 2012-03-23  Pedro Alves  <palves@redhat.com>
6911
6912         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6913         a variable whose type size is the same as the inferior's pointer
6914         size.
6915
6916 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6917
6918         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6919         struct siginfo.
6920         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6921         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6922         * linux-low.h: Include <signal.h>.
6923         (struct siginfo): Remove forward declaration.
6924         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6925         struct siginfo.
6926
6927 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6928
6929         * .gitignore: Ignore more files.
6930
6931 2012-03-19  Pedro Alves  <palves@redhat.com>
6932             Jan Kratochvil  <jan.kratochvil@redhat.com>
6933
6934         * server.c (cont_thread, general_thread): Add describing comments.
6935         (start_inferior): Clear `cont_thread'.
6936         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6937         of a process.
6938
6939 2012-03-15  Yao Qi  <yao@codesourcery.com>
6940
6941         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6942         handling to ...
6943         (cmd_qtdp): ... here.
6944
6945 2012-03-15  Yao Qi  <yao@codesourcery.com>
6946
6947         * tracepoint.c (struct tracepoint_action_ops): New.
6948         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6949         (m_tracepoint_action_download): New.
6950         (r_tracepoint_action_download): New.
6951         (x_tracepoint_action_download): New.
6952         (l_tracepoint_action_download): New.
6953         (add_tracepoint_action): Install `action->ops' according type.
6954         (download_tracepoint_1): Move code `download' function pointer
6955         of various tracepoint_action_ops.
6956
6957 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6958
6959         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6960         linux_ptrace_attach_warnings.
6961
6962 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6963
6964         * Makefile.in (linux-ptrace.o): New.
6965         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6966         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6967         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6968         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6969         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6970         of these targets.
6971         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6972
6973 2012-03-08  Yao Qi  <yao@codesourcery.com>
6974             Pedro Alves  <palves@redhat.com>
6975
6976         Fix PR server/13392.
6977         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6978         offset of JMP insn.
6979         * tracepoint.c (remove_tracepoint): New.
6980         (cmd_qtdp): Call remove_tracepoint when failed to install.
6981
6982 2012-03-07  Pedro Alves  <palves@redhat.com>
6983
6984         * linux-low.c (get_detach_signal): New.
6985         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6986         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6987         ptrace call.
6988         * server.c (program_signals, program_signals_p): New.
6989         (handle_general_set): Handle QProgramSignals.
6990         * server.h (program_signals, program_signals_p): Declare.
6991
6992 2012-03-05  Pedro Alves  <palves@redhat.com>
6993             Jan Kratochvil  <jan.kratochvil@redhat.com>
6994
6995         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6996         New comment why.
6997
6998 2012-03-03  Yao Qi  <yao@codesourcery.com>
6999
7000         * tracepoint.c (tracepoint_look_up_symbols): Update call to
7001         agent_look_up_symbols.
7002
7003 2012-03-03  Yao Qi  <yao@codesourcery.com>
7004
7005         * Makefile.in (linux-low.o): Keep dependence on agent.h.
7006         (linux-x86-low.o): Likewise.
7007         * server.h: Remove in_process_agent_loaded.
7008         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
7009         common/agent.c.
7010         Update callers.
7011
7012 2012-03-03  Yao Qi  <yao@codesourcery.com>
7013
7014         * tracepoint.c (gdb_agent_capability): New global.
7015         (in_process_agent_loaded_ust): Renamed to
7016         `in_process_agent_supports_ust'.
7017         Update callers.
7018         (in_process_agent_supports_ust): Call agent_capability_check.
7019         (clear_installed_tracepoints): Assert that agent supports
7020         agent.
7021
7022 2012-03-03  Yao Qi  <yao@codesourcery.com>
7023
7024         * linux-low.c (linux_supports_agent): New.
7025         (linux_target_ops): Initialize field `supports_agent' with
7026         linux_supports_agent.
7027         * target.h (struct target_ops) <supports_agent>: New.
7028         (target_supports_agent): New macro.
7029         * server.c (handle_general_set): Handle packet 'QAgent'.
7030         (handle_query): Send `QAgent+'.
7031         * Makefile.in (server.o): Depends on agent.h.
7032
7033 2012-03-03  Yao Qi  <yao@codesourcery.com>
7034
7035         * Makefile.in (OBS): Add agent.o.
7036         Add new rule for agent.o.
7037         Track dependence of tracepoint.c on agent.h.
7038         * tracepoint.c (run_inferior_command_1):
7039         (run_inferior_command): Call agent_run_command.
7040         (gdb_ust_connect_sync_socket): Deleted.  Move it to
7041         common/agent.c.
7042         (resume_thread, stop_thread): Likewise.
7043         (gdb_ust_socket_init): Renamed to ...
7044         (gdb_agent_socket_init): ... New.
7045         (gdb_ust_thread): Renamed to ...
7046         (gdb_agent_helper_thread): ... New.
7047         (gdb_ust_init): Move some code to ...
7048         (gdb_agent_init): ... here.  New.
7049         [HAVE_UST]: Call gdb_ust_init.
7050         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
7051         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
7052         * config.in, configure: Regenerated.
7053
7054 2012-03-02  Pedro Alves  <palves@redhat.com>
7055
7056         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
7057         * linux-low.c (struct simple_pid_list): New.
7058         (stopped_pids): New a struct simple_pid_list pointer.
7059         (add_to_pid_list, pull_pid_from_list): New.
7060         (handle_extended_wait): Don't assume the first signal new children
7061         report is SIGSTOP.  Adjust call to pull_pid_from_list.
7062         (linux_wait_for_lwp): Adjust.
7063
7064 2012-03-02  Yao Qi  <yao@codesourcery.com>
7065
7066         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
7067         debug log.
7068
7069 2012-03-02  Yao Qi  <yao@codesourcery.com>
7070
7071         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
7072         `stop_pc' and `tpoint'.  Update caller.
7073
7074 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
7075
7076         * linux-low.h (linux_target_ops): Add regset_bitmap member.
7077         * linux-low.c (use_linux_regsets): New macro.
7078         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
7079         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
7080         (linux_register_in_regsets): New function.
7081         (usr_fetch_inferior_registers): Skip registers covered by
7082         regsets.
7083         (usr_store_inferior_registers): Likewise.
7084         (usr_fetch_inferior_registers): New macro.
7085         (usr_store_inferior_registers): Likewise.
7086         (linux_fetch_registers): Handle mixed regset/non-regset targets.
7087         (linux_store_registers): Likewise.
7088         * linux-mips-low.c (init_registers_mips_dsp_linux): New
7089         prototype.
7090         (init_registers_mips64_dsp_linux): Likewise.
7091         (init_registers_mips_linux): New macro.
7092         (init_registers_mips_dsp_linux): Likewise.
7093         (mips_dsp_num_regs): Likewise.
7094         (DSP_BASE, DSP_CONTROL): New fallback macros.
7095         (mips_base_regs): New macro.
7096         (mips_regmap): Use it.  Fix the size.
7097         (mips_dsp_regmap): New variable.
7098         (mips_dsp_regset_bitmap): Likewise.
7099         (mips_arch_setup): New function.
7100         (mips_cannot_fetch_register): Use the_low_target.regmap rather
7101         than mips_regmap.
7102         (mips_cannot_store_register): Likewise.
7103         (the_low_target): Update .arch_setup, .num_regs and .regmap
7104         initializers.  Add .regset_bitmap initializer.
7105         * linux-arm-low.c (the_low_target): Add .regset_bitmap
7106         initializer.
7107         * linux-bfin-low.c (the_low_target): Likewise.
7108         * linux-cris-low.c (the_low_target): Likewise.
7109         * linux-crisv32-low.c (the_low_target): Likewise.
7110         * linux-ia64-low.c (the_low_target): Likewise.
7111         * linux-m32r-low.c (the_low_target): Likewise.
7112         * linux-m68k-low.c (the_low_target): Likewise.
7113         * linux-ppc-low.c (the_low_target): Likewise.
7114         * linux-s390-low.c (the_low_target): Likewise.
7115         * linux-sh-low.c (the_low_target): Likewise.
7116         * linux-sparc-low.c (the_low_target): Likewise.
7117         * linux-tic6x-low.c (the_low_target): Likewise.
7118         * linux-x86-low.c (the_low_target): Likewise.
7119         * linux-xtensa-low.c (the_low_target): Likewise.
7120         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
7121         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
7122         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
7123         srv_xmlfiles.
7124         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
7125         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
7126
7127 2012-02-29  Yao Qi  <yao@codesourcery.com>
7128             Pedro Alves  <palves@redhat.com>
7129
7130         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
7131         `step_over_finished' is true.
7132
7133 2012-02-27  Pedro Alves  <palves@redhat.com>
7134
7135         * linux-low.c (pid_is_stopped): Delete, moved to common/.
7136         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
7137
7138 2012-02-27  Pedro Alves  <palves@redhat.com>
7139
7140         PR server/9684
7141         * linux-low.c (pid_is_stopped): New.
7142         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
7143
7144 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
7145
7146         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
7147         of conditions.
7148
7149 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
7150
7151         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
7152
7153 2012-02-24  Luis Machado  <lgustavo@codesourcery>
7154
7155         * server.c (handle_query): Advertise support for target-side
7156         breakpoint condition evaluation.
7157         (process_point_options): New function.
7158         (process_serial_event): When inserting a breakpoint, check for
7159         a target-side condition that should be evaluated.
7160
7161         * mem-break.c: Include regcache.h and ax.h.
7162         (point_cond_list_t): New data structure.
7163         (breakpoint) <cond_list>: New field.
7164         (find_gdb_breakpoint_at): Make non-static.
7165         (delete_gdb_breakpoint_at): Clear any target-side
7166         conditions.
7167         (clear_gdb_breakpoint_conditions): New function.
7168         (add_condition_to_breakpoint): Likewise.
7169         (add_breakpoint_condition): Likewise.
7170         (gdb_condition_true_at_breakpoint): Likewise.
7171         (gdb_breakpoint_here): Return result directly instead
7172         of going through a local variable.
7173
7174         * mem-break.h (find_gdb_breakpoint_at): New prototype.
7175         (clear_gdb_breakpoint_conditions): Likewise.
7176         (add_breakpoint_condition): Likewise.
7177         (gdb_condition_true_at_breakpoint): Likewise.
7178
7179         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
7180         (need_step_over_p): Take target-side breakpoint condition into
7181         consideration.
7182
7183 2012-02-24  Luis Machado  <lgustavo@codesourcery>
7184
7185         * server.h: Include tracepoint.h.
7186         (agent_mem_read, agent_get_trace_state_variable_value,
7187         agent_set_trace_state_variable_value,
7188         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
7189         get_set_tsv_func_addr): New prototypes.
7190
7191         * ax.h: New include file.
7192         * ax.c: New source file.
7193
7194         * tracepoint.c: Include ax.h.
7195         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
7196         agent_expr, eval_result_type): Move to ax.h.
7197         (parse_agent_expr): Rename to ...
7198         (gdb_parse_agent_expr): ... this, make it non-static and move
7199         to ax.h.
7200         (unparse_agent_expr) Rename to ...
7201         (gdb_unparse_agent_expr): ... this, make it non-static and move
7202         to ax.h.
7203         (eval_agent_expr): Rename to ...
7204         (eval_tracepoint_agent_expr): ... this.
7205         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
7206         forward declarations.
7207         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
7208         (agent_get_trace_state_variable_value): New function.
7209         (agent_set_trace_state_variable_value): New function.
7210         (cmd_qtdp): Call gdb_parse_agent_expr (...).
7211         (response_tracepoint): Call gdb_unparse_agent_expr (...).
7212         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
7213         (condition_true_at_tracepoint): Likewise.
7214         (parse_agent_expr): Rename to ...
7215         (gdb_parse_agent_expr): ... this and move to ax.c.
7216         (unparse_agent_expr): Rename to ...
7217         (gdb_unparse_agent_expr): ... this and move to ax.c.
7218         (gdb_agent_op_name): Move to ax.c.
7219         (eval_agent_expr): Rename to ...
7220         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
7221         and move to ax.c.
7222         (eval_tracepoint_agent_expr): New function.
7223         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
7224         non-static.
7225         (current_insn_ptr, emit_error, struct bytecode_address): Move to
7226         ax.c.
7227         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
7228         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
7229         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
7230         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
7231         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
7232         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
7233         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
7234         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
7235         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
7236         (compile_bytecodes): Remove forward declaration.
7237         (is_goto_target): Move to ax.c.
7238         (compile_bytecodes): Move to ax.c and call
7239         agent_get_trace_state_variable_value (...) and
7240         agent_set_trace_state_variable_value (...).
7241
7242         * Makefile.in: Update ax.c and IPA dependencies.
7243
7244 2012-02-24  Pedro Alves  <palves@redhat.com>
7245
7246         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
7247         (cmd_bigqtbuffer_circular): ... this.  Only handle
7248         'QTBuffer:circular:'.
7249         (handle_tracepoint_general_set): Adjust.
7250
7251 2012-02-16  Yao Qi  <yao@codesourcery.com>
7252
7253         * inferiors.c: Move code to ...
7254         * dll.c: .... here.  New.
7255         * server.h: Declare clear_dlls.
7256         * Makefile.in (SFILES): Add dll.c.
7257         (OBS): Add dll.o
7258         (dll.o): New rule.
7259
7260 2012-02-11  Yao Qi  <yao@codesourcery.com>
7261
7262         * server.c: (handle_monitor_command): Add a new parameter
7263         `own_buf'.
7264         (handle_query): Update caller.
7265
7266 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
7267
7268         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
7269         * configure, config.in: Regenerate.
7270         * hostio.c: Provide an alternate implementation if HAVE_READLINK
7271         is not defined.
7272
7273 2012-02-02  Pedro Alves  <palves@redhat.com>
7274
7275         Try SIGKILL first, then PTRACE_KILL.
7276         * linux-low.c (linux_kill_one_lwp): New.
7277         (linux_kill_one_lwp): Rename to ...
7278         (kill_one_lwp_callback): ... this.  Use the new
7279         linux_kill_one_lwp.
7280
7281 2012-02-02  Pedro Alves  <palves@redhat.com>
7282
7283         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
7284         inferior.
7285
7286 2012-01-27  Pedro Alves  <palves@redhat.com>
7287
7288         * linux-low.c (linux_child_pid_to_exec_file): Delete.
7289         (elf_64_file_p): Make static.
7290         (linux_pid_exe_is_elf_64_file): New.
7291         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
7292         Delete declarations.
7293         (linux_pid_exe_is_elf_64_file): Declare.
7294         * linux-x86-low.c (x86_arch_setup): Use
7295         linux_pid_exe_is_elf_64_file.
7296
7297 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7298
7299         * linux-low.c (linux_wait_for_event_1): Rename to ...
7300         (linux_wait_for_event): ... here and merge it with former
7301         linux_wait_for_event - new variable wait_ptid, use it.
7302         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
7303
7304 2012-01-23  Pedro Alves  <palves@redhat.com>
7305
7306         * server.c (main): Avoid yet another case of infinite loop while
7307         detaching/killing after a longjmp.
7308
7309 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
7310
7311         Code cleanup.
7312         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
7313
7314 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
7315
7316         * hostio.c (handle_readlink): New function.
7317         (handle_vFile): Call it to handle "vFile:readlink" packets.
7318
7319 2012-01-20  Pedro Alves  <palves@redhat.com>
7320             Ulrich Weigand  <ulrich.weigand@linaro.org>
7321
7322         * server.c (handle_v_requests): Only support vAttach and vRun to
7323         start multiple processes when in extended protocol mode.
7324
7325 2012-01-17  Pedro Alves  <palves@redhat.com>
7326
7327         * tracepoint.c (initialize_tracepoint): Use mmap instead of
7328         memalign plus mprotect to allocate the scratch buffer.
7329
7330 2012-01-13  Pedro Alves  <palves@redhat.com>
7331
7332         * server.c (attach_inferior): Clear `cont_thread'.
7333
7334 2012-01-13  Pedro Alves  <palves@redhat.com>
7335
7336         * server.c (main): Avoid infinite loop while detaching/killing
7337         after a longjmp.
7338
7339 2012-01-09  Doug Evans  <dje@google.com>
7340
7341         * server.c (start_inferior): Set last_ptid in --wrapper case.
7342
7343 2012-01-06  Yao Qi  <yao@codesourcery.com>
7344
7345         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
7346         defined.
7347         [IN_PROCESS_AGENT] (debug_agent): New global variable.
7348
7349 2012-01-04  Yao Qi  <yao@codesourcery.com>
7350
7351         * tracepoint.c (cmd_qtdp): Print debug message
7352         for static tracepoint.
7353
7354 2012-01-04  Yao Qi  <yao@codesourcery.com>
7355
7356         * tracepoint.c (trace_vdebug): Differentiate debug message
7357         between gdbserver and IPA.
7358
7359 2012-01-03  Yao Qi  <yao@codesourcery.com>
7360
7361         * tracepoint.c (tracepoint_was_hit): Don't collect for
7362         static tracepoint.
7363
7364 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
7365
7366         * terminal.h: Reformat copyright header.
7367
7368 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
7369
7370         * server.c (gdbserver_version): Update copyright year.
7371         * gdbreplay.c (gdbreplay_version): Likewise.
7372
7373 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
7374
7375         * linux-low.c (linux_create_inferior): Put empty if clause for write.
7376
7377         Revert:
7378         2011-12-18  Hui Zhu  <teawater@gmail.com>
7379         * linux-low.c (linux_create_inferior): Save return value to ret.
7380
7381 2011-12-18  Hui Zhu  <teawater@gmail.com>
7382
7383         * linux-low.c (linux_create_inferior): Save return value to ret.
7384
7385 2011-12-16  Doug Evans  <dje@google.com>
7386
7387         * linux-low.c (linux_create_inferior): If stdio connection,
7388         redirect stdin from /dev/null, stdout to stderr.
7389         * remote-utils.c (remote_is_stdio): New static global.
7390         (remote_connection_is_stdio): New function.
7391         (remote_prepare): Handle stdio connection.
7392         (remote_open): Ditto.
7393         (remote_close): Don't close stdin for stdio connections.
7394         (read_prim,write_prim): New functions.  Replace all calls to
7395         read/write to these.
7396         * server.c (main): Watch for "-" argument.  Move call to
7397         remote_prepare before start_inferior.
7398         * server.h (STDIO_CONNECTION_NAME): New macro.
7399         (remote_connection_is_stdio): Declare.
7400
7401         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
7402         in debugging output.
7403
7404 2011-12-15  Yao Qi  <yao@codesourcery.com>
7405
7406         * tracepoint.c: Include sys/syscall.h.
7407         (gdb_ust_thread): Remove preprocessor conditional.
7408
7409 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
7410
7411         * linux-low.c (linux_detach_one_lwp): Call
7412         the_low_target.prepare_to_resume before detaching.
7413
7414 2011-12-14  Yao Qi  <yao@codesourcery.com>
7415
7416         * tracepoint.c (gdb_ust_thread): Don't ignore return value
7417         of write.
7418
7419 2011-12-14  Yao Qi  <yao@codesourcery.com>
7420
7421         * i386-low.c (i386_low_stopped_data_address): Initialize local
7422         variable `control'.
7423
7424 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
7425
7426         PR remote/13492
7427
7428         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
7429         DR_CONTROL unless necessary.  Extend comments.
7430         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
7431         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
7432
7433 2011-12-13  Yao Qi  <yao@codesourcery.com>
7434
7435         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
7436         macros.
7437         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
7438
7439 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
7440
7441         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
7442         Print new debug message for such case.
7443
7444 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7445
7446         Fix overlapping memcpy.
7447         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
7448         the read_inferior_memory transfer.
7449         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
7450         write_inferior_memory transfer.
7451         (set_fast_tracepoint_jump): New variable buf.  Use it for the
7452         read_inferior_memory and write_inferior_memory transfers.
7453         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
7454         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
7455         Use it for the write_inferior_memory transfer.
7456         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
7457         buffers.
7458
7459 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
7460
7461         * linux-low.c (fetch_register, store_register): Make code
7462         consistent, fix formatting.
7463
7464 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
7465
7466         * linux-low.c (usr_store_inferior_registers): Factor out code
7467         to handle individual registers into...
7468         (store_register): ... this new function.
7469
7470 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
7471
7472         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
7473         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
7474         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
7475         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
7476         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
7477         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
7478         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
7479         (srv_xmlfiles): Add new XML files.
7480
7481         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
7482         and <sys/uio.h>.
7483         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
7484         (init_registers_s390_linux32v1): Add prototype.
7485         (init_registers_s390_linux32v2): Likewise.
7486         (init_registers_s390_linux64v1): Likewise.
7487         (init_registers_s390_linux64v2): Likewise.
7488         (init_registers_s390x_linux64v1): Likewise.
7489         (init_registers_s390x_linux64v2): Likewise.
7490         (s390_num_regs): Increment to 52.
7491         (s390_regmap): Add orig_r2 register.
7492         (s390_num_regs_3264): Increment to 68.
7493         (s390_regmap_3264): Add orig_r2 register.
7494         (s390_collect_ptrace_register): Handle orig_r2 register.
7495         (s390_supply_ptrace_register): Likewise.
7496         (s390_fill_last_break): New function.
7497         (s390_store_last_break): Likewise.
7498         (s390_fill_system_call): New function.
7499         (s390_store_system_call): Likewise.
7500         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
7501         register sets.
7502         (s390_check_regset): New function.
7503         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
7504         NT_S390_SYSTEM_CALL regsets and use appropriate description.
7505         Update target_regsets for available register sets.
7506
7507 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
7508             Jan Kratochvil  <jan.kratochvil@redhat.com>
7509
7510         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
7511         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
7512         New.
7513         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
7514         * linux-low.h (struct process_info_private): New member r_debug.
7515         * server.c (handle_qxfer_libraries): Call
7516         the_target->qxfer_libraries_svr4.
7517         (handle_qxfer_libraries_svr4): New function.
7518         (qxfer_packets): New entry "libraries-svr4".
7519         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
7520         * target.h (struct target_ops): New member qxfer_libraries_svr4.
7521         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
7522         PACKET_qXfer_libraries_svr4.
7523
7524 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
7525
7526         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
7527         PSW address/mask between 8-byte and 16-byte formats.
7528         (s390_supply_ptrace_register): Likewise.
7529         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
7530         basic addressing mode bit.
7531
7532 2011-11-24  Stan Shebs  <stan@codesourcery.com>
7533
7534         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
7535
7536 2011-11-17  Stan Shebs  <stan@codesourcery.com>
7537
7538         * tracepoint.c (struct tracepoint): New field traceframe_usage.
7539         (tracing_start_time): New global.
7540         (tracing_stop_time): New global.
7541         (tracing_user_name): New global.
7542         (tracing_notes): New global.
7543         (tracing_stop_note): New global.
7544         (cmd_qtstart): Set traceframe_usage, start_time.
7545         (stop_tracing): Set stop_time.
7546         (cmd_qtstatus): Report additional status.
7547         (cmd_qtp): New function.
7548         (handle_tracepoint_query): Call it.
7549         (cmd_qtnotes): New function.
7550         (handle_tracepoint_general_set): Call it.
7551         (get_timestamp): Rename from tsv_get_timestamp.
7552
7553 2011-11-14  Stan Shebs  <stan@codesourcery.com>
7554             Kwok Cheung Yeung  <kcy@codesourcery.com>
7555
7556         * linux-x86-low.c (small_jump_insn): New.
7557         (i386_install_fast_tracepoint_jump_pad): Add arguments for
7558         trampoline and error message, build a trampoline and issue a small
7559         jump instruction to it.
7560         (x86_install_fast_tracepoint_jump_pad): Add arguments for
7561         trampoline and error message.
7562         (x86_get_min_fast_tracepoint_insn_len): New.
7563         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
7564         * linux-low.h (struct linux_target_ops): Add arguments to
7565         install_fast_tracepoint_jump_pad operation, add new operation.
7566         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
7567         arguments.
7568         (linux_get_min_fast_tracepoint_insn_len): New function.
7569         (linux_target_op): Add new operation.
7570         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
7571         (gdb_trampoline_buffer_end): Ditto.
7572         (gdb_trampoline_buffer_error): Ditto.
7573         (struct ipa_sym_addresses): Add fields for new IPA variables.
7574         (symbol_list): Add entries for new IPA variables.
7575         (struct tracepoint): Add fields to hold the address range of the
7576         trampoline used by the tracepoint.
7577         (trampoline_buffer_head): New static variable.
7578         (trampoline_buffer_tail): Ditto.
7579         (claim_trampoline_space): New function.
7580         (have_fast_tracepoint_trampoline_buffer): New function.
7581         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
7582         structure.
7583         (install_fast_tracepoint): Ditto, also add error buffer argument.
7584         (cmd_qtminftpilen): New function.
7585         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
7586         (fast_tracepoint_from_trampoline_address): New function.
7587         (fast_tracepoint_collecting): Handle trampoline as part of jump
7588         pad space.
7589         (set_trampoline_buffer_space): New function.
7590         (initialize_tracepoint): Initialize new IPA variables.
7591         * target.h (struct target_ops): Add arguments to
7592         install_fast_tracepoint_jump_pad operation, add new
7593         get_min_fast_tracepoint_insn_len operation.
7594         (target_get_min_fast_tracepoint_insn_len): New.
7595         (install_fast_tracepoint_jump_pad): Add arguments.
7596         * server.h (IPA_BUFSIZ): Define.
7597         * linux-i386-ipa.c: Include extra header files.
7598         (initialize_fast_tracepoint_trampoline_buffer): New function.
7599         (initialize_low_tracepoint): Call it.
7600         * server.h (set_trampoline_buffer_space): Declare.
7601         (claim_trampoline_space): Ditto.
7602         (have_fast_tracepoint_trampoline_buffer): Ditto.
7603
7604 2011-11-14  Yao Qi  <yao@codesourcery.com>
7605
7606         * server.c (handle_query): Handle InstallInTrace for qSupported.
7607         * tracepoint.c (add_tracepoint): Sort list.
7608         (install_tracepoint, download_tracepoint): New.
7609         (cmd_qtdp): Call them to install and download tracepoints.
7610         (sort_tracepoints): Removed.
7611         (cmd_qtstart): Update.
7612
7613 2011-11-14  Yao Qi  <yao@codesourcery.com>
7614
7615         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
7616         * mem-break.h: Declare.
7617         * tracepoint.c (cmd_qtstart): Move some code to ...
7618         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
7619         New.
7620         (download_tracepoints): Move some code to ...
7621         (download_tracepoint_1): ... here.  New.
7622
7623 2011-11-08  Yao Qi  <yao@codesourcery.com>
7624
7625         * remote-utils.c (relocate_instruction): A comment fix.
7626
7627 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
7628
7629         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
7630         (i386_dr_low_get_control, i386_dr_low_get_status): Use
7631         dr_status_mirror and dr_control_mirror from debug_reg_state.
7632         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
7633         (i386_initial_stuff): Remove use of deleted globals.
7634         (i386_get_thread_context, i386_set_thread_context,
7635         i386_thread_added): Use dr_status_mirror and dr_control_mirror
7636         from debug_reg_state.
7637
7638 2011-11-05  Yao Qi  <yao@codesourcery.com>
7639
7640         * tracepoint.c (gdb_collect): Loop over tracepoints of same
7641         address as TPOINT's.
7642
7643 2011-11-02  Stan Shebs  <stan@codesourcery.com>
7644
7645         * tracepoint.c (agent_mem_read_string): New function.
7646         (eval_agent_expr): Call it for tracenz.
7647         * server.c (handle_query): Report support for tracenz.
7648
7649 2011-11-02  Yao Qi  <yao@codesourcery.com>
7650
7651         * tracepoint.c (cmd_qtstart): Remove unused local variables.
7652
7653 2011-11-02  Yao Qi  <yao@codesourcery.com>
7654
7655         * target.h: Fix a typo in comment.
7656
7657 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
7658
7659         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
7660         clobber the breakpoints' shadows with fast tracepoint jumps.
7661         * mem-break.h (check_mem_write): Add `myaddr' parameter.
7662         * target.c (write_inferior_memory): Also pass MYADDR down to
7663         check_mem_write.
7664
7665 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
7666
7667         * configure.ac: Check support for personality routine.
7668         * configure: Regenerate.
7669         * config.in: Likewise.
7670         * linux-low.c: Include <sys/personality.h>.
7671         Define ADDR_NO_RANDOMIZE if necessary.
7672         (linux_create_inferior): Disable address space randomization when
7673         forking inferior, if requested.
7674         (linux_supports_disable_randomization): New function.
7675         (linux_target_ops): Install it.
7676         * server.h (disable_randomization): Declare.
7677         * server.c (disable_randomization): New global variable.
7678         (handle_general_set): Handle QDisableRandomization.
7679         (handle_query): Likewise for qSupported.
7680         (main): Support --disable-randomization and --no-disable-randomization
7681         command line arguments.
7682         * target.h (struct target_ops): Add supports_disable_randomization.
7683         (target_supports_disable_randomization): New macro.
7684
7685 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
7686
7687         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
7688         ifdef check.
7689         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
7690         [!PT_GETDSBT] (target_loadmap): New definition.
7691         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
7692         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
7693         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
7694         and PT_GETDSBT to LINUX_LOADMAP.
7695         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
7696         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
7697
7698 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7699
7700         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
7701         (arm_linux_hwbp_cap): New static variable.
7702         (arm_linux_get_hwbp_cap): Replace by ...
7703         (arm_linux_init_hwbp_cap): ... this new function.
7704         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
7705         (arm_linux_get_hw_watchpoint_count): Likewise.
7706         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7707         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
7708         (arm_prepare_to_resume): Use perror_with_name instead of error.
7709
7710 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7711
7712         * linux-arm-low.c: Include <signal.h>.
7713         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
7714         (struct arm_linux_hwbp_cap): New data type.
7715         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
7716         (struct arm_linux_hw_breakpoint): New data type.
7717         (MAX_BPTS, MAX_WPTS): Define.
7718         (struct arch_process_info, struct arch_lwp_info): New data types.
7719         (arm_linux_get_hwbp_cap): New function.
7720         (arm_linux_get_hw_breakpoint_count): Likewise.
7721         (arm_linux_get_hw_watchpoint_count): Likewise.
7722         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7723         (arm_hwbp_control_initialize): Likewise.
7724         (arm_hwbp_control_is_enabled): Likewise.
7725         (arm_hwbp_control_is_initialized): Likewise.
7726         (arm_hwbp_control_disable): Likewise.
7727         (arm_linux_hw_breakpoint_equal): Likewise.
7728         (arm_linux_hw_point_initialize): Likewise.
7729         (struct update_registers_data): New data structure.
7730         (update_registers_callback: New function.
7731         (arm_insert_point): Likewise.
7732         (arm_remove_point): Likewise.
7733         (arm_stopped_by_watchpoint): Likewise.
7734         (arm_stopped_data_address): Likewise.
7735         (arm_new_process): Likewise.
7736         (arm_new_thread): Likewise.
7737         (arm_prepare_to_resume): Likewise.
7738         (the_low_target): Register arm_insert_point, arm_remove_point,
7739         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
7740         arm_new_thread, and arm_prepare_to_resume.
7741
7742 2011-09-15  Stan Shebs  <stan@codesourcery.com>
7743
7744         * server.h (struct emit_ops): Add compare-goto fields.
7745         * tracepoint.c (gdb_agent_op_sizes): New table.
7746         (emit_eq_goto): New function.
7747         (emit_ne_goto): New function.
7748         (emit_lt_goto): New function.
7749         (emit_le_goto): New function.
7750         (emit_gt_goto): New function.
7751         (emit_ge_goto): New function.
7752         (is_goto_target): New function.
7753         (compile_bytecodes): Recognize special cases of compare-goto
7754         combinations and call specialized emitters for them.
7755         * linux-x86-low.c (amd64_emit_eq_goto): New function.
7756         (amd64_emit_ne_goto): New function.
7757         (amd64_emit_lt_goto): New function.
7758         (amd64_emit_le_goto): New function.
7759         (amd64_emit_gt_goto): New function.
7760         (amd64_emit_ge_goto): New function.
7761         (amd64_emit_ops): Add the new functions.
7762         (i386_emit_eq_goto): New function.
7763         (i386_emit_ne_goto): New function.
7764         (i386_emit_lt_goto): New function.
7765         (i386_emit_le_goto): New function.
7766         (i386_emit_gt_goto): New function.
7767         (i386_emit_ge_goto): New function.
7768         (i386_emit_ops): Add the new functions.
7769
7770 2011-09-08  Stan Shebs  <stan@codesourcery.com>
7771
7772         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
7773         (i386_emit_epilogue): Restore %ebx.
7774
7775 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
7776
7777         * server.c (step_thread): Remove definition.
7778         (process_serial_event): Don't handle Hs.
7779         * server.h (step_thread): Remove declaration.
7780         * target.c (set_desired_inferior): Remove use of step_thread.
7781
7782 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7783
7784         * linux-low.c: Include linux-procfs.h.
7785         (linux_attach_lwp_1): Update comments.
7786         (linux_attach): Scan for existing threads when attaching to a
7787         process that is the tgid.
7788         * Makefile.in: Update dependencies.
7789
7790 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7791
7792         * configure.srv: Add linux-procfs.o dependencies.
7793
7794 2011-08-14  Yao Qi  <yao@codesourcery.com>
7795
7796         * target.h (struct target_ops): Fix indent.
7797         * win32-low.c (win32_target_ops): Fix comment.
7798
7799 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
7800             Yao Qi  <yao@codesourcery.com>
7801
7802         * Makefile.in (clean): Remove tic6x-*.c files.
7803         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
7804         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
7805         (tic6x-c64xp-linux.c): Likewise.
7806         * configure.srv: Add support for tic6x-*-uclinux.
7807         * linux-tic6x-low.c: New.
7808         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
7809
7810 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
7811             Yao Qi  <yao@codesourcery.com>
7812
7813         * target.h (struct target_ops): Add read_loadmap.
7814         * linux-low.c (struct target_loadseg): New type.
7815         (struct target_loadmap): New type.
7816         (linux_read_loadmap): New function.
7817         (linux_target_ops): Add linux_read_loadmap.
7818         * server.c (handle_query): Support qXfer:fdpic:read packet.
7819         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
7820         to NULL.
7821
7822 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7823
7824         * win32-low.c: Include <stdint.h>.
7825
7826 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
7827
7828         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7829         to the inferior here.
7830         (i386_remove_aligned_watchpoint): Ditto.
7831         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7832         fit part of the watchpoint in the debug registers.
7833         (i386_update_inferior_debug_regs): New.
7834         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7835         registers, and only update the inferior on success.
7836         (i386_low_remove_watchpoint): Ditto.
7837
7838 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7839
7840         * linux-low.c (compare_ints, unique, list_threads, show_process,
7841         linux_core_of_thread): Delete.
7842         (linux_target_ops): Change linux_core_of_thread to
7843         linux_common_core_of_thread.
7844         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7845         * utils.c (malloc_failure): Change type of argument.
7846         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7847         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7848         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7849         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7850         (IPA_OBJS): Add common-utils-ipa.o.
7851         (ptid_h, linux_osdata_h): New macros.
7852         (server_h): Add common/common-utils.h, common/xml-utils.h,
7853         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7854         common/ptid.h.
7855         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7856         ptid.o, buffer.o): New rules.
7857         (linux-low.o): Add common/linux-osdata.h as a dependency.
7858         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7859         * configure.ac: Add AC_HEADER_DIRENT check.
7860         * config.in: Regenerate.
7861         * configure: Regenerate.
7862         * remote-utils.c (xml_escape_text): Delete.
7863         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7864         buffer_xml_printf): Move to common/buffer.c.
7865         * server.c (main): Remove call to initialize_inferiors.
7866         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7867         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7868         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7869         internal_error, gdb_assert, gdb_assert_fail): Delete.
7870         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7871         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7872         common/buffer.h.
7873         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7874         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7875         initialize_inferiors): Delete.
7876
7877 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7878
7879         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7880         symbol error.
7881
7882 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7883
7884         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7885         assertion.
7886         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7887
7888 2011-05-26  Yao Qi  <yao@codesourcery.com>
7889
7890         * Makefile.in (thread-db.o): Track dependence to
7891         common/gdb_thread_db.h.
7892         * thread-db.c: include gdb_thread_db.h from right place.
7893
7894 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7895
7896         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7897         __FILE__ and __LINE__ to internal_error.
7898
7899 2011-05-13  Doug Evans  <dje@google.com>
7900
7901         * thread-db.c (try_thread_db_load_from_sdir): New function.
7902         (try_thread_db_load_from_dir): New function.
7903         (thread_db_load_search): Handle $sdir, ignore $pdir.
7904         Remove trying of system directories if search of
7905         libthread-db-search-path fails, that is now done via $sdir.
7906
7907 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7908
7909         * server.c (handle_query): Add EnableDisableTracepoints to the list
7910         of supported features.
7911         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7912         tracepoints.
7913         (cmd_qtenable_disable): New.
7914         (cmd_qtstart): Install tracepoints even if disabled.
7915         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7916         receiving a QTEnable or QTDisable packet.
7917         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7918         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7919         tracepoints.
7920         (gdb_probe): Skip data collection if static tracepoint is disabled.
7921
7922 2011-05-10  Doug Evans  <dje@google.com>
7923
7924         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7925
7926 2011-05-04  Doug Evans  <dje@google.com>
7927
7928         * linux-low.c (linux_join): Skip process lookup.
7929         * spu-low.c (spu_join): Ditto.
7930         * server.c (join_inferiors_callback): Delete.
7931         (process_serial_event): For 'D' packet (detach) call join_inferior
7932         directly.
7933
7934 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7935
7936         * README: Don't mention xscale*-*-linux*.
7937         * configure.srv (xscale*-*-linux*): Don't handle target.
7938
7939 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7940
7941         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7942         casting pointers.
7943         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7944         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7945         (i386_emit_void_call_2): Likewise.
7946
7947 2011-04-26  Yao Qi  <yao@codesourcery.com>
7948
7949         * linux-low.c: Move common macros to linux-ptrace.h.
7950         Include linux-ptrace.h.
7951         * Makefile.in (linux_ptrace_h): New.
7952         (linux-low.o): Depends on linux-ptrace.h.
7953
7954 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7955
7956         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7957         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7958         (remote_prepare): New function with most of the TCP code from ...
7959         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7960         setting transport_is_reliable.
7961         * server.c (run_once): New variable.
7962         (gdbserver_usage): Document it.
7963         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7964         the first run if RUN_ONCE.
7965         * server.h (run_once, remote_prepare): New declarations.
7966
7967 2011-04-19  Tom Tromey  <tromey@redhat.com>
7968
7969         * win32-low.c (handle_load_dll): Remove duplicate "the".
7970
7971 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7972
7973         Remove support for old Cygwin 1.5 versions.
7974         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7975         function to avoid warning.
7976         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7977         warning.
7978
7979 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7980
7981         * gdbserver/server.h (Macro _): Define it if not available.
7982
7983 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7984
7985         * hostio.c (handle_close): Remove unnecessary null test.
7986
7987 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7988
7989         * Makefile.in (maintainer-clean realclean distclean): Remove
7990         "make ...  subdir_do" command.
7991
7992 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7993
7994         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7995
7996         * server.c (handle_v_run): Free alloced buffer on early return.
7997
7998 2011-03-09  Yao Qi  <yao@codesourcery.com>
7999
8000         Revert:
8001         2011-03-04  Yao Qi  <yao@codesourcery.com>
8002
8003         * Makefile.in: Remove GNU make feature --directory.
8004
8005         2011-03-05  Yao Qi  <yao@codesourcery.com>
8006
8007         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
8008         (subdir_do): New make target.  Copied from gdb/Makefile.
8009         (maintainer-clean, realclean, distclean, clean): Call corresponding
8010         make targets in common/Makefile.
8011
8012         2011-02-11  Yao Qi  <yao@codesourcery.com>
8013
8014         * configure.ac: Call AC_PROG_RANLIB.
8015         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
8016         * configure: Regenerate.
8017
8018 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
8019
8020         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
8021
8022 2011-03-06  Yao Qi  <yao@codesourcery.com>
8023
8024         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
8025
8026 2011-03-05  Yao Qi  <yao@codesourcery.com>
8027
8028         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
8029         (subdir_do): New make target.  Copied from gdb/Makefile.
8030         (maintainer-clean, realclean, distclean, clean): Call corresponding
8031         make targets in common/Makefile.
8032
8033 2011-03-04  Yao Qi  <yao@codesourcery.com>
8034
8035         * Makefile.in: Remove GNU make feature --directory.
8036
8037 2011-03-04  Michael Snyder  <msnyder@vmware.com>
8038
8039         * server.c (queue_stop_reply): Call xmalloc not malloc.
8040
8041 2011-03-02  Michael Snyder  <msnyder@vmware.com>
8042
8043         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
8044
8045 2011-02-28  Michael Snyder  <msnyder@vmware.com>
8046
8047         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
8048         (cmd_qtframe): Ditto.
8049         (cmd_qtbuffer): Ditto.
8050         (cmd_bigqtbuffer): Ditto.
8051
8052         * utils.c (decimal2str): Initialize 'width' to nine, then
8053         don't mess with it.
8054
8055 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
8056
8057         * hostio.c (require_data): Free *data, not data.
8058
8059 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8060
8061         * hostio.c (require_data): Use free, not xfree.
8062
8063 2011-02-27  Michael Snyder  <msnyder@vmware.com>
8064
8065         * server.c (handle_query): Discard unused value.
8066
8067         * hostio.c (require_data): Free malloc memory before returning
8068         error.
8069
8070 2011-02-26  Michael Snyder  <msnyder@vmware.com>
8071
8072         * linux-low.c (list_threads): Call closedir for dirent.
8073
8074 2011-02-27  Michael Snyder  <msnyder@vmware.com>
8075
8076         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
8077         a case statement falls through.
8078
8079         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
8080
8081         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
8082         in comparison.
8083
8084 2011-02-26  Michael Snyder  <msnyder@vmware.com>
8085
8086         * utils.c (decimal2str): Eliminate dead code and dead param.
8087         (pulongest): Drop dead param from call to decimal2str.
8088         (plongest): Ditto.
8089
8090 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
8091
8092         Revert the following patch (not approved yet):
8093         2011-02-21  Hui Zhu  <teawater@gmail.com>
8094         * tracepoint.c (tp_printf): New function.
8095         (eval_agent_expr): Handle gdb_agent_op_printf.
8096
8097 2011-02-21  Hui Zhu  <teawater@gmail.com>
8098
8099         * tracepoint.c (tp_printf): New function.
8100         (eval_agent_expr): Handle gdb_agent_op_printf.
8101
8102 2011-02-18  Tom Tromey  <tromey@redhat.com>
8103
8104         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
8105         (tracepoint.o): Likewise.
8106         * tracepoint.c (enum gdb_agent_op): Use ax.def.
8107         (gdb_agent_op_names): Likewise.
8108
8109 2011-02-18  Tom Tromey  <tromey@redhat.com>
8110
8111         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
8112         gdb_agent_op_rot>: New constants.
8113         (gdb_agent_op_names): Add pick and roll.
8114         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
8115         cases.
8116
8117 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
8118
8119         * aclocal.m4: Regenerated with aclocal-1.11.1.
8120
8121 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
8122
8123         * server.c (handle_qxfer_traceframe_info): New.
8124         (qxfer_packets): Register "traceframe-info".
8125         (handle_query): Report support for qXfer:traceframe-info:read+.
8126         * tracepoint.c (match_blocktype): New.
8127         (traceframe_find_block_type): Rename to ...
8128         (traceframe_walk_blocks): ... this.  Add callback filter argument,
8129         and use it.
8130         (traceframe_find_block_type): New, reimplemented on top of
8131         traceframe_walk_blocks.
8132         (build_traceframe_info_xml): New.
8133         (traceframe_read_info): New.
8134         * server.h (traceframe_read_info): Declare.
8135
8136 2011-02-11  Yao Qi  <yao@codesourcery.com>
8137
8138         * configure.ac: Call AC_PROG_RANLIB.
8139         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
8140         * configure: Regenerate.
8141
8142 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
8143
8144         * server.c (gdb_read_memory): Change return semantics to allow
8145         partial transfers.
8146         (handle_search_memory_1): Adjust.
8147         (process_serial_event) <'m' packet>: Handle partial transfers.
8148         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
8149
8150 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
8151
8152         * regcache.c (init_register_cache): Initialize
8153         regcache->register_status.
8154         (free_register_cache): Release regcache->register_status.
8155         (regcache_cpy): Copy register_status.
8156         (registers_to_string): Print 'x's for unavailable registers.
8157         (supply_register): Mark the register's status valid or
8158         unavailable, depending on whether a buffer was passed in or not.
8159         (supply_register_zeroed): New.
8160         (supply_regblock): Mark the registers' status valid or
8161         unavailable, depending on whether a buffer was passed in or not.
8162         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
8163         (struct regcache): New `register_status' field.
8164         (supply_register_zeroed): Declare.
8165         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
8166         supply_register_zeroed, rather than passing a NULL buffer to
8167         supply_register.
8168         * tracepoint.c (fetch_traceframe_registers): Update comment.
8169
8170 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
8171
8172         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
8173         buffer explicit.
8174
8175 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
8176
8177         * server.h (decode_xfer_write): Change prototype.
8178         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
8179         and don't extract the annex here.
8180         * server.c (decode_xfer_read): Remove `annex' parameter,
8181         and don't extract the annex here.
8182         (decode_xfer): New.
8183         (struct qxfer): New.
8184         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
8185         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
8186         (handle_qxfer_statictrace): New functions, abstracted out from
8187         handle_query, and made to use the struct qxfer interface.
8188         (handle_threads_qxfer_proper): Rename to ...
8189         (handle_qxfer_threads_proper): ... this.
8190         (handle_threads_qxfer): Rename to ...
8191         (handle_qxfer_threads): ... this.  Adjust.
8192         (qxfer_packets): New array.
8193         (handle_qxfer): New function.
8194         (handle_query): Use handle_qxfer.
8195
8196 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
8197
8198         * gdbreplay.c: Shorten lines of >= 80 columns.
8199         * linux-low.c: Ditto.
8200         * linux-ppc-low.c: Ditto.
8201         * linux-s390-low.c: Ditto.
8202         * linux-sparc-low.c: Ditto.
8203         * linux-x86-low.c: Ditto.
8204         * linux-xtensa-low.c: Ditto.
8205         * mem-break.c: Ditto.
8206         * nto-low.c: Ditto.
8207         * regcache.h: Ditto.
8208         * remote-utils.c: Ditto.
8209         * server.c: Ditto.
8210         * server.h: Ditto.
8211         * thread-db.c: Ditto.
8212         * tracepoint.c: Ditto.
8213         * utils.c: Ditto.
8214         * win32-low.h: Ditto.
8215
8216 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
8217
8218         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
8219         update.
8220
8221 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
8222
8223         * server.c (gdbserver_version): Update copyright year in version
8224         output.
8225         * gdbreplay.c (gdbreplay_version): Ditto.
8226
8227 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
8228
8229         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
8230         * linux-bfin-low.c: New file.
8231         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
8232         PT_DATA_ADDR for BFIN targets.
8233         * Makefile.in (SFILES): Add linux-bfin-low.c.
8234         (clean): Remove reg-bfin.c.
8235         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
8236         * README: Mention supported Blackfin targets.
8237
8238 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
8239
8240         * .gitignore: New file.
8241
8242 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
8243
8244         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
8245
8246 2010-10-22  Jie Zhang  <jie@codesourcery.com>
8247
8248         * Makefile.in: Add FLAGS_TO_PASS variable.
8249         (install): Remove dependency of install-only and recursively
8250         invoke make for install-only.
8251
8252 2010-10-04  Doug Evans  <dje@google.com>
8253
8254         * Makefile.in (uninstall): Use $(DESTDIR).
8255
8256 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
8257
8258         PR gdb/11842
8259
8260         * linux-x86-low.c (compat_siginfo_from_siginfo)
8261         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
8262         si_code is < 0.  Check for si_code == SI_TIMER before checking for
8263         si_code < 0.
8264
8265 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
8266
8267         * lynx-i386-low.c: New file.
8268         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
8269
8270 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
8271
8272         * lynx-low.c (ptrace_request_to_str): Remove handling for
8273         request values that have been removed in LynxOS 5.x.
8274
8275 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
8276
8277         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
8278         <ptrace.h>
8279
8280 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
8281
8282         * configure.ac: Add --enable-inprocess-agent option.
8283         * configure: Rebuilt.
8284
8285 2010-09-06  Yao Qi  <yao@codesourcery.com>
8286
8287         * linux-low.c (linux_kill): Remove unused variable.
8288         (linux_stabilize_threads): Likewise.
8289         * server.c (start_inferior): Likewise.
8290         (queue_stop_reply_callback): Likewise.
8291         * tracepoint.c (do_action_at_tracepoint): Likewise.
8292
8293 2010-09-06  Yao Qi  <yao@codesourcery.com>
8294
8295         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
8296         on return.
8297
8298 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
8299
8300         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
8301
8302 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
8303
8304         * Makefile.in (install-only): Replace $IPA_DEPFILES with
8305         "$(IPA_DEPFILES)".
8306
8307 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8308
8309         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
8310         gdbserver/lynx-ppc-low.c: New files.
8311         * Makefile.in (lynx_low_h): New variable.
8312         (lynx-low.o, lynx-ppc-low.o): New rules.
8313         * configure.ac: On LynxOS, link with -lnetinet.
8314         * configure.srv: Add handling of powerpc-*-lynxos* targets.
8315         * configure: regenerate.
8316
8317 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8318
8319         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
8320         * configure.ac: Add check for vasprintf and vsnprintf.
8321         * configure, config.in: Regenerate.
8322         * server.h (vasprintf, vsnprintf): Add conditional declarations.
8323
8324 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8325
8326         * gdbreplay.c: Move include of alloca.h up, next to include of
8327         malloc.h.
8328         * server.h: Add include of malloc.h.
8329         * mem-break.c: Remove include of malloc.h.
8330         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
8331
8332 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8333
8334         * Makefile.in (memmem.o): Build with -Wno-error.
8335
8336 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8337
8338         * utils.c (xsnprintf): Make non-static.
8339         * server.h: Add xsnprintf declaration.
8340         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
8341         replace calls to snprintf by calls to xsnprintf throughout.
8342
8343 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
8344
8345         * configure.ac: Add configure check for alloca.
8346         * configure, config.in: Regenerate.
8347         * server.h: Include alloca.h if it exists.
8348         * gdbreplay.c: Include alloca.h if it exists.
8349
8350 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
8351
8352         * linux-low.c (__SIGRTMIN): Define if not already defined.
8353         (linux_create_inferior): Check for __ANDROID__ rather than
8354         __SIGRTMIN.
8355         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
8356         are already deferred.
8357         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
8358         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
8359         stopped and already has a pending signal to report.
8360         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
8361         a pending signal to report or is moving out of a jump pad.
8362         (linux_init_signals): Check for __ANDROID__ rather than
8363         __SIGRTMIN.
8364
8365 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
8366
8367         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
8368         debug_threads check.  Avoid a linear search when not doing debug
8369         output.
8370
8371 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8372
8373         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
8374         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
8375         (struct file_handler) <fd>: Change type to gdb_fildes_t.
8376         (process_event): Change local fd's type to gdb_fildes_t.
8377         (create_file_handler): Adjust prototype.
8378         (delete_file_handler): Adjust prototype.
8379         (handle_file_event): Adjust prototype.  Use pfildes.
8380         (create_file_event): Adjsut prototype.
8381         * remote-utils.c (remote_desc, listen_desc): Change type to
8382         gdb_fildes_t.
8383         * server.h: New gdb_fildes_t typedef.
8384         [USE_WIN32API]: Include winsock2.h.
8385         (delete_file_handler, add_file_handler): Adjust prototypes.
8386         (pfildes): Declare.
8387         * utils.c (pfildes): New.
8388
8389 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8390
8391         * configure.ac (build_warnings): Add -Wno-char-subscripts.
8392         * configure: Regenerate.
8393
8394 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
8395
8396         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
8397         (linux_done_accessing_memory): ... this.
8398         (linux_target_ops): Adjust.
8399         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
8400         * nto-low.c (nto_target_ops): Adjust comment.
8401         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
8402         * spu-low.c (spu_target_ops): Adjust comment.
8403         * target.h (target_ops): Rename unprepare_to_access_memory field
8404         to done_accessing_memory.
8405         (unprepare_to_access_memory): Rename to ...
8406         (done_accessing_memory): ... this.
8407
8408 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8409
8410         * linux-low.c (linux_prepare_to_access_memory): New.
8411         (linux_unprepare_to_access_memory): New.
8412         (linux_target_ops): Install them.
8413         * server.c (read_memory): Rename to ...
8414         (gdb_read_memory): ... this.  Use
8415         prepare_to_access_memory/prepare_to_access_memory.
8416         (write_memory): Rename to ...
8417         (gdb_write_memory): ... this.  Use
8418         prepare_to_access_memory/prepare_to_access_memory.
8419         (handle_search_memory_1): Adjust.
8420         (process_serial_event): Adjust.
8421         * target.h (struct target_ops): New fields
8422         prepare_to_access_memory and unprepare_to_access_memory.
8423         (prepare_to_access_memory, unprepare_to_access_memory): New.
8424         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
8425         prepare_to_access_memory/prepare_to_access_memory.
8426         * nto-low.c (nto_target_ops): Adjust.
8427         * spu-low.c (spu_target_ops): Adjust.
8428         * win32-low.c (win32_target_ops): Adjust.
8429
8430 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8431
8432         * Makefile.in (WARN_CFLAGS): Get it from configure.
8433         (WERROR_CFLAGS): New.
8434         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
8435         * configure.ac: Introduce --enable-werror, which adds -Werror to
8436         the compiler command line.  Enabled by default.  Disable with
8437         --disable-werror.  Add -Wdeclaration-after-statement
8438         Wpointer-arith and -Wformat-nonliteral to warning flags.
8439         * configure: Regenerate.
8440
8441 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8442
8443         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
8444
8445 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
8446
8447         * gdbreplay.c (remote_error): New.
8448         (gdbchar): New.
8449         (expect): Use gdbchar.  Check for error reading from GDB.
8450         Clarify sync error output.
8451         (play): Check for errors writing to GDB.
8452         * linux-low.c (sigchld_handler): Really ignore `write' errors.
8453         * remote-utils.c (getpkt): Check for errors writing to the remote
8454         descriptor.
8455
8456 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8457
8458         * linux-low.c (linux_wait_1): Move non-debugging code out of
8459         `debug_threads' control.
8460
8461 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8462
8463         * linux-low.c (linux_wait_1): Don't set last_status here.
8464         * server.c (push_event, queue_stop_reply_callback): Assert we're
8465         not pushing a TARGET_WAITKIND_IGNORE event.
8466         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
8467         (myresume, handle_target_event): Set the thread's last_resume_kind
8468         and last_status from the target returned status.
8469
8470 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
8471
8472         PR threads/10729
8473
8474         * linux-x86-low.c (update_debug_registers_callback): New.
8475         (i386_dr_low_set_addr): Use it.
8476         (i386_dr_low_get_addr): New.
8477         (i386_dr_low_set_control): Use update_debug_registers_callback.
8478         (i386_dr_low_get_control): New.
8479         (i386_dr_low_get_status): Adjust.
8480         * linux-low.c (linux_stop_lwp): New.
8481         * linux-low.h (linux_stop_lwp): Declare.
8482
8483         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
8484         argument instead of a i386_debug_reg_state.
8485         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
8486         a i386_debug_reg_state.
8487         (i386_insert_aligned_watchpoint): Adjust.
8488         (i386_remove_aligned_watchpoint): Adjust.
8489         (i386_low_stopped_data_address): Read the debug registers from the
8490         inferior instead of from the mirrors.
8491         * i386-low.h (struct i386_debug_reg_state): Extend comment.
8492         (i386_dr_low_get_addr): Declare.
8493         (i386_dr_low_get_control): Declare.
8494         (i386_dr_low_get_status): Change prototype.
8495
8496         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
8497         (i386_dr_low_get_addr): New.
8498         (i386_dr_low_get_control): New.
8499         (i386_dr_low_get_status): Adjust prototype.  Return
8500         dr_status_mirror.
8501         (i386_initial_stuff): Clear dr_status_mirror and
8502         dr_control_mirror.
8503         (i386_get_thread_context): Adjust.
8504         (i386_set_thread_context): Adjust.
8505         (i386_thread_added): Adjust.
8506
8507 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
8508
8509         * linux-low.h (linux_thread_area): Delete declaration.
8510
8511 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
8512
8513         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
8514         after its termination.
8515
8516 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
8517
8518         * linux-low.c (gdb_wants_lwp_stopped): Delete.
8519         (gdb_wants_all_stopped): Delete.
8520         (linux_wait_1): Don't call them.
8521         * server.c (handle_v_cont): Tag all threads as want-stopped.
8522         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
8523         stopped as "client-wants-stopped".
8524
8525 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
8526
8527         * Makefile.in (signals_h): New.
8528         (server_h): Depend on it.
8529         (server.o): Don't depend on $(signals_def).
8530         (signals.o): Depend on $(signals_def).
8531
8532 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
8533
8534         * Makefile.in (signals_def): New.
8535         (server_h): Append include/gdb/signals.h and signals_def.
8536         (server.o): Append signals_def.
8537
8538 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
8539
8540         * server.c (handle_target_event): Use target_signal_to_host for
8541         resume_info.sig initialization.
8542         * target.h (struct thread_resume) <sig>: New comment.
8543
8544 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
8545
8546         * server.c (handle_query): strcpy() the returned string from paddress()
8547         instead of sprintf().
8548         * utils.c (paddress): Return phex_nz().
8549
8550 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
8551
8552         * server.c (handle_v_cont): Call mourn_inferior if process
8553         just exited.
8554         (myresume): Likewise.
8555
8556 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
8557
8558         Static tracepoints, and integration with UST.
8559
8560         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
8561         * mem-break.c (uninsert_all_breakpoints)
8562         (reinsert_all_breakpoints): New.
8563         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
8564         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
8565         (gdb_agent_ust_loaded, helper_thread_id)
8566         (gdb_agent_helper_thread_id): New macros.
8567         (struct ipa_sym_addresses): Add addr_ust_loaded,
8568         addr_helper_thread_id, addr_cmd_buf.
8569         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
8570         (in_process_agent_loaded_ust): New.
8571         (write_e_ust_not_loaded): New.
8572         (maybe_write_ipa_ust_not_loaded): New.
8573         (struct collect_static_trace_data_action): New.
8574         (enum tracepoint_type) <static_tracepoint>: New.
8575         (struct tracepoint) <handle>: Mention static tracepoints.
8576         (struct static_tracepoint_ctx): New.
8577         (CMD_BUF_SIZE): New.
8578         (add_tracepoint_action): Handle static tracepoint actions.
8579         (unprobe_marker_at): New.
8580         (clear_installed_tracepoints): Handle static tracepoints.
8581         (cmd_qtdp): Handle static tracepoints.
8582         (probe_marker_at): New.
8583         (cmd_qtstart): Handle static tracepoints.
8584         (response_tracepoint): Handle static tracepoints.
8585         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
8586         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
8587         (get_context_regcache): Handle static tracepoints.
8588         (do_action_at_tracepoint): Handle static tracepoint actions.
8589         (traceframe_find_block_type): Handle static trace data blocks.
8590         (traceframe_read_sdata): New.
8591         (download_tracepoints): Download static tracepoint actions.
8592         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
8593         (GDB_PROBE_NAME): New.
8594         (ust_ops): New.
8595         (GET_UST_SYM): New.
8596         (USTF): New.
8597         (dlsym_ust): New.
8598         (ust_marker_to_static_tracepoint): New.
8599         (gdb_probe): New.
8600         (collect_ust_data_at_tracepoint): New.
8601         (gdb_ust_probe): New.
8602         (UNIX_PATH_MAX, SOCK_DIR): New.
8603         (gdb_ust_connect_sync_socket): New.
8604         (resume_thread, stop_thread): New.
8605         (run_inferior_command): New.
8606         (init_named_socket): New.
8607         (gdb_ust_socket_init): New.
8608         (cstr_to_hexstr): New.
8609         (next_st): New.
8610         (first_marker, next_marker): New.
8611         (response_ust_marker): New.
8612         (cmd_qtfstm, cmd_qtsstm): New.
8613         (unprobe_marker_at, probe_marker_at): New.
8614         (cmd_qtstmat, gdb_ust_thread): New.
8615         (gdb_ust_init): New.
8616         (initialize_tracepoint_ftlib): Call gdb_ust_init.
8617         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
8618         (ST_REGENTRY): New.
8619         (x86_64_st_collect_regmap): New.
8620         (X86_64_NUM_ST_COLLECT_GREGS): New.
8621         (AMD64_RIP_REGNUM): New.
8622         (supply_static_tracepoint_registers): New.
8623         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
8624         (ST_REGENTRY): New.
8625         (i386_st_collect_regmap): New.
8626         (i386_NUM_ST_COLLECT_GREGS): New.
8627         (supply_static_tracepoint_registers): New.
8628         * server.c (handle_query): Handle qXfer:statictrace:read.
8629         <qSupported>: Report support for StaticTracepoints, and
8630         qXfer:statictrace:read features.
8631         * server.h (traceframe_read_sdata)
8632         (supply_static_tracepoint_registers): Declare.
8633         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
8634         (unpack_varlen_hex): Include in IPA build.
8635         * Makefile.in (ustlibs, ustinc): New.
8636         (IPA_OBJS): Add remote-utils-ipa.o.
8637         ($(IPA_LIB)): Link -ldl and -lpthread.
8638         (UST_CFLAGS): New.
8639         (IPAGENT_CFLAGS): Add UST_CFLAGS.
8640         * config.in, configure: Regenerate.
8641
8642 2010-06-20  Ian Lance Taylor  <iant@google.com>
8643             Pedro Alves  <pedro@codesourcery.com>
8644
8645         * linux-x86-low.c (always_true): Delete.
8646         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
8647         trying to fool the compiler with always_true.
8648
8649 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
8650
8651         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
8652         conditions in gdbserver.
8653
8654 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
8655
8656         * spu-low.c (spu_read_memory): Wrap around local store limit.
8657         (spu_write_memory): Likewise.
8658
8659 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
8660
8661         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
8662         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
8663         LONGEST uses.
8664         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
8665         uses.
8666         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
8667         uses with LONGEST uses.
8668
8669 2010-06-14  Stan Shebs  <stan@codesourcery.com>
8670             Pedro Alves  <pedro@codesourcery.com>
8671
8672         Bytecode compiler.
8673
8674         * linux-x86-low.c: Include limits.h.
8675         (add_insns): New.
8676         (always_true): New.
8677         (EMIT_ASM): New.
8678         (EMIT_ASM32): New.
8679         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
8680         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
8681         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
8682         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
8683         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
8684         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
8685         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
8686         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
8687         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
8688         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
8689         (amd64_emit_void_call_2): New.
8690         (amd64_emit_ops): New.
8691         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
8692         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
8693         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
8694         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
8695         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
8696         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
8697         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
8698         (i386_emit_call, i386_emit_reg, i386_emit_pop)
8699         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
8700         (i386_emit_stack_adjust, i386_emit_int_call_1)
8701         (i386_emit_void_call_2): New.
8702         (i386_emit_ops): New.
8703         (x86_emit_ops): New.
8704         (the_low_target): Install x86_emit_ops.
8705         * server.h (struct emit_ops): New.
8706         (get_raw_reg_func_addr): Declare.
8707         (current_insn_ptr, emit_error): Declare.
8708         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
8709         (set_trace_state_variable_value): New defines.
8710         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
8711         addr_get_trace_state_variable_value and
8712         addr_set_trace_state_variable_value.
8713         (symbol_list): New fields for get_raw_reg,
8714         get_trace_state_variable_value and set_trace_state_variable_value.
8715         (condfn): New typedef.
8716         (struct tracepoint): New field `compiled_cond'.
8717         (do_action_at_tracepoint): Clear compiled_cond.
8718         (get_trace_state_variable_value, set_trace_state_variable_value):
8719         Export in the IPA.
8720         (condition_true_at_tracepoint): If there's a compiled condition,
8721         run that.
8722         (current_insn_ptr, emit_error): New globals.
8723         (struct bytecode_address): New.
8724         (get_raw_reg_func_addr): New.
8725         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
8726         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
8727         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
8728         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
8729         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
8730         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
8731         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
8732         (compile_tracepoint_condition, compile_bytecodes): New.
8733         * target.h (emit_ops): Forward declare.
8734         (struct target_ops): New field emit_ops.
8735         (target_emit_ops): New.
8736         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
8737         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
8738         * linux-low.c (linux_emit_ops): New.
8739         (linux_target_ops): Install it.
8740         * linux-low.h (struct linux_target_ops): New field emit_ops.
8741
8742 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
8743
8744         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
8745         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
8746
8747 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8748             Stan Shebs  <stan@codesourcery.com>
8749
8750         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
8751         (all): Depend on $(extra_libraries).
8752         (install-only): Install the IPA.
8753         (IPA_OBJS, IPA_LIB): New.
8754         (clean): Remove the IPA lib.
8755         (IPAGENT_CFLAGS): New.
8756         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
8757         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
8758         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
8759         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
8760         * configure.ac: Check for atomic builtins support in the compiler.
8761         (IPA_DEPFILES, extra_libraries): Define.
8762         * configure.srv (ipa_obj): Add description.
8763         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
8764         (i[34567]86-*-linux*): Set ipa_obj.
8765         (x86_64-*-linux*): Set ipa_obj.
8766         * linux-low.c (stabilizing_threads): New.
8767         (supports_fast_tracepoints): New.
8768         (linux_detach): Stabilize threads before detaching.
8769         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
8770         the lwp is either not stabilizing, or is moving out of a jump pad.
8771         (linux_fast_tracepoint_collecting): New.
8772         (maybe_move_out_of_jump_pad): New.
8773         (enqueue_one_deferred_signal): New.
8774         (dequeue_one_deferred_signal): New.
8775         (linux_wait_for_event_1): If moving out of a jump pad, defer
8776         pending signals to later.
8777         (linux_stabilize_threads): New.
8778         (linux_wait_1): Check if threads need moving out of jump pads, and
8779         do it if so.
8780         (stuck_in_jump_pad_callback): New.
8781         (move_out_of_jump_pad_callback): New.
8782         (lwp_running): New.
8783         (linux_resume_one_lwp): Handle moving out of jump pads.
8784         (linux_set_resume_request): Dequeue deferred signals.
8785         (need_step_over_p): Also step over fast tracepoint jumps.
8786         (start_step_over): Also uninsert fast tracepoint jumps.
8787         (finish_step_over): Also reinsert fast tracepoint jumps.
8788         (linux_install_fast_tracepoint_jump): New.
8789         (linux_target_ops): Install linux_stabilize_threads and
8790         linux_install_fast_tracepoint_jump_pad.
8791         * linux-low.h (linux_target_ops) <get_thread_area,
8792         install_fast_tracepoint_jump_pad>: New fields.
8793         (struct lwp_info) <collecting_fast_tracepoint,
8794         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
8795         (linux_get_thread_area): Declare.
8796         * linux-x86-low.c (jump_insn): New.
8797         (x86_get_thread_area): New.
8798         (append_insns): New.
8799         (push_opcode): New.
8800         (amd64_install_fast_tracepoint_jump_pad): New.
8801         (i386_install_fast_tracepoint_jump_pad): New.
8802         (x86_install_fast_tracepoint_jump_pad): New.
8803         (the_low_target): Install x86_get_thread_area and
8804         x86_install_fast_tracepoint_jump_pad.
8805         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
8806         (struct fast_tracepoint_jump): New.
8807         (fast_tracepoint_jump_insn): New.
8808         (fast_tracepoint_jump_shadow): New.
8809         (find_fast_tracepoint_jump_at): New.
8810         (fast_tracepoint_jump_here): New.
8811         (delete_fast_tracepoint_jump): New.
8812         (set_fast_tracepoint_jump): New.
8813         (uninsert_fast_tracepoint_jumps_at): New.
8814         (reinsert_fast_tracepoint_jumps_at): New.
8815         (set_breakpoint_at): Use write_inferior_memory.
8816         (uninsert_raw_breakpoint): Use write_inferior_memory.
8817         (check_mem_read): Mask out fast tracepoint jumps.
8818         (check_mem_write): Mask out fast tracepoint jumps.
8819         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
8820         (set_fast_tracepoint_jump): Declare.
8821         (delete_fast_tracepoint_jump)
8822         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
8823         (reinsert_fast_tracepoint_jumps_at): Declare.
8824         * regcache.c: Don't compile many functions when building the
8825         in-process agent library.
8826         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
8827         the register buffer in the heap.
8828         (free_register_cache): If the register buffer isn't owned by the
8829         regcache, don't free it.
8830         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8831         pre-existing register caches.
8832         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8833         type.
8834         (convert_ascii_to_int): : Constify `from' parameter type.
8835         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8836         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8837         the needed buffer in-place.
8838         (relocate_instruction): New.
8839         * server.c (handle_query) <qSymbols>: If the target supports
8840         tracepoints, give it a chance of looking up symbols.  Report
8841         support for fast tracepoints.
8842         (handle_status): Stabilize threads.
8843         (process_serial_event): Adjust.
8844         * server.h (struct fast_tracepoint_jump): Forward declare.
8845         (struct process_info) <fast_tracepoint_jumps>: New field.
8846         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8847         (decode_X_packet, decode_M_packet): Adjust.
8848         (relocate_instruction): Declare.
8849         (in_process_agent_loaded): Declare.
8850         (tracepoint_look_up_symbols): Declare.
8851         (struct fast_tpoint_collect_status): Declare.
8852         (fast_tracepoint_collecting): Declare.
8853         (force_unlock_trace_buffer): Declare.
8854         (handle_tracepoint_bkpts): Declare.
8855         (initialize_low_tracepoint)
8856         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8857         * target.h (struct target_ops) <stabilize_threads,
8858         install_fast_tracepoint_jump_pad>: New fields.
8859         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8860         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8861         [HAVE_STDINT_H]: Include stdint.h.
8862         (trace_debug_1): Rename to ...
8863         (trace_vdebug): ... this.
8864         (trace_debug): Rename to ...
8865         (trace_debug_1): ... this.  Add `level' parameter.
8866         (trace_debug): New.
8867         (ATTR_USED, ATTR_NOINLINE): New.
8868         (IP_AGENT_EXPORT): New.
8869         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8870         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8871         (about_to_request_buffer_space, trace_buffer_is_full)
8872         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8873         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8874         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8875         (traceframe_write_count, traceframes_created)
8876         (trace_state_variables)
8877         New renaming defines.
8878         (struct ipa_sym_addresses): New.
8879         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8880         (symbol_list): New.
8881         (ipa_sym_addrs): New.
8882         (all_tracepoint_symbols_looked_up): New.
8883         (in_process_agent_loaded): New.
8884         (write_e_ipa_not_loaded): New.
8885         (maybe_write_ipa_not_loaded): New.
8886         (tracepoint_look_up_symbols): New.
8887         (debug_threads) [IN_PROCESS_AGENT]: New.
8888         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8889         (UNKNOWN_SIDE_EFFECTS): New.
8890         (stop_tracing): New.
8891         (flush_trace_buffer): New.
8892         (stop_tracing_bkpt): New.
8893         (flush_trace_buffer_bkpt): New.
8894         (read_inferior_integer): New.
8895         (read_inferior_uinteger): New.
8896         (read_inferior_data_pointer): New.
8897         (write_inferior_data_pointer): New.
8898         (write_inferior_integer): New.
8899         (write_inferior_uinteger): New.
8900         (struct collect_static_trace_data_action): Delete.
8901         (enum tracepoint_type): New.
8902         (struct tracepoint) <type>: New field `type'.
8903         <actions_str, step_actions, step_actions_str>: Only include in
8904         GDBserver.
8905         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8906         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8907         (tracepoints): Use IP_AGENT_EXPORT.
8908         (last_tracepoint): Don't include in the IPA.
8909         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8910         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8911         (alloced_trace_state_variables): New.
8912         (trace_state_variables): Use IP_AGENT_EXPORT.
8913         (traceframe_t): Delete unused variable.
8914         (circular_trace_buffer): Don't include in the IPA.
8915         (trace_buffer_start): Delete.
8916         (struct trace_buffer_control): New.
8917         (trace_buffer_free): Delete.
8918         (struct ipa_trace_buffer_control): New.
8919         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8920         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8921         New.
8922         (trace_buffer_ctrl): New.
8923         (TRACE_BUFFER_CTRL_CURR): New.
8924         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8925         Reimplement as macros.
8926         (trace_buffer_wrap): Delete.
8927         (traceframe_write_count, traceframe_read_count)
8928         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8929         (struct tracepoint_hit_ctx) <type>: New field.
8930         (struct fast_tracepoint_ctx): New.
8931         (memory_barrier): New.
8932         (cmpxchg): New.
8933         (record_tracepoint_error): Update atomically in the IPA.
8934         (clear_inferior_trace_buffer): New.
8935         (about_to_request_buffer_space): New.
8936         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8937         updating the same buffer.
8938         (add_tracepoint): Default the tracepoint's type to trap
8939         tracepoint, and orig_size to -1.
8940         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8941         internal variables.
8942         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8943         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8944         (cmd_qtdp): Handle fast tracepoints.
8945         (cmd_qtdv): Adjust.
8946         (max_jump_pad_size): New.
8947         (gdb_jump_pad_head): New.
8948         (get_jump_space_head): New.
8949         (claim_jump_space): New.
8950         (sort_tracepoints): New.
8951         (MAX_JUMP_SIZE): New.
8952         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8953         IPA.
8954         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8955         support.  Upload fast traceframes, and delete internal IPA
8956         breakpoints.
8957         (stop_tracing_handler): New.
8958         (flush_trace_buffer_handler): New.
8959         (cmd_qtstop): Upload fast tracepoints.
8960         (response_tracepoint): Handle fast tracepoints.
8961         (tracepoint_finished_step): Upload fast traceframes.  Set the
8962         tracepoint hit context's tracepoint type.
8963         (handle_tracepoint_bkpts): New.
8964         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8965         type.  Add comment about fast tracepoints.
8966         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8967         non-existing action_str field.
8968         (get_context_regcache): Handle fast tracepoints.
8969         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8970         to the regcache.
8971         (fast_tracepoint_from_jump_pad_address): New.
8972         (fast_tracepoint_from_ipa_tpoint_address): New.
8973         (collecting_t): New.
8974         (force_unlock_trace_buffer): New.
8975         (fast_tracepoint_collecting): New.
8976         (collecting): New.
8977         (gdb_collect): New.
8978         (write_inferior_data_ptr): New.
8979         (target_tp_heap): New.
8980         (target_malloc): New.
8981         (download_agent_expr): New.
8982         (UALIGN): New.
8983         (download_tracepoints): New.
8984         (download_trace_state_variables): New.
8985         (upload_fast_traceframes): New.
8986         (IPA_FIRST_TRACEFRAME): New.
8987         (IPA_NEXT_TRACEFRAME_1): New.
8988         (IPA_NEXT_TRACEFRAME): New.
8989         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8990         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8991         (gdb_jump_pad_buffer_end): New.
8992         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8993         (initialize_tracepoint): Adjust.
8994         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8995         buffer.  Initialize the low module.
8996         * utils.c (PREFIX, TOOLNAME): New.
8997         (malloc_failure): Use PREFIX.
8998         (error): In the IPA, an error causes an exit.
8999         (fatal, warning): Use PREFIX.
9000         (internal_error): Use TOOLNAME.
9001         (NUMCELLS): Increase to 10.
9002         * configure, config.in: Regenerate.
9003
9004 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
9005
9006         * server.c (handle_query) <qSupported>: Do two passes over the
9007         qSupported string to avoid nesting strtok.
9008
9009 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
9010
9011         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
9012         (CDEPS): New.
9013         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
9014         -Wl,--dynamic-list.
9015         * configure: Regenerate.
9016         * proc-service.list: New.
9017
9018 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
9019
9020         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
9021         New comment.
9022
9023 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
9024
9025         * gdbreplay.c (remote_open): Check error return from socket() call by
9026         its equality to -1 not by it being negative.
9027         * remote-utils.c (remote_open): Likewise.
9028
9029 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
9030
9031         * config.h: Regenerate.
9032
9033 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
9034
9035         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
9036         doesn't provide PTRACE_GET_THREAD_AREA.
9037
9038 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
9039
9040         * linux-m68k-low.c: Include <asm/ptrace.h>
9041         (ps_get_thread_area): Implement.
9042
9043 2010-05-03  Doug Evans  <dje@google.com>
9044
9045         * event-loop.c (struct callback_event): New struct.
9046         (callback_list): New global.
9047         (append_callback_event, delete_callback_event): New functions.
9048         (process_callback): New function.
9049         (start_event_loop): Call it.
9050         * remote-utils.c (NOT_SCHEDULED): Define.
9051         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
9052         moved out of readchar.
9053         (readchar): Rewrite.  Call reschedule before returning.
9054         (reset_readchar): New function.
9055         (remote_close): Call it.
9056         (process_remaining, reschedule): New functions.
9057         * server.h (callback_handler_func): New typedef.
9058         (append_callback_event, delete_callback_event): Declare.
9059
9060 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
9061
9062         * proc-service.c (ps_pglobal_lookup): Use
9063         thread_db_look_up_one_symbol.
9064         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
9065         parameter.  Use it instead of all_symbols_looked_up.
9066         * server.h (struct process_info) <all_symbols_looked_up>: Delete
9067         field.
9068         (all_symbols_looked_up): Don't declare.
9069         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
9070         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
9071         field.
9072         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
9073         Set all_symbols_looked_up here.
9074         (thread_db_look_up_one_symbol): New.
9075         (thread_db_get_tls_address): Adjust.
9076         (thread_db_load_search, try_thread_db_load_1): Always allocate the
9077         thread_db object on the heap, and tentatively set it in the
9078         process structure.
9079         (thread_db_init): Don't set all_symbols_looked_up here.
9080         * linux-low.h (thread_db_look_up_one_symbol): Declare.
9081
9082 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
9083
9084         * linux-low.c (linux_kill, linux_detach): Adjust.
9085         (status_pending_p_callback): Remove redundant statement.  Check
9086         for !TARGET_WAITIKIND_IGNORE, instead of
9087         TARGET_WAITKIND_STOPPED.
9088         (handle_tracepoints): Make sure LWP is locked.  Adjust.
9089         (linux_wait_for_event_1): Adjust.
9090         (linux_cancel_breakpoints): New.
9091         (unsuspend_one_lwp): New.
9092         (unsuspend_all_lwps): New.
9093         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
9094         (send_sigstop_callback): Change return type to int, add new
9095         `except' parameter and handle it.
9096         (suspend_and_send_sigstop_callback): New.
9097         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
9098         pass them down.  If SUSPEND, also increment the lwp's suspend
9099         count.
9100         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
9101         (need_step_over_p): Don't consider suspended LWPs.
9102         (start_step_over): Adjust.
9103         (proceed_one_lwp): Change return type to int, add new `except'
9104         parameter and handle it.
9105         (unsuspend_and_proceed_one_lwp): New.
9106         (proceed_all_lwps): Use find_inferior instead of
9107         for_each_inferior.
9108         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
9109         also decrement the suspend count of LWPs.  Pass `except' down,
9110         instead of hacking its suspend count.
9111         (linux_pause_all): Add `freeze' parameter.  Adjust.
9112         (linux_unpause_all): New.
9113         (linux_target_ops): Install linux_unpause_all.
9114         * server.c (handle_status): Adjust.
9115         * target.h (struct target_ops): New fields `unpause_all' and
9116         `cancel_breakpoints'.  Add new parameter to `pause_all'.
9117         (pause_all): Add new `freeze' parameter.
9118         (unpause_all): New.
9119         (cancel_breakpoints): New.
9120         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
9121         cancel breakpoints.
9122         (cmd_qtstart): Pause threads.
9123         (stop_tracing): Pause threads, and cancel breakpoints.
9124         * win32-low.c (win32_target_ops): Adjust.
9125
9126 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
9127
9128         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
9129         the inferior right away from here...
9130         (linux_wait_1): ... to here, and adjust to check the thread's
9131         last_resume_kind instead of the lwp's step or stop_expected flags.
9132
9133 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
9134
9135         * README: Use consistent `GDB' and `GDBserver' spellings.
9136
9137 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
9138
9139         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
9140         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
9141         (linux_detach_one_lwp): Assume the lwp is stopped.
9142         (any_thread_of): Delete.
9143         (linux_detach): Stop all lwps here.  Don't blindly delete all
9144         breakpoints.
9145         (delete_lwp_callback): New.
9146         (linux_mourn): Delete all lwps of the process that is gone.
9147         (linux_wait_1): Don't delete the last lwp of the process here.
9148         * mem-break.h (mark_breakpoints_out): Declare.
9149         * mem-break.c (mark_breakpoints_out): New.
9150         (free_all_breakpoints): Use it.
9151         * server.c (handle_target_event): If the process is gone, mark
9152         breakpoints out.
9153         * thread-db.c (struct thread_db) <create_bp>: New field.
9154         (thread_db_enable_reporting): Fix prototype.  Store a thread event
9155         breakpoint reference in the thread_db struct.
9156         (thread_db_load_search): Clear the thread_db object.
9157         (try_thread_db_load_1): Ditto.
9158         (switch_to_process): New.
9159         (disable_thread_event_reporting): Use it.
9160         (remove_thread_event_breakpoints): New.
9161         (thread_db_detach, thread_db_mourn): Use it.
9162
9163 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
9164
9165         * linux-low.c (linux_enable_event_reporting): New.
9166         (linux_wait_for_event_1, handle_extended_wait): Use it.
9167
9168 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
9169
9170         * linux-low.c (linux_kill_one_lwp, linux_kill)
9171         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
9172         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
9173         SIGSTOP even if the LWP is stopped.
9174         (send_sigstop_callback): New.
9175         (stop_all_lwps): Use send_sigstop_callback instead.
9176         (linux_resume_one_thread): Adjust.
9177         (proceed_one_lwp): Still proceed an LWP that the client has
9178         requested to stop, if we haven't reported it as stopped yet.  Make
9179         sure that LWPs the client want stopped, have a pending SIGSTOP.
9180
9181 2010-04-26  Doug Evans  <dje@google.com>
9182
9183         * server.c (handle_general_set): Make static.
9184
9185         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
9186         Print received char after testing for error/eof instead of before.
9187         (input_interrupt): Tweak comment.
9188
9189 2010-04-23  Doug Evans  <dje@google.com>
9190
9191         * server.c (start_inferior): Print inferior argv if --debug.
9192
9193 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
9194
9195         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
9196         * nto-x86-low.c: Include server.h
9197
9198 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
9199
9200         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
9201         be consistent with other sources of this directory.
9202         (init_registers_amd64): Correct name of source file of this function
9203         in the comment.
9204
9205 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
9206
9207         * configure.srv (x86_64-*-mingw*): New configuration for Windows
9208         64-bit executables.
9209
9210 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
9211
9212         * win32-i386-low.c: Add 64-bit support.
9213         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
9214         (init_registers_amd64): Declare.
9215         (mappings): Add 64-bit version of array.
9216         (init_windows_x86): New function.
9217         (the_low_target): Change init_arch field to init_windows_x86.
9218
9219 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
9220
9221         * win32-low.c: Adapt to support also 64-bit architecture.
9222         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
9223         (get_image_name): Use SIZE_T type for local variable `done'.
9224         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
9225         (toolhelp_get_dll_name): Idem.
9226         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
9227         Use uintptr_t typecast to avoid warning.
9228         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
9229         (handle_exception): Use phex_nz to avoid warning.
9230         (win32_wait): Remove unused local variable `process'.
9231
9232 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
9233
9234         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
9235         `amd64-avx.o'.
9236
9237 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
9238
9239         * configure.ac: Use `ws2_32' library for srv_mingw.
9240         * configure: Regenerate.
9241         * gdbreplay.c: Include winsock2.h instead of winsock.h.
9242         * remote-utils.c: Likewise.
9243
9244 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
9245
9246         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
9247         if __x86_64__ is defined.
9248
9249 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
9250
9251         * configure: Regenerate.
9252
9253 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
9254
9255         * server.c (handle_query): Handle 'qGetTIBAddr' query.
9256         * target.h (target_ops): New get_tib_address field.
9257         * win32-low.h (win32_thread_info): Add thread_local_base field.
9258         * win32-low.c (child_add_thread): Add tlb argument.
9259         Set thread_local_base field to TLB.
9260         (get_child_debug_event): Adapt to child_add_thread change.
9261         (win32_get_tib_address): New function.
9262         (win32_target_ops): Set get_tib_address field to
9263         win32_get_tib_address.
9264         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
9265
9266 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
9267
9268         * linux-low.c (linux_mourn): Also remove the process.
9269         * server.c (handle_target_event): Don't remove the process here.
9270         * nto-low.c (nto_mourn): New.
9271         (nto_target_ops): Install it.
9272         * spu-low.c (spu_mourn): New.
9273         (spu_target_ops): Install it.
9274         * win32-low.c (win32_mourn): New.
9275         (win32_target_ops): Install it.
9276
9277 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
9278
9279         * server.h (buffer_xml_printf): Remove redundant `;'.
9280
9281 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
9282
9283         * regcache.c (set_register_cache): Invalidate regcaches before
9284         changing the register cache layout.
9285         (regcache_invalidate_one): Allow a NULL regcache.
9286         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
9287         regcaches before changing the register cache layout or the target
9288         regsets.
9289
9290 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
9291
9292         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
9293         variable warning on Linux/x86-64.
9294
9295 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
9296
9297         GDBserver disconnected tracing support.
9298
9299         * linux-low.c (linux_remove_process): Delete.
9300         (add_lwp): Don't set last_resume_kind here.
9301         (linux_kill): Use `mourn'.
9302         (linux_detach): Use `thread_db_detach', and `mourn'.
9303         (linux_mourn): New.
9304         (linux_attach_lwp_1): Adjust comment.
9305         (linux_attach): last_resume_kind moved the thread_info; adjust.
9306         (status_pending_p_callback): Adjust.
9307         (linux_wait_for_event_1): Adjust.
9308         (count_events_callback, select_singlestep_lwp_callback)
9309         (select_event_lwp_callback, cancel_breakpoints_callback)
9310         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
9311         (proceed_one_lwp): Adjust.
9312         (linux_async): Add debug output.
9313         (linux_thread_stopped): New.
9314         (linux_pause_all): New.
9315         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
9316         linux_pause_all.
9317         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
9318         (thread_db_free): Delete declaration.
9319         (thread_db_detach, thread_db_mourn): Declare.
9320         * thread-db.c (thread_db_init): Use thread_db_mourn.
9321         (thread_db_free): Delete, split in two.
9322         (disable_thread_event_reporting): New.
9323         (thread_db_detach): New.
9324         (thread_db_mourn): New.
9325
9326         * server.h (struct thread_info) <last_resume_kind>: New field.
9327         <attached>: Add comment.
9328         <gdb_detached>: New field.
9329         (handler_func): Change return type to int.
9330         (handle_serial_event, handle_target_event): Ditto.
9331         (gdb_connected): Declare.
9332         (tracing): Delete.
9333         (disconnected_tracing): Declare.
9334         (stop_tracing): Declare.
9335
9336         * server.c (handle_query) <qSupported>: Report support for
9337         disconnected tracing.
9338         (queue_stop_reply_callback): Account for running threads.
9339         (gdb_wants_thread_stopped): New.
9340         (gdb_wants_all_threads_stopped): New.
9341         (gdb_reattached_process): New.
9342         (handle_status): Clear the `gdb_detached' flag of all processes.
9343         In all-stop, stop all threads.
9344         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
9345         (process_serial_event): If the remote connection breaks, or if an
9346         exit was forced with "monitor exit", force an event loop exit.
9347         Handle disconnected tracing on detach.
9348         (handle_serial_event): Adjust.
9349         (handle_target_event): If GDB isn't connected, forward events back
9350         to the inferior, unless the last process exited, in which case,
9351         exit gdbserver.  Adjust interface.
9352
9353         * remote-utils.c (remote_open): Don't block in accept.  Instead
9354         register an event loop source on the listen socket file
9355         descriptor.  Refactor bits into ...
9356         (listen_desc): ... this new global.
9357         (gdb_connected): ... this new function.
9358         (enable_async_notification): ... this new function.
9359         (handle_accept_event): ... this new function.
9360         (remote_close): Clear remote_desc.
9361
9362         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
9363
9364         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
9365         New fields.
9366         (mourn_inferior): Define.
9367         (target_process_qsupported): Avoid the dangling else problem.
9368         (thread_stopped): Define.
9369         (pause_all): Define.
9370         (target_waitstatus_to_string): Declare.
9371         * target.c (target_waitstatus_to_string): New.
9372
9373         * tracepoint.c (tracing): Make extern.
9374         (disconnected_tracing): New.
9375         (stop_tracing): Make extern.  Handle tracing stops due to GDB
9376         disconnecting.
9377         (cmd_qtdisconnected): New.
9378         (cmd_qtstatus): Report disconnected tracing status in trace reply.
9379         (handle_tracepoint_general_set): Handle QTDisconnected.
9380
9381         * event-loop.c (event_handler_func): Change return type to int.
9382         (process_event): Bail out if the event handler wants the event
9383         loop to stop.
9384         (handle_file_event): Ditto.
9385         (start_event_loop): Bail out if the event handler wants the event
9386         loop to stop.
9387
9388         * nto-low.c (nto_target_ops): Adjust.
9389         * spu-low.c (spu_wait): Don't remove the process here.
9390         (spu_target_ops): Adjust.
9391         * win32-low.c (win32_wait): Don't remove the process here.
9392         (win32_target_ops): Adjust.
9393
9394 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
9395
9396         * regcache.c (realloc_register_cache): Invalidate inferior's
9397         regcache before recreating it.
9398
9399 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
9400
9401         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
9402
9403 2010-04-09  Stan Shebs  <stan@codesourcery.com>
9404             Pedro Alves  <pedro@codesourcery.com>
9405
9406         * server.h (LONGEST): New.
9407         (struct thread_info) <while_stepping>: New field.
9408         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
9409         Declare.
9410         (initialize_tracepoint, handle_tracepoint_general_set)
9411         (handle_tracepoint_query, tracepoint_finished_step)
9412         (tracepoint_was_hit, release_while_stepping_state_list):
9413         (current_traceframe): Declare.
9414         * server.c (handle_general_set): Handle tracepoint packets.
9415         (read_memory): New.
9416         (write_memory): New.
9417         (handle_search_memory_1): Use read_memory.
9418         (handle_query): Report support for conditional tracepoints, trace
9419         state variables, and tracepoint sources.  Handle tracepoint
9420         queries.
9421         (main): Initialize the tracepoints module.
9422         (process_serial_event): Handle traceframe reads/writes.
9423
9424         * linux-low.c (handle_tracepoints): New.
9425         (linux_wait_1): Call it.
9426         (linux_resume_one_lwp): Handle while-stepping.
9427         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
9428         (linux_target_ops): Install them.
9429         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
9430         New field.
9431         * linux-x86-low.c (x86_supports_tracepoints): New.
9432         (the_low_target). Install it.
9433
9434         * mem-break.h (delete_breakpoint): Declare.
9435         * mem-break.c (delete_breakpoint): Make external.
9436
9437         * target.h (struct target_ops): Add `supports_tracepoints',
9438         `read_pc', and `write_pc' fields.
9439         (target_supports_tracepoints): Define.
9440         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
9441         (phex_nz): New.
9442
9443         * regcache.h (struct regcache) <registers_owned>: New field.
9444         (init_register_cache, regcache_cpy): Declare.
9445         (regcache_read_pc, regcache_write_pc): Declare.
9446         (register_cache_size): Declare.
9447         (supply_regblock): Declare.
9448         * regcache.c (init_register_cache): New.
9449         (new_register_cache): Use it.
9450         (regcache_cpy): New.
9451         (register_cache_size): New.
9452         (supply_regblock): New.
9453         (regcache_read_pc, regcache_write_pc): New.
9454
9455         * tracepoint.c: New.
9456
9457         * Makefile.in (OBS): Add tracepoint.o.
9458         (tracepoint.o): New rule.
9459
9460 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
9461
9462         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
9463         (i386-mmx.o): New.
9464         (i386-mmx.c): Likewise.
9465         (i386-mmx-linux.o): Likewise.
9466         (i386-mmx-linux.c): Likewise.
9467
9468         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
9469         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
9470         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
9471         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
9472
9473         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
9474         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
9475         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
9476
9477 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
9478
9479         * Makefile.in (clean): Updated.
9480         (i386-avx.o): New.
9481         (i386-avx.c): Likewise.
9482         (i386-avx-linux.o): Likewise.
9483         (i386-avx-linux.c): Likewise.
9484         (amd64-avx.o): Likewise.
9485         (amd64-avx.c): Likewise.
9486         (amd64-avx-linux.o): Likewise.
9487         (amd64-avx-linux.c): Likewise.
9488
9489         * configure.srv (srv_i386_regobj): Add i386-avx.o.
9490         (srv_i386_linux_regobj): Add i386-avx-linux.o.
9491         (srv_amd64_regobj): Add amd64-avx.o.
9492         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
9493         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
9494         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
9495         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
9496         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
9497         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
9498         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
9499
9500         * i387-fp.c: Include "i386-xstate.h".
9501         (i387_xsave): New.
9502         (i387_cache_to_xsave): Likewise.
9503         (i387_xsave_to_cache): Likewise.
9504         (x86_xcr0): Likewise.
9505
9506         * i387-fp.h (i387_cache_to_xsave): Likewise.
9507         (i387_xsave_to_cache): Likewise.
9508         (x86_xcr0): Likewise.
9509
9510         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
9511         * linux-crisv32-low.c (target_regsets): Likewise.
9512         * linux-m68k-low.c (target_regsets): Likewise.
9513         * linux-mips-low.c (target_regsets): Likewise.
9514         * linux-ppc-low.c (target_regsets): Likewise.
9515         * linux-s390-low.c (target_regsets): Likewise.
9516         * linux-sh-low.c (target_regsets): Likewise.
9517         * linux-sparc-low.c (target_regsets): Likewise.
9518         * linux-xtensa-low.c (target_regsets): Likewise.
9519
9520         * linux-low.c: Include <sys/uio.h>.
9521         (regsets_fetch_inferior_registers): Support nt_type.
9522         (regsets_store_inferior_registers): Likewise.
9523         (linux_process_qsupported): New.
9524         (linux_target_ops): Add linux_process_qsupported.
9525
9526         * linux-low.h (regset_info): Add nt_type.
9527         (linux_target_ops): Add process_qsupported.
9528
9529         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
9530         and <sys/uio.h>.
9531         (init_registers_i386_avx_linux): New.
9532         (init_registers_amd64_avx_linux): Likewise.
9533         (xmltarget_i386_linux_no_xml): Likewise.
9534         (xmltarget_amd64_linux_no_xml): Likewise.
9535         (PTRACE_GETREGSET): Likewise.
9536         (PTRACE_SETREGSET): Likewise.
9537         (x86_fill_xstateregset): Likewise.
9538         (x86_store_xstateregset): Likewise.
9539         (use_xml): Likewise.
9540         (x86_linux_update_xmltarget): Likewise.
9541         (x86_linux_process_qsupported): Likewise.
9542         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
9543         (x86_arch_setup): Don't call init_registers_amd64_linux nor
9544         init_registers_i386_linux here.  Call
9545         x86_linux_update_xmltarget.
9546         (the_low_target): Add x86_linux_process_qsupported.
9547
9548         * server.c (handle_query): Call target_process_qsupported.
9549
9550         * target.h (target_ops): Add process_qsupported.
9551         (target_process_qsupported): New.
9552
9553 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
9554
9555         * inferiors.c (add_thread): Set last_status kind to
9556         TARGET_WAITKIND_IGNORE.
9557         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
9558         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
9559         (linux_wait_1): Move `thread' local definition to block that uses
9560         it.  Don't NULL initialize `event_child'.
9561         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
9562         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
9563         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
9564
9565 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9566
9567         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
9568         an extended waitstatus, or by a watchpoint.
9569         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
9570         thread was stepping or has been stopped by a watchpoint.
9571
9572 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9573
9574         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
9575         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
9576         of another, then delete the previous, and validate all
9577         breakpoints.
9578         (validate_inserted_breakpoint): New.
9579         (delete_disabled_breakpoints): New.
9580         (validate_breakpoints): New.
9581         (check_mem_read): Validate breakpoints before trusting their
9582         shadow.  Delete disabled breakpoints.
9583         (check_mem_write): Validate breakpoints before trusting they
9584         should be inserted.  Delete disabled breakpoints.
9585         * mem-break.h (validate_breakpoints):
9586         * server.c (handle_query): Validate breakpoints when we see a
9587         qSymbol query.
9588
9589 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
9590
9591         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
9592         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
9593         if we could tell there's a GDB breakpoint at stop_pc.
9594         (need_step_over_p): Don't do a step over if we find a GDB
9595         breakpoint at the resume PC.
9596
9597         * mem-break.c (struct raw_breakpoint): New.
9598         (enum bkpt_type): New type `gdb_breakpoint'.
9599         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
9600         fields.  New field `raw'.
9601         (find_raw_breakpoint_at): New.
9602         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
9603         breakpoint instead.
9604         (set_breakpoint_at): Adjust.
9605         (delete_raw_breakpoint): New.
9606         (release_breakpoint): New.
9607         (delete_breakpoint): Rename to...
9608         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
9609         release_breakpoint.  Return ENOENT.
9610         (delete_breakpoint): Reimplement.
9611         (find_breakpoint_at): Delete.
9612         (find_gdb_breakpoint_at): New.
9613         (delete_breakpoint_at): Delete.
9614         (set_gdb_breakpoint_at): New.
9615         (delete_gdb_breakpoint_at): New.
9616         (gdb_breakpoint_here): New.
9617         (set_reinsert_breakpoint): Use release_breakpoint.
9618         (uninsert_breakpoint): Rename to ...
9619         (uninsert_raw_breakpoint): ... this.
9620         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
9621         (reinsert_raw_breakpoint): Change parameter type to
9622         raw_breakpoint.
9623         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
9624         instead.
9625         (check_breakpoints): Adjust.  Use release_breakpoint.
9626         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
9627         (breakpoint_inserted_here): Ditto.
9628         (check_mem_read): Adjust to iterate over raw breakpoints instead.
9629         Don't trust the breakpoint's shadow if it is not inserted.
9630         (check_mem_write): Adjust to iterate over raw breakpoints instead.
9631         (delete_all_breakpoints): Adjust.
9632         (free_all_breakpoints): Mark all breakpoints as uninserted, and
9633         use delete_breakpoint_1.
9634
9635         * mem-break.h (breakpoints_supported): Delete declaration.
9636         (set_gdb_breakpoint_at): Declare.
9637         (gdb_breakpoint_here): Declare.
9638         (delete_breakpoint_at): Delete.
9639         (delete_gdb_breakpoint_at): Declare.
9640
9641         * server.h (struct raw_breakpoint): Forward declare.
9642         (struct process_info): New field `raw_breakpoints'.
9643
9644         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
9645         breakpoints.
9646
9647 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9648
9649         * linux-low.c (status_pending_p_callback): Fix comment.
9650         (linux_wait_for_event_1): Move most of the internal breakpoint
9651         handling from here...
9652         (linux_wait_1): ... to here.
9653         (count_events_callback): New.
9654         (select_singlestep_lwp_callback): New.
9655         (select_event_lwp_callback): New.
9656         (cancel_breakpoints_callback): New.
9657         (select_event_lwp): New.
9658         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
9659         priority to all LWPs that have had events that should be reported
9660         to the client.  Cancel breakpoints when about to reporting the
9661         event to the client, not while stopping lwps.  No longer cancel
9662         finished single-steps here.
9663         (cancel_finished_single_step): Delete.
9664         (cancel_finished_single_steps): Delete.
9665
9666 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9667
9668         * mem-break.c (enum bkpt_type): New.
9669         (struct breakpoint): New field `type'.
9670         (set_breakpoint_at): Change return type to struct breakpoint
9671         pointer.  Set type to `other_breakpoint' by default.
9672         (delete_breakpoint): Rewrite, supporting more than one breakpoint
9673         in the breakpoint list.
9674         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
9675         (reinsert_breakpoint): Rename to ...
9676         (reinsert_raw_breakpoint): ... this.
9677         (reinsert_breakpoints_at): Adjust.
9678         * mem-break.h (struct breakpoint): Declare.
9679         (set_breakpoint_at): Change return type to struct breakpoint
9680         pointer.
9681
9682 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9683
9684         * server.c (handle_query): Assign, not compare.
9685
9686 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9687
9688         Teach linux gdbserver to step-over-breakpoints.
9689
9690         * linux-low.c (can_hardware_single_step): New.
9691         (supports_breakpoints): New.
9692         (handle_extended_wait): If stopping threads, read the stop pc of
9693         the new cloned LWP.
9694         (get_pc): New.
9695         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
9696         low target doesn't support retrieving the PC.
9697         (add_lwp): Set last_resume_kind to resume_continue.
9698         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
9699         (linux_attach): Don't clear stop_expected.  Set the lwp's
9700         last_resume_kind to resume_stop.
9701         (linux_detach_one_lwp): Don't check for removed breakpoints.
9702         (check_removed_breakpoint): Delete.
9703         (status_pending_p): Rename to ...
9704         (status_pending_p_callback): ... this.  Don't check for removed
9705         breakpoints.  Don't consider threads that are stopped from GDB's
9706         perspective.
9707         (linux_wait_for_lwp): Always read the stop_pc here.
9708         (cancel_breakpoint): New.
9709         (step_over_bkpt): New global.
9710         (linux_wait_for_event_1): Implement stepping over breakpoints.
9711         (gdb_wants_lwp_stopped): New.
9712         (gdb_wants_all_stopped): New.
9713         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
9714         single-step traps here.  Store the thread's last reported target
9715         wait status.
9716         (send_sigstop): Don't clear stop_expected.  Always set it,
9717         instead.
9718         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
9719         (cancel_finished_single_step): New.
9720         (cancel_finished_single_steps): New.
9721         (wait_for_sigstop): Don't cancel finished single-step traps here.
9722         (linux_resume_one_lwp): Don't check for removed breakpoints.
9723         Don't set `step' on non-hardware step archs.
9724         (linux_set_resume_request): Ignore resume_stop requests if already
9725         stopping or stopped.  Set the lwp's last_resume_kind.
9726         (resume_status_pending_p): Don't check for removed breakpoints.
9727         (need_step_over_p): New.
9728         (start_step_over): New.
9729         (finish_step_over): New.
9730         (linux_resume_one_thread): Always queue a sigstop for resume_stop
9731         requests.  Clear the thread's last reported target waitstatus.
9732         Don't use the `suspended' flag.  Don't consider pending breakpoints.
9733         (linux_resume): Start a step-over if necessary.
9734         (proceed_one_lwp): New.
9735         (proceed_all_lwps): New.
9736         (unstop_all_lwps): New.
9737         * linux-low.h (struct lwp_info): Rewrite comment for the
9738         `suspended' flag.  Add the `stop_pc' field.  Delete the
9739         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
9740         Add `'last_resume_kind' and `need_step_over' fields.
9741         * inferiors.c (struct thread_info): Delete, moved elsewhere.
9742         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
9743         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
9744         (set_raw_breakpoint_at): New.
9745         (set_breakpoint_at): Rewrite to use it.
9746         (reinsert_breakpoint_handler): Delete.
9747         (set_reinsert_breakpoint): New.
9748         (reinsert_breakpoint_by_bp): Delete.
9749         (delete_reinsert_breakpoints): New.
9750         (uninsert_breakpoint): Rewrite.
9751         (uninsert_breakpoints_at): New.
9752         (reinsert_breakpoint): Rewrite.
9753         (reinsert_breakpoints_at): New.
9754         (check_breakpoints): Rewrite.
9755         (breakpoint_here): New.
9756         (breakpoint_inserted_here): New.
9757         (check_mem_read): Adjust.
9758         * mem-break.h (breakpoints_supported, breakpoint_here)
9759         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
9760         (reinsert_breakpoint_by_bp): Delete declaration.
9761         (delete_reinsert_breakpoints): Declare.
9762         (reinsert_breakpoint): Delete declaration.
9763         (reinsert_breakpoints_at): Declare.
9764         (uninsert_breakpoint): Delete declaration.
9765         (uninsert_breakpoints_at): Declare.
9766         (check_breakpoints): Adjust prototype.
9767         * server.h: Adjust include order.
9768         (struct thread_info): Declare here.  Add a `last_status' field.
9769
9770 2010-03-23  Michael Snyder  <msnyder@vmware.com>
9771
9772         * server.c (crc32): New function.
9773         (handle_query): Add handling for 'qCRC:' request.
9774
9775 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
9776
9777         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
9778         lwp had been stopped by a watchpoint.
9779
9780 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
9781
9782         * server.h (internal_error): Declare.
9783         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
9784         * utils.c (internal_error): New function.
9785
9786 2010-03-15  Andreas Schwab  <schwab@redhat.com>
9787
9788         * configure.srv: Fix typo setting srv_regobj.
9789
9790 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
9791
9792         * linux-low.c (fetch_register): Avoid passing a non string literal
9793         format to `error'.
9794         (usr_store_inferior_registers): Ditto.
9795
9796 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9797
9798         * linux-low.c (linux_write_memory): Bail out early if peeking
9799         memory failed.
9800
9801 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9802
9803         * linux-low.h (struct lwp_info): New fields
9804         `stopped_by_watchpoint' and `stopped_data_address'.
9805         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
9806         here, and cache them in the lwp object.
9807         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
9808         directly.
9809         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
9810         field.
9811         (linux_stopped_by_watchpoint): Rewrite.
9812         (linux_stopped_data_address): Rewrite.
9813
9814 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
9815
9816         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
9817         switching the current inferior, not before.
9818
9819 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
9820
9821         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
9822         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
9823         i386-linux.c and amd64-linux.c.
9824         (reg-i386.o): Removed.
9825         (reg-i386.c): Likewise.
9826         (reg-i386-linux.o): Likewise.
9827         (reg-i386-linux.c): Likewise.
9828         (reg-x86-64.o): Likewise.
9829         (reg-x86-64.c): Likewise.
9830         (reg-x86-64-linux.o): Likewise.
9831         (reg-x86-64-linux.c): Likewise.
9832         (i386.o): New.
9833         (i386.c): Likewise.
9834         (i386-linux.o): Likewise.
9835         (i386-linux.c): Likewise.
9836         (amd64.o): Likewise.
9837         (amd64.c): Likewise.
9838         (amd64-linux.o): Likewise.
9839         (amd64-linux.c): Likewise.
9840
9841         * configure.srv (srv_i386_regobj): New.
9842         (srv_i386_linux_regobj): Likewise.
9843         (srv_amd64_regobj): Likewise.
9844         (srv_amd64_linux_regobj): Likewise.
9845         (srv_i386_32bit_xmlfiles): Likewise.
9846         (srv_i386_64bit_xmlfiles): Likewise.
9847         (srv_i386_xmlfiles): Likewise.
9848         (srv_amd64_xmlfiles): Likewise.
9849         (srv_i386_linux_xmlfiles): Likewise.
9850         (srv_amd64_linux_xmlfiles): Likewise.
9851         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9852         srv_xmlfiles to $srv_i386_xmlfiles.
9853         (i[34567]86-*-mingw32ce*): Likewise.
9854         (i[34567]86-*-mingw*): Likewise.
9855         (i[34567]86-*-nto*): Likewise.
9856         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9857         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9858         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9859         (x86_64-*-linux*): Likewise.
9860
9861         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9862         (init_registers_amd64_linux): New.
9863         (x86_arch_setup): Replace init_registers_x86_64_linux with
9864         init_registers_amd64_linux.
9865
9866 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9867
9868         * configure.ac: Check for libdl.  If it is not available link against
9869         static libthread_db.
9870         * configure: Regenerate.
9871
9872 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9873
9874         PR9605
9875
9876         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9877         handing a read watchpoint.
9878         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9879
9880 2010-02-12  Doug Evans  <dje@google.com>
9881
9882         * linux-low.c (linux_supports_tracefork_flag): Document.
9883         (linux_look_up_symbols): Add comment.
9884
9885 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9886
9887         * regcache.c (supply_register): Clear regcache if buf is NULL.
9888
9889 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9890             Joel Brobecker  <brobecker@adacore.com>
9891
9892         * inferiors.c (find_inferior): Add function documentation.
9893         (unloaded_dll): Handle the case where the unloaded dll has not
9894         been previously registered in the dll list.
9895
9896 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9897
9898         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9899         (thumb2_breakpoint): New.
9900         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9901
9902 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9903
9904         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9905         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9906         breakpoints.
9907
9908 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9909
9910         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9911
9912 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9913
9914         * linux-s390-low.c (s390_collect_ptrace_register)
9915         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9916
9917 2010-01-21  Doug Evans  <dje@google.com>
9918
9919         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9920         (PTRACE_ARG4_TYPE): New macro.
9921         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9922         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9923         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9924         (usr_store_inferior_registers): Ditto.
9925         (linux_read_memory, linux_write_memory): Ditto.
9926         (linux_test_for_tracefork): Ditto.
9927
9928         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9929         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9930
9931 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9932
9933         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9934         target.
9935
9936 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9937
9938         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9939         prototype to take a regcache.  Adjust.
9940
9941 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9942
9943         * regcache.h (struct thread_info): Forward declare.
9944         (struct regcache): New.
9945         (new_register_cache): Adjust prototype.
9946         (get_thread_regcache): Declare.
9947         (free_register_cache): Adjust prototype.
9948         (registers_to_string, registers_from_string): Ditto.
9949         (supply_register, supply_register_by_name, collect_register)
9950         (collect_register_as_string, collect_register_by_name): Ditto.
9951         * regcache.c (struct inferior_regcache_data): Delete.
9952         (get_regcache): Rename to ...
9953         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9954         fetching registers.
9955         (regcache_invalidate_one): Adjust.
9956         (regcache_invalidate): Fix prototype.
9957         (new_register_cache): Return the new register cache.
9958         (free_register_cache): Change prototype.
9959         (realloc_register_cache): Adjust.
9960         (registers_to_string): Change prototype to take a regcache.  Adjust.
9961         (registers_from_string): Ditto.
9962         (register_data): Ditto.
9963         (supply_register): Ditto.
9964         (supply_register_by_name): Ditto.
9965         (collect_register): Ditto.
9966         (collect_register_as_string): Ditto.
9967         (collect_register_by_name): Ditto.
9968         * server.c (process_serial_event): Adjust.
9969         * linux-low.h (regset_fill_func, regset_store_func): Change
9970         prototype.
9971         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9972         Change prototype.
9973         * linux-low.c (get_stop_pc): Adjust.
9974         (check_removed_breakpoint): Adjust.
9975         (linux_wait_for_event): Adjust.
9976         (linux_resume_one_lwp): Adjust.
9977         (fetch_register): Add regcache parameter.  Adjust.
9978         (usr_store_inferior_registers): Ditto.
9979         (regsets_fetch_inferior_registers): Ditto.
9980         (regsets_store_inferior_registers): Ditto.
9981         (linux_fetch_registers, linux_store_registers): Ditto.
9982         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9983         regcache.  Adjust.
9984         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9985         Ditto.
9986         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9987         prototype to take a regcache.
9988         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9989         * remote-utils.c (convert_ascii_to_int, outreg)
9990         (prepare_resume_reply): Change prototype to take a regcache.
9991         Adjust.
9992         * target.h (struct target_ops) <fetch_registers, store_registers>:
9993         Change prototype to take a regcache.
9994         (fetch_inferior_registers, store_inferior_registers): Change
9995         prototype to take a regcache.  Adjust.
9996         * proc-service.c (ps_lgetregs): Adjust.
9997         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9998         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9999         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
10000         take a regcache.  Adjust.
10001         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
10002         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
10003         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
10004         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
10005         * linux-cris-low.c (cris_get_pc, cris_set_pc)
10006         (cris_cannot_fetch_register):
10007         (cris_breakpoint_at): Change prototype to take a regcache.
10008         Adjust.
10009         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
10010         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
10011         to take a regcache.  Adjust.
10012         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
10013         Adjust.
10014         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
10015         take a regcache.  Adjust.
10016         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
10017         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
10018         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
10019         * linux-mips-low.c (mips_get_pc):
10020         (mips_set_pc): Change prototype to take a regcache.  Adjust.
10021         (mips_reinsert_addr): Adjust.
10022         (mips_collect_register): Change prototype to take a regcache.
10023         Adjust.
10024         (mips_supply_register):
10025         (mips_collect_register_32bit, mips_supply_register_32bit)
10026         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
10027         (mips_store_fpregset): Ditto.
10028         * linux-ppc-low.c (ppc_supply_ptrace_register)
10029         (ppc_supply_ptrace_register): Ditto.
10030         (parse_spufs_run): Adjust.
10031         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
10032         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
10033         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
10034         take a regcache.  Adjust.
10035         * linux-s390-low.c (s390_collect_ptrace_register)
10036         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
10037         (s390_set_pc): Change prototype to take a regcache.  Adjust.
10038         (s390_arch_setup): Adjust.
10039         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
10040         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
10041         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
10042         (sparc_fill_gregset, sparc_store_gregset_from_stack)
10043         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
10044         regcache.  Adjust.
10045         (sparc_breakpoint_at): Adjust.
10046         * linux-xtensa-low.c (xtensa_fill_gregset):
10047         (xtensa_store_gregset):
10048         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
10049         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
10050         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
10051         prototype to take a regcache.  Adjust.
10052         * win32-arm-low.c (arm_fetch_inferior_register)
10053         (arm_store_inferior_register): Change prototype to take a
10054         regcache.  Adjust.
10055         * win32-i386-low.c (i386_fetch_inferior_register)
10056         (i386_store_inferior_register): Change prototype to take a
10057         regcache.  Adjust.
10058         * win32-low.c (child_fetch_inferior_registers)
10059         (child_store_inferior_registers): Change prototype to take a
10060         regcache.  Adjust.
10061         (win32_wait): Adjust.
10062         (win32_fetch_inferior_registers): Change prototype to take a
10063         regcache.  Adjust.
10064         (win32_store_inferior_registers): Adjust.
10065         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
10066         store_inferior_register>: Change prototype to take a regcache.
10067
10068 2010-01-20  Doug Evans  <dje@google.com>
10069
10070         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
10071         #ifdef.
10072         (linux_wait_for_event1, linux_init_signals): Ditto.
10073         (W_STOPCODE): Provide definition if missing.
10074
10075 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
10076
10077         * linux-low.c (linux_core_of_thread): New.
10078         (compare_ints, show_process, list_threads): New.
10079         (linux_qxfer_osdata): Report threads and cores.
10080         (linux_target_op): Register linux_core_of_thread.
10081         * remote-utils.c (prepare_resume_reply): Report the core.
10082         (buffer_xml_printf): Support %d specifier.
10083         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
10084         New.
10085         (handle_query): Handle qXfer:threads.  Announce availability
10086         thereof.
10087         * target.h (struct target_ops): New field core_of_thread.
10088
10089 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
10090
10091         * Makefile.in (clean): Remove new generated files.
10092         (reg-s390.o, reg-s390.c): Remove rules.
10093         (reg-s390x.o, reg-s390x.c): Likewise.
10094         (s390-linux32.o, s390-linux32.c): Add rules.
10095         (s390-linux64.o, s390-linux64.c): Likewise.
10096         (s390x-linux64.o, s390x-linux64.c): Likewise.
10097         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
10098         * linux-s390-low.c: Include <elf.h>.
10099         (HWCAP_S390_HIGH_GPRS): Define if undefined.
10100         (init_registers_s390): Remove prototype.
10101         (init_registers_s390x): Likewise.
10102         (init_registers_s390_linux32): Add prototype.
10103         (init_registers_s390_linux64): Likewise.
10104         (init_registers_s390x_linux64): Likewise.
10105         (s390_num_regs_3264): New define.
10106         (s390_regmap_3264): New global variable.
10107         (s390_cannot_fetch_register): Remove obsolete check.
10108         (s390_cannot_store_register): Likewise.
10109         (s390_collect_ptrace_register): Handle upper/lower register halves.
10110         (s390_supply_ptrace_register): Likewise.
10111         (s390_fill_gregset): Update to register number changes.
10112         (s390_get_hwcap): New routine.
10113         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
10114         Install appropriate regmap and register set.
10115
10116 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
10117
10118         * server.c (gdbserver_version): Update copyright year to 2010.
10119         * gdbreplay.c (gdbreplay_version): Likewise.
10120
10121 2009-12-28  Doug Evans  <dje@google.com>
10122
10123         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
10124         elf/external.h.  Include <elf.h> instead but only if necessary.
10125
10126 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
10127
10128         * linux-low.c (linux_remove_process): Remove `detaching'
10129         parameter.  Don't release/detach from thread_db here.
10130         (linux_kill): Release/detach from thread_db here, ...
10131         (linux_detach): ... and here, before actually detaching.
10132         (linux_wait_1): ... and here, when a process exits.
10133         * thread-db.c (any_thread_of): New.
10134         (thread_db_free): Switch the current inferior to a thread of the
10135         passed in process.
10136
10137 2009-12-21  Doug Evans  <dje@google.com>
10138
10139         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
10140
10141         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
10142         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
10143         warning ifndef __NR_tkill.  Move setting of errno there too.
10144         Delete unnecessary resetting of errno after syscall.
10145         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
10146
10147         * configure.ac: Check for dladdr.
10148         * config.in: Regenerate.
10149         * configure: Regenerate.
10150         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
10151         (try_thread_db_load): Update.
10152
10153         * linux-low.c (my_waitpid): Delete unnecessary prototype.
10154
10155 2009-12-18  Doug Evans  <dje@google.com>
10156
10157         * event-loop.c: Include unistd.h if it exists.
10158
10159         * linux-low.c (my_waitpid): Move definition away from being in
10160         between linux_tracefork_child/linux_test_for_tracefork.
10161
10162         * gdb_proc_service.h (psaddr_t): Fix type.
10163         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
10164         signature to match glibc.
10165
10166 2009-12-16  Doug Evans  <dje@google.com>
10167
10168         * linux-low.c (linux_read_memory): Fix argument to read.
10169
10170 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
10171
10172         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
10173         events, don't leave current_inferior pointing at null.
10174
10175 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
10176
10177         * win32-low.c (LOG): Delete.
10178         (OUTMSG): Output to stderr.
10179         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
10180         on compile time LOG macro.
10181         (win32_wait): Fix debug output.
10182
10183 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
10184
10185         * win32-low.c (win32_add_one_solib): If the dll name is
10186         "ntdll.dll", prepend the system directory to the dll path.
10187
10188 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
10189
10190         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
10191
10192 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
10193             Vladimir Prus  <vladimir@codesourcery.com>
10194
10195         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
10196         * configure.ac: Check for __mcoldfire__ and set
10197         gdb_cv_m68k_is_coldfire.
10198         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
10199         reg-cf.o and reg-m68k.o.
10200         * configure: Regenerated.
10201
10202 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
10203
10204         * linux-low.c (linux_remove_process): Add `detaching' parameter.
10205         Pass it to thread_db_free.
10206         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
10207         proper `detaching' argument to linux_remove_process.
10208         * linux-low.h (thread_db_free): Add `detaching' parameter.
10209         * thread-db.c (thread_db_init): Pass false as `detaching' argument
10210         to thread_db_free.
10211         (thread_db_free): Add `detaching' parameter.  Only
10212         call td_ta_clear_event if detaching from process.
10213
10214 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
10215
10216         * thread-db.c (thread_db_free): Fix typo.
10217
10218 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
10219
10220         PR gdb/10838
10221         * thread-db.c (thread_db_free): Call td_ta_clear_event.
10222
10223 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
10224
10225         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
10226         with an i686 compiler.
10227         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
10228         needed.
10229         * configure: Rebuilt.
10230
10231 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
10232
10233         PR gdb/10783
10234
10235         * server.c (handle_search_memory_1): Correct read_addr initialization
10236         in loop for searching subsequent chunks.
10237
10238 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
10239
10240         * configure.ac: New --with-libthread-db option.
10241         * thread-db.c: Allow direct dependence on libthread_db.
10242         (thread_db_free): Adjust.
10243         * config.in: Regenerate.
10244         * configure: Likewise.
10245
10246 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
10247
10248         PR gdb/10757
10249         * thread-db.c (attach_thread): New function.
10250         (maybe_attach_thread): Return success/failure.
10251         (find_new_threads_callback): Adjust.
10252         (thread_db_find_new_threads): Loop until no new threads.
10253
10254 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
10255
10256         * proc-service.c (ps_lgetregs): Formatting.
10257
10258 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
10259
10260         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
10261         * configure.ac: Adjust.
10262         * linux-low.h (struct process_info_private): Move members to struct
10263         thread_db.
10264         (thread_db_free, thread_db_handle_monitor_command): New prototype.
10265         * linux-low.c (linux_remove_process): Adjust.
10266         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
10267         * server.c (handle_query): Move code ...
10268         (handle_monitor_command): ... here. New function.
10269         * target.h (struct target_ops): New member.
10270         * thread-db.c (struct thread_db): New.
10271         (libthread_db_search_path): New variable.
10272         (thread_db_create_event, thread_db_enable_reporting)
10273         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
10274         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
10275         (try_thread_db_load_1, dladdr_to_soname): New functions.
10276         (try_thread_db_load, thread_db_load_search): New functions.
10277         (thread_db_init): Search for libthread_db.
10278         (thread_db_free): New function.
10279         (thread_db_handle_monitor_command): Likewise.
10280         * config.in: Regenerate.
10281         * configure: Regenerate.
10282
10283 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
10284
10285         * spu-low.c (spu_kill): Wait for inferior to terminate.
10286         Call clear_inferiors.
10287         (spu_detach): Call clear_inferiors.
10288
10289 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10290
10291         * aclocal.m4: Regenerate.
10292         * config.in: Likewise.
10293         * configure: Likewise.
10294
10295 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
10296
10297         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
10298         (parse_spufs_run): New function.
10299         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
10300         (ppc_breakpoint_at): Handle SPU breakpoints.
10301
10302 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
10303
10304         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
10305         (SPUFS_MAGIC): Define.
10306         (spu_enumerate_spu_ids): New function.
10307         (linux_qxfer_spu): New function.
10308         (linux_target_ops): Install linux_qxfer_spu.
10309
10310 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
10311
10312         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
10313         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
10314         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
10315         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
10316         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
10317         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
10318         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
10319         (init_registers_powerpc_cell32l): Add prototype.
10320         (init_registers_powerpc_cell64l): Likewise.
10321         (ppc_arch_setup): Detect Cell/B.E. architecture.
10322
10323 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10324
10325         * Makefile.in (datarootdir): New variable.
10326
10327 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
10328
10329         * linux-low.c (linux_write_memory): Update debugging output.
10330         * Makefile.in (clean): Add new descriptions.
10331         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
10332         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
10333         * configure.srv: Add new files for arm*-*-linux*.
10334         * linux-arm-low.c: Add new declarations.
10335         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
10336         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
10337         (HWCAP_VFPv3D16): New.
10338         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
10339         instead of __IWMMXT__.
10340         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
10341         (arm_arch_setup): New.
10342         (target_regsets): Remove #ifdef.  Add VFP regset.
10343         (the_low_target): Use arm_arch_setup.
10344
10345 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
10346
10347         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
10348         the main thread again.
10349
10350 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
10351
10352         Adding Neutrino gdbserver.
10353         * configure: Regenerated.
10354         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
10355         * configure.srv (i[34567]86-*-nto*): New target.
10356         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
10357         * remote-utils.c [__QNX__]: Include sys/iomgr.h
10358         (nto_comctrl) [__QNX__]: New function.
10359         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
10360
10361 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
10362
10363         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
10364         srv_tgtobj.
10365
10366 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
10367             Pedro Alves  <pedro@codesourcery.com>
10368
10369         * win32-i386-low.c (i386_get_thread_context): Handle systems that
10370         don't support CONTEXT_EXTENDED_REGISTERS.
10371         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
10372         (the_low_target): Install them.
10373         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
10374         failing with ERROR_PIPE_NOT_CONNECTED.
10375
10376 2009-06-30  Doug Evans  <dje@google.com>
10377             Pierre Muller  <muller@ics.u-strasbg.fr>
10378
10379         Add h/w watchpoint support to x86-linux, win32-i386.
10380         * Makefile.in (SFILES): Add i386-low.c
10381         (i386_low_h): Define.
10382         (i386-low.o): Add dependencies.
10383         (linux-x86-low.o): Add i386-low.h dependency.
10384         (win32-i386-low.o): Ditto.
10385         * i386-low.c: New file.
10386         * i386-low.h: New file.
10387         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
10388         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
10389         * linux-low.c (linux_add_process): Initialize arch_private.
10390         (linux_remove_process): Free arch_private.
10391         (add_lwp): Initialize arch_private.
10392         (delete_lwp): Free arch_private.
10393         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
10394         provided.
10395         * linux-low.h (process_info_private): New member arch_private.
10396         (lwp_info): New member arch_private.
10397         (linux_target_ops): New members new_process, new_thread,
10398         prepare_to_resume.
10399         (ptid_of): New macro.
10400         * linux-x86-low.c: Include stddef.h, i386-low.h.
10401         (arch_process_info): New struct.
10402         (arch_lwp_info): New struct.
10403         (x86_linux_dr_get, x86_linux_dr_set): New functions.
10404         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
10405         (i386_dr_low_get_status): New function.
10406         (x86_insert_point, x86_remove_point): New functions.
10407         (x86_stopped_by_watchpoint): New function.
10408         (x86_stopped_data_address): New function.
10409         (x86_linux_new_process, x86_linux_new_thread): New functions.
10410         (x86_linux_prepare_to_resume): New function.
10411         (the_low_target): Add entries for insert_point, remove_point,
10412         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
10413         prepare_to_resume.
10414         * server.c (debug_hw_points): New global.
10415         (monitor_show_help): Document set debug-hw-points.
10416         (handle_query): Process "set debug-hw-points".
10417         * server.h (debug_hw_points): Declare.
10418         (paddress): Declare.
10419         * utils.c (NUMCELLS, CELLSIZE): New macros.
10420         (get_sell, xsnprintf, paddress): New functions.
10421         * win32-arm-low.c (the_low_target): Add entries for insert_point,
10422         remove_point, stopped_by_watchpoint, stopped_data_address.
10423         * win32-i386-low.c: Include i386-low.h.
10424         (debug_reg_state): Replaces dr.
10425         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
10426         (i386_dr_low_get_status): New function.
10427         (i386_insert_point, i386_remove_point): New functions.
10428         (i386_stopped_by_watchpoint): New function.
10429         (i386_stopped_data_address): New function.
10430         (i386_initial_stuff): Update.
10431         (get_thread_context,set_thread_context,i386_thread_added): Update.
10432         (the_low_target): Add entries for insert_point,
10433         remove_point, stopped_by_watchpoint, stopped_data_address.
10434         * win32-low.c (win32_insert_watchpoint): New function.
10435         (win32_remove_watchpoint): New function.
10436         (win32_stopped_by_watchpoint): New function.
10437         (win32_stopped_data_address): New function.
10438         (win32_target_ops): Add entries for insert_watchpoint,
10439         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
10440         * win32-low.h (win32_target_ops): New members insert_point,
10441         remove_point, stopped_by_watchpoint, stopped_data_address.
10442
10443 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
10444
10445         * server.c (process_serial_event): Re-return unsupported, not
10446         error, if the type isn't recognized.  Re-allow supporting only
10447         insert or remove packets.  Also call require_running for
10448         breakpoints.  Add missing break statement to default case.  Tidy.
10449         * target.h (struct target_ops): Rename insert_watchpoint to
10450         insert_point, and remove_watchpoint to remove_point.
10451
10452         * linux-low.h (struct linux_target_ops): Likewise.
10453         * linux-low.c (linux_insert_watchpoint): Rename to ...
10454         (linux_insert_point): ... this.  Adjust.
10455         (linux_remove_watchpoint): Rename to ...
10456         (linux_remove_point): ... this.  Adjust.
10457         (linux_target_ops): Adjust.
10458         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
10459         (cris_insert_point): ... this.
10460         (cris_remove_watchpoint): Rename to ...
10461         (cris_remove_point): ... this.
10462         (the_low_target): Adjust.
10463
10464 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
10465
10466         * server.c (handle_v_kill): Pass signal_pid to
10467         kill_inferior if multi_process is zero.
10468
10469 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
10470
10471         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
10472         * target.h (target_ops): Comment for *_watchpoint to make it clear
10473         the functions can get types '0' and '1'.
10474
10475 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
10476
10477         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
10478         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
10479         * regcache.c (get_regcache): Likewise.
10480         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
10481         * win32-low.c (child_fetch_inferior_registers): Remove check for
10482         regno 0.
10483
10484 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
10485             Pedro Alves <pedro@codesourcery.com>
10486
10487         * target.h (struct target_ops) <supports_multi_process>: New
10488         callback.
10489         (target_supports_multi_process): New.
10490         * server.c (handle_query): Even if GDB reports support, only
10491         enable multi-process if the target also supports it.  Report
10492         multi-process support only if the target backend supports it.
10493         * linux-low.c (linux_supports_multi_process): New function.
10494         (linux_target_ops): Install it as target_supports_multi_process
10495         callback.
10496
10497 2009-05-24  Doug Evans  <dje@google.com>
10498
10499         Global renaming of find_thread_pid to find_thread_ptid.
10500         * server.h (find_thread_ptid): Renamed from find_thread_pid.
10501         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
10502         All callers updated.
10503
10504         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
10505         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
10506         directly.
10507
10508         * linux-low.c (get_stop_pc): Print pc if debug_threads.
10509         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
10510         (linux_resume_one_lwp): Ditto.
10511
10512 2009-05-23  Doug Evans  <dje@google.com>
10513
10514         * linux-low.c (linux_resume_one_lwp): Change type of first arg
10515         from struct inferior_list_entry * to struct lwp_info *.
10516         All callers updated.
10517
10518 2009-05-13  Doug Evans  <dje@google.com>
10519
10520         * linux-x86-low.c: Don't include assert.h.
10521         (x86_siginfo_fixup): Use fatal, not assert.
10522         (x86_arch_setup): Fix comment.
10523
10524 2009-05-12  Doug Evans  <dje@google.com>
10525
10526         Biarch support for i386/amd64 gdbserver.
10527         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
10528         Add linux-x86-low.c.
10529         (linux-i386-low.o, linux-x86-64-low.o): Delete.
10530         (linux-x86-low.o): Add.
10531         * linux-x86-64-low.c: Delete.
10532         * linux-i386-low.c: Delete.
10533         * linux-x86-low.c: New file.
10534         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
10535         linux-x86-low.o.
10536         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
10537         linux-x86-low.o.
10538         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
10539         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
10540         (linux_child_pid_to_exec_file): New function.
10541         (elf_64_header_p, elf_64_file_p): New functions.
10542         (siginfo_fixup): New function.
10543         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
10544         give target a chance to convert layout.
10545         * linux-low.h (linux_target_ops): New member siginfo_fixup.
10546         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
10547
10548 2009-05-07  Doug Evans  <dje@google.com>
10549
10550         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
10551         (regsets_store_inferior_registers): Ditto.
10552
10553 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
10554
10555         PR server/10048
10556
10557         * linux-low.c (must_set_ptrace_flags): Delete.
10558         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
10559         of the global.
10560         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
10561         `lwp->must_set_ptrace_flags' instead.
10562         (linux_wait_for_event_1): Set ptrace options here.
10563         (linux_wait_1): ... not here.
10564
10565 2009-04-30  Doug Evans  <dje@google.com>
10566
10567         * inferiors.c (started_inferior_callback): New function.
10568         (attached_inferior_callback): New function.
10569         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
10570         * server.c (print_started_pid, print_attached_pid): New functions.
10571         (detach_or_kill_for_exit): New function.
10572         (main): Call it instead of for_each_inferior (kill_inferior_callback).
10573         * server.h (have_started_inferiors_p): Declare.
10574         (have_attached_inferiors_p): Declare.
10575
10576         * inferiors.c (remove_process): Fix memory leak, free process.
10577         * linux-low.c (linux_remove_process): New function.
10578         (linux_kill): Call it instead of remove_process.
10579         (linux_detach, linux_wait_1): Ditto.
10580
10581 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
10582
10583         * configure.srv: Add x86 Windows CE target.
10584
10585 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
10586
10587         * inferiors.c (get_thread_process): Make global.
10588         * server.h (get_thread_process): Add prototype.
10589         * thread-db.c (find_one_thread): Use get_thread_process
10590         instead of current_process.
10591         (thread_db_get_tls_address): Do not crash if called when
10592         thread layer is not yet initialized.
10593
10594 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
10595
10596         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
10597         * spu-low.c (current_tid): Rename to ...
10598         (current_ptid): ... this.
10599         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
10600         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
10601         ptid_get_lwp (current_ptid) instead of current_tid.
10602         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
10603         instead of current_tid.  Use find_process_pid to verify pid
10604         argument is valid.  Pass proper argument to remove_process.
10605         (spu_thread_alive): Compare current_ptid instead of current_tid.
10606         (spu_resume): Likewise.
10607
10608 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
10609
10610         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
10611         variable.
10612
10613 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10614
10615         Implement the multiprocess extensions, and add linux multiprocess
10616         support.
10617
10618         * server.h (ULONGEST): Declare.
10619         (struct ptid, ptid_t): New.
10620         (minus_one_ptid, null_ptid): Declare.
10621         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
10622         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
10623         (struct inferior_list_entry): Change `id' type from unsigned from
10624         to ptid_t.
10625         (struct sym_cache, struct breakpoint, struct
10626         process_info_private): Forward declare.
10627         (struct process_info): Declare.
10628         (current_process): Declare.
10629         (all_processes): Declare.
10630         (initialize_inferiors): Declare.
10631         (add_thread): Adjust to use ptid_t.
10632         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
10633         (add_process, remove_process, find_thread_pid): Declare.
10634         (find_inferior_id): Adjust to use ptid_t.
10635         (cont_thread, general_thread, step_thread): Change type to ptid_t.
10636         (multi_process): Declare.
10637         (push_event): Adjust to use ptid_t.
10638         (read_ptid, write_ptid): Declare.
10639         (prepare_resume_reply): Adjust to use ptid_t.
10640         (clear_symbol_cache): Declare.
10641         * inferiors.c (all_processes): New.
10642         (null_ptid, minus_one_ptid): New.
10643         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
10644         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
10645         (add_thread): Change unsigned long to ptid.  Remove gdb_id
10646         parameter.  Adjust.
10647         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
10648         (gdb_id_to_thread): Rename to ...
10649         (find_thread_pid): ... this.  Change unsigned long to ptid.
10650         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
10651         (loaded_dll, pull_pid_from_list): Adjust.
10652         (add_process, remove_process, find_process_pid)
10653         (get_thread_process, current_process, initialize_inferiors): New.
10654         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
10655         (struct target_waitstatus) <related_pid>: Ditto.
10656         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
10657         return type to int.
10658         (struct target_ops) <join>: Add `pid' argument.
10659         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
10660         (struct target_ops) <wait>: Add `ptid' field.  Change return type
10661         to ptid.
10662         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
10663         (mywait): Add `ptid' argument.  Change return type to ptid_t.
10664         (target_pid_to_str): Declare.
10665         * target.c (set_desired_inferior): Adjust to use ptids.
10666         (mywait): Add new `ptid' argument.  Adjust.
10667         (target_pid_to_str): New.
10668         * mem-break.h (free_all_breakpoints): Declare.
10669         * mem-break.c (breakpoints): Delelete.
10670         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
10671         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
10672         to use per-process breakpoint list.
10673         (free_all_breakpoints): New.
10674         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
10675         (symbol_cache, all_symbols_looked_up): Delete.
10676         (hexchars): New.
10677         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
10678         read_ptid): New.
10679         (prepare_resume_reply): Change ptid argument's type from unsigned
10680         long to ptid_t.  Adjust.  Implement W;process and X;process.
10681         (free_sym_cache, clear_symbol_cache): New.
10682         (look_up_one_symbol): Adjust to per-process symbol cache.  *
10683         * server.c (cont_thread, general_thread, step_thread): Change type
10684         to ptid_t.
10685         (attached): Delete.
10686         (multi_process): New.
10687         (last_ptid): Change type to ptid_t.
10688         (struct vstop_notif) <ptid>: Change type to ptid_t.
10689         (queue_stop_reply, push_event): Change `ptid' argument's type to
10690         ptid_t.
10691         (discard_queued_stop_replies): Add `pid' argument.
10692         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
10693         changes.  Don't reference the `attached' global.
10694         (attach_inferior): Adjust to mywait interface changes.
10695         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
10696         features.  Handle and report "multiprocess+".  Handle
10697         "qAttached:PID".
10698         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
10699         changes.
10700         (handle_v_kill): New.
10701         (handle_v_stopped): Adjust to use target_pid_to_str.
10702         (handle_v_requests): Allow multiple attaches and runs when
10703         multiprocess extensions are in effect.  Handle "vKill".
10704         (myresume): Adjust to use ptids.
10705         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
10706         (handle_status): Adjust to discard_queued_stop_replies interface
10707         change.
10708         (first_thread_of, kill_inferior_callback)
10709         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
10710         (main): Call initialize_inferiors.  Adjust to use ptids, killing
10711         and detaching from all inferiors.  Handle multiprocess packet
10712         variants.
10713         * linux-low.h: Include gdb_proc_service.h.
10714         (struct process_info_private): New.
10715         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
10716         <lwpid_of>: Use ptid_get_lwp.
10717         (get_lwp_thread): Adjust.
10718         (struct lwp_info): Add `dead' member.
10719         (find_lwp_pid): Declare.
10720         * linux-low.c (thread_db_active): Delete.
10721         (new_inferior): Adjust comment.
10722         (inferior_pid): Delete.
10723         (linux_add_process): New.
10724         (handle_extended_wait): Adjust.
10725         (add_lwp): Change unsigned long to ptid.
10726         (linux_create_inferior): Add process to processes table.  Adjust
10727         to use ptids.  Don't set new_inferior here.
10728         (linux_attach_lwp): Rename to ...
10729         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
10730         it.  Adjust to use ptids.
10731         (linux_attach_lwp): New.
10732         (linux_attach): Add process to processes table.  Don't set
10733         new_inferior here.
10734         (struct counter): New.
10735         (second_thread_of_pid_p, last_thread_of_process_p): New.
10736         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
10737         multiple processes.
10738         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
10739         processes.  Remove process from process table.
10740         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
10741         to multiple processes.
10742         (any_thread_of): New.
10743         (linux_detach): Add `pid' argument, and handle it.  Remove process
10744         from processes table.
10745         (linux_join): Add `pid' argument.  Handle it.
10746         (linux_thread_alive): Change unsighed long argument to ptid_t.
10747         Consider dead lwps as not being alive.
10748         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
10749         threads we're not interested in.
10750         (same_lwp, find_lwp_pid): New.
10751         (linux_wait_for_lwp): Change `pid' argument's type from int to
10752         ptid_t.  Adjust.
10753         (linux_wait_for_event): Rename to ...
10754         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
10755         from int to ptid_t.  Adjust.
10756         (linux_wait_for_event): New.
10757         (linux_wait_1): Add `ptid' argument.  Change return type to
10758         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
10759         that exit from the process table.
10760         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
10761         Adjust.
10762         (mark_lwp_dead): New.
10763         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
10764         stopping all threads, mark its main lwp as dead.
10765         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
10766         ptids.
10767         (fetch_register, usr_store_inferior_registers)
10768         (regsets_fetch_inferior_registers)
10769         (regsets_store_inferior_registers, linux_read_memory)
10770         (linux_write_memory): Inline `inferior_pid'.
10771         (linux_look_up_symbols): Adjust to use per-process
10772         `thread_db_active'.
10773         (linux_request_interrupt): Adjust to use ptids.
10774         (linux_read_auxv): Inline `inferior_pid'.
10775         (initialize_low): Don't reference thread_db_active.
10776         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
10777         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
10778         (ps_getpid): Return the pid of the current inferior.
10779         * thread-db.c (proc_handle, thread_agent): Delete.
10780         (thread_db_create_event, thread_db_enable_reporting): Adjust to
10781         per-process data.
10782         (find_one_thread): Change argument type to ptid_t.  Adjust to
10783         per-process data.
10784         (maybe_attach_thread): Adjust to per-process data and ptids.
10785         (thread_db_find_new_threads): Ditto.
10786         (thread_db_init): Ditto.
10787         * spu-low.c (spu_create_inferior, spu_attach): Add process to
10788         processes table.  Adjust to use ptids.
10789         (spu_kill, spu_detach): Adjust interface.  Remove process from
10790         processes table.
10791         (spu_join, spu_thread_alive): Adjust interface.
10792         (spu_wait): Adjust interface.  Remove process from processes
10793         table.  Adjust to use ptids.
10794         * win32-low.c (current_inferior_tid): Delete.
10795         (current_inferior_ptid): New.
10796         (debug_event_ptid): New.
10797         (thread_rec): Take a ptid.  Adjust.
10798         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
10799         (child_delete_thread): Ditto.
10800         (do_initial_child_stuff): Add `attached' argument.  Add process to
10801         processes table.
10802         (child_fetch_inferior_registers, child_store_inferior_registers):
10803         Adjust.
10804         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
10805         (win32_attach): Pass 1 to do_initial_child_stuff.
10806         (win32_kill): Adjust interface.  Remove process from processes
10807         table.
10808         (win32_detach): Ditto.
10809         (win32_join): Adjust interface.
10810         (win32_thread_alive): Take a ptid.
10811         (win32_resume): Adjust to use ptids.
10812         (get_child_debug_event): Ditto.
10813         (win32_wait): Adjust interface.  Remove exiting process from
10814         processes table.
10815
10816 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10817
10818         Non-stop mode support.
10819
10820         * server.h (non_stop): Declare.
10821         (gdb_client_data, handler_func): Declare.
10822         (delete_file_handler, add_file_handler, start_event_loop):
10823         Declare.
10824         (handle_serial_event, handle_target_event, push_event)
10825         (putpkt_notif): Declare.
10826         * target.h (enum resume_kind): New.
10827         (struct thread_resume): Replace `step' field by `kind' field.
10828         (TARGET_WNOHANG): Define.
10829         (struct target_ops) <wait>: Add `options' argument.
10830         <supports_non_stop, async, start_non_stop>: New fields.
10831         (target_supports_non_stop, target_async): New.
10832         (start_non_stop): Declare.
10833         (mywait): Add `options' argument.
10834         * target.c (mywait): Add `options' argument.  Print child exit
10835         notifications here.
10836         (start_non_stop): New.
10837         * server.c (non_stop, own_buf, mem_buf): New globals.
10838         (struct vstop_notif): New.
10839         (notif_queue): New global.
10840         (queue_stop_reply, push_event, discard_queued_stop_replies)
10841         (send_next_stop_reply): New.
10842         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10843         interface changes.
10844         (attach_inferior): In non-stop mode, don't wait for the target
10845         here.
10846         (handle_general_set): Handle QNonStop.
10847         (handle_query): When handling qC, return the current general
10848         thread, instead of the first thread of the list.
10849         (handle_query): If the backend supports non-stop mode, include
10850         QNonStop+ in the qSupported query response.
10851         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10852         and non-stop mode.
10853         (handle_v_attach, handle_v_run): Handle non-stop mode.
10854         (handle_v_stopped): New.
10855         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10856         (myresume): Adjust to use resume_kind.  Handle non-stop.
10857         (queue_stop_reply_callback): New.
10858         (handle_status): Handle non-stop mode.
10859         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10860         Refactor serial protocol handling from here ...
10861         (process_serial_event): ... to this new function.  When GDB
10862         selects any thread, select one here.  In non-stop mode, wait until
10863         GDB acks all pending events before exiting.
10864         (handle_serial_event, handle_target_event): New.
10865         * remote-utils.c (remote_open): Install remote_desc in the event
10866         loop.
10867         (remote_close): Remove remote_desc from the event loop.
10868         (putpkt_binary): Rename to...
10869         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10870         (putpkt_binary): New as wrapper around putpkt_binary_1.
10871         (putpkt_notif): New.
10872         (prepare_resume_reply): In non-stop mode, don't change the
10873         general_thread.
10874         * event-loop.c: New.
10875         * Makefile.in (OBJ): Add event-loop.o.
10876         (event-loop.o): New rule.
10877
10878         * linux-low.h (pid_of): Moved here.
10879         (lwpid_of): New.
10880         (get_lwp_thread): Use lwpid_of.
10881         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10882         * linux-low.c (pid_of): Delete.
10883         (inferior_pid): Use lwpid_of.
10884         (linux_event_pipe): New.
10885         (target_is_async_p): New.
10886         (delete_lwp): New.
10887         (handle_extended_wait): Use lwpid_of.
10888         (add_lwp): Don't set lwpid field.
10889         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10890         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10891         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10892         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10893         first.  Adjust to linux_wait_for_event interface changes.  Use
10894         lwpid_of.
10895         (linux_detach): Don't delete the main lwp here.
10896         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10897         (status_pending_p): Don't consider explicitly suspended lwps.
10898         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10899         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10900         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10901         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10902         pointer.  Add status pointer argument.  Return a pid instead of a
10903         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10904         changes.  In non-stop mode, don't switch to a random thread.
10905         (linux_wait): Rename to...
10906         (linux_wait_1): ... this.  Add target_options argument, and handle
10907         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10908         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10909         clean exit and signal exit code.  Don't stop all threads in
10910         non-stop mode.  In all-stop mode, only stop all threads when
10911         reporting a stop to GDB.  Handle explicit thread stop requests.
10912         (async_file_flush, async_file_mark): New.
10913         (linux_wait): New.
10914         (send_sigstop): Use lwpid_of.
10915         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10916         interface changes.  In non-stop mode, don't switch to a random
10917         thread.
10918         (linux_resume_one_lwp): Use lwpid_of.
10919         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10920         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10921         non-stop mode, don't look for pending flag in all threads.
10922         (resume_status_pending_p): Don't consider explicitly suspended
10923         threads.
10924         (my_waitpid): Reimplement.  Emulate __WALL.
10925         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10926         Use lwpid_of.
10927         (sigchld_handler, linux_supports_non_stop, linux_async)
10928         (linux_start_non_stop): New.
10929         (linux_target_ops): Register linux_supports_non_stop, linux_async
10930         and linux_start_non_stop.
10931         (initialize_low): Install SIGCHLD handler.
10932         * thread-db.c (thread_db_create_event, find_one_thread)
10933         (thread_db_get_tls_address): Use lwpid_of.
10934         * win32-low.c (win32_detach): Adjust to use resume_kind.
10935         (win32_wait): Add `options' argument.
10936         * spu-low.c (spu_resume): Adjust to use resume_kind.
10937         (spu_wait): Add `options' argument.
10938
10939 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10940
10941         Decouple target code from remote protocol.
10942
10943         * target.h (enum target_waitkind): New.
10944         (struct target_waitstatus): New.
10945         (struct target_ops) <wait>: Return an unsigned long.  Take a
10946         target_waitstatus pointer instead of a char pointer.
10947         (mywait): Likewise.
10948         * target.c (mywait): Change prototype to return an unsigned long.
10949         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10950         * server.h (thread_from_wait, old_thread_from_wait): Delete
10951         declarations.
10952         (prepare_resume_reply): Change prototype to take a
10953         target_waitstatus.
10954         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10955         (last_status, last_ptid): New.
10956         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10957         pid instead of a signal.
10958         (attach_inferior): Remove "status" and "signal" parameters.
10959         Adjust.
10960         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10961         not as an address.
10962         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10963         (handle_v_requests, myresume): Remove "status" and "signal"
10964         parameters.  Adjust.
10965         (handle_status): New.
10966         (main): Delete local `status'.  Adjust.
10967         * remote-utils.c: Include target.h.
10968         (prepare_resume_reply): Change prototype to take a
10969         target_waitstatus.  Adjust.
10970
10971         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10972         interface.
10973         * spu-low.c (spu_wait): Adjust.
10974         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10975         Delete.
10976         (win32_wait): Adjust.
10977
10978 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10979
10980         * target.h (struct thread_resume): Delete leave_stopped member.
10981         (struct target_ops): Add a `n' argument to the `resume' callback.
10982         * server.c (start_inferior): Adjust.
10983         (handle_v_cont, myresume): Adjust.
10984         * linux-low.c (check_removed_breakpoint): Adjust to resume
10985         interface change, and to removed leave_stopped field.
10986         (resume_ptr): Delete.
10987         (struct thread_resume_array): New.
10988         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10989         resume interface change.
10990         (linux_continue_one_thread, linux_queue_one_thread)
10991         (resume_status_pending_p): Check if the resume field is NULL
10992         instead of checking the leave_stopped member.
10993         (linux_resume): Adjust to the target resume interface change.
10994         * spu-low.c (spu_resume): Adjust to the target resume interface
10995         change.
10996         * win32-low.c (win32_detach, win32_resume): Ditto.
10997
10998 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10999
11000         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
11001         flag.
11002         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
11003         pending.
11004         (linux_continue_one_thread): Only preserve the stepping flag if
11005         there's a pending breakpoint.
11006
11007 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
11008
11009         * server.c (main): After the inferior having exited, call
11010         remote_close before exiting gdbserver.
11011
11012 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
11013
11014         Fix size of FPSCR in Power 7 processors.
11015         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
11016         (PPC_FEATURE_HAS_DFP): New #define.
11017         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
11018         size of the FPSCR.
11019
11020 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
11021
11022         * server.c (handle_query) Whitespace and formatting.
11023
11024 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
11025
11026         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
11027         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
11028         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
11029         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
11030         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
11031         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
11032         Makefile.in, configure.ac: Fix whitespace throughout.
11033         * configure: Regenerate.
11034
11035 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
11036
11037         * inferiors.c (find_inferior): Make it safe for the callback
11038         function to delete the currently iterated inferior.
11039
11040 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
11041
11042         * Makefile.in (linuw_low_h): Move higher.
11043         (thread-db.o): Depend on $(linux_low_h).
11044
11045 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
11046
11047         Rename "process" to "lwp" throughout.
11048
11049         * linux-low.c (all_processes): Rename to...
11050         (all_lwps): ... this.
11051         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
11052         (add_process): Rename to ...
11053         (add_lwp): ... this.  Adjust.
11054         (linux_create_inferior): Adjust.
11055         (linux_attach_lwp): Adjust.
11056         (linux_attach): Adjust.
11057         (linux_kill_one_process): Rename to ...
11058         (linux_kill_one_lwp): ... this.  Adjust.
11059         (linux_kill): Adjust.
11060         (linux_detach_one_process): Rename to ...
11061         (linux_detach_one_lwp): ... this.  Adjust.
11062         (linux_detach): Adjust.
11063         (check_removed_breakpoint): Adjust.
11064         (status_pending_p): Adjust.
11065         (linux_wait_for_process): Rename to ...
11066         (linux_wait_for_lwp): ... this.  Adjust.
11067         (linux_wait_for_event): Adjust.
11068         (send_sigstop): Adjust.
11069         (wait_for_sigstop): Adjust.
11070         (stop_all_processes): Rename to ...
11071         (stop_all_lwps): ... this.
11072         (linux_resume_one_process): Rename to ...
11073         (linux_resume_one_lwp): ... this.  Adjust.
11074         (linux_set_resume_request, linux_continue_one_thread)
11075         (linux_queue_one_thread, resume_status_pending_p)
11076         (usr_store_inferior_registers, regsets_store_inferior_registers)
11077         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
11078         Adjust.
11079         * linux-low.h (get_process): Rename to ...
11080         (get_lwp): ... this.  Adjust.
11081         (get_thread_process): Rename to ...
11082         (get_thread_lwp): ... this.  Adjust.
11083         (get_process_thread): Rename to ...
11084         (get_lwp_thread): ... this.  Adjust.
11085         (struct process_info): Rename to ...
11086         (struct lwp_info): ... this.
11087         (all_processes): Rename to ...
11088         (all_lwps): ... this.
11089         * proc-service.c (ps_lgetregs): Adjust.
11090         * thread-db.c (thread_db_create_event, find_one_thread)
11091         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
11092
11093 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
11094
11095         * server.c (handle_query): Handle "qAttached".
11096
11097 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
11098
11099         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
11100         GPLv3, update license URL.
11101
11102 2009-03-01  Doug Evans  <dje@google.com>
11103
11104         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
11105         (server_h): Add gdb_signals.h.
11106         (signals.o): Update.
11107         * server.h (target_signal_from_host,target_signal_to_host_p)
11108         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
11109
11110 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
11111
11112         * remote-utils.c (getpkt): Also generate remote-debug
11113         information if noack_mode is set.
11114
11115 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
11116
11117         * server.c (handle_query): Report qXfer:siginfo:read and
11118         qXfer:siginfo:write as supported and handle them.
11119         * target.h (struct target_ops) <qxfer_siginfo>: New field.
11120         * linux-low.c (linux_xfer_siginfo): New.
11121         (linux_target_ops): Set it.
11122
11123 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
11124
11125         * server.c (gdbserver_usage): Mention --remote-debug.
11126         (main): Accept '--remote-debug' switch.
11127
11128 2009-01-18  Doug Evans  <dje@google.com>
11129
11130         * regcache.c (new_register_cache): No need to check result of xcalloc.
11131         * server.c (handle_search_memory): Back out calls to xmalloc,
11132         result is checked and error is returned to user upon failure.
11133         (handle_query): Ditto.  Add more checks for result of malloc.
11134         (handle_v_cont): Check result of malloc, report error back to
11135         user upon failure.
11136         (handle_v_run): Ditto.  Call freeargv.
11137         * server.h (freeargv): Declare.
11138         * utils.c (freeargv): New fn.
11139
11140 2009-01-15  Doug Evans  <dje@google.com>
11141
11142         * gdbreplay.c (perror_with_name): Make arg const char *.
11143         * server.h (target_signal_to_name): Make return type const char *.
11144         * thread-db.c (thread_db_err_str): Make return type const char *.
11145         * utils.c (perror_with_name): Make arg const char *.
11146
11147 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
11148
11149         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
11150         when handling a EXIT_PROCESS_DEBUG_EVENT.
11151
11152 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
11153
11154         * gdbreplay.c (gdbreplay_version): Update copyright year.
11155         * server.c (gdbserver_version): Likewise.
11156
11157 2009-01-05  Doug Evans  <dje@google.com>
11158
11159         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
11160         (handle_extended_wait): Improve comment.
11161
11162 2008-12-13  Doug Evans  <dje@google.com>
11163
11164         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
11165         * server.h (ATTR_MALLOC): New macro.
11166         (xmalloc,xcalloc,xstrdup): Declare.
11167         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
11168         * inferiors.c: Ditto.
11169         * linux-low.c: Ditto.
11170         * mem-break.c: Ditto.
11171         * regcache.c: Ditto.
11172         * remote-utils.c: Ditto.
11173         * server.c: Ditto.
11174         * target.c: Ditto.
11175         * win32-low.c: Ditto.
11176
11177 2008-12-12  Doug Evans  <dje@google.com>
11178
11179         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
11180         in debugging printf.
11181
11182         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
11183
11184 2008-12-09  Doug Evans  <dje@google.com>
11185
11186         * linux-low.h (struct process_info): Delete member tid, unused.
11187         * thread-db.c (find_one_thread): Update.
11188         (maybe_attach_thread): Update.
11189
11190 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
11191
11192         * target.h (struct target_ops): Add qxfer_osdata member.
11193         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
11194         and dirent.h.
11195         (linux_qxfer_osdata): New functions.
11196         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
11197         callback.
11198         * server.c (handle_query): Handle "qXfer:osdata:read:".
11199         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
11200         (buffer_xml_printf): New functions.
11201         * server.h (struct buffer): New.
11202         (buffer_grow_str, buffer_grow_str0): New macros.
11203         (buffer_grow, buffer_free, buffer_init, buffer_finish)
11204         (buffer_xml_printf): Declare.
11205
11206 2008-11-24  Doug Evans  <dje@google.com>
11207
11208         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
11209
11210 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
11211
11212         * server.c (handle_v_run): Always use the supplied argument list.
11213
11214 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
11215
11216         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
11217         (xtensa_regmap_table): Add entry for scompare1.
11218
11219 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
11220
11221         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
11222         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
11223         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
11224         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
11225         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
11226         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
11227         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
11228         XML target descriptions.
11229         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
11230         when inferior is running on an ISA 2.05 or later processor.  Add
11231         special case to return offset for full 64-bit slot of FPSCR when
11232         in 32-bits.
11233
11234 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
11235
11236         * Makefile.in (SFILES, clean): Added sparc64 files.
11237         (reg-sparc64.o, reg-sparc64.c): New.
11238         * configure.srv (sparc*-*-linux*): New configuration.
11239         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
11240         syscall arguments for SPARC.
11241         (regsets_store_inferior_registers): Likewise.
11242         * linux-sparc-low.c: New file.
11243
11244 2008-10-21  Doug Evans  <dje@google.com>
11245
11246         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
11247         (READLINE_DIR,READLINE_DEP): Delete.
11248         (INTERNAL_CFLAGS): Update.
11249         (LINTFLAGS): Update.
11250
11251 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
11252
11253         * server.c (handle_v_run): If GDB didn't specify an argv, use the
11254         whole argv from the last run, not just argv[0].
11255
11256 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
11257
11258         * regcache.c (new_register_cache): Return NULL if the register
11259         cache size isn't known yet.
11260         (free_register_cache): Avoid dereferencing a NULL regcache.
11261
11262 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11263
11264         * configure.srv: Merge MIPS and MIPS64.
11265
11266 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
11267
11268         * Makefile.in (uninstall): Apply $(EXEEXT) too.
11269
11270 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
11271
11272         * Makefile.in: Add required vsx dependencies.
11273
11274         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
11275         Declare init_registers_powerpc_vsx32l.
11276         Declare init_registers_powerpc_vsx64l.
11277         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
11278         (ppc_arch_setup): Check for VSX in hwcap.
11279         (ppc_fill_vsxregset): New function.
11280         (ppc_store_vsxregset): New function.
11281         Add new VSX entry in regset_info target_regsets.
11282
11283         * configure.srv: Add new VSX dependencies.
11284
11285 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
11286
11287         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
11288         (remote_open): Set or clear transport_is_reliable.
11289         (putpkt_binary): Don't expect acks in noack mode.
11290         (getpkt): Don't send ack/nac in noack mode.
11291         * server.c (handle_general_set): Handle QStartNoAckMode.
11292         (handle_query): If connected by tcp pass QStartNoAckMode+ in
11293         qSupported.
11294         (main): Reset noack_mode on every connection.
11295         * server.h (noack_mode): Declare.
11296
11297 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
11298
11299         * Makefile.in (GDBREPLAY_OBS): New variable.
11300         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
11301
11302 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
11303             Daniel Jacobowitz  <dan@codesourcery.com>
11304
11305         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
11306         (usr_store_inferior_registers): Likewise.
11307         (regsets_store_inferior_registers): Likewise.
11308
11309 2008-07-31  Rolf Jansen  <rj@surtec.com>
11310             Pedro Alves  <pedro@codesourcery.com>
11311
11312         * configure.ac: Check for memmem declaration.
11313         * server.c [HAVE_MALLOC_H]: Include malloc.h.
11314         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
11315         (disable_packet_qfThreadInfo): Unconditionally compile.
11316         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
11317         * configure, config.in: Regenerate.
11318
11319 2008-07-28  Doug Kwan  <dougkwan@google.com>
11320
11321         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
11322         (linux_write_memory): Remove declaration of errno.
11323
11324 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
11325
11326         * linux-low.c (handle_extended_wait): Do not use "status"
11327         variable uninitialized.
11328
11329 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
11330
11331         * server.c (handle_v_attach): Inhibit reporting dll changes.
11332
11333 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
11334
11335         * remote-utils.c (prepare_resume_reply): If requested, don't
11336         output "thread:TID" in the T stop reply.
11337
11338         * server.c (disable_packet_vCont, disable_packet_Tthread)
11339         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
11340         (handle_query): If requested, disable support for qC, qfThreadInfo
11341         and qsThreadInfo.
11342         (handle_v_requests): If requested, disable support for vCont.
11343         (gdbserver_show_disableable): New.
11344         (main): Handle --disable-packet and --disable-packet=LIST.
11345
11346         * server.h (disable_packet_vCont, disable_packet_Tthread)
11347         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
11348
11349 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
11350
11351         * server.c (gdbserver_usage): Mention --version.
11352
11353 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
11354
11355         * Makefile.in (gdbreplay.o): New rule.
11356
11357 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
11358
11359         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
11360         message, not gdbserver.
11361
11362 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
11363             Nathan Sidwell  <nathan@codesourcery.com>
11364             Joseph Myers  <joseph@codesourcery.com>
11365
11366         * acinclude.m4: Include ../../config/acx.m4.
11367         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
11368         * configure, config.in: Regenerate.
11369         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
11370         * server.c (gdbserver_version): Print PKGVERSION.
11371         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
11372         (main): Adjust gdbserver_usage calls.
11373         * gdbreplay.c (version, host_name): Add declarations.
11374         (gdbreplay_version, gdbreplay_usage): New.
11375         (main): Accept --version and --help options.
11376
11377 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
11378
11379         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
11380         (arm_breakpoint_at): Handle Thumb.
11381         (the_low_target): Add comment.
11382
11383 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
11384
11385         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
11386
11387 2008-05-09  Doug Evans  <dje@google.com>
11388
11389         * server.h (decode_search_memory_packet): Declare.
11390         * remote-utils.c (decode_search_memory_packet): New fn.
11391         * server.c (handle_search_memory_1): New fn.
11392         (handle_search_memory): New fn.
11393         (handle_query): Process qSearch:memory packets.
11394
11395 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
11396
11397         * regcache.c (registers_length): Remove.
11398         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
11399         full register packet.
11400         * regcache.h (registers_length): Remove prototype.
11401         * server.h (PBUFSIZ): Define to 16384.
11402
11403 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
11404
11405         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
11406         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
11407         powerpc-64l.o, and powerpc-altivec64l.o.
11408         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
11409         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
11410         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
11411         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
11412         rs6000/power-linux.xml, and rs6000/power64-linux.xml
11413         to srv_xmlfiles.
11414
11415         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
11416         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
11417         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
11418         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
11419         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
11420         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
11421         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
11422         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
11423         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
11424         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
11425         (clean): Update.
11426
11427         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
11428         (init_registers_powerpc_32l): ... this new prototype.
11429         (init_registers_powerpc_32): Remove, replace by ...
11430         (init_registers_powerpc_altivec32l): ... this new prototype.
11431         (init_registers_powerpc_e500): Remove, replace by ...
11432         (init_registers_powerpc_e500l): ... this new prototype.
11433         (init_registers_ppc64): Remove, replace by ...
11434         (init_registers_powerpc_64l): ... this new prototype.
11435         (init_registers_powerpc_64): Remove, replace by ...
11436         (init_registers_powerpc_altivec64l): ... this new prototype.
11437         (ppc_num_regs): Set to 73.
11438         (PT_ORIG_R3, PT_TRAP): Define if necessary.
11439         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
11440         (ppc_cannot_store_register): Handle orig_r3 and trap.
11441         (ppc_arch_setup): Update init_registers_... calls.
11442         (ppc_fill_gregset): Handle orig_r3 and trap.
11443
11444         * inferiors.c (clear_inferiors): Reset current_inferior.
11445
11446 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
11447
11448         * acinclude.m4: Add override.m4.
11449         * configure: Regenerate.
11450
11451 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
11452
11453         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
11454         initial call to init_register_ppc64.
11455
11456 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
11457
11458         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
11459         single powerpc*-*-linux* case.
11460         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
11461
11462 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
11463
11464         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
11465         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
11466         from reg_xmlfiles.
11467         * linux-ppc-low.c: Include <elf.h>.
11468         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
11469         (ppc_hwcap): New global variable.
11470         (ppc_regmap): Remove __SPE__ #ifdef sections.
11471         (ppc_regmap_e500): New global variable.
11472         (ppc_cannot_store_register): Update __SPE__ special case.
11473         (ppc_get_hwcap): New function.
11474         (ppc_arch_setup): Use it to determine whether inferior supports
11475         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
11476         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
11477         Do not access registers if target does not support AltiVec.
11478         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
11479         Do not access registers if target does not support SPE.
11480         (target_regsets): Unconditionally include AltiVec and SPE regsets.
11481
11482 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
11483
11484         * linux-low.c (disabled_regsets, num_regsets): New.
11485         (use_regsets_p): Delete.
11486         (linux_wait_for_process): Clear disabled_regsets.
11487         (regsets_fetch_inferior_registers): Check and set it.
11488         (regsets_store_inferior_registers): Likewise.
11489         (linux_fetch_registers, linux_store_registers): Do not use
11490         use_regsets_p.
11491         (initialize_low): Allocate disabled_regsets.
11492
11493 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
11494
11495         * Makefile.in (LIBOBJS): New.
11496         (OBS): Use LIBOBJS.
11497         (memmem.o): New rule.
11498         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
11499         * configure: Regenerated.
11500
11501 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
11502
11503         * server.c (handle_query): Never return "unsupported" for
11504         qXfer:features:read queries.
11505
11506 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
11507
11508         * server.c (get_features_xml): Fix inverted condition.
11509         (handle_query): Always support qXfer:feature:read.
11510
11511 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
11512
11513         * server.c (wrapper_argv): New.
11514         (start_inferior): Handle wrapper_argv.  If set, expect an extra
11515         trap.
11516         (gdbserver_usage): Document --wrapper.
11517         (main): Parse --wrapper.
11518
11519 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11520
11521         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
11522         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
11523         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
11524         (ppc_set_pc): Likewise.
11525         (ppc_arch_setup): New function.
11526         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
11527         of collect_register.
11528         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
11529
11530 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11531
11532         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
11533         instead of linux-ppc64-low.o.
11534         * linux-ppc64-low.c: Remove file.
11535         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
11536         (linux-ppc64-low.o): Remove rule.
11537
11538         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
11539         (init_registers_powerpc_64): Likewise.
11540         (ppc_regmap): Conditionally define depending on __powerpc64__.
11541         (ppc_cannot_store_register): Do not special-case "fpscr" when
11542         compiled on __powerpc64__.
11543         (ppc_collect_ptrace_register): New function.
11544         (ppc_supply_ptrace_register): New function.
11545         (ppc_breakpoint): Change type to "unsigned int".
11546         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
11547         (the_low_target): Conditionally provide initializers for the
11548         arch_setup member depending on __powerpc64__.  Install
11549         collect_ptrace_register and supply_ptrace_register members.
11550
11551 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
11552
11553         * regcache.h (gdbserver_xmltarget): Add extern declaration.
11554         * server.c (gdbserver_xmltarget): Define.
11555         (get_features_xml): Use it to replace "target.xml" and arch_string.
11556
11557         * configure.srv: Remove srv_xmltarget.  Add XML files that were
11558         mentioned there to srv_xmlfiles instead.  Remove conditional tests
11559         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
11560         srv_xmlfiles and srv_regobj to include all possible choices.
11561         * configure.ac (srv_xmltarget): Remove.
11562         (srv_xmlfiles): Do not add "target.xml".
11563         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
11564         checks for supplementary target information.
11565         * configure: Regenerate.
11566         * Makefile.in (XML_TARGET): Remove.
11567         (target.xml): Remove rule.
11568         (clean): Do not clean up target.xml.
11569         (.PRECIOUS): Do not mention target.xml.
11570
11571         * target.h (struct target_ops): Remove arch_string member.
11572         * linux-low.c (linux_arch_string): Remove.
11573         (linux_target_ops): Remove arch_string initializer.
11574         * linux-low.h (struct linux_target_ops): Remove arch_string member.
11575         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
11576         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
11577         * spu-low.c (spu_arch_string): Remove.
11578         (spu_target_ops): Remove arch_string initializer.
11579         * win32-low.c (win32_arch_string): Remove.
11580         (win32_target_ops): Remove arch_string initializer.
11581         * win32-low.h (struct win32_target_ops): Remove arch_string member.
11582         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
11583         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
11584
11585 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11586
11587         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
11588         by collect_ptrace_register and supply_ptrace_register hooks.
11589         * linux-low.c (fetch_register): Use supply_ptrace_register callback
11590         instead of checking for the_low_target.left_pad_xfer.
11591         (usr_store_inferior_registers): Use collect_ptrace_register callback
11592         instead of checking for the_low_target.left_pad_xfer.
11593
11594         * linux-s390-low.c (s390_collect_ptrace_register): New function.
11595         (s390_supply_ptrace_register): Likewise.
11596         (s390_fill_gregset): Call s390_collect_ptrace_register.
11597         (the_low_target): Update.
11598
11599         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
11600         (ppc_supply_ptrace_register): Likewise.
11601         (the_low_target): Update.
11602
11603         * linux-i386-low.c (the_low_target): Update.
11604         * linux-x86-64-low.c (the_low_target): Update.
11605
11606 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11607
11608         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
11609         reg-s390.o and reg-s390x.o.
11610
11611         * linux-low.c (new_inferior): New global variable.
11612         (linux_create_inferior, linux_attach): Set it.
11613         (linux_wait_for_process): Call the_low_target.arch_setup after the
11614         target has stopped for the first time.
11615         (initialize_low): Do not call the_low_target.arch_setup.
11616
11617         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
11618         (s390_set_pc): Likewise.
11619         (s390_arch_setup): New function.
11620         (the_low_target): Use s390_arch_setup as arch_setup routine.
11621
11622         * regcache.c (realloc_register_cache): New function.
11623         (set_register_cache): Call it for each existing regcache.
11624
11625 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
11626
11627         * server.h (init_registers): Remove prototype.
11628
11629         * linux-low.h (struct linux_target_ops): Add arch_setup field.
11630         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
11631         instead of init_registers ().
11632         * linux-arm-low.c (init_registers_arm): Add prototype.
11633         (init_registers_arm_with_iwmmxt): Likewise.
11634         (the_low_target): Add initializer for arch_setup field.
11635         * linux-cris-low.c (init_registers_cris): Add prototype.
11636         (the_low_target): Add initializer for arch_setup field.
11637         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
11638         (the_low_target): Add initializer for arch_setup field.
11639         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
11640         (the_low_target): Add initializer for arch_setup field.
11641         * linux-ia64-low.c (init_registers_ia64): Add prototype.
11642         (the_low_target): Add initializer for arch_setup field.
11643         * linux-m32r-low.c (init_registers_m32r): Add prototype.
11644         (the_low_target): Add initializer for arch_setup field.
11645         * linux-m68k-low.c (init_registers_m68k): Add prototype.
11646         (the_low_target): Add initializer for arch_setup field.
11647         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
11648         (init_registers_mips64_linux): Likewise.
11649         (the_low_target): Add initializer for arch_setup field.
11650         * linux-ppc-low.c (init_registers_ppc): Add prototype.
11651         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
11652         (the_low_target): Add initializer for arch_setup field.
11653         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
11654         (init_registers_powerpc_64): Likewise.
11655         (the_low_target): Add initializer for arch_setup field.
11656         * linux-s390-low.c (init_registers_s390): Add prototype.
11657         (init_registers_s390x): Likewise.
11658         (the_low_target): Add initializer for arch_setup field.
11659         * linux-sh-low.c (init_registers_sh): Add prototype.
11660         (the_low_target): Add initializer for arch_setup field.
11661         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
11662         (the_low_target): Add initializer for arch_setup field.
11663         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
11664         (the_low_target): Add initializer for arch_setup field.
11665
11666         * win32-low.h (struct win32_target_ops): Add arch_setup field.
11667         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
11668         instead of init_registers ().
11669         * win32-arm-low.c (init_registers_arm): Add prototype.
11670         (the_low_target): Add initializer for arch_setup field.
11671         * win32-i386-low.c (init_registers_i386): Add prototype.
11672         (the_low_target): Add initializer for arch_setup field.
11673
11674         * spu-low.c (init_registers_spu): Add prototype.
11675         (initialize_low): Call initialie_registers_spu () instead of
11676         initialize_registers ().
11677
11678 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
11679
11680         * server.c (handle_v_requests): When handling the vRun and vAttach
11681         packets, if already debugging a process, don't kill it.  Return an
11682         error instead.
11683
11684 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
11685
11686         * server.c (handle_query): Correct length check.
11687
11688 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
11689
11690         * win32-low.c (do_initial_child_stuff): Add process handle
11691         parameter.  Set current_process_handle and current_process_id from the
11692         parameters. Clear globals.
11693         (win32_create_inferior): Don't set current_process_handle and
11694         current_process_id here.  Instead pass them on the call to
11695         do_initial_child_stuff.
11696         (win32_attach): Likewise.
11697         (win32_clear_inferiors): New.
11698         (win32_kill): Don't close the current process handle or the
11699         current thread handle here.  Instead call win32_clear_inferiors.
11700         (win32_detach): Don't open a new handle to the process.  Call
11701         win32_clear_inferiors.
11702         (win32_join): Don't rely on current_process_handle; open a new
11703         handle using the process id.
11704         (win32_wait): Call win32_clear_inferiors when the inferior process
11705         has exited.
11706
11707 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
11708
11709         * server.c (monitor_show_help): Add "exit".
11710
11711 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
11712
11713         * Makefile.in (SFILES): Add linux-xtensa-low.c.
11714         (clean): Add reg-xtensa.c.
11715         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
11716         * configure.srv (xtensa*-*-linux*) New target.
11717         * linux-xtensa-low.c: New.
11718         * xtensa-xtregs.c: New.
11719
11720 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
11721
11722         * hostio.c: Don't include errno.h.
11723         (errno_to_fileio_errno): Move to hostio-errno.
11724         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
11725         error number outputting to the target->hostio_last_error callback.
11726         (hostio_packet_error): Use FILEIO_EINVAL directly.
11727         (handle_open, handle_pread, hostio_error, handle_unlink): Update
11728         calls to hostio_error.
11729         * hostio-errno.c: New.
11730         * server.h (hostio_last_error_from_errno): Declare.
11731         * target.h (target_ops): Add hostio_last_error member.
11732         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
11733         as hostio_last_error handler.
11734         * spu-low.c (spu_target_ops): Likewise.
11735         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
11736         (wince_hostio_last_error): New functions.
11737         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
11738         as hostio_last_error handler.
11739         (win32_target_ops) [!_WIN32_WCE]: Register
11740         hostio_last_error_from_errno as hostio_last_error handler.
11741         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
11742         (hostio-errno.o): New rule.
11743         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
11744         * configure.srv (srv_hostio_err_objs): New variable.  Default to
11745         hostio-errno.o.
11746         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
11747         * configure: Regenerate.
11748
11749 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11750
11751         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
11752         (linux_kill, linux_detach): Clean up the process list.
11753         * remote-utils.c (remote_open): Improve port number parsing.
11754         (putpkt_binary, input_interrupt): Only send interrupts if the target
11755         is running.
11756         * server.c (extended_protocol): Make static.
11757         (attached): Define earlier.
11758         (exit_requested, response_needed, program_argv): New variables.
11759         (target_running): New.
11760         (start_inferior): Clear attached here.
11761         (attach_inferior): Set attached here.
11762         (require_running): Define.
11763         (handle_query): Use require_running and target_running.  Implement
11764         "monitor exit".
11765         (handle_v_attach, handle_v_run): New.
11766         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
11767         (gdbserver_usage): Update.
11768         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
11769         --attach along with other options or after the port.  Save
11770         program_argv.  Support no initial program.  Resynchronize
11771         communication with GDB after an error.  Handle "monitor exit".
11772         Use require_running and target_running.  Always allow the extended
11773         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
11774         restart in extended mode.
11775         * README: Refer to the GDB manual.  Update --attach usage.
11776
11777 2007-12-20  Andreas Schwab  <schwab@suse.de>
11778
11779         * linux-low.c (STACK_SIZE): Define.
11780         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
11781         (linux_test_for_tracefork): Likewise.
11782
11783 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
11784
11785         * linux-low.c (linux_wait_for_event): Update messages.  Do not
11786         reinsert auto-delete breakpoints.
11787         * mem-break.c (struct breakpoint): Change return type of handler to
11788         int.
11789         (set_breakpoint_at): Update handler type.
11790         (reinsert_breakpoint_handler): Return 1 instead of calling
11791         delete_breakpoint.
11792         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
11793         setting a new one.
11794         (check_breakpoints): Delete auto-delete breakpoints and return 2.
11795         * mem-break.h (set_breakpoint_at): Update handler type.
11796         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
11797         * win32-low.c (auto_delete_breakpoint): New.
11798         (get_child_debug_event): Use it.
11799
11800 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
11801
11802         * configure.ac: Check for pread and pwrite.
11803         * hostio.c (handle_pread): Fall back to lseek and read.
11804         (handle_pwrite): Fall back to lseek and write.
11805         * config.in, configure: Regenerated.
11806
11807 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
11808
11809         * server.c (myresume): Add own_buf argument.
11810         (main): Update calls.
11811
11812 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
11813
11814         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
11815         * remote-utils.c (remote_open): Do not call disable_async_io.
11816         (block_async_io): Delete.
11817         (unblock_async_io): Make static.
11818         (initialize_async_io): New.
11819         * server.c (handle_v_cont): Handle async I/O here.
11820         (myresume): Likewise.  Move other common resume tasks here...
11821         (main): ... from here.  Call initialize_async_io.  Disable async
11822         I/O before the main loop.
11823         * server.h (initialize_async_io): Declare.
11824         (block_async_io, unblock_async_io): Delete prototypes.
11825         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
11826
11827 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
11828
11829         * remote-utils.c (readchar): Allow binary data in received messages.
11830
11831 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11832
11833         * win32-low.c (attaching): New global.
11834         (win32_create_inferior): Clear the `attaching' global.
11835         (win32_attach): Set the `attaching' global.
11836         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11837         attaching.  Only set a breakpoint at the entry point if not
11838         attaching.
11839
11840 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11841
11842         * server.c (main): Don't report dll events on the initial
11843         connection on attaches.
11844
11845 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11846
11847         * server.c (main): Relax numerical bases supported for the pid of
11848         the --attach command line argument.
11849
11850 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11851
11852         * win32-low.c (win32_attach): Call OpenProcess before
11853         DebugActiveProcess, not after.  Add last error output to error
11854         call.
11855
11856 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11857
11858         * win32-low.c (win32_get_thread_context)
11859         (win32_set_thread_context): New functions.
11860         (thread_rec): Use win32_get_thread_context.
11861         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11862         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11863         field.
11864
11865 2007-12-03  Leo Zayas
11866             Pedro Alves  <pedro_alves@portugalmail.pt>
11867
11868         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11869         global variables.
11870         (child_add_thread): Minor cleanup.
11871         (child_continue): Resume artificially suspended threads before
11872         calling ContinueDebugEvent.
11873         (suspend_one_thread): New.
11874         (fake_breakpoint_event): New.
11875         (get_child_debug_event): Change return type to int.  Check here if
11876         gdb sent an interrupt request.  If a soft interrupt was requested,
11877         fake a breakpoint event.  Return 0 if there is no event to handle,
11878         and 1 otherwise.
11879         (win32_wait): Don't check here if gdb sent an interrupt request.
11880         Ensure there is a valid event to handle.
11881         (win32_request_interrupt): Add soft interruption method as last
11882         resort.
11883
11884 2007-12-03  Leo Zayas
11885             Pedro Alves  <pedro_alves@portugalmail.pt>
11886
11887         * win32-low.h (win32_thread_info): Add descriptions to the
11888         structure members.  Replace `suspend_count' counter by a
11889         `suspended' flag.
11890         * win32-low.c (thread_rec): Update condition of when to get the
11891         context from the inferior.  Rely on ContextFlags being set if it
11892         has already been retrieved.  Only suspend the inferior thread if
11893         we haven't already.  Warn if that fails.
11894         (continue_one_thread): s/suspend_count/suspended/.  Only call
11895         ResumeThread once.  Warn if that fails.
11896
11897 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11898
11899         * win32-low.c (win32_wait): Don't read from the inferior when it
11900         has already exited.
11901
11902 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11903
11904         * Makefile.in (win32_low_h): New variable.
11905         (win32-low.o): Add dependency on $(win32_low_h).
11906         (win32-arm-low.o, win32-i386-low.o): New rules.
11907
11908 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11909
11910         * hostio.c: Correct copyright year.
11911
11912 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11913
11914         * Makefile.in (OBS): Add hostio.o.
11915         (hostio.o): New rule.
11916         * server.h (handle_vFile): Declare.
11917         * hostio.c: New file.
11918         * server.c (handle_v_requests): Take packet_len and new_packet_len
11919         for binary packets.  Call handle_vFile.
11920         (main): Update call to handle_v_requests.
11921
11922 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11923
11924         * linux-low.c: Include <sched.h>.
11925
11926 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11927
11928         * linux-low.c (linux_tracefork_grandchild): New.
11929         (linux_tracefork_child): Use clone.
11930         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11931
11932 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11933
11934         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11935
11936 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11937
11938         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11939
11940 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11941
11942         * inferiors.c (change_inferior_id): Delete.
11943         (add_pid_to_list, pull_pid_from_list): New.
11944         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11945         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11946         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11947         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11948         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11949         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11950         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11951         (using_threads): Always set to 1.
11952         (handle_extended_wait): New.
11953         (add_process): Do not set TID.
11954         (linux_create_inferior): Set must_set_ptrace_flags.
11955         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11956         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11957         (linux_thread_alive): Rename TID argument to LWPID.
11958         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11959         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11960         call to dead_thread_notify.  Call handle_extended_wait.
11961         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11962         (send_sigstop): Delete sigstop_sent.
11963         (wait_for_sigstop): Avoid TID.
11964         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11965         (linux_test_for_tracefork): New.
11966         (linux_lookup_signals): Use thread_db_active and
11967         linux_supports_tracefork_flag.
11968         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11969         * linux-low.h (get_process_thread): Avoid TID.
11970         (struct process_ifo): Move thread_known and tid to the end.  Remove
11971         sigstop_sent.
11972         (linux_attach_lwp, thread_db_init): Update prototypes.
11973         * server.h (change_inferior_id): Delete prototype.
11974         (add_pid_to_list, pull_pid_from_list): New prototypes.
11975         * thread-db.c (thread_db_use_events): New.
11976         (find_first_thread): Rename to...
11977         (find_one_thread): ...this.  Update callers and messages.  Do not
11978         call fatal.  Check thread_db_use_events.  Do not call
11979         change_inferior_id or new_thread_notify.
11980         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11981         (thread_db_init): Set thread_db_use_events.  Check use_events.
11982         * utils.c (fatal, warning): Correct message prefix.
11983
11984 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11985
11986         * Makefile.in (clean): Remove new files.
11987         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11988         (powerpc-64.o, powerpc-64.c): New rules.
11989         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11990         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11991         with SPE.
11992         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11993         SPE targets.
11994         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11995         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11996         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11997         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11998         (target_regsets): Add AltiVec and SPE register sets.
11999         * configure.ac: Check for AltiVec and SPE.
12000         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
12001         (ppc_fill_vrregset, ppc_store_vrregset): New.
12002         (target_regsets): Add AltiVec register set.
12003         * configure: Regenerated.
12004
12005 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
12006
12007         * linux-low.c (O_LARGEFILE): Define.
12008         (linux_read_memory): Use /proc/PID/mem.
12009         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
12010         * configure, config.in: Regenerated.
12011
12012 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
12013
12014         * linux-low.c (linux_wait_for_event): Do not pass signals while
12015         single-stepping.
12016
12017 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
12018
12019         * win32-low.c (create_process): New.
12020         (win32_create_inferior): Use create_process instead of
12021         CreateProcess.  If create_process failed retry appending an ".exe"
12022         suffix.  Store the GetLastError result immediatelly after
12023         create_process calls and use it on the call to error.
12024
12025 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
12026
12027         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
12028
12029 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
12030
12031         * configure.ac: Switch license to GPLv3.
12032
12033 2007-08-01  Michael Snyder  <msnyder@access-company.com>
12034
12035         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
12036
12037 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
12038
12039         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
12040         typedef.
12041         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
12042         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
12043         CloseToolhelp32Snapshot.
12044         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
12045         CloseToolhelp32Snapshot.
12046
12047 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
12048
12049         * server.c (main): Check for inferior exit before main loop.
12050
12051 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
12052
12053         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
12054         instead of on tmp_desc.
12055
12056 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
12057             Daniel Jacobowitz  <dan@codesourcery.com>
12058
12059         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
12060         (add_thread): Minor cleanups.
12061         (clear_inferiors): Move lower in the file.  Clear the DLL
12062         list.
12063         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
12064         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
12065         (xml_escape_text): New.
12066         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
12067         for qSupported.
12068         (handle_v_cont): Report errors.
12069         (gdbserver_version): Update.
12070         (main): Correct size of own_buf.  Do not report initial DLL events.
12071         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
12072         (unloaded_dll, xml_escape_text): New.
12073         * win32-low.c (enum target_waitkind): Update comments.
12074         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
12075         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
12076         (win32_EnumProcessModules, win32_GetModuleInformation)
12077         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
12078         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
12079         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
12080         (win32_Module32First, win32_Module32Next, load_toolhelp)
12081         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
12082         (get_child_debug_event): Handle DLL events.
12083         (win32_wait): Likewise.
12084
12085 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12086
12087         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
12088         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
12089
12090 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
12091
12092         * win32-low.c (handle_output_debug_string): Ignore event if not
12093         waiting.
12094
12095 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
12096
12097         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
12098
12099 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
12100
12101         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
12102
12103 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
12104
12105         * inferiors.c (change_inferior_id): Add comment.
12106         * linux-low.c (check_removed_breakpoint): Add an early
12107         prototype.  Improve debug output.
12108         (linux_attach): Doc update.
12109         (linux_detach_one_process, linux_detach): Clean up before releasing
12110         each process.
12111         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
12112         * linux-low.h (struct process_info): Doc improvement.
12113         * mem-break.c (delete_all_breakpoints): New.
12114         * mem-break.h (delete_all_breakpoints): New prototype.
12115         * thread-db.c (find_first_thread): New.
12116         (thread_db_create_event): Call it instead of
12117         thread_db_find_new_threads.  Clean up unused variables.
12118         (maybe_attach_thread): Remove first thread handling.
12119         (thread_db_find_new_threads): Use find_first_thread.
12120         (thread_db_get_tls_address): Likewise.
12121
12122 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
12123
12124         * thread-db.c (thread_db_find_new_threads): Add prototype.
12125         (thread_db_create_event): Check for the main thread before adding
12126         a new thread.
12127         (maybe_attach_thread): Only enable event reporting if TID == 0.
12128         (thread_db_get_tls_address): Check for new threads.
12129
12130 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
12131
12132         * linux-low.c (linux_create_inferior): Try execv before execvp.
12133         * spu-low.c (spu_create_inferior): Likewise.
12134
12135 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
12136
12137         * linux-low.c (linux_create_inferior): Change execv to execvp.
12138         * spu-low.c (spu_create_inferior): Likewies.
12139
12140 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
12141
12142         * Makefile.in (clean): Clean new files instead of deleted ones.
12143         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
12144         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
12145         rules.
12146         * configure.srv: Specify XML files and new regformats for MIPS and
12147         MIPS64 GNU/Linux.
12148         * linux-mips-low.c (mips_num_regs): Set to only used registers.
12149         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
12150         an entry for the restart register.
12151         (mips_cannot_fetch_register, mips_cannot_store_register)
12152         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
12153         register names to match the XML descriptions.
12154         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
12155         restart register instead of $0.
12156
12157 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
12158             Markus Deuling  <deuling@de.ibm.com>
12159
12160         * remote-utils.c (decode_xfer_write): New function.
12161         * server.h (decode_xfer_write): Add prototype.
12162         * server.c (handle_query): Add PACKET_LEN argument.  Support
12163         qXfer:spu:read and qXfer:spu:write packets.
12164         (main): Pass packet_len to handle_query.
12165         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
12166         * target.h (target_ops): Add qxfer_spu.
12167
12168 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
12169
12170         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
12171         accessing non-seekable spufs files.
12172
12173 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
12174
12175         * server.c (handle_query): Add reply for qC packet.
12176
12177 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12178             Leo Zayas  <lerele@champenstudios@com>
12179
12180         * server.h (check_remote_input_interrupt_request): New function.
12181         * remote_utils.c (INVALID_DESCRIPTOR): New define.
12182         (remote_desc): Initialize with INVALID_DESCRIPTOR.
12183         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
12184         (check_remote_input_interrupt_request): New function.
12185         * server.h (check_remote_input_interrupt_request): Declare.
12186         * win32-low.c (winapi_DebugBreakProcess,
12187         winapi_GenerateConsoleCtrlEvent): New typedefs.
12188         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
12189         to 250 ms.
12190         (win32_wait): Check for remote interrupt request
12191         with check_remote_input_interrupt_request.
12192         (win32_request_interrupt): New function.
12193         (win32_target_op): Set request_interrupt to win32_request_interrupt.
12194
12195 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12196
12197         * win32-low.c (debug_registers_changed,
12198         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
12199         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
12200         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
12201         (thread_rec): Get context using the low target.
12202         (child_add_thread): Call thread_added on the low target,
12203         which does the same thing.
12204         (regptr): Delete.
12205         (do_initial_child_stuff): Remove debug registers references.
12206         Set context using the low target.  Resume threads after
12207         setting the contexts.
12208         (child_continue): Remove dead variable.  Remove debug
12209         registers references.
12210         (child_fetch_inferior_registers): Go through the low target.
12211         (do_child_store_inferior_registers): Remove.
12212         (child_store_inferior_registers): Go through the low target.
12213         (win32_resume): Remove debug registers references.
12214         Set context using the low target.
12215         (handle_exception): Change return type to void.  Don't record
12216         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
12217         first chance exception.
12218         (get_child_debug_event): Change return type to void.  Remove
12219         goto loop.  Always return after waiting for debug event.
12220         (win32_wait): Convert to switch statement.  Handle spurious
12221         events.
12222
12223         * win32-i386-low.c (debug_registers_changed,
12224         debug_registers_used): New.
12225         (initial_stuff): Rename to ...
12226         (i386_initial_stuff): ... this.  Clear debug registers
12227         state variables.
12228         (store_debug_registers): Delete.
12229         (i386_get_thread_context): New.
12230         (load_debug_registers): Delete.
12231         (i386_set_thread_context): New.
12232         (i386_thread_added): New.
12233         (single_step): Rename to ...
12234         (i386_single_step): ... this.
12235         (do_fetch_inferior_registers): Rename to ...
12236         (i386_fetch_inferior_register): ... this.
12237         (i386_store_inferior_register): New.
12238         (the_low_target): Adapt to new interface.
12239
12240         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
12241         (arm_get_thread_context): New.
12242         (arm_set_thread_context): New.
12243         (regptr): New.
12244         (do_fetch_inferior_registers): Rename to ...
12245         (arm_fetch_inferior_register): ... this.
12246         (arm_store_inferior_register): New.
12247         (arm_wince_breakpoint): Reimplement as unsigned long.
12248         (arm_wince_breakpoint_len): Define.
12249         (the_low_target): Adapt to new interface.
12250
12251         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
12252         load_debug_registers.  Add get_thread_context, set_thread_context,
12253         thread_added and store_inferior_register.  Rename
12254         fetch_inferior_registers to fetch_inferior_register.
12255         (regptr): Remove declaration.
12256
12257 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12258
12259         * linux-low.c (linux_detach): Change return type to int.  Return 0.
12260         * spu-low.c (spu_detach): Likewise.
12261
12262 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12263
12264         * target.h (target_ops): Change return type of detach to int.
12265         Add join.
12266         (join_inferior): New.
12267         * server.c (main): Don't skip detach support on mingw32.
12268         If the inferior doesn't support detaching return error.
12269         Call join_inferior instead of using waitpid.
12270         * linux-low.c (linux_join): New.
12271         (linux_target_op): Add linux_join.
12272         * spu-low.c (spu_join): New.
12273         (spu_target_ops): Add spu_join.
12274         * win32-low.c (win32_detach): Adapt to new interface.
12275         Reopen current_process_handle before detaching.  Issue a child
12276         resume before detaching.
12277         (win32_join): New.
12278         (win32_target_op): Add win32_join.
12279
12280 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12281
12282         * win32-low.c (win32-attach): Fix return value.
12283         * target.h (target_ops): Describe ATTACH return values.
12284
12285 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12286
12287         * win32-low.c (GETPROCADDRESS): Define.
12288         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
12289         (winapi_DebugSetProcessKillOnExit): Likewise.
12290         (win32_create_inferior): Force usage of ansi CreateProcessA.
12291         (win32_attach): Use GETPROCADDRESS.
12292         (win32_detach): Likewise.
12293
12294 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
12295
12296         * win32-low.c (win32_wait): Don't use WSTOPSIG.
12297
12298 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
12299
12300         * win32-low.c: Commit leftover changes from 2007-03-29.
12301
12302 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
12303
12304         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
12305         fields short instead of int.  Add explicit padding.
12306         (i387_cache_to_fsave): Remove unnecessary casts.
12307         (i387_fsave_to_cache): Doc fix.
12308         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
12309
12310 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
12311
12312         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
12313         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
12314
12315 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
12316
12317         * configure.srv (arm*-*-mingw32ce*): Move near the other
12318         arm targets.
12319
12320 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
12321
12322         * configure.ac: Add errno checking.
12323         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
12324         sys/file.h and malloc.h.
12325         (AC_CHECK_DECLS): Add perror.
12326         (srv_mingwce): Handle.
12327         * configure.srv (i[34567]86-*-cygwin*): Add
12328         win32-i386-low.o to srv_tgtobj.
12329         (i[34567]86-*-mingw*): Likewise.
12330         (arm*-*-mingw32ce*): Add case.
12331         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
12332         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
12333         [__MINGW32CE__] (strerror): New function.
12334         [__MINGW32CE__] (errno): Define to GetLastError.
12335         [__MINGW32CE__] (COUNTOF): New macro.
12336         (remote_open): Remove extra close call.
12337         * mem-break.c (delete_breakpoint_at): New function.
12338         * mem-break.h (delete_breakpoint_at): Declare.
12339         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
12340         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
12341         [USE_WIN32API] (read, write): Add char* casts.
12342         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
12343         * server.h: Include wincecompat.h on Windows CE.
12344         [HAVE_ERRNO_H]: Check.
12345         (perror): Declare if not declared.
12346         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
12347         (perror_with_name): Remove errno declaration.
12348         * wincecompat.h: New.
12349         * wincecompat.c: New.
12350         * win32-low.h: New.
12351         * win32-arm-low.c: New.
12352         * win32-i386-low.c: New.
12353         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
12354         (OUTMSG2): Make it safe.
12355         (_T): New macro.
12356         (COUNTOF): New macro.
12357         (NUM_REGS): Get it from the low target.
12358         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
12359         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
12360         (thread_rec): Let low target handle debug registers.
12361         (child_add_thread): Likewise.
12362         (child_init_thread_list): Likewise.
12363         (continue_one_thread): Likewise.
12364         (regptr): New.
12365         (do_child_fetch_inferior_registers): Move to ...
12366         * win32-i386-low.c: ... here, and rename to ...
12367         (do_fetch_inferior_registers): ... this.
12368         * win32-low.c (child_fetch_inferior_registers):
12369         Go through the low target.
12370         (do_child_store_inferior_registers): Use regptr.
12371         (strwinerror): New function.
12372         (win32_create_inferior): Handle Windows CE.
12373         Use strwinerror instead of strerror on Windows error
12374         codes.  Add program to the error output.
12375         Don't close the main thread handle on Windows CE.
12376         (win32_attach): Use coredll.dll on Windows CE.
12377         (win32_kill): Close current process and current
12378         thread handles.
12379         (win32_detach): Use coredll.dll on Windows CE.
12380         (win32_resume): Let low target handle debug registers, and
12381         step request.
12382         (handle_exception): Add/Remove initial breakpoint.  Avoid
12383         non-existant WSTOPSIG on Windows CE.
12384         (win32_read_inferior_memory): Cast to remove warning.
12385         (win32_arch_string): Go through the low target.
12386         (initialize_low): Call set_breakpoint_data with the low
12387         target's breakpoint.
12388         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
12389         FOP_REGNUM, mappings): Move to ...
12390         * win32-i386-low.c: ... here.
12391         * win32-low.c (win32_thread_info): Move to ...
12392         * win32-low.h: ... here.
12393         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
12394         win32-arm-low.c and wincecompat.c.
12395         (all:): Add $EXEEXT.
12396         (install-only:): Likewise.
12397         (gdbserver:): Likewise.
12398         (gdbreplay:): Likewise.
12399         * config.in: Regenerate.
12400         * configure: Regenerate.
12401
12402 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
12403
12404         * win32-low.c: Rename typedef thread_info to
12405         win32_thread_info throughout.
12406
12407 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
12408
12409         * win32-i386-low.c: Rename to ...
12410         * win32-low.c: ... this.
12411         * configure.srv: Replace win32-i386-low.o with win32-low.o.
12412         * Makefile.in: Likewise.
12413
12414 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
12415
12416         * remote-utils.c (monitor_output): Constify msg parameter.
12417         * server.h (monitor_output): Likewise.
12418         * win32-i386-low.c (handle_output_debug_string): New.
12419         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
12420         handle_output_debug_string.
12421         (get_child_debug_event): Likewise.
12422
12423 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
12424
12425         * server.c (main): Correct strtoul check.
12426
12427 2007-03-27  Jon Ringle  <jon@ringle.org>
12428
12429         * linux-low.c: Check __ARCH_HAS_MMU__ also.
12430
12431 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
12432
12433         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
12434
12435 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
12436
12437         * terminal.h: Check HAVE_SGTTY_H.
12438
12439 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
12440
12441         * remote-utils.c (remote_open): Print out the assigned port number.
12442
12443 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
12444
12445         * remote-utils.c (monitor_output): New function.
12446         * server.c (debug_threads): Define here.
12447         (monitor_show_help): New function.
12448         (handle_query): Handle qRcmd.
12449         (main): Do not handle 'd' packet.
12450         * server.h (debug_threads, remote_debug, monitor_output): Declare.
12451         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
12452         of debug_threads.
12453
12454 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12455
12456         * Makefile.in (EXEEXT): New.
12457         (clean): Use $(EXEEXT).
12458
12459 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12460
12461         * target.h (target_ops): Rename send_signal to request_interrupt,
12462         and remove enum target_signal parameter.
12463         * linux-low.c (linux_request_interrupt): Rename from
12464         linux_send_signal, and always send SIGINT.
12465         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
12466         and always send SIGINT.
12467         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
12468         of send_signal.
12469         (input_interrupt): Likewise.
12470
12471 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
12472
12473         * server.c (get_features_xml): Check if target implemented
12474         arch_string.
12475         * win32-i386-low.c (win32_arch_string): New.
12476         (win32_target_ops): Add win32_arch_string as arch_string member.
12477
12478 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
12479
12480         * spu-low.c (spu_arch_string): New.
12481         (spu_target_ops): Add spu_arch_string.
12482
12483 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
12484
12485         * remote-utils.c: Remove HAVE_TERMINAL_H check.
12486         * configure.ac: Do not check for terminal.h.
12487         * configure, config.in: Regenerated.
12488
12489 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12490
12491         * Makefile.in (OBS): Add $(XML_BUILTIN).
12492         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
12493         (clean): Update.
12494         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
12495         (arm-with-iwmmxt.c): New.
12496         * config.in, configure: Regenerate.
12497         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
12498         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
12499         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
12500         (arm*-*-linux*): Add iWMMXt and regset support.
12501         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
12502         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
12503         (arm_store_wmmxregset, target_regsets): New.
12504         * server.c (get_features_xml): Take annex argument.  Check builtin
12505         XML documents.
12506         (handle_query): Handle multiple annexes.
12507
12508 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
12509
12510         * remote-utils.c [USE_WIN32API] (read, write): Define.
12511         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
12512         write.
12513
12514 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
12515
12516         * linux-i386-low.c (the_low_target): Set arch_string.
12517         * linux-x86-64-low.c (the_low_target): Likewise.
12518         * linux-low.c (linux_arch_string): New.
12519         (linux_target_ops): Add it.
12520         * linux-low.h (struct linux_target_ops): Add arch_string.
12521         * server.c (write_qxfer_response): Use const void * for DATA.
12522         (get_features_xml): New.
12523         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
12524         * target.h (struct target_ops): Add arch_string method.
12525
12526 2007-01-03  Denis Pilat  <denis.pilat@st.com>
12527             Daniel Jacobowitz  <dan@codesourcery.com>
12528
12529         * linux-low.c (linux_kill): Handle being called with no threads.
12530         * win32-i386-low.c (win32_kill): Likewise.
12531         (get_child_debug_event): Clear current_process_handle.
12532
12533 2006-12-30  Denis PILAT  <denis.pilat@st.com>
12534             Daniel Jacobowitz  <dan@codesourcery.com>
12535
12536         * remote-utils.c (remote_open): Check the type of specified
12537         serial port devices before opening them.
12538         * server.c (main): Kill the inferior if an error occurs during
12539         the first remote_open.
12540
12541 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
12542
12543         * README: Update supported targets.
12544
12545 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
12546
12547         * Makefile.in (clean): Remove reg-mips64.c.
12548         (reg-mips64.c, reg-mips64.o): New rules.
12549         * configure.srv: Handle mips64.  Include regset support for mips.
12550         * linux-mips-low.c (union mips_register): New.
12551         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
12552         (mips_breakpoint, mips_breakpoint_at): Use int.
12553         (mips_collect_register, mips_supply_register)
12554         (mips_collect_register_32bit, mips_supply_register_32bit)
12555         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
12556         (mips_store_fpregset, target_regsets): New.
12557         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
12558
12559 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
12560
12561         * configure.srv: Add target "spu*-*-*".
12562         * Makefile.in (clean): Remove reg-spu.c.
12563         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
12564         * spu-low.c: New file.
12565
12566 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
12567
12568         * configure.ac: Correct td_thr_tls_get_addr test.
12569         * configure: Regenerated.
12570
12571 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
12572
12573         * linux-low.c (linux_wait_for_event): Reformat.  Use the
12574         pass_signals array.
12575         * remote-utils.c (decode_address_to_semicolon): New.
12576         * server.c (pass_signals, handle_general_set): New.
12577         (handle_query): Mention QPassSignals for qSupported.
12578         (main): Call handle_general_set.
12579         * server.h (pass_signals, decode_address_to_semicolon): New.
12580
12581 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
12582
12583         * server.c (handle_query): Correct error handling for read_auxv.
12584
12585 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
12586
12587         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
12588         and srv_linux_thread_db to yes.
12589         * linux-s390-low.c (s390_fill_gregset): New function.
12590         (target_regsets): Define data structure.
12591
12592 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
12593
12594         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
12595         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
12596         * config.in, configure: Regenerated.
12597         * inferiors.c (gdb_id_to_thread): New function.
12598         (gdb_id_to_thread_id): Use it.
12599         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
12600         * linux-low.h (struct process_info): Add th member.
12601         (thread_db_get_tls_address): New prototype.
12602         * remote-utils.c (decode_address): Make non-static.
12603         * server.c (handle_query): Handle qGetTLSAddr.
12604         * server.h (gdb_id_to_thread, decode_address): New prototypes.
12605         * target.h (struct target_ops): Add get_tls_address.
12606         * thread-db.c (maybe_attach_thread): Save the thread handle.
12607         (thread_db_get_tls_address): New.
12608
12609 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
12610
12611         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
12612         (linux_resume_one_process): Take a siginfo_t *.  Update all
12613         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
12614         (struct pending_signals): Add a siginfo_t.
12615         (linux_wait_for_process): Always set last_status.
12616         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
12617         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
12618         * linux-low.h (struct process_info): Add last_status.
12619
12620 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
12621
12622         * remote-utils.c (try_rle): New function.
12623         (putpkt_binary): Use it.
12624
12625 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
12626
12627         * Makefile.in (clean): Clean reg-x86-64-linux.c.
12628         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
12629         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
12630         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
12631         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
12632         point registers.
12633
12634 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
12635
12636         * server.c (terminal_fd): New variable.
12637         (old_foreground_pgrp): Likewise.
12638         (restore_old_foreground_pgrp): New function.
12639         (start_inferior): Record the terminal file descriptor in terminal_fd
12640         and its original foreground group in old_foreground_pgrp.  Register
12641         restore_old_foreground_pgrp with atexit().
12642
12643 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
12644
12645         * server.c (handle_query): Correct qPart to qXfer.
12646
12647 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
12648
12649         * configure.ac: Check for more headers which are missing on
12650         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
12651         * configure.srv: Add Cygwin and mingw32.
12652         * remote-utils.c: Don't include headers unconditionally which
12653         are missing on mingw32.  Include <winsock.h> for mingw32.
12654         (remote_open): Adjust for mingw32 support.  Flush
12655         standard error after writing to it.
12656         (remote_close, putpkt_binary, input_interrupt, block_async_io)
12657         (unblock_async_io, enable_async_io, disable_async_io)
12658         (readchar, getpkt): Update for Winsock support.
12659         (prepare_resume_reply): Expect a protocol signal number.
12660         * server.c: Disable <sys/wait.h> on mingw32.
12661         (start_inferior): Adjust for mingw32 support.  Flush
12662         standard error after writing to it.
12663         (attach_inferior): Likewise.  Use protocol signal
12664         numbers.
12665         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
12666         and names.
12667         * win32-i386-low.c: New file.
12668         * Makefile.in (XM_CLIBS): Set.
12669         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
12670         (win32-i386-low.o): New dependency rule.
12671         * linux-low.c (linux_wait): Use target signal numbers.
12672         * target.h (struct target_ops): Doc fix.
12673         * server.h (target_signal_to_name): New prototype.
12674         * gdbreplay.c: Don't include headers unconditionally which
12675         are missing on mingw32.  Include <winsock.h> for mingw32.
12676         (remote_close, remote_open): Adjust for Winsock support.
12677         * configure, config.in: Regenerated.
12678
12679 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12680
12681         * server.c (decode_xfer_read, write_qxfer_response): New.
12682         (handle_query): Take a packet length argument.  Handle
12683         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
12684         the qSupported response.
12685         (main): Update call to handle_query.
12686
12687 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
12688
12689         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
12690         (putpkt_binary): Renamed from putpkt and adjusted for binary
12691         data.
12692         (putpkt): New wrapper for putpkt_binary.
12693         (readchar): Don't mask off the high bit.
12694         (decode_X_packet): New function.
12695         * server.c (main): Call putpkt_binary if a handler sets the packet
12696         length.  Save the length of the incoming packet.  Handle 'X'.
12697         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
12698
12699 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
12700
12701         * server.c (handle_query): Handle qSupported.
12702
12703 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12704
12705         * remote-utils.c (all_symbols_looked_up): New variable.
12706         (look_up_one_symbol): Check it.
12707         * server.h (look_up_one_symbol): New declaration.
12708         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
12709
12710 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12711
12712         * Makefile.in (linux-arm-low.o): Update dependencies.
12713         * linux-arm-low.c: Include "gdb_proc_service.h".
12714         (PTRACE_GET_THREAD_AREA): Define.
12715         (ps_get_thread_area): New function.
12716
12717 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
12718
12719         * configure.srv (m68k*-*-uclinux*): New target.
12720         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
12721         (linux_resume_one_process): Remove extraneous cast.
12722         (linux_read_offsets): New.
12723         (linux_target_op): Add linux_read_offsets on mmuless systems.
12724         * server.c (handle_query): Add qOffsets logic.
12725         * target.h (struct target_ops): Add read_offsets.
12726
12727 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12728
12729         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
12730         (PTRACE_GET_THREAD_AREA): Define.
12731         (ps_get_thread_area): New function.
12732         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
12733         (linux-x86-64-low.o): Update.
12734
12735 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12736
12737         * configure.ac: Remove checks for prfpregset_t.
12738         * gdb_proc_service.h: New file.
12739         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
12740         new "gdb_proc_service.h".
12741         * proc-service.c: Likewise.
12742         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
12743         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
12744         * Makefile.in (gdb_proc_service_h): Updated.
12745         * configure, config.in: Regenerated.
12746
12747 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12748
12749         * remote-utils.c (prepare_resume_reply): Move declaration
12750         of gdb_id_from_wait to the top of the block.
12751
12752 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
12753
12754         * linux-low.c (regsets_store_inferior_registers): Read the regset
12755         from the target before filling it.
12756
12757 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12758
12759         * server.c (attach_inferior): Return SIGTRAP for a successful
12760         attach.
12761
12762 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
12763
12764         * Makefile.in (OBS): Add version.o.
12765         (STAGESTUFF): Delete.
12766         (version.o): Add dependencies.
12767         (version.c): Replace rule.
12768         (clean): Remove version.c.
12769         * server.c (gdbserver_version): New.
12770         (gdbserver_usage): Use printf.
12771         (main): Handle --version and --help.
12772         * server.h (version, host_name): Add declarations.
12773
12774 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
12775
12776         * linux-arm-low.c:
12777         * linux-arm-low.c:
12778         * inferiors.c:
12779         * i387-fp.h:
12780         * i387-fp.c:
12781         * gdbreplay.c:
12782         * regcache.c:
12783         * proc-service.c:
12784         * mem-break.h:
12785         * mem-break.c:
12786         * linux-x86-64-low.c:
12787         * linux-sh-low.c:
12788         * linux-s390-low.c:
12789         * linux-ppc64-low.c:
12790         * linux-ppc-low.c:
12791         * linux-mips-low.c:
12792         * linux-m68k-low.c:
12793         * linux-m32r-low.c:
12794         * linux-low.h:
12795         * linux-low.c:
12796         * linux-ia64-low.c:
12797         * linux-i386-low.c:
12798         * linux-crisv32-low.c:
12799         * thread-db.c:
12800         * terminal.h:
12801         * target.h:
12802         * target.c:
12803         * server.h:
12804         * server.c:
12805         * remote-utils.c:
12806         * regcache.h:
12807         * utils.c:
12808         * Makefile.in:
12809         * configure.ac:
12810         * gdbserver.1: Add (C) after Copyright.  Update the FSF
12811         address.
12812
12813 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
12814
12815         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
12816         (arm_breakpoint_at): Recognize both breakpoints.
12817         (the_low_target): Use the correct breakpoint instruction.
12818
12819 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
12820
12821         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
12822         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
12823         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
12824         (the_low_target): Update.
12825
12826 2005-10-25  Andreas Schwab  <schwab@suse.de>
12827
12828         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12829
12830         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12831         (ia64_num_regs): Reduce to 462.
12832
12833 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12834
12835         * acinclude.m4: Correct quoting.
12836         * aclocal.m4: Regenerated.
12837
12838         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12839         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12840         (thread_db_init): Call thread_db_err_str.
12841         * configure.ac: Check for TD_VERSION.
12842         * config.in, configure: Regenerated.
12843
12844 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12845
12846         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12847
12848 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12849
12850         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12851         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12852         * config.in, configure: Regenerated.
12853         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12854         * linux-i386-low.c, linux-m68k-low.c: Update to use
12855         HAVE_PTRACE_GETREGS.
12856         * linux-low.c (regsets_fetch_inferior_registers)
12857         (regsets_store_inferior_registers): Only return 0 if we processed
12858         GENERAL_REGS.
12859         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12860         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12861
12862 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12863
12864         * inferiors.c (struct thread_info): Add gdb_id.
12865         (add_thread): Add gdb_id argument.
12866         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12867         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12868         calls to add_thread.
12869         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12870         * server.c (handle_query): Use thread_to_gdb_id.
12871         (handle_v_cont, main): Use gdb_id_to_thread_id.
12872         * server.h (add_thread): Update prototype.
12873         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12874         prototypes.
12875
12876 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12877
12878         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12879         left-padded registers.
12880         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12881         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12882
12883 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12884
12885         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12886         * configure: Regenerate.
12887         * config.in: Regenerate.
12888         * server.h (NEED_DECLARATION_STRERROR):
12889         Replace with !HAVE_DECL_STRERROR.
12890
12891 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12892
12893         * linux-low.c (linux_wait, linux_send_signal): Don't test
12894         an unsigned long variable for > 0 if it could be MAX_ULONG.
12895         * server.c (myresume): Likewise.
12896         * target.c (set_desired_inferior): Likewise.
12897
12898 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12899
12900         * configure.ac: Simplify and improve check for socklen_t.
12901         * configure, config.in: Regenerate.
12902
12903 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12904
12905         * acconfig.h: Remove.
12906         * configure.ac: Add a test for socklen_t.  Use three-argument
12907         AC_DEFINE throughout.
12908         * config.in: Regenerated using autoheader 2.59.
12909         * configure: Regenerated.
12910
12911         * gdbreplay.c (socklen_t): Provide a default.
12912         (remote_open): Use socklen_t.
12913         * remote-utils.c (socklen_t): Provide a default.
12914         (remote_open): Use socklen_t.
12915         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12916         unsigned char.
12917
12918         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12919         char for buffers.
12920         * linux-low.c (linux_read_memory, linux_write_memory)
12921         (linux_read_auxv): Likewise.
12922         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12923         (check_mem_write): Likewise.
12924         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12925         Likewise.
12926         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12927         (registers_from_string, register_data): Likewise.
12928         * server.c (handle_query, main): Likewise.
12929         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12930         (decode_M_packet): Likewise.
12931         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12932         * target.h (struct target_ops): Update read_memory, write_memory,
12933         and read_auxv.
12934         (read_inferior_memory, write_inferior_memory): Update.
12935         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12936         to unsigned char *.
12937         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12938         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12939         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12940         linux-s390-low.c, linux-sh-low.c: Update for changes in
12941         read_inferior_memory and the_low_target->breakpoint.
12942
12943 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12944
12945         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12946         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12947         * configure.srv: Add powerpc64-*-linux*.
12948         * linux-ppc64-low.c: New file.
12949
12950 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12951
12952         * linux-cris-low.c: New file with support for CRIS.
12953         * linux-crisv32-low.c: Ditto for CRISv32.
12954         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12955         (clean): Add reg-cris.c and reg-crisv32.c.
12956         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12957         reg-crisv32.o, and reg-crisv32.c to make rules.
12958         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12959         recognized targets.
12960
12961 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12962
12963         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12964         of sizeof (PTRACE_XFER_TYPE).
12965         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12966
12967 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12968
12969         * target.h (struct target_ops): Add insert_watchpoint,
12970         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12971         pointers for hardware watchpoint support.
12972         * linux-low.h (struct linux_target_ops): Ditto.
12973         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12974         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12975         to linux_target_ops.
12976         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12977         reply packet.
12978         * server.c (main): Recognize 'Z' and 'z' packets.
12979
12980 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12981
12982         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12983         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12984         (the_low_target): Add new members.
12985
12986 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12987
12988         * proc-service.c (ps_lgetregs): Search all_processes instead of
12989         all_threads.
12990
12991 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12992
12993         * server.c (start_inferior): Change return type to int.
12994         (attach_inferior): Change sigptr to int *.
12995         (handle_v_cont, handle_v_requests): Change signal to int *.
12996         (main): Change signal to int.
12997
12998 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12999
13000         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
13001         * configure.srv: Add m32r*-*-linux*.
13002         * linux-m32r-low.c: New file.
13003
13004 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
13005
13006         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
13007
13008 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
13009
13010         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
13011         Take unsigned long arguments for PIDs.
13012         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
13013         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
13014         (wait_for_sigstop, linux_resume_one_process)
13015         (regsets_fetch_inferior_registers, linux_send_signal)
13016         (linux_read_auxv): Likewise.  Update the types of variables holding
13017         PIDs.  Update format string specifiers.
13018         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
13019         * remote-utils.c (prepare_resume_reply): Likewise.
13020         * server.c (cont_thread, general_thread, step_thread)
13021         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
13022         unsigned long.
13023         (handle_query): Update format specifiers.
13024         (handle_v_cont, main): Use strtoul for thread IDs.
13025         * server.h (struct inferior_list_entry): Use unsigned long for ID.
13026         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
13027         (general_thread, step_thread, thread_from_wait)
13028         (old_thread_from_wait): Update.
13029         * target.h (struct thread_resume): Use unsigned long for THREAD.
13030         (struct target_ops): Use unsigned long for arguments to attach and
13031         thread_alive.
13032
13033 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
13034
13035         * acinclude.m4: Include bfd/bfd.m4 directly.
13036         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
13037         <agriffis@toolchain.org>.
13038         * aclocal.m4, configure: Regenerated.
13039
13040 2005-01-07  Andrew Cagney  <cagney@gnu.org>
13041
13042         * configure.ac: Rename configure.in, require autoconf 2.59.
13043         * configure: Re-generate.
13044
13045 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
13046
13047         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
13048         LIBS when finished.
13049         * aclocal.m4: Regenerated.
13050         * configure: Regenerated.
13051
13052 2004-11-21  Andreas Schwab  <schwab@suse.de>
13053
13054         * linux-m68k-low.c (m68k_num_gregs): Define.
13055         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
13056         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
13057         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
13058         (m68k_breakpoint_at): New.  Add to the_low_target.
13059
13060         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
13061         srv_linux_thread_db to yes.
13062
13063 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
13064
13065         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
13066         (ARCH_SET_FS): Likewise.
13067         (ARCH_GET_FS): Likewise.
13068         (ARCH_GET_GS): Likewise.
13069
13070 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
13071
13072         * linux-i386-low.c (ps_get_thread_area): New.
13073         * linux-x86-64-low.c (ps_get_thread_area): New.
13074         * linux-low.c: Include <sys/syscall.h>.
13075         (linux_kill_one_process): Don't kill the first thread here.
13076         (linux_kill): Kill the first thread here.
13077         (kill_lwp): New function.
13078         (send_sigstop, linux_send_signal): Use it.
13079         * proc-service.c: Clean up #ifdefs.
13080         (fpregset_info): Delete.
13081         (ps_lgetregs): Update and enable implementation.
13082         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
13083         implementations.
13084         * remote-utils.c (struct sym_cache, symbol_cache): New.
13085         (input_interrupt): Print a clearer message.
13086         (async_io_enabled): New variable.
13087         (enable_async_io, disable_async_io): Use it.  Update comments.
13088         (look_up_one_symbol): Use the symbol cache.
13089         * thread-db.c (thread_db_look_up_symbols): New function.
13090         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
13091
13092 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
13093
13094         * configure.in: Test for -rdynamic.
13095         * configure: Regenerated.
13096         * Makefile (INTERNAL_LDFLAGS): New.
13097         (gdbserver, gdbreplay): Use it.
13098
13099 2004-09-02  Andrew Cagney  <cagney@gnu.org>
13100
13101         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
13102
13103 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
13104
13105         * linux-low.c (linux_wait): Clear all_processes list also.
13106
13107 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
13108
13109         * linux-low.c: Include <errno.h>.  Remove extern declaration of
13110         errno.
13111
13112 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
13113
13114         * gdbreplay.c, server.h, utils.c: Update copyright years.
13115
13116 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
13117
13118         * server.c (main): Print child status or termination signal from
13119         variable 'signal', not 'sig'.
13120
13121 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
13122
13123         * linux-low.c (linux_read_memory): Change return type to
13124         int.  Check for and return error from ptrace().
13125         * target.c (read_inferior_memory): Change return type to int.  Pass
13126         back return status from the_target->read_memory().
13127         * target.h (struct target_ops): Adapt *read_memory() prototype.
13128         Update comment.
13129         (read_inferior_memory): Adapt prototype.
13130         * server.c (main): Return an error packet if
13131         read_inferior_memory() returns an error.
13132
13133 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
13134
13135         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
13136         Unify with other clean targets.
13137
13138 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
13139
13140         * server.c (handle_v_cont): Call set_desired_inferior.
13141
13142 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
13143
13144         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
13145
13146 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
13147
13148         * linux-low.c (linux_wait): Unblock async I/O.
13149         (linux_resume): Block and enable async I/O.
13150         * remote-utils.c (block_async_io, unblock_async_io): New functions.
13151         * server.h (block_async_io, unblock_async_io): Add prototypes.
13152
13153 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
13154
13155         * remote-utils.c (remote_open): Print a status notice after
13156         opening a TCP port.
13157         * server.c (attach_inferior): Print a status notice after
13158         attaching.
13159
13160 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
13161
13162         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
13163
13164 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
13165
13166         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
13167         error packet.
13168         * server.c, target.h: Update copyright years.
13169
13170 2004-02-25  Roland McGrath  <roland@redhat.com>
13171
13172         * target.h (struct target_ops): New member `read_auxv'.
13173         * server.c (handle_query): Handle qPart:auxv:read: query using that.
13174         * linux-low.c (linux_read_auxv): New function.
13175         (linux_target_ops): Initialize `read_auxv' member to that.
13176
13177 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
13178
13179         Committed by Jim Blandy  <jimb@redhat.com>.
13180
13181         * linux-s390-low.c (s390_num_regs): Update.
13182         (s390_regmap): Remove control registers.  Use __s390x__ predefine
13183         instead of GPR_SIZE to distiguish s390 and s390x targets.
13184
13185 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
13186
13187         * linux-low.c: Update copyright year.
13188         (check_removed_breakpoint): Clear pending_is_breakpoint.
13189         (linux_set_resume_request, linux_queue_one_thread)
13190         (resume_status_pending_p): New functions.
13191         (linux_continue_one_thread): Use process->resume.
13192         (linux_resume): Only resume threads if there are no pending events.
13193         * linux-low.h (struct process_info): Add resume request
13194         pointer.
13195
13196 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
13197
13198         * regcache.c (new_register_cache): Clear the allocated register
13199         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
13200
13201 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
13202
13203         * linux-low.c (linux_resume): Take a struct thread_resume *
13204         argument.
13205         (linux_wait): Update call.
13206         (resume_ptr): New static variable.
13207         (linux_continue_one_thread): Renamed from
13208         linux_continue_one_process.  Use resume_ptr.
13209         (linux_resume): Use linux_continue_one_thread.
13210         * server.c (handle_v_cont, handle_v_requests): New functions.
13211         (myresume): New function.
13212         (main): Handle 'v' case.
13213         * target.h (struct thread_resume): New type.
13214         (struct target_ops): Change argument of "resume" to struct
13215         thread_resume *.
13216         (myresume): Delete macro.
13217
13218 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
13219
13220         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
13221         (uninstall): Support DESTDIR.
13222
13223 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
13224
13225         * configure.srv: Add xscale*linux copy of arm*linux entry.
13226
13227 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
13228
13229         * linux-arm-low.c (arm_reinsert_addr): New function.
13230         (the_low_target): Add arm_reinsert_addr.
13231
13232 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
13233
13234         * mem-break.c: Remove whitespace at end of file.
13235
13236 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
13237
13238         * configure.in: Check whether we need to prototype strerror.
13239         * server.h: Optionally prototype strerror.
13240         * gdbreplay.c (perror_with_name): Use strerror.
13241         * linux-low.c (linux_attach_lwp): Use strerror.
13242         * utils.c (perror_with_name): Use strerror.
13243         * config.in, configure: Regenerated.
13244
13245 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
13246
13247         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
13248         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
13249
13250 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
13251
13252         * Makefile.in (SFILES): Update.
13253         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
13254         low-sun3.c: Remove files.
13255
13256 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
13257
13258         * linux-low.c: Move comment to linux_thread_alive where it belonged.
13259         (linux_detach_one_process, linux_detach): New functions.
13260         (linux_target_ops): Add linux_detach.
13261         * server.c (main): Handle 'D' packet.
13262         * target.h (struct target_ops): Add "detach" member.
13263         (detach_inferior): Define.
13264
13265 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
13266
13267         From Kelley Cook  <kelleycook@wideopenwest.com>:
13268         * configure.srv: Accept i[34567]86 variants.
13269
13270 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
13271
13272         * linux-low.c (linux_wait_for_event): Correct comment typos.
13273         (linux_resume_one_process): Call check_removed_breakpoint.
13274         (linux_send_signal): New function.
13275         (linux_target_ops): Add linux_send_signal.
13276         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
13277         of kill.
13278         * target.h (struct target_ops): Add send_signal.
13279
13280 2003-05-29  Jim Blandy  <jimb@redhat.com>
13281
13282         * linux-low.c (usr_store_inferior_registers): Transfer buf in
13283         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
13284         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
13285         away part of the register's value.
13286
13287 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
13288
13289         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
13290         (linux_wait_for_event, linux_init_signals): Likewise.
13291
13292 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
13293
13294         * configure.in: Check for stdlib.h.
13295         * configure: Regenerated.
13296         * config.in: Regenerated.
13297
13298 2003-01-04  Andreas Schwab  <schwab@suse.de>
13299
13300         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
13301
13302 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
13303
13304         * Makefile.in: Remove obsolete code.
13305
13306 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
13307
13308         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
13309         defined(PT_FPR0_HI).
13310
13311 2002-11-17  Stuart Hughes  <seh@zee2.com>
13312
13313         * linux-arm-low.c (arm_num_regs): Increase.
13314         (arm_regmap): Include status register.
13315
13316 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
13317
13318         * linux-low.c (register_addr): Remove incorrect -1 check.
13319
13320 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
13321
13322         * linux-low.c (linux_create_inferior): Call setpgid.  Return
13323         the new PID.
13324         (unstopped_p, linux_signal_pid): Remove.
13325         (linux_target_ops): Remove linux_signal_pid.
13326         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
13327         global instead of target method.
13328         * target.h (struct target_ops): Remove signal_pid.  Update comment
13329         for create_inferior.
13330         * server.c (signal_pid): New variable.
13331         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
13332         gdbserver.  Set the child to be the foreground process group.
13333         (attach_inferior): Set signal_pid.
13334
13335 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
13336
13337         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
13338
13339 2002-08-20  Jim Blandy  <jimb@redhat.com>
13340
13341         * Makefile.in (LDFLAGS): Allow the configure script to establish a
13342         default for this.
13343
13344 2002-08-01  Andrew Cagney  <cagney@redhat.com>
13345
13346         * Makefile.in: Make chill references obsolete.
13347
13348 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
13349
13350         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
13351         * configure: Regenerate.
13352         * config.in: Regenerate.
13353
13354 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
13355
13356         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
13357         (perror_with_name, remote_close, remote_open, expect, play): Static.
13358
13359 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
13360
13361         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
13362         byte offsets instead of an array of indexes.
13363         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
13364
13365 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
13366
13367         * regcache.c: Add comment.
13368
13369 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
13370
13371         * thread-db.c: New file.
13372         * proc-service.c: New file.
13373         * acinclude.m4: New file.
13374         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
13375         proc-service.o, and thread-db.o.
13376         (linux-low.o): Add USE_THREAD_DB.
13377         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
13378         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
13379         * aclocal.m4: Regenerated.
13380         * config.in: Regenerated.
13381         * configure: Regenerated.
13382         * configure.in: Check for proc_service.h, sys/procfs.h,
13383         thread_db.h, and linux/elf.h headrs.
13384         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
13385         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
13386         Check for -lthread_db and thread support.
13387         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
13388         PowerPC, and SuperH.
13389         * i387-fp.c: Constify arguments.
13390         * i387-fp.h: Likewise.
13391         * inferiors.c: (struct thread_info): Renamed from
13392         `struct inferior_info'.  Remove PID member.  Use generic inferior
13393         list header.  All uses updated.
13394         (inferiors, signal_pid): Removed.
13395         (all_threads): New variable.
13396         (get_thread): Define.
13397         (add_inferior_to_list): New function.
13398         (for_each_inferior): New function.
13399         (change_inferior_id): New function.
13400         (add_inferior): Removed.
13401         (remove_inferior): New function.
13402         (add_thread): New function.
13403         (free_one_thread): New function.
13404         (remove_thread): New function.
13405         (clear_inferiors): Use for_each_inferior and free_one_thread.
13406         (find_inferior): New function.
13407         (find_inferior_id): New function.
13408         (inferior_target_data): Update argument type.
13409         (set_inferior_target_data): Likewise.
13410         (inferior_regcache_data): Likewise.
13411         (set_inferior_regcache_data): Likewise.
13412         * linux-low.c (linux_bp_reinsert): Remove.
13413         (all_processes, stopping_threads, using_thrads)
13414         (struct pending_signals, debug_threads, pid_of): New.
13415         (inferior_pid): Replace with macro.
13416         (struct inferior_linux_data): Remove.
13417         (get_stop_pc, add_process): New functions.
13418         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
13419         Use add_process and add_thread.
13420         (linux_attach_lwp): New function, based on old linux_attach.  Use
13421         add_process and add_thread.  Set stop_expected for new threads.
13422         (linux_attach): New function.
13423         (linux_kill_one_process): New function.
13424         (linux_kill): Kill all LWPs.
13425         (linux_thread_alive): Use find_inferior_id.
13426         (check_removed_breakpoints, status_pending_p): New functions.
13427         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
13428         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
13429         struct for the found process.
13430         (linux_wait_for_event): New function.
13431         (linux_wait): Use it.  Support LWPs.
13432         (send_sigstop, wait_for_sigstop, stop_all_processes)
13433         (linux_resume_one_process, linux_continue_one_process): New functions.
13434         (linux_resume): Support LWPs.
13435         (REGISTER_RAW_SIZE): Remove.
13436         (fetch_register): Use register_size instead.  Call supply_register.
13437         (usr_store_inferior_registers): Likewise.  Call collect_register.
13438         Fix recursive case.
13439         (regsets_fetch_inferior_registers): Improve error message.
13440         (regsets_store_inferior_registers): Add debugging.
13441         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
13442         (unstopped_p, linux_signal_pid): New functions.
13443         (linux_target_ops): Add linux_signal_pid.
13444         (linux_init_signals): New function.
13445         (initialize_low): Call it.  Initialize using_threads.
13446         * regcache.c (inferior_regcache_data): Add valid
13447         flag.
13448         (get_regcache): Fetch registers lazily.  Add fetch argument
13449         and update all callers.
13450         (regcache_invalidate_one, regcache_invalidate): New
13451         functions.
13452         (new_register_cache): Renamed from create_register_cache.
13453         Return the new regcache.
13454         (free_register_cache): Change argument to a void *.
13455         (registers_to_string, registers_from_string): Call get_regcache
13456         with fetch flag set.
13457         (register_data): Make static.  Pass fetch flag to get_regcache.
13458         (supply_register): Call get_regcache with fetch flag clear.
13459         (collect_register): Call get_regcache with fetch flag set.
13460         (collect_register_as_string): New function.
13461         * regcache.h: Update.
13462         * remote-utils.c (putpkt): Flush after debug output and use
13463         stderr.
13464         Handle input interrupts while waiting for an ACK.
13465         (input_interrupt): Use signal_pid method.
13466         (getpkt): Flush after debug output and use stderr.
13467         (outreg): Use collect_register_as_string.
13468         (new_thread_notify, dead_thread_notify): New functions.
13469         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
13470         and general_thread.
13471         (look_up_one_symbol): Flush after debug output.
13472         * server.c (step_thread, server_waiting): New variables.
13473         (start_inferior): Don't use signal_pid.  Update call to mywait.
13474         (attach_inferior): Update call to mywait.
13475         (handle_query): Handle qfThreadInfo and qsThreadInfo.
13476         (main): Don't fetch/store registers explicitly.  Use
13477         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
13478         calls to mywait.
13479         * server.h: Update.
13480         (struct inferior_list, struct_inferior_list_entry): New.
13481         * target.c (set_desired_inferior): New.
13482         (write_inferior_memory): Constify.
13483         (mywait): New function.
13484         * target.h: Update.
13485         (struct target_ops): New signal_pid method.
13486         (mywait): Removed macro, added prototype.
13487
13488         * linux-low.h (regset_func): Removed.
13489         (regset_fill_func, regset_store_func): New.
13490         (enum regset_type): New.
13491         (struct regset_info): Add type field.  Use new operation types.
13492         (struct linux_target_ops): stop_pc renamed to get_pc.
13493         Add decr_pc_after_break and breakpoint_at.
13494         (get_process, get_thread_proess, get_process_thread)
13495         (strut process_info, all_processes, linux_attach_lwp)
13496         (thread_db_init): New.
13497
13498         * linux-arm-low.c (arm_get_pc, arm_set_pc,
13499         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
13500         (the_low_target): Add new members.
13501         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
13502         (i386_store_fpxregset): Constify.
13503         (target_regsets): Add new kind identifier.
13504         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
13505         (i386_set_pc): Add debugging.
13506         (i386_breakpoint_at): New function.
13507         (the_low_target): Add new members.
13508         * linux-mips-low.c (mips_get_pc, mips_set_pc)
13509         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
13510         (mips_breakpoint_at): New.
13511         (the_low_target): Add new members.
13512         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
13513         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
13514         (the_low_target): Add new members.
13515         * linux-sh-low.c (sh_get_pc, sh_set_pc)
13516         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
13517         (the_low_target): Add new members.
13518         * linux-x86-64-low.c (target_regsets): Add new kind
13519         identifier.
13520
13521 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
13522
13523         From Martin Pool <mbp@samba.org>:
13524         * server.c (gdbserver_usage): New function.
13525         (main): Call it.
13526
13527 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
13528
13529         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
13530         stop_at -> stop_pc.
13531
13532 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
13533
13534         * Makefile.in: Remove obsolete code.
13535
13536 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
13537
13538         * linux-low.c (regsets_fetch_inferior_registers),
13539         (regsets_store_inferior_registers): Removed cast to int from
13540         ptrace() calls.
13541         * regcache.h: Added declaration of struct inferior_info.
13542
13543 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
13544
13545         * inferiors.c (struct inferior_info): Add regcache_data.
13546         (add_inferior): Call create_register_cache.
13547         (clear_inferiors): Call free_register_cache.
13548         (inferior_regcache_data, set_inferior_regcache_data): New functions.
13549         * regcache.c (struct inferior_regcache_data): New.
13550         (registers): Remove.
13551         (get_regcache): New function.
13552         (create_register_cache, free_register_cache): New functions.
13553         (set_register_cache): Don't initialize the register cache here.
13554         (registers_to_string, registers_from_string, register_data): Call
13555         get_regcache.
13556         * regcache.h: Add prototypes.
13557         * server.h: Likewise.
13558
13559 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
13560
13561         * mem-break.c: New file.
13562         * mem-break.h: New file.
13563         * Makefile.in: Add mem-break.o rule; update server.h
13564         dependencies.
13565         * inferiors.c (struct inferior_info): Add target_data
13566         member.
13567         (clear_inferiors): Free target_data member if set.
13568         (inferior_target_data, set_inferior_target_data): New functions.
13569         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
13570         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
13571         * linux-low.c (linux_bp_reinsert): New variable.
13572         (struct inferior_linux_data): New.
13573         (linux_create_inferior): Use set_inferior_target_data.
13574         (linux_attach): Likewise.  Call add_inferior.
13575         (linux_wait_for_one_inferior): New function.
13576         (linux_wait): Call it.
13577         (linux_write_memory): Add const.
13578         (initialize_low): Call set_breakpoint_data.
13579         * linux-low.h (struct linux_target_ops): Add breakpoint
13580         handling members.
13581         * server.c (attach_inferior): Remove extra add_inferior
13582         call.
13583         * server.h: Include mem-break.h.  Update inferior.c
13584         prototypes.
13585         * target.c (read_inferior_memory)
13586         (write_inferior_memory): New functions.
13587         * target.h (read_inferior_memory)
13588         (write_inferior_memory): Change macros to prototypes.
13589         (struct target_ops): Update comments.  Add const to write_memory
13590         definition.
13591
13592 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
13593
13594         * linux-low.c (usr_store_inferior_registers): Support
13595         registers which are allowed to fail to store.
13596         * linux-low.h (linux_target_ops): Likewise.
13597         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
13598         (ppc_cannot_store_register): FPSCR may not be storable.
13599
13600 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13601
13602         * server.h: Include <string.h> if HAVE_STRING_H.
13603         * ChangeLog: Correct paths in last ChangeLog entry.
13604
13605 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13606
13607         * linux-low.h: Remove obsolete prototypes.
13608         (struct linux_target_ops): New.
13609         (extern the_low_target): New.
13610         * linux-low.c (num_regs, regmap): Remove declarations.
13611         (register_addr): Use the_low_target explicitly.
13612         (fetch_register): Likewise.
13613         (usr_fetch_inferior_registers): Likewise.
13614         (usr_store_inferior_registers): Likewise.
13615         * linux-arm-low.c (num_regs): Remove.
13616         (arm_num_regs): Define.
13617         (arm_regmap): Renamed from regmap, made static.
13618         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
13619         made static.
13620         (arm_cannot_store_register): Renamed from cannot_store_register,
13621         made static.
13622         (the_low_target): New.
13623         * linux-i386-low.c (num_regs): Remove.
13624         (i386_num_regs): Define.
13625         (i386_regmap): Renamed from regmap, made static.
13626         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
13627         made static.
13628         (i386_cannot_store_register): Renamed from cannot_store_register,
13629         made static.
13630         (the_low_target): New.
13631         * linux-ia64-low.c (num_regs): Remove.
13632         (ia64_num_regs): Define.
13633         (ia64_regmap): Renamed from regmap, made static.
13634         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
13635         made static.
13636         (ia64_cannot_store_register): Renamed from cannot_store_register,
13637         made static.
13638         (the_low_target): New.
13639         * linux-m68k-low.c (num_regs): Remove.
13640         (m68k_num_regs): Define.
13641         (m68k_regmap): Renamed from regmap, made static.
13642         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
13643         made static.
13644         (m68k_cannot_store_register): Renamed from cannot_store_register,
13645         made static.
13646         (the_low_target): New.
13647         * linux-mips-low.c (num_regs): Remove.
13648         (mips_num_regs): Define.
13649         (mips_regmap): Renamed from regmap, made static.
13650         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
13651         made static.
13652         (mips_cannot_store_register): Renamed from cannot_store_register,
13653         made static.
13654         (the_low_target): New.
13655         * linux-ppc-low.c (num_regs): Remove.
13656         (ppc_num_regs): Define.
13657         (ppc_regmap): Renamed from regmap, made static.
13658         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
13659         made static.
13660         (ppc_cannot_store_register): Renamed from cannot_store_register,
13661         made static.
13662         (the_low_target): New.
13663         * linux-s390-low.c (num_regs): Remove.
13664         (s390_num_regs): Define.
13665         (s390_regmap): Renamed from regmap, made static.
13666         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
13667         made static.
13668         (s390_cannot_store_register): Renamed from cannot_store_register,
13669         made static.
13670         (the_low_target): New.
13671         * linux-sh-low.c (num_regs): Remove.
13672         (sh_num_regs): Define.
13673         (sh_regmap): Renamed from regmap, made static.
13674         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
13675         made static.
13676         (sh_cannot_store_register): Renamed from cannot_store_register,
13677         made static.
13678         (the_low_target): New.
13679         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
13680         (the_low_target): New.
13681
13682 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13683
13684         * Makefile.in: Add stamp-h target.
13685         * configure.in: Create stamp-h.
13686         * configure: Regenerated.
13687
13688 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13689
13690         * inferiors.c: New file.
13691         * target.c: New file.
13692         * target.h: New file.
13693         * Makefile.in:  Add target.o and inferiors.o.  Update
13694         dependencies.
13695         * linux-low.c (inferior_pid): New static variable,
13696         moved from server.c.
13697         (linux_create_inferior): Renamed from create_inferior.
13698         Call add_inferior.  Return 0 on success instead of a PID.
13699         (linux_attach): Renamed from myattach.
13700         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
13701         (linux_thread_alive): Renamed from mythread_alive.
13702         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
13703         child dies.
13704         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
13705         (regsets_store_inferior_registers): Correct error message.
13706         Add missing ``return 0''.
13707         (linux_fetch_registers): Renamed from fetch_inferior_registers.
13708         (linux_store_registers): Renamed from store_inferior_registers.
13709         (linux_read_memory): Renamed from read_inferior_memory.
13710         (linux_write_memory): Renamed from write_inferior_memory.
13711         (linux_target_ops): New structure.
13712         (initialize_low): Call set_target_ops ().
13713         * remote-utils.c (unhexify): New function.
13714         (hexify): New function.
13715         (input_interrupt): Send signals to ``signal_pid''.
13716         * server.c (inferior_pid): Remove.
13717         (start_inferior): Update create_inferior call.
13718         (attach_inferior): Call add_inferior.
13719         (handle_query): New function.
13720         (main): Call handle_query for `q' packets.
13721         * server.h: Include "target.h".  Remove obsolete prototypes.
13722         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
13723
13724 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13725
13726         * Makefile.in: Add WARN_CFLAGS.  Update configury
13727         dependencies.
13728         * configure.in: Check for <string.h>
13729         * configure: Regenerate.
13730         * config.in: Regenerate.
13731         * gdbreplay.c: Include needed system headers.
13732         (remote_open): Remove strchr prototype.
13733         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
13734         * regcache.c (supply_register): Change buf argument to const void *.
13735         (supply_register_by_name): Likewise.
13736         (collect_register): Change buf argument to void *.
13737         (collect_register_by_name): Likewise.
13738         * regcache.h: Add missing prototypes.
13739         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
13740         * server.c (handle_query): New function.
13741         (attached): New static variable, moved out of main.
13742         (main): Quiet longjmp clobber warnings.
13743         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
13744         * utils.c (error): Remove NORETURN.
13745         (fatal): Likewise.