New vCtrlC packet, non-stop mode equivalent of \003
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-11-30  Pedro Alves  <palves@redhat.com>
2
3         * server.c (handle_v_requests): Handle vCtrlC.
4
5 2015-11-30  Pedro Alves  <palves@redhat.com>
6
7         * gdbthread.h (find_any_thread_of_pid): Declare.
8         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
9         functions.
10         * server.c (handle_query): If current_thread is NULL, look for
11         another thread of the selected process.
12
13 2015-11-26  Daniel Colascione  <dancol@dancol.org>
14             Simon Marchi  <simon.marchi@ericsson.com>
15
16         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
17         * server.c (handle_qxfer_threads_worker): Refactor to include thread
18         name in reply.
19         * target.h (struct target_ops) <thread_name>: New field.
20         (target_thread_name): New macro.
21
22 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
23
24         * regcache.h (regcache_invalidate_pid): Add declaration.
25         * regcache.c (regcache_invalidate_pid): New function, extracted
26         from regcache_invalidate.
27         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
28         Add trivial documentation comment.
29         * lynx-low.c: Use regcache_invalidate_pid instead of
30         regcache_invalidate.
31
32 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
33
34         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
35         and Elf64_auxv_t if the target is Android.
36
37 2015-11-22  Doug Evans  <xdje42@gmail.com>
38
39         * target.h: #include <sys/types.h>.
40
41 2015-11-19  Pedro Alves  <palves@redhat.com>
42
43         * linux-low.c (linux_process_qsupported): Change prototype.
44         Adjust.
45         * linux-low.h (struct linux_target_ops) <process_qsupported>:
46         Change prototype.
47         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
48         and adjust to loop over all features.
49         * server.c (handle_query) <qSupported>: Adjust to call
50         target_process_qsupported once, passing it a vector of unprocessed
51         features.
52         * target.h (struct target_ops) <process_qsupported>: Change
53         prototype.
54         (target_process_qsupported): Adjust.
55
56 2015-11-19  Pedro Alves  <palves@redhat.com>
57
58         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
59         mode.
60         * configure: Regenerate.
61
62 2015-11-19  Pedro Alves  <palves@redhat.com>
63
64         * configure: Regenerate.
65
66 2015-11-19  Yao Qi  <yao.qi@linaro.org>
67
68         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
69         type to uint32_t.
70
71 2015-11-19  Yao Qi  <yao.qi@linaro.org>
72
73         * linux-aarch64-low.c (enum aarch64_operand_type): New.
74         (struct aarch64_operand): Move enum out.
75
76 2015-11-19  Yao Qi  <yao.qi@linaro.org>
77
78         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
79         struct user_fpsimd_state *.
80         (aarch64_store_fpregset): Likewise.
81
82 2015-11-19  Yao Qi  <yao.qi@linaro.org>
83
84         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
85         struct user_pt_regs *.
86         (aarch64_store_gregset): Likewise.
87
88 2015-11-18  Pedro Alves  <palves@redhat.com>
89
90         * Makefile.in (all_object_files): Add $IPA_OBJS.
91
92 2015-11-17  Pedro Alves  <palves@redhat.com>
93
94         * win32-low.c (win32_resume): Use gdb_signal_from_host,
95         GDB_SIGNAL_0 and gdb_signal_to_string.
96
97 2015-11-17  Pedro Alves  <palves@redhat.com>
98
99         * win32-low.c (handle_output_debug_string): Remove parameter.
100         (win32_kill): Remove our_status local and adjust call to
101         handle_output_debug_string.
102         (get_child_debug_event): Adjust call to
103         handle_output_debug_string.
104
105 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
106
107         * linux-mips-low.c (mips_fill_gregset): Add cast.
108         (mips_store_gregset): Likewise.
109         (mips_fill_fpregset): Likewise.
110         (mips_store_fpregset): Likewise.
111
112 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
113
114         * linux-mips-low.c (mips_add_watchpoint): Rename private to
115         priv.
116
117 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
118
119         * linux-mips-low.c (mips_linux_new_thread): Change type of
120         watch_type to enum target_hw_bp_type.
121
122 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
123
124                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
125                 Change return type to arm_hwbp_type.
126
127 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
128
129         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
130         (arm_store_gregset): Likewise.
131         * linux-arm-low.c (arm_get_hwcap): Likewise.
132         (arm_read_description): Likewise.
133
134 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
135
136         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
137
138 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
139
140         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
141         (ppc_fill_vsxregset): Likewise.
142         (ppc_store_vsxregset): Likewise.
143         (ppc_fill_vrregset): Likewise.
144         (ppc_store_vrregset): Likewise.
145         (ppc_fill_evrregset): Likewise.
146         (ppc_store_evrregset): Likewise.
147
148 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
149
150         * linux-ppc-low.c (ppc_usrregs_info): Remove
151         forward-declaration.
152         (ppc_arch_setup): Move lower in file.
153
154 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
155
156         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
157         (ps_pdwrite): Likewise.
158
159 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
160
161         * linux-arm-low.c (arm_new_thread): Move pointer dereference
162         to after assert checks.
163
164 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
165
166         * proc-service.c (ps_pdread): Add/adjust casts.
167         (ps_pdwrite): Add/adjust casts.
168
169 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
170
171         * server.c (handle_search_memory_1): Cast return value of
172         memmem.
173
174 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
175
176         * server.c (write_qxfer_response): Change type of data to
177         gdb_byte *.
178
179 2015-10-29  Pedro Alves  <palves@redhat.com>
180
181         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
182
183 2015-10-29  Pedro Alves  <palves@redhat.com>
184
185         * tracepoint.c (clear_installed_tracepoints): Add casts.
186
187 2015-10-29  Pedro Alves  <palves@redhat.com>
188
189         * server.c (handle_v_cont, process_serial_event): Add enum
190         gdb_signal casts to signal parsing code.
191
192 2015-10-29  Pedro Alves  <palves@redhat.com>
193
194         * linux-low.h (NULL_REGSET): Define.
195         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
196         * linux-arm-low.c (arm_regsets): Likewise.
197         * linux-crisv32-low.c (cris_regsets): Likewise.
198         * linux-m68k-low.c (m68k_regsets): Likewise.
199         * linux-mips-low.c (mips_regsets): Likewise.
200         * linux-nios2-low.c (nios2_regsets): Likewise.
201         * linux-ppc-low.c (ppc_regsets): Likewise.
202         * linux-s390-low.c (s390_regsets): Likewise.
203         * linux-sh-low.c (sh_regsets): Likewise.
204         * linux-sparc-low.c (sparc_regsets): Likewise.
205         * linux-tic6x-low.c (tic6x_regsets): Likewise.
206         * linux-tile-low.c (tile_regsets): Likewise.
207         * linux-x86-low.c (x86_regsets): Likewise.
208         * linux-xtensa-low.c (xtensa_regsets): Likewise.
209
210 2015-10-29  Pedro Alves  <palves@redhat.com>
211
212         * linux-low.h (NULL_REGSET): Define.
213         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
214         * linux-arm-low.c (arm_regsets): Likewise.
215         * linux-crisv32-low.c (cris_regsets): Likewise.
216         * linux-m68k-low.c (m68k_regsets): Likewise.
217         * linux-mips-low.c (mips_regsets): Likewise.
218         * linux-nios2-low.c (nios2_regsets): Likewise.
219         * linux-ppc-low.c (ppc_regsets): Likewise.
220         * linux-s390-low.c (s390_regsets): Likewise.
221         * linux-sh-low.c (sh_regsets): Likewise.
222         * linux-sparc-low.c (sparc_regsets): Likewise.
223         * linux-tic6x-low.c (tic6x_regsets): Likewise.
224         * linux-tile-low.c (tile_regsets): Likewise.
225         * linux-x86-low.c (x86_regsets): Likewise.
226         * linux-xtensa-low.c (xtensa_regsets): Likewise.
227
228 2015-10-26  Doug Evans  <dje@google.com>
229
230         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
231
232 2015-10-26  Doug Evans  <dje@google.com>
233
234         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
235
236 2015-10-26  Doug Evans  <dje@google.com>
237
238         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
239         for debug_printf.
240         (attach_thread, find_new_threads_callback): Ditto.
241
242 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
243
244         * mem-break.h (set_breakpoint_data): Remove.
245
246 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
247
248         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
249         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
250         (initialize_low): Remove set_breakpoint_data call.
251         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
252         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
253         (initialize_low): Remove set_breakpoint_data call.
254         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
255         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
256         (initialize_low): Remove set_breakpoint_data call.
257
258 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
259
260         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
261         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
262         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
263         * target.h (target_breakpoint_kind_from_pc): New macro.
264
265 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
266
267         * linux-low.c (default_breakpoint_kind_from_pc): New function.
268         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
269         the default breakpoint kind.
270
271 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
272
273         * linux-arm-low.c (arm_supports_z_point_type): Add software
274         breakpoint support.
275
276 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
277
278         * linux-arm-low.c: Refactor breakpoint definitions.
279         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
280         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
281
282 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
283
284         * Makefile.in: Add arm.c/o.
285         * configure.srv: Likewise.
286         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
287         (arm_breakpoint_kind_from_pc): New function.
288         (arm_sw_breakpoint_from_kind): Return proper kind.
289         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
290
291 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
292
293         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
294         removal.
295         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
296         (struct raw_breakpoint) <size>: Remove.
297         (struct raw_breakpoint) <kind>: Add.
298         (bp_size): New function.
299         (bp_opcode): Likewise.
300         (find_raw_breakpoint_at): Adjust for kind.
301         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
302         (remove_memory_breakpoint): Adjust for kind call bp_size.
303         (set_raw_breakpoint_at): Adjust for kind.
304         (set_breakpoint): Likewise.
305         (set_breakpoint_at): Call breakpoint_kind_from_pc.
306         (delete_raw_breakpoint): Adjust for kind.
307         (delete_breakpoint): Likewise.
308         (find_gdb_breakpoint): Likewise.
309         (set_gdb_breakpoint_1): Likewise.
310         (set_gdb_breakpoint): Likewise.
311         (delete_gdb_breakpoint_1): Likewise.
312         (delete_gdb_breakpoint): Likewise.
313         (uninsert_raw_breakpoint): Likewise.
314         (reinsert_raw_breakpoint): Likewise.
315         (set_breakpoint_data): Remove.
316         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
317         (check_mem_read): Adjust for kind call bp_size.
318         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
319         (clone_one_breakpoint): Adjust for kind.
320         * mem-break.h (set_gdb_breakpoint): Likewise.
321         (delete_gdb_breakpoint): Likewise.
322         * server.c (process_serial_event): Likewise.
323
324 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
325
326         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
327         (struct linux_target_ops) <breakpoint>: Remove.
328         (struct linux_target_ops) <breakpoint_len>: Remove.
329         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
330         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
331         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
332         (arm_sw_breakpoint_from_kind): New function.
333         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
334         (struct linux_target_ops) <breakpoint>: Remove.
335         (struct linux_target_ops) <breakpoint_len>: Remove.
336         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
337         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
338         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
339         (struct linux_target_ops) <breakpoint>: Remove.
340         (struct linux_target_ops) <breakpoint_len>: Remove.
341         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
342         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
343         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
344         (struct linux_target_ops) <breakpoint>: Remove.
345         (struct linux_target_ops) <breakpoint_len>: Remove.
346         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
347         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
348         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
349         and sw_breakpoint_from_kind to increment the pc.
350         (linux_breakpoint_kind_from_pc): New function.
351         (linux_sw_breakpoint_from_kind): New function.
352         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
353         (initialize_low): Call breakpoint_kind_from_pc and
354         sw_breakpoint_from_kind to replace breakpoint_data/len.
355         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
356         New field.
357         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
358         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
359         (struct linux_target_ops) <breakpoint>: Remove.
360         (struct linux_target_ops) <breakpoint_len>: Remove.
361         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
362         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
363         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
364         (struct linux_target_ops) <breakpoint>: Remove.
365         (struct linux_target_ops) <breakpoint_len>: Remove.
366         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
367         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
368         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
369         (struct linux_target_ops) <breakpoint>: Remove.
370         (struct linux_target_ops) <breakpoint_len>: Remove.
371         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
372         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
373         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
374         (struct linux_target_ops) <breakpoint>: Remove.
375         (struct linux_target_ops) <breakpoint_len>: Remove.
376         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
377         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
378         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
379         (struct linux_target_ops) <breakpoint>: Remove.
380         (struct linux_target_ops) <breakpoint_len>: Remove.
381         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
382         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
383         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
384         (struct linux_target_ops) <breakpoint>: Remove.
385         (struct linux_target_ops) <breakpoint_len>: Remove.
386         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
387         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
388         * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
389         (struct linux_target_ops) <breakpoint>: Remove.
390         (struct linux_target_ops) <breakpoint_len>: Remove.
391         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
392         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
393         * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
394         (struct linux_target_ops) <breakpoint>: Remove.
395         (struct linux_target_ops) <breakpoint_len>: Remove.
396         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
397         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
398         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
399         (struct linux_target_ops) <breakpoint>: Remove.
400         (struct linux_target_ops) <breakpoint_len>: Remove.
401         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
402         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
403         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
404         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
405         (struct linux_target_ops) <breakpoint>: Remove.
406         (struct linux_target_ops) <breakpoint_len>: Remove.
407         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
408         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
409         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
410         (struct linux_target_ops) <breakpoint>: Remove.
411         (struct linux_target_ops) <breakpoint_len>: Remove.
412         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
413         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
414
415 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
416
417         * linux-cris-low.c (cris_get_pc): Remove void arg.
418
419 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
420
421         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
422         variable name.
423
424 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
425
426         * inferiors.c (thread_pid_matches_callback): New function.
427         (find_thread_process): New function.
428         (remove_thread): Reset current_thread.
429         (remove_process): Assert threads have been removed first.
430
431 2015-10-15  Yao Qi  <yao.qi@linaro.org>
432
433         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
434         if it is 3.
435         (aarch64_remove_point): Likewise.
436         * regcache.c (regcache_register_size): New function.
437
438 2015-10-12  Yao Qi  <yao.qi@linaro.org>
439
440         * linux-aarch64-low.c: Update all callers as emit_load_store
441         is renamed to aarch64_emit_load_store.
442
443 2015-10-12  Yao Qi  <yao.qi@linaro.org>
444
445         * linux-aarch64-low.c: Update all callers of function renaming
446         from emit_insn to aarch64_emit_insn.
447
448 2015-10-12  Yao Qi  <yao.qi@linaro.org>
449
450         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
451         arch/aarch64-insn.h.
452         (struct aarch64_memory_operand): Likewise.
453         (ENCODE): Likewise.
454         (emit_insn): Move to arch/aarch64-insn.c.
455         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
456         (emit_load_store): Move to arch/aarch64-insn.c.
457         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
458         (can_encode_int32): Remove.
459
460 2015-10-12  Yao Qi  <yao.qi@linaro.org>
461
462         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
463         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
464         (aarch64_relocate_instruction): Likewise.
465         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
466         (struct aarch64_insn_visitor): Likewise.
467
468 2015-10-12  Yao Qi  <yao.qi@linaro.org>
469
470         * linux-aarch64-low.c (struct aarch64_insn_data): New.
471         (struct aarch64_insn_visitor): New.
472         (struct aarch64_insn_relocation_data): New.
473         (aarch64_ftrace_insn_reloc_b): New function.
474         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
475         (aarch64_ftrace_insn_reloc_cb): Likewise.
476         (aarch64_ftrace_insn_reloc_tb): Likewise.
477         (aarch64_ftrace_insn_reloc_adr): Likewise.
478         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
479         (aarch64_ftrace_insn_reloc_others): Likewise.
480         (visitor): New.
481         (aarch64_relocate_instruction): Use visitor.
482
483 2015-10-12  Yao Qi  <yao.qi@linaro.org>
484
485         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
486         int.  Add argument buf.
487         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
488         aarch64_relocate_instruction.
489
490 2015-10-12  Yao Qi  <yao.qi@linaro.org>
491
492         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
493         argument insn.  Remove local variable insn.  Don't call
494         target_read_uint32.
495         (aarch64_install_fast_tracepoint_jump_pad): Call
496         target_read_uint32.
497
498 2015-09-30  Yao Qi  <yao.qi@linaro.org>
499
500         * linux-aarch64-low.c (emit_movk): Shorten a long line.
501         (emit_load_store_pair): Likewise.
502
503 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
504
505         * dll.c (match_dll): Add cast(s).
506         (unloaded_dll): Likewise.
507         * linux-low.c (second_thread_of_pid_p): Likewise.
508         (delete_lwp_callback): Likewise.
509         (count_events_callback): Likewise.
510         (select_event_lwp_callback): Likewise.
511         (linux_set_resume_request): Likewise.
512         * server.c (accumulate_file_name_length): Likewise.
513         (emit_dll_description): Likewise.
514         (handle_qxfer_threads_worker): Likewise.
515         (visit_actioned_threads): Likewise.
516         * thread-db.c (any_thread_of): Likewise.
517         * tracepoint.c (same_process_p): Likewise.
518         (match_blocktype): Likewise.
519         (build_traceframe_info_xml): Likewise.
520
521 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
522
523         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
524         assignment.
525         (gdb_unparse_agent_expr): Likewise.
526         * hostio.c (require_data): Likewise.
527         (handle_pread): Likewise.
528         * linux-low.c (disable_regset): Likewise.
529         (fetch_register): Likewise.
530         (store_register): Likewise.
531         (get_dynamic): Likewise.
532         (linux_qxfer_libraries_svr4): Likewise.
533         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
534         (set_fast_tracepoint_jump): Likewise.
535         (uninsert_fast_tracepoint_jumps_at): Likewise.
536         (reinsert_fast_tracepoint_jumps_at): Likewise.
537         (validate_inserted_breakpoint): Likewise.
538         (clone_agent_expr): Likewise.
539         * regcache.c (init_register_cache): Likewise.
540         * remote-utils.c (putpkt_binary_1): Likewise.
541         (decode_M_packet): Likewise.
542         (decode_X_packet): Likewise.
543         (look_up_one_symbol): Likewise.
544         (relocate_instruction): Likewise.
545         (monitor_output): Likewise.
546         * server.c (handle_search_memory): Likewise.
547         (handle_qxfer_exec_file): Likewise.
548         (handle_qxfer_libraries): Likewise.
549         (handle_qxfer): Likewise.
550         (handle_query): Likewise.
551         (handle_v_cont): Likewise.
552         (handle_v_run): Likewise.
553         (captured_main): Likewise.
554         * target.c (write_inferior_memory): Likewise.
555         * thread-db.c (try_thread_db_load_from_dir): Likewise.
556         * tracepoint.c (init_trace_buffer): Likewise.
557         (add_tracepoint_action): Likewise.
558         (add_traceframe): Likewise.
559         (add_traceframe_block): Likewise.
560         (cmd_qtdpsrc): Likewise.
561         (cmd_qtdv): Likewise.
562         (cmd_qtstatus): Likewise.
563         (response_source): Likewise.
564         (response_tsv): Likewise.
565         (cmd_qtnotes): Likewise.
566         (gdb_collect): Likewise.
567         (initialize_tracepoint): Likewise.
568
569 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
570
571         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
572         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
573         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
574         <NOP>: New.
575         (enum aarch64_condition_codes): New enum.
576         (w0): New static global.
577         (fp): Likewise.
578         (lr): Likewise.
579         (struct aarch64_memory_operand) <type>: New
580         MEMORY_OPERAND_POSTINDEX type.
581         (postindex_memory_operand): New helper function.
582         (emit_ret): New function.
583         (emit_load_store_pair): New function, factored out of emit_stp
584         with support for MEMORY_OPERAND_POSTINDEX.
585         (emit_stp): Rewrite using emit_load_store_pair.
586         (emit_ldp): New function.
587         (emit_load_store): Likewise.
588         (emit_ldr): Mention post-index instruction in comment.
589         (emit_ldrh): New function.
590         (emit_ldrb): New function.
591         (emit_ldrsw): Mention post-index instruction in comment.
592         (emit_str): Likewise.
593         (emit_subs): New function.
594         (emit_cmp): Likewise.
595         (emit_and): Likewise.
596         (emit_orr): Likewise.
597         (emit_orn): Likewise.
598         (emit_eor): Likewise.
599         (emit_mvn): Likewise.
600         (emit_lslv): Likewise.
601         (emit_lsrv): Likewise.
602         (emit_asrv): Likewise.
603         (emit_mul): Likewise.
604         (emit_sbfm): Likewise.
605         (emit_sbfx): Likewise.
606         (emit_ubfm): Likewise.
607         (emit_ubfx): Likewise.
608         (emit_csinc): Likewise.
609         (emit_cset): Likewise.
610         (emit_nop): Likewise.
611         (emit_ops_insns): New helper function.
612         (emit_pop): Likewise.
613         (emit_push): Likewise.
614         (aarch64_emit_prologue): New function.
615         (aarch64_emit_epilogue): Likewise.
616         (aarch64_emit_add): Likewise.
617         (aarch64_emit_sub): Likewise.
618         (aarch64_emit_mul): Likewise.
619         (aarch64_emit_lsh): Likewise.
620         (aarch64_emit_rsh_signed): Likewise.
621         (aarch64_emit_rsh_unsigned): Likewise.
622         (aarch64_emit_ext): Likewise.
623         (aarch64_emit_log_not): Likewise.
624         (aarch64_emit_bit_and): Likewise.
625         (aarch64_emit_bit_or): Likewise.
626         (aarch64_emit_bit_xor): Likewise.
627         (aarch64_emit_bit_not): Likewise.
628         (aarch64_emit_equal): Likewise.
629         (aarch64_emit_less_signed): Likewise.
630         (aarch64_emit_less_unsigned): Likewise.
631         (aarch64_emit_ref): Likewise.
632         (aarch64_emit_if_goto): Likewise.
633         (aarch64_emit_goto): Likewise.
634         (aarch64_write_goto_address): Likewise.
635         (aarch64_emit_const): Likewise.
636         (aarch64_emit_call): Likewise.
637         (aarch64_emit_reg): Likewise.
638         (aarch64_emit_pop): Likewise.
639         (aarch64_emit_stack_flush): Likewise.
640         (aarch64_emit_zero_ext): Likewise.
641         (aarch64_emit_swap): Likewise.
642         (aarch64_emit_stack_adjust): Likewise.
643         (aarch64_emit_int_call_1): Likewise.
644         (aarch64_emit_void_call_2): Likewise.
645         (aarch64_emit_eq_goto): Likewise.
646         (aarch64_emit_ne_goto): Likewise.
647         (aarch64_emit_lt_goto): Likewise.
648         (aarch64_emit_le_goto): Likewise.
649         (aarch64_emit_gt_goto): Likewise.
650         (aarch64_emit_ge_got): Likewise.
651         (aarch64_emit_ops_impl): New static global variable.
652         (aarch64_emit_ops): New target function, return
653         &aarch64_emit_ops_impl.
654         (struct linux_target_ops): Install it.
655
656 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
657
658         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
659         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
660         aarch64-ipa.o.
661         * linux-aarch64-ipa.c: New file.
662         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
663         and endian.h.
664         (aarch64_get_thread_area): New target method.
665         (extract_signed_bitfield): New helper function.
666         (aarch64_decode_ldr_literal): New function.
667         (enum aarch64_opcodes): New enum.
668         (struct aarch64_register): New struct.
669         (struct aarch64_operand): New struct.
670         (x0): New static global.
671         (x1): Likewise.
672         (x2): Likewise.
673         (x3): Likewise.
674         (x4): Likewise.
675         (w2): Likewise.
676         (ip0): Likewise.
677         (sp): Likewise.
678         (xzr): Likewise.
679         (aarch64_register): New helper function.
680         (register_operand): Likewise.
681         (immediate_operand): Likewise.
682         (struct aarch64_memory_operand): New struct.
683         (offset_memory_operand): New helper function.
684         (preindex_memory_operand): Likewise.
685         (enum aarch64_system_control_registers): New enum.
686         (ENCODE): New macro.
687         (emit_insn): New helper function.
688         (emit_b): New function.
689         (emit_bcond): Likewise.
690         (emit_cb): Likewise.
691         (emit_tb): Likewise.
692         (emit_blr): Likewise.
693         (emit_stp): Likewise.
694         (emit_ldp_q_offset): Likewise.
695         (emit_stp_q_offset): Likewise.
696         (emit_load_store): Likewise.
697         (emit_ldr): Likewise.
698         (emit_ldrsw): Likewise.
699         (emit_str): Likewise.
700         (emit_ldaxr): Likewise.
701         (emit_stxr): Likewise.
702         (emit_stlr): Likewise.
703         (emit_data_processing_reg): Likewise.
704         (emit_data_processing): Likewise.
705         (emit_add): Likewise.
706         (emit_sub): Likewise.
707         (emit_mov): Likewise.
708         (emit_movk): Likewise.
709         (emit_mov_addr): Likewise.
710         (emit_mrs): Likewise.
711         (emit_msr): Likewise.
712         (emit_sevl): Likewise.
713         (emit_wfe): Likewise.
714         (append_insns): Likewise.
715         (can_encode_int32_in): New helper function.
716         (aarch64_relocate_instruction): New function.
717         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
718         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
719         (struct linux_target_ops): Install aarch64_get_thread_area,
720         aarch64_install_fast_tracepoint_jump_pad and
721         aarch64_get_min_fast_tracepoint_insn_len.
722
723 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
724
725         * Makefile.in (aarch64-insn.o): New rule.
726         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
727
728 2015-09-21  Yao Qi  <yao.qi@linaro.org>
729
730         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
731
732 2015-09-21  Yao Qi  <yao.qi@linaro.org>
733
734         * tracepoint.c (max_jump_pad_size): Remove.
735
736 2015-09-18  Yao Qi  <yao.qi@linaro.org>
737
738         * linux-aarch64-low.c: Don't include sys/uio.h.
739         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
740
741 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
742
743         * tracepoint.c (eval_result_type): Change prototype.
744         (condition_true_at_tracepoint): Fix argument to compiled_cond.
745
746 2015-09-15  Pedro Alves  <palves@redhat.com>
747
748         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
749         Check whether to report exec events instead of checking whether
750         multiprocess is enabled.
751
752 2015-09-15  Pedro Alves  <palves@redhat.com>
753
754         PR remote/18965
755         * remote-utils.c (prepare_resume_reply): Merge
756         TARGET_WAITKIND_VFORK_DONE switch case with the
757         TARGET_WAITKIND_FORKED case.
758
759 2015-09-15  Yao Qi  <yao.qi@linaro.org>
760
761         * server.c (handle_query): Check string comparison using
762         "else if" instead of "if".
763
764 2015-09-15  Yao Qi  <yao.qi@linaro.org>
765
766         * server.c (vCont_supported): New global variable.
767         (handle_query): Set vCont_supported to 1 if "vContSupported+"
768         matches.  Append ";vContSupported+" to own_buf.
769         (handle_v_requests): Append ";s;S" to own_buf if target supports
770         hardware single step or vCont_supported is false.
771         (capture_main): Set vCont_supported to zero.
772
773 2015-09-15  Yao Qi  <yao.qi@linaro.org>
774
775         * linux-low.c (linux_supports_conditional_breakpoints): Rename
776         it to ...
777         (linux_supports_hardware_single_step): ... New function.
778         (linux_target_ops): Update.
779         * lynx-low.c (lynx_target_ops): Set field
780         supports_hardware_single_step to target_can_do_hardware_single_step.
781         * nto-low.c (nto_target_ops): Likewise.
782         * spu-low.c (spu_target_ops): Likewise.
783         * win32-low.c (win32_target_ops): Likewise.
784         * target.c (target_can_do_hardware_single_step): New function.
785         * target.h (struct target_ops) <supports_conditional_breakpoints>:
786         Remove.  <supports_hardware_single_step>: New field.
787         (target_supports_conditional_breakpoints): Remove.
788         (target_supports_hardware_single_step): New macro.
789         (target_can_do_hardware_single_step): Declare.
790         * server.c (handle_query): Use target_supports_hardware_single_step
791         instead of target_supports_conditional_breakpoints.
792
793 2015-09-15  Yao Qi  <yao.qi@linaro.org>
794
795         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
796         function.
797         (struct linux_target_ops the_low_target): Install
798         aarch64_linux_siginfo_fixup.
799
800 2015-09-11  Don Breazeal  <donb@codesourcery.com>
801             Luis Machado  <lgustavo@codesourcery.com>
802
803         * linux-low.c (linux_mourn): Static declaration.
804         (linux_arch_setup): Move in front of
805         handle_extended_wait.
806         (linux_arch_setup_thread): New function.
807         (handle_extended_wait): Handle exec events.  Call
808         linux_arch_setup_thread.  Make event_lwp argument a
809         pointer-to-a-pointer.
810         (check_zombie_leaders): Do not check stopped threads.
811         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
812         (linux_low_filter_event): Add lwp and thread for exec'ing
813         non-leader thread if leader thread has been deleted.
814         Refactor code into linux_arch_setup_thread and call it.
815         Pass child lwp pointer by reference to handle_extended_wait.
816         (linux_wait_for_event_filtered): Update comment.
817         (linux_wait_1): Prevent clobbering exec event status.
818         (linux_supports_exec_events): New function.
819         (linux_target_ops) <supports_exec_events>: Initialize new member.
820         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
821         new member.
822         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
823         * server.c (report_exec_events): New global variable.
824         (handle_query): Handle qSupported query for exec-events feature.
825         (captured_main): Initialize report_exec_events.
826         * server.h (report_exec_events): Declare new global variable.
827         * target.h (struct target_ops) <supports_exec_events>: New
828         member.
829         (target_supports_exec_events): New macro.
830         * win32-low.c (win32_target_ops) <supports_exec_events>:
831         Initialize new member.
832
833 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
834
835         * linux-low.c (linux_low_enable_btrace): Remove.
836         (linux_target_ops): Replace linux_low_enable_btrace with
837         linux_enable_btrace.
838
839 2015-09-03  Yao Qi  <yao.qi@linaro.org>
840
841         * linux-aarch64-low.c (aarch64_insert_point): Call
842         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
843         returns true.
844
845 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
846
847         * linux-low.c (check_stopped_by_breakpoint): Use
848         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
849
850 2015-08-27  Pedro Alves  <palves@redhat.com>
851
852         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
853
854 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
855
856         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
857         the XNEW-family equivalent.
858         (compile_bytecodes): Likewise.
859         * dll.c (loaded_dll): Likewise.
860         * event-loop.c (append_callback_event): Likewise.
861         (create_file_handler): Likewise.
862         (create_file_event): Likewise.
863         * hostio.c (handle_open): Likewise.
864         * inferiors.c (add_thread): Likewise.
865         (add_process): Likewise.
866         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
867         * linux-arm-low.c (arm_new_process): Likewise.
868         (arm_new_thread): Likewise.
869         * linux-low.c (add_to_pid_list): Likewise.
870         (linux_add_process): Likewise.
871         (handle_extended_wait): Likewise.
872         (add_lwp): Likewise.
873         (enqueue_one_deferred_signal): Likewise.
874         (enqueue_pending_signal): Likewise.
875         (linux_resume_one_lwp_throw): Likewise.
876         (linux_resume_one_thread): Likewise.
877         (linux_read_memory): Likewise.
878         (linux_write_memory): Likewise.
879         * linux-mips-low.c (mips_linux_new_process): Likewise.
880         (mips_linux_new_thread): Likewise.
881         (mips_add_watchpoint): Likewise.
882         * linux-x86-low.c (initialize_low_arch): Likewise.
883         * lynx-low.c (lynx_add_process): Likewise.
884         * mem-break.c (set_raw_breakpoint_at): Likewise.
885         (set_breakpoint): Likewise.
886         (add_condition_to_breakpoint): Likewise.
887         (add_commands_to_breakpoint): Likewise.
888         (clone_agent_expr): Likewise.
889         (clone_one_breakpoint): Likewise.
890         * regcache.c (new_register_cache): Likewise.
891         * remote-utils.c (look_up_one_symbol): Likewise.
892         * server.c (queue_stop_reply): Likewise.
893         (start_inferior): Likewise.
894         (queue_stop_reply_callback): Likewise.
895         (handle_target_event): Likewise.
896         * spu-low.c (fetch_ppc_memory): Likewise.
897         (store_ppc_memory): Likewise.
898         * target.c (set_target_ops): Likewise.
899         * thread-db.c (thread_db_load_search): Likewise.
900         (try_thread_db_load_1): Likewise.
901         * tracepoint.c (add_tracepoint): Likewise.
902         (add_tracepoint_action): Likewise.
903         (create_trace_state_variable): Likewise.
904         (cmd_qtdpsrc): Likewise.
905         (cmd_qtro): Likewise.
906         (add_while_stepping_state): Likewise.
907         * win32-low.c (child_add_thread): Likewise.
908         (get_image_name): Likewise.
909
910 2015-08-25  Yao Qi  <yao.qi@linaro.org>
911
912         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
913
914 2015-08-25  Yao Qi  <yao.qi@linaro.org>
915
916         * Makefile.in (aarch64-linux.o): New rule.
917         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
918         srv_tgtobj.
919         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
920         (aarch64_init_debug_reg_state): Make it extern.
921         (aarch64_linux_prepare_to_resume): Remove.
922
923 2015-08-25  Yao Qi  <yao.qi@linaro.org>
924
925         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
926         lwp_arch_private_info and ptid_of_lwp.
927
928 2015-08-25  Yao Qi  <yao.qi@linaro.org>
929
930         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
931         Find proc_info by find_process_pid.  All callers updated.
932
933 2015-08-25  Yao Qi  <yao.qi@linaro.org>
934
935         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
936         Remove.
937         (debug_reg_change_callback): Remove.
938         (aarch64_notify_debug_reg_change): Remove.
939
940 2015-08-25  Yao Qi  <yao.qi@linaro.org>
941
942         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
943         Call current_lwp_ptid.
944
945 2015-08-25  Yao Qi  <yao.qi@linaro.org>
946
947         * linux-aarch64-low.c (debug_reg_change_callback): Use
948         debug_printf.
949
950 2015-08-25  Yao Qi  <yao.qi@linaro.org>
951
952         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
953
954 2015-08-25  Yao Qi  <yao.qi@linaro.org>
955
956         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
957
958 2015-08-25  Yao Qi  <yao.qi@linaro.org>
959
960         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
961         the code.
962
963 2015-08-25  Yao Qi  <yao.qi@linaro.org>
964
965         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
966         Remove.
967         (debug_reg_change_callback): Remove argument entry and add argument
968         lwp.  Remove local variable thread.  Don't print thread id in the
969         debugging output.  Don't check whether pid of thread equals to pid.
970         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
971         iterate_over_lwps instead find_inferior.
972
973 2015-08-24  Pedro Alves  <palves@redhat.com>
974
975         * inferiors.c (get_first_process): New function.
976         * inferiors.h (get_first_process): New declaration.
977         * remote-utils.c (read_ptid): Default to the first process in the
978         list, instead of to the current thread's process.
979
980 2015-08-24  Pedro Alves  <palves@redhat.com>
981
982         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
983         * event-loop.c: Likewise.
984         * remote-utils.c: Likewise.
985         * tracepoint.c: Likewise.
986
987 2015-08-24  Pedro Alves  <palves@redhat.com>
988
989         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
990         ptid_get_lwp.
991
992 2015-08-21  Pedro Alves  <palves@redhat.com>
993
994         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
995         instead of literal 1.
996
997 2015-08-21  Pedro Alves  <palves@redhat.com>
998
999         * tdesc.c (default_description): Explicitly zero-initialize.
1000
1001 2015-08-21  Pedro Alves  <palves@redhat.com>
1002
1003         PR gdb/18749
1004         * inferiors.c (remove_thread): Discard any pending stop reply for
1005         this thread.
1006         * server.c (remove_all_on_match_pid): Rename to ...
1007         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1008         instead of a pid.
1009         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1010         extern.
1011         (handle_v_kill, kill_inferior_callback, captured_main)
1012         (process_serial_event): Adjust.
1013         * server.h (discard_queued_stop_replies): Declare.
1014
1015 2015-08-21  Pedro Alves  <palves@redhat.com>
1016
1017         * linux-low.c (wait_for_sigstop): Always switch to no thread
1018         selected if the previously current thread dies.
1019         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1020         process instead of the current thread's.
1021         * remote-utils.c (input_interrupt): Don't check if there's no
1022         current thread.
1023         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1024         current thread to the general thread fails, error out.
1025         (handle_qxfer_auxv, handle_qxfer_libraries)
1026         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1027         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1028         (handle_query): Check if there's a thread selected instead of
1029         checking whether there's any thread in the thread list.
1030         (handle_qxfer_threads, handle_qxfer_btrace)
1031         (handle_qxfer_btrace_conf): Don't error out early if there's no
1032         thread in the thread list.
1033         (handle_v_cont, myresume): Don't set the current thread to the
1034         continue thread.
1035         (process_serial_event) <Hg handling>: Also set thread_id if the
1036         previous general thread is still alive.
1037         (process_serial_event) <g/G handling>: If setting the current
1038         thread to the general thread fails, error out.
1039         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1040         thread's lwp instead of the current thread's.
1041         * target.c (set_desired_thread): If the desired thread was not
1042         found, leave the current thread pointing to NULL.  Return an int
1043         (boolean) indicating success.
1044         * target.h (set_desired_thread): Change return type to int.
1045
1046 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1047
1048         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1049         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1050         #includes.
1051         (ps_get_thread_area): New function.
1052
1053 2015-08-19  Gary Benson  <gbenson@redhat.com>
1054
1055         * hostio.c (handle_pread): Do not attempt to read more data
1056         than hostio_reply_with_data can fit in a packet.
1057
1058 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1059
1060         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1061
1062 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1063
1064         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1065
1066 2015-08-06  Pedro Alves  <palves@redhat.com>
1067
1068         * tracepoint.c (expr_eval_result): Now an int.
1069
1070 2015-08-06  Pedro Alves  <palves@redhat.com>
1071
1072         * gdbthread.h (struct regcache): Forward declare.
1073         (struct thread_info) <regcache_data>: Now a struct regcache
1074         pointer.
1075         * inferiors.c (inferior_regcache_data)
1076         (set_inferior_regcache_data): Now work with struct regcache
1077         pointers.
1078         * inferiors.h (struct regcache): Forward declare.
1079         (inferior_regcache_data, set_inferior_regcache_data): Now work
1080         with struct regcache pointers.
1081         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1082         (free_register_cache_thread): Remove struct regcache pointer
1083         casts.
1084
1085 2015-08-06  Pedro Alves  <palves@redhat.com>
1086
1087         * server.c (captured_main): On error, print the exception message
1088         to stderr, and if run_once is set, throw a quit.
1089
1090 2015-08-06  Pedro Alves  <palves@redhat.com>
1091
1092         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1093         the current thread.
1094
1095 2015-08-06  Pedro Alves  <palves@redhat.com>
1096
1097         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1098         reading beyond the passed in buffer length.
1099
1100 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1101
1102         * tracepoint.c (symbol_list) <required>: Remove.
1103
1104 2015-08-06  Pedro Alves  <palves@redhat.com>
1105
1106         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1107         count if stopping and suspending threads.
1108         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1109         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1110         (linux_detach): Complete an ongoing step-over.
1111         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1112         throughout.
1113         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1114         (linux_wait_1): If passing a signal to the inferior after
1115         finishing a step-over, unsuspend and re-resume all lwps.  If we
1116         see a single-step event but the thread should be continuing, don't
1117         pass the trap to gdb.
1118         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1119         internal_error instead of gdb_assert.
1120         (enqueue_pending_signal): New function.
1121         (check_ptrace_stopped_lwp_gone): Add debug output.
1122         (start_step_over): Use internal_error instead of gdb_assert.
1123         (complete_ongoing_step_over): New function.
1124         (linux_resume_one_thread): Don't resume a suspended thread.
1125         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1126         it stepping.
1127
1128 2015-08-06  Pedro Alves  <palves@redhat.com>
1129
1130         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1131         (linux_thread_alive): Use lwp_is_marked_dead.
1132         (extended_event_reported): Delete.
1133         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1134         instead of extended_event_reported.
1135         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1136         as well.
1137         (lwp_is_marked_dead): New function.
1138         (lwp_running): Use lwp_is_marked_dead.
1139         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1140         comment.
1141
1142 2015-08-06  Pedro Alves  <palves@redhat.com>
1143
1144         * linux-low.c (linux_wait_1): Move fork event output out of the
1145         !report_to_gdb check.  Pass event_child->waitstatus to
1146         target_waitstatus_to_string instead of ourstatus.
1147
1148 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1149
1150         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1151         if current_thread is 32 bit.
1152
1153 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1154
1155         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1156         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1157         * server.c (extended_protocol): Remove "static".
1158         * server.h (extended_protocol): Declare it.
1159
1160 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1161
1162         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1163         both aarch64 and aarch32.
1164         (aarch64_set_pc): Likewise.
1165
1166 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1167
1168         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1169         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1170         arm-with-neon.xml to srv_xmlfiles.
1171         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1172         (is_64bit_tdesc): New function.
1173         (aarch64_linux_read_description): New function.
1174         (aarch64_arch_setup): Call aarch64_linux_read_description.
1175         (regs_info): Rename to regs_info_aarch64.
1176         (aarch64_regs_info): Return right regs_info.
1177         (initialize_low_arch): Call initialize_low_arch_aarch32.
1178
1179 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1180
1181         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1182         * linux-aarch32-low.c: New file.
1183         * linux-aarch32-low.h: New file.
1184         * linux-arm-low.c (arm_fill_gregset): Move it to
1185         linux-aarch32-low.c.
1186         (arm_store_gregset): Likewise.
1187         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1188         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1189         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1190         (regs_info): Rename to regs_info_arm.
1191         (arm_regs_info): Return regs_info_aarch32 if
1192         have_ptrace_getregset is 1 and target description is
1193         arm_with_neon or arm_with_vfpv3.
1194         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1195         Call initialize_low_arch_aarch32 instead.
1196
1197 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1198
1199         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1200         * linux-low.c: ... here.
1201         * linux-low.h (have_ptrace_getregset): Declare it.
1202
1203 2015-08-04  Pedro Alves  <palves@redhat.com>
1204
1205         * thread-db.c (struct thread_db): Use new typedefs.
1206         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1207         CHK calls.
1208         (disable_thread_event_reporting): Cast result of dlsym to
1209         destination function pointer type.
1210         (thread_db_mourn): Use td_ta_delete_ftype.
1211
1212 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1213
1214         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1215         arch variant.
1216         (CDX_BREAKPOINT): Define for R2.
1217         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1218         (the_low_target): Add comments.
1219
1220 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1221
1222         * linux-arm-low.c (arm_hwcap): Remove it.
1223         (arm_read_description): New local variable arm_hwcap.  Don't
1224         set arm_hwcap to zero.
1225
1226 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1227
1228         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1229         Use regcache->tdesc instead.
1230         (arm_store_wmmxregset): Likewise.
1231         (arm_fill_vfpregset): Likewise.
1232         (arm_store_vfpregset): Likewise.
1233
1234 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1235
1236         * linux-arm-low.c: Include arch/arm.h.
1237         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1238         (arm_store_gregset): Likewise.
1239
1240 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1241
1242         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1243         ptrace's 4th parameter.
1244
1245 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1246
1247         * configure.srv (case aarch64*-*-linux*): Don't set
1248         srv_linux_usrregs.
1249
1250 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1251
1252         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1253         sys/ptrace.h.
1254         * linux-arm-low.c: Likewise.
1255         * linux-cris-low.c: Likewise.
1256         * linux-crisv32-low.c: Likewise.
1257         * linux-low.c: Likewise.
1258         * linux-m68k-low.c: Likewise.
1259         * linux-mips-low.c: Likewise.
1260         * linux-nios2-low.c: Likewise.
1261         * linux-s390-low.c: Likewise.
1262         * linux-sparc-low.c: Likewise.
1263         * linux-tic6x-low.c: Likewise.
1264         * linux-tile-low.c: Likewise.
1265         * linux-x86-low.c: Likewise.
1266
1267 2015-07-24  Pedro Alves  <palves@redhat.com>
1268
1269         * config.in: Regenerate.
1270         * configure: Regenerate.
1271
1272 2015-07-24  Pedro Alves  <palves@redhat.com>
1273
1274         * acinclude.m4: Include ../ptrace.m4.
1275         * configure.ac: Call GDB_AC_PTRACE.
1276         * config.in, configure: Regenerate.
1277
1278 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1279
1280         * linux-low.c (linux_create_inferior): Remove setting to
1281         proc->priv->new_inferior.
1282         (linux_attach): Likewise.
1283         (linux_low_filter_event): Likewise.
1284         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1285
1286 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1287
1288         * linux-low.c (linux_arch_setup): New function.
1289         (linux_low_filter_event): If proc->tdesc is NULL and
1290         proc->attached is true, call the_low_target.arch_setup.
1291         Otherwise, keep status pending, and return.
1292         (linux_resume_one_lwp_throw): Don't call get_pc if
1293         thread->while_stepping isn't NULL.  Don't call
1294         get_thread_regcache if proc->tdesc is NULL.
1295         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1296         (linux_target_ops): Install arch_setup.
1297         * server.c (start_inferior): Call the_target->arch_setup.
1298         * target.h (struct target_ops) <arch_setup>: New field.
1299         (target_arch_setup): New marco.
1300         * lynx-low.c (lynx_target_ops): Update.
1301         * nto-low.c (nto_target_ops): Update.
1302         * spu-low.c (spu_target_ops): Update.
1303         * win32-low.c (win32_target_ops): Update.
1304
1305 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1306
1307         * linux-low.c (linux_add_process): Don't set
1308         proc->priv->new_inferior.
1309         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1310         (linux_attach): Likewise.
1311
1312 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1313
1314         * server.c (start_inferior): Code refactor.
1315
1316 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1317
1318         * server.c (process_serial_event): Set general_thread.
1319
1320 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1321
1322         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1323         aarch64_linux_get_debug_reg_capacity.
1324
1325 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1326
1327         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1328         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1329         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1330         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1331         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1332         (AARCH64_HWP_ALIGNMENT): Likewise.
1333         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1334         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1335         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1336         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1337         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1338         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1339         (struct aarch64_debug_reg_state): Likewise.
1340         (struct arch_lwp_info): Likewise.
1341         (aarch64_align_watchpoint): Likewise.
1342         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1343         (aarch64_watchpoint_length): Likewise.
1344         (aarch64_point_encode_ctrl_reg): Likewise
1345         (aarch64_point_is_aligned): Likewise.
1346         (aarch64_align_watchpoint): Likewise.
1347         (aarch64_linux_set_debug_regs):
1348         (aarch64_dr_state_insert_one_point): Likewise.
1349         (aarch64_dr_state_remove_one_point): Likewise.
1350         (aarch64_handle_breakpoint): Likewise.
1351         (aarch64_handle_aligned_watchpoint): Likewise.
1352         (aarch64_handle_unaligned_watchpoint): Likewise.
1353         (aarch64_handle_watchpoint): Likewise.
1354
1355 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1356
1357         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1358         and don't aarch64_get_debug_reg_state.  All callers update.
1359         (aarch64_handle_aligned_watchpoint): Likewise.
1360         (aarch64_handle_unaligned_watchpoint): Likewise.
1361         (aarch64_handle_watchpoint): Likewise.
1362         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1363         (aarch64_remove_point): Likewise.
1364
1365 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1366
1367         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1368         debug_printf.
1369         (aarch64_handle_unaligned_watchpoint): Likewise.
1370
1371 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1372
1373         Revert the previous 3 commits:
1374         Move gdb_regex* to common/
1375         Move linux_find_memory_regions_full & co.
1376         gdbserver build-id attribute generator
1377
1378 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1379             Jan Kratochvil  <jan.kratochvil@redhat.com>
1380
1381         gdbserver build-id attribute generator.
1382         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1383         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1384         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1385         (find_phdr): New.
1386         (get_dynamic): Use find_pdhr to traverse program headers.
1387         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1388         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1389         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
1390         (get_hex_build_id): New.
1391         (linux_qxfer_libraries_svr4): Add optional build-id attribute
1392         to reply XML document.
1393
1394 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1395             Jan Kratochvil  <jan.kratochvil@redhat.com>
1396
1397         * target.c: Include target/target-utils.h and fcntl.h.
1398         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
1399         (target_fileio_read_stralloc): New functions.
1400
1401 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1402
1403         * Makefile.in (OBS): Add gdb_regex.o.
1404         (gdb_regex.o): New.
1405         * config.in: Rebuilt.
1406         * configure: Rebuilt.
1407
1408 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1409             Jan Kratochvil  <jan.kratochvil@redhat.com>
1410
1411         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
1412         * Makefile.in (OBS): Add target-utils.o.
1413         (linux-maps.o, target-utils.o): New.
1414         * configure.srv (srv_linux_obj): Add linux-maps.o.
1415
1416 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
1417
1418         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
1419         function, return 1.
1420         (the_low_target): Install it.
1421
1422 2015-07-14  Pedro Alves  <palves@redhat.com>
1423
1424         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
1425         Instead, ignore ECHILD, and throw an error for other errnos.
1426
1427 2015-07-10  Pedro Alves  <palves@redhat.com>
1428
1429         * event-loop.c (struct callback_event) <data>: Change type to
1430         gdb_client_data instance instead of gdb_client_data pointer.
1431         (append_callback_event): Adjust.
1432
1433 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
1434
1435         * linux-aarch64-low.c: Add comments for each linux_target_ops
1436         method.  Remove comments already covered in target_ops and
1437         linux_target_ops definitions.
1438         (the_low_target): Add comments for each unimplemented method.
1439
1440 2015-07-09  Yao Qi  <yao.qi@linaro.org>
1441
1442         * linux-aarch64-low.c (aarch64_regmap): Remove.
1443         (aarch64_usrregs_info): Remove.
1444         (regs_info): Set field usrregs to NULL.
1445
1446 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
1447
1448         * linux-low.c: Include "rsp-low.h"
1449         (linux_low_encode_pt_config, linux_low_encode_raw): New.
1450         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
1451         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
1452         (handle_btrace_enable_pt): New.
1453         (handle_btrace_general_set): Support "pt".
1454         (handle_btrace_conf_general_set): Support "pt:size".
1455
1456 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1457
1458         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
1459         Z_PACKET_SW_BP.
1460
1461 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1462
1463         * linux-aarch64-low.c: Remove comment about endianness.
1464         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
1465         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
1466         memcmp.
1467
1468 2015-06-24  Gary Benson  <gbenson@redhat.com>
1469
1470         * linux-i386-ipa.c (stdint.h): Do not include.
1471         * lynx-i386-low.c (stdint.h): Likewise.
1472         * lynx-ppc-low.c (stdint.h): Likewise.
1473         * mem-break.c (stdint.h): Likewise.
1474         * thread-db.c (stdint.h): Likewise.
1475         * tracepoint.c (stdint.h): Likewise.
1476         * win32-low.c (stdint.h): Likewise.
1477
1478 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
1479
1480         * server.c (write_qxfer_response): Update call to
1481         remote_escape_output.
1482
1483 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
1484             Jan Kratochvil  <jan.kratochvil@redhat.com>
1485
1486         Merge multiple hex conversions.
1487         * gdbreplay.c (tohex): Rename to 'fromhex'.
1488         (logchar): Use fromhex.
1489
1490 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1491
1492         * server.c (handle_qxfer_libraries): Set `version' attribute for
1493         <library-list>.
1494
1495 2015-06-10  Gary Benson  <gbenson@redhat.com>
1496
1497         * target.h (struct target_ops) <multifs_open>: New field.
1498         <multifs_unlink>: Likewise.
1499         <multifs_readlink>: Likewise.
1500         * linux-low.c (nat/linux-namespaces.h): New include.
1501         (linux_target_ops): Initialize the_target->multifs_open,
1502         the_target->multifs_unlink and the_target->multifs_readlink.
1503         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
1504         * hostio.c (hostio_fs_pid): New static variable.
1505         (hostio_handle_new_gdb_connection): New function.
1506         (handle_setfs): Likewise.
1507         (handle_open): Use the_target->multifs_open as appropriate.
1508         (handle_unlink): Use the_target->multifs_unlink as appropriate.
1509         (handle_readlink): Use the_target->multifs_readlink as
1510         appropriate.
1511         (handle_vFile): Handle vFile:setfs packets.
1512         * server.c (handle_query): Call hostio_handle_new_gdb_connection
1513         after target_handle_new_gdb_connection.
1514
1515 2015-06-10  Gary Benson  <gbenson@redhat.com>
1516
1517         * configure.ac (AC_CHECK_FUNCS): Add setns.
1518         * config.in: Regenerate.
1519         * configure: Likewise.
1520         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
1521         (linux-namespaces.o): New rule.
1522         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
1523
1524 2015-06-09  Gary Benson <gbenson@redhat.com>
1525
1526         * hostio.c (handle_open): Process mode argument with
1527         fileio_to_host_mode.
1528
1529 2015-06-01  Yao Qi  <yao.qi@linaro.org>
1530
1531         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
1532         * linux-x86-low.c: Likewise.
1533
1534 2015-05-28  Don Breazeal  <donb@codesourcery.com>
1535
1536         * linux-low.c (handle_extended_wait): Initialize
1537         thread_info.last_resume_kind for new fork children.
1538
1539 2015-05-15  Pedro Alves  <palves@redhat.com>
1540
1541         * target.h (target_handle_new_gdb_connection): Rewrite using if
1542         wrapped in do/while.
1543
1544 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
1545
1546         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
1547         * configure, config.in: Regenerate.
1548         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
1549         Declare typedef.
1550
1551 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1552
1553         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
1554         PTRACE_EVENT_VFORK_DONE.
1555         (linux_low_ptrace_options, extended_event_reported): Add vfork
1556         events.
1557         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
1558         and "vforkdone" for RSP 'T' Stop Reply Packet.
1559         * server.h (report_vfork_events): Declare
1560         global variable.
1561
1562 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1563
1564         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
1565         (the_low_target) <new_fork>: Initialize new member.
1566         * linux-arm-low.c (arm_new_fork): New function.
1567         (the_low_target) <new_fork>: Initialize new member.
1568         * linux-low.c (handle_extended_wait): Call new target function
1569         new_fork.
1570         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
1571         * linux-mips-low.c (mips_add_watchpoint): New function
1572         extracted from mips_insert_point.
1573         (the_low_target) <new_fork>: Initialize new member.
1574         (mips_linux_new_fork): New function.
1575         (mips_insert_point): Call mips_add_watchpoint.
1576         * linux-x86-low.c (x86_linux_new_fork): New function.
1577         (the_low_target) <new_fork>: Initialize new member.
1578
1579 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1580
1581         * linux-low.c (handle_extended_wait): Implement return value,
1582         rename argument 'event_child' to 'event_lwp', handle
1583         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
1584         (linux_low_ptrace_options): New function.
1585         (linux_low_filter_event): Call linux_low_ptrace_options,
1586         use different argument fo linux_enable_event_reporting,
1587         use return value from handle_extended_wait.
1588         (extended_event_reported): New function.
1589         (linux_wait_1): Call extended_event_reported and set
1590         status to report fork events.
1591         (linux_write_memory): Add pid to debug message.
1592         (reset_lwp_ptrace_options_callback): New function.
1593         (linux_handle_new_gdb_connection): New function.
1594         (linux_target_ops): Initialize new structure member.
1595         * linux-low.h (struct lwp_info) <waitstatus>: New member.
1596         * lynx-low.c: Initialize new structure member.
1597         * remote-utils.c (prepare_resume_reply): Implement stop reason
1598         "fork" for "T" stop message.
1599         * server.c (handle_query): Call handle_new_gdb_connection.
1600         * server.h (report_fork_events): Declare global flag.
1601         * target.h (struct target_ops) <handle_new_gdb_connection>:
1602         New member.
1603         (target_handle_new_gdb_connection): New macro.
1604         * win32-low.c: Initialize new structure member.
1605
1606 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1607
1608         * mem-break.c (APPEND_TO_LIST): Define macro.
1609         (clone_agent_expr): New function.
1610         (clone_one_breakpoint): New function.
1611         (clone_all_breakpoints): New function.
1612         * mem-break.h: Declare new functions.
1613
1614 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1615
1616         * linux-low.c (linux_supports_fork_events): New function.
1617         (linux_supports_vfork_events): New function.
1618         (linux_target_ops): Initialize new structure members.
1619         (initialize_low): Call linux_check_ptrace_features.
1620         * lynx-low.c (lynx_target_ops): Initialize new structure
1621         members.
1622         * server.c (report_fork_events, report_vfork_events):
1623         New global flags.
1624         (handle_query): Add new features to qSupported packet and
1625         response.
1626         (captured_main): Initialize new global variables.
1627         * target.h (struct target_ops) <supports_fork_events>:
1628         New member.
1629         <supports_vfork_events>: New member.
1630         (target_supports_fork_events): New macro.
1631         (target_supports_vfork_events): New macro.
1632         * win32-low.c (win32_target_ops): Initialize new structure
1633         members.
1634
1635 2015-05-12  Gary Benson <gbenson@redhat.com>
1636
1637         * server.c (handle_qxfer_exec_file): Use current process
1638         if annex is empty.
1639
1640 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
1641
1642         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
1643         Remove HAVE_PTRACE_GETREGS conditionals.
1644         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
1645         instead of PTRACE_GETREGS and PTRACE_SETREGS.
1646
1647 2015-05-08  Yao Qi  <yao.qi@linaro.org>
1648
1649         * linux-low.c (linux_supports_conditional_breakpoints): New
1650         function.
1651         (linux_target_ops): Install new target method.
1652         * lynx-low.c (lynx_target_ops): Install NULL hook for
1653         supports_conditional_breakpoints.
1654         * nto-low.c (nto_target_ops): Likewise.
1655         * spu-low.c (spu_target_ops): Likewise.
1656         * win32-low.c (win32_target_ops): Likewise.
1657         * server.c (handle_query): Check
1658         target_supports_conditional_breakpoints.
1659         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1660         New field.
1661         (target_supports_conditional_breakpoints): New macro.
1662
1663 2015-05-06  Pedro Alves  <palves@redhat.com>
1664
1665         PR server/18081
1666         * server.c (start_inferior): If the process exits, mourn it.
1667
1668 2015-04-21  Gary Benson <gbenson@redhat.com>
1669
1670         * hostio.c (fileio_open_flags_to_host): Factored out to
1671         fileio_to_host_openflags in common/fileio.c.  Single use
1672         updated.
1673
1674 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1675
1676         * linux-xtensa-low.c (xtensa_fill_gregset)
1677         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
1678         XCHAL_HAVE_LOOP.
1679
1680 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1681
1682         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
1683         (regs_info): Replace usrregs pointer with NULL.
1684
1685 2015-04-17  Gary Benson  <gbenson@redhat.com>
1686
1687         * target.h (struct target_ops) <pid_to_exec_file>: New field.
1688         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
1689         * server.c (handle_qxfer_exec_file): New function.
1690         (qxfer_packets): Add exec-file entry.
1691         (handle_query): Report qXfer:exec-file:read as supported packet.
1692
1693 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
1694
1695         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
1696
1697 2015-04-09  Gary Benson <gbenson@redhat.com>
1698
1699         * hostio-errno.c (errno_to_fileio_error): Remove function.
1700         Update caller to use remote_fileio_to_fio_error.
1701
1702 2015-04-09  Yao Qi  <yao.qi@linaro.org>
1703
1704         * linux-low.c (linux_insert_point): Call
1705         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
1706         (linux_remove_point): Call remove_memory_breakpoint if type is
1707         raw_bkpt_type_sw.
1708         * linux-x86-low.c (x86_insert_point): Don't call
1709         insert_memory_breakpoint.
1710         (x86_remove_point): Don't call remove_memory_breakpoint.
1711
1712 2015-04-01  Pedro Alves  <palves@redhat.com>
1713             Cleber Rosa  <crosa@redhat.com>
1714
1715         * server.c (gdbserver_usage): Reorganize and extend the usage
1716         message.
1717
1718 2015-03-24  Pedro Alves  <palves@redhat.com>
1719
1720         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
1721         output.  Also dump TRAP_TRACE.
1722         (linux_low_filter_event): In debug output, distinguish a
1723         resume_stop SIGSTOP from a delayed SIGSTOP.
1724
1725 2015-03-24  Gary Benson  <gbenson@redhat.com>
1726
1727         * linux-x86-low.c (x86_linux_new_thread): Moved to
1728         nat/x86-linux.c.
1729         (x86_linux_prepare_to_resume): Likewise.
1730
1731 2015-03-24  Gary Benson  <gbenson@redhat.com>
1732
1733         * Makefile.in (x86-linux-dregs.o): New rule.
1734         * configure.srv: Add x86-linux-dregs.o to relevant targets.
1735         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
1736         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
1737         (x86_linux_dr_get): Likewise.
1738         (x86_linux_dr_set): Likewise.
1739         (update_debug_registers_callback): Likewise.
1740         (x86_linux_dr_set_addr): Likewise.
1741         (x86_linux_dr_get_addr): Likewise.
1742         (x86_linux_dr_set_control): Likewise.
1743         (x86_linux_dr_get_control): Likewise.
1744         (x86_linux_dr_get_status): Likewise.
1745         (x86_linux_update_debug_registers): Likewise.
1746
1747 2015-03-24  Gary Benson  <gbenson@redhat.com>
1748
1749         * linux-x86-low.c (x86_linux_update_debug_registers):
1750         New function, factored out from...
1751         (x86_linux_prepare_to_resume): ...this.
1752
1753 2015-03-24  Gary Benson  <gbenson@redhat.com>
1754
1755         * linux-x86-low.c (x86_linux_dr_get): Update comments.
1756         (x86_linux_dr_set): Likewise.
1757         (update_debug_registers_callback): Likewise.
1758         (x86_linux_dr_set_addr): Likewise.
1759         (x86_linux_dr_get_addr): Likewise.
1760         (x86_linux_dr_set_control): Likewise.
1761         (x86_linux_dr_get_control): Likewise.
1762         (x86_linux_dr_get_status): Likewise.
1763         (x86_linux_prepare_to_resume): Likewise.
1764
1765 2015-03-24  Gary Benson  <gbenson@redhat.com>
1766
1767         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
1768         Use perror_with_name.  Pass string through gettext.
1769         (x86_linux_dr_set): Likewise.
1770
1771 2015-03-24  Gary Benson  <gbenson@redhat.com>
1772
1773         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
1774         (x86_linux_dr_set_addr): ...this.
1775         (x86_dr_low_get_addr): Rename to...
1776         (x86_linux_dr_get_addr): ...this.
1777         (x86_dr_low_set_control): Rename to...
1778         (x86_linux_dr_set_control): ...this.
1779         (x86_dr_low_get_control): Rename to...
1780         (x86_linux_dr_get_control): ...this.
1781         (x86_dr_low_get_status): Rename to...
1782         (x86_linux_dr_get_status): ...this.
1783         (x86_dr_low): Update with new function names.
1784
1785 2015-03-24  Gary Benson  <gbenson@redhat.com>
1786
1787         * Makefile.in (x86-linux.o): New rule.
1788         * configure.srv: Add x86-linux.o to relevant targets.
1789         * linux-low.c (lwp_set_arch_private_info): New function.
1790         (lwp_arch_private_info): Likewise.
1791         * linux-x86-low.c: Include nat/x86-linux.h.
1792         (arch_lwp_info): Removed structure.
1793         (update_debug_registers_callback):
1794         Use lwp_set_debug_registers_changed.
1795         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
1796         and lwp_set_debug_registers_changed.
1797         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
1798
1799 2015-03-24  Gary Benson  <gbenson@redhat.com>
1800
1801         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
1802         * linux-arm-low.c (arm_new_thread): Likewise.
1803         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
1804         * linux-mips-low.c (mips_linux_new_thread): Likewise.
1805         * linux-x86-low.c (x86_linux_new_thread): Likewise.
1806         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
1807
1808 2015-03-24  Gary Benson  <gbenson@redhat.com>
1809
1810         * linux-low.c (ptid_of_lwp): New function.
1811         (lwp_is_stopped): Likewise.
1812         (lwp_stop_reason): Likewise.
1813         * linux-x86-low.c (update_debug_registers_callback):
1814         Use lwp_is_stopped.
1815         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
1816         lwp_stop_reason.
1817
1818 2015-03-24  Gary Benson  <gbenson@redhat.com>
1819
1820         * linux-low.h (linux_stop_lwp): Remove declaration.
1821
1822 2015-03-24  Gary Benson  <gbenson@redhat.com>
1823
1824         * linux-low.h: Include nat/linux-nat.h.
1825         * linux-low.c (iterate_over_lwps_args): New structure.
1826         (iterate_over_lwps_filter): New function.
1827         (iterate_over_lwps): Likewise.
1828         * linux-x86-low.c (update_debug_registers_callback):
1829         Update signature to what iterate_over_lwps expects.
1830         Remove PID check that iterate_over_lwps now performs.
1831         (x86_dr_low_set_addr): Use iterate_over_lwps.
1832         (x86_dr_low_set_control): Likewise.
1833
1834 2015-03-24  Gary Benson  <gbenson@redhat.com>
1835
1836         * linux-x86-low.c (x86_debug_reg_state): New function.
1837         (x86_linux_prepare_to_resume): Use the above.
1838
1839 2015-03-24  Gary Benson  <gbenson@redhat.com>
1840
1841         * linux-low.c (current_lwp_ptid): New function.
1842         * linux-x86-low.c: Include nat/linux-nat.h.
1843         (x86_dr_low_get_addr): Use current_lwp_ptid.
1844         (x86_dr_low_get_control): Likewise.
1845         (x86_dr_low_get_status): Likewise.
1846
1847 2015-03-20  Pedro Alves  <palves@redhat.com>
1848
1849         * tracepoint.c (cmd_qtstatus): Make "str" const.
1850
1851 2015-03-20  Pedro Alves  <palves@redhat.com>
1852
1853         * server.c (handle_general_set): Make "req_str" const.
1854
1855 2015-03-19  Pedro Alves  <palves@redhat.com>
1856
1857         * linux-low.c (linux_resume_one_lwp): Rename to ...
1858         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
1859         instead call perror_with_name.
1860         (check_ptrace_stopped_lwp_gone): New function.
1861         (linux_resume_one_lwp): Reimplement as wrapper around
1862         linux_resume_one_lwp_throw that swallows errors if the LWP is
1863         gone.
1864
1865 2015-03-19  Pedro Alves  <palves@redhat.com>
1866
1867         * linux-low.c (count_events_callback, select_event_lwp_callback):
1868         No longer check whether the thread has resume_stop as last resume
1869         kind.
1870
1871 2015-03-19 Pedro Alves  <palves@redhat.com>
1872
1873         * linux-low.c (count_events_callback, select_event_lwp_callback):
1874         Use the lwp's status_pending_p field, not the thread's.
1875
1876 2015-03-19  Pedro Alves  <palves@redhat.com>
1877
1878         * linux-low.c (select_event_lwp_callback): Update comments to
1879         no longer mention SIGTRAP.
1880
1881 2015-03-18  Gary Benson  <gbenson@redhat.com>
1882
1883         * server.c (handle_query): Do not report vFile:fstat as supported.
1884
1885 2015-03-11  Gary Benson  <gbenson@redhat.com>
1886
1887         * hostio.c (sys/types.h): New include.
1888         (sys/stat.h): Likewise.
1889         (common-remote-fileio.h): Likewise.
1890         (handle_fstat): New function.
1891         (handle_vFile): Handle vFile:fstat packets.
1892
1893 2015-03-11  Gary Benson  <gbenson@redhat.com>
1894
1895         * configure.ac (AC_CHECK_MEMBERS): Add checks for
1896         struct stat.st_blocks and struct stat.st_blksize.
1897         * configure: Regenerate.
1898         * config.in: Likewise.
1899         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
1900         (OBS): Add common-remote-fileio.o.
1901         (common-remote-fileio.o): New rule.
1902
1903 2015-03-09  Pedro Alves  <palves@redhat.com>
1904
1905         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
1906         'struct sockaddr' pointer in 'accept' call.
1907
1908 2015-03-09  Pedro Alves  <palves@redhat.com>
1909
1910         Revert:
1911         2015-03-07  Pedro Alves  <palves@redhat.com>
1912         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
1913         or <winsock2.h> here.  Instead include "gdb_socket.h".
1914         (remote_open): Use union gdb_sockaddr_u.
1915         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
1916         or <winsock2.h> here.  Instead include "gdb_socket.h".
1917         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
1918         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
1919         or <sys/un.h>.
1920         (init_named_socket, gdb_agent_helper_thread): Use union
1921         gdb_sockaddr_u.
1922
1923 2015-03-07  Pedro Alves  <palves@redhat.com>
1924
1925         * configure.ac (build_warnings): Move
1926         -Wdeclaration-after-statement to the C-specific set.
1927         * configure: Regenerate.
1928
1929 2015-03-07  Pedro Alves  <palves@redhat.com>
1930
1931         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
1932         or <winsock2.h> here.  Instead include "gdb_socket.h".
1933         (remote_open): Use union gdb_sockaddr_u.
1934         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
1935         or <winsock2.h> here.  Instead include "gdb_socket.h".
1936         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
1937         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
1938         or <sys/un.h>.
1939         (init_named_socket, gdb_agent_helper_thread): Use union
1940         gdb_sockaddr_u.
1941
1942 2015-03-07  Pedro Alves  <palves@redhat.com>
1943
1944         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
1945         instead.
1946
1947 2015-03-06  Yao Qi  <yao.qi@linaro.org>
1948
1949         * linux-aarch64-low.c (aarch64_insert_point): Use
1950         show_debug_regs as a boolean.
1951         (aarch64_remove_point): Likewise.
1952
1953 2015-03-05  Pedro Alves  <palves@redhat.com>
1954
1955         * lynx-low.c (lynx_target_ops): Install NULL hooks for
1956         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
1957         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
1958         * nto-low.c (nto_target_ops): Likewise.
1959         * spu-low.c (spu_target_ops): Likewise.
1960         * win32-low.c (win32_target_ops): Likewise.
1961
1962 2015-03-04  Pedro Alves  <palves@redhat.com>
1963
1964         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
1965         Decide whether a breakpoint triggered based on the SIGTRAP's
1966         siginfo.si_code.
1967         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
1968         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
1969         (linux_low_filter_event): Check for breakpoints before checking
1970         watchpoints.
1971         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
1972         siginfo.si_code.
1973         (linux_stopped_by_sw_breakpoint)
1974         (linux_supports_stopped_by_sw_breakpoint)
1975         (linux_stopped_by_hw_breakpoint)
1976         (linux_supports_stopped_by_hw_breakpoint): New functions.
1977         (linux_target_ops): Install new target methods.
1978
1979 2015-03-04  Pedro Alves  <palves@redhat.com>
1980
1981         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
1982         * server.c (swbreak_feature, hwbreak_feature): New globals.
1983         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
1984         (captured_main): Clear swbreak_feature and hwbreak_feature.
1985         * server.h (swbreak_feature, hwbreak_feature): Declare.
1986         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
1987         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
1988         supports_stopped_by_hw_breakpoint>: New fields.
1989         (target_supports_stopped_by_sw_breakpoint)
1990         (target_stopped_by_sw_breakpoint)
1991         (target_supports_stopped_by_hw_breakpoint)
1992         (target_stopped_by_hw_breakpoint): Declare.
1993
1994 2015-03-04  Pedro Alves  <palves@redhat.com>
1995
1996         enum lwp_stop_reason -> enum target_stop_reason
1997         * linux-low.c (check_stopped_by_breakpoint): Adjust.
1998         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
1999         (linux_wait_1, stuck_in_jump_pad_callback)
2000         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2001         (linux_stopped_by_watchpoint):
2002         * linux-low.h (enum lwp_stop_reason): Delete.
2003         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2004         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2005
2006 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2007
2008         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2009
2010 2015-03-03  Gary Benson  <gbenson@redhat.com>
2011
2012         * hostio.c (handle_vFile): Fix prefix lengths.
2013
2014 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2015
2016         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2017         ptr_bits.
2018
2019 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2020
2021         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2022         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2023         (clean): Add "rm -f" for above C files.
2024         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2025         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2026         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2027         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2028         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2029         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2030         (init_registers_s390x_vx_linux64)
2031         (init_registers_s390x_tevx_linux64)
2032         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2033         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2034         declarations.
2035         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2036         (s390_store_vxrs_high): New functions.
2037         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2038         NT_S390_VXRS_HIGH.
2039         (s390_arch_setup): Add logic for selecting one of the new target
2040         descriptions.  Activate the new vector regsets if applicable.
2041         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2042         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2043         and init_registers_s390x_tevx_linux64.
2044
2045 2015-03-01  Pedro Alves  <palves@redhat.com>
2046
2047         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2048         parameter.
2049
2050 2015-02-27  Pedro Alves  <palves@redhat.com>
2051
2052         * linux-x86-low.c (u_debugreg_offset): New function.
2053         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2054
2055 2015-02-27  Pedro Alves  <palves@redhat.com>
2056
2057         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2058         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2059         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2060         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2061         (ps_lsetfpregs, ps_getpid)
2062         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2063         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2064         (ps_lsetxregs, ps_plog): Declare.
2065
2066 2015-02-27  Pedro Alves  <palves@redhat.com>
2067
2068         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2069         IP_AGENT_EXPORT_FUNC.
2070         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2071         IP_AGENT_EXPORT_FUNC.
2072         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2073         (IP_AGENT_EXPORT): Delete.
2074         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2075         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2076         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2077         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2078         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2079         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2080         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2081         (traceframe_read_count, traceframe_write_count)
2082         (traceframes_created, trace_state_variables, get_raw_reg)
2083         (get_trace_state_variable_value, set_trace_state_variable_value)
2084         (ust_loaded, helper_thread_id, cmd_buf): Use
2085         IPA_SYM_EXPORTED_NAME.
2086         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2087         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2088         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2089         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2090         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2091         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2092         EXTERN_C_PUSH/EXTERN_C_POP.
2093         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2094         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2095         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2096         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2097         (traceframe_write_count, traceframe_read_count)
2098         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2099         (about_to_request_buffer_space, get_trace_state_variable_value)
2100         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2101         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2102         EXTERN_C_PUSH/EXTERN_C_POP.
2103         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2104         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2105         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2106         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2107         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2108         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2109         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2110         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2111         Define.
2112         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2113         (IP_AGENT_EXPORT_VAR_DECL): Define.
2114         (tracing): Declare.
2115         (gdb_agent_get_raw_reg): Declare.
2116
2117 2015-02-27  Tom Tromey  <tromey@redhat.com>
2118             Pedro Alves  <palves@redhat.com>
2119
2120         Rename symbols whose names are reserved C++ keywords throughout.
2121
2122 2015-02-27  Pedro Alves  <palves@redhat.com>
2123
2124         * Makefile.in (COMPILER): New, get it from autoconf.
2125         (CXX): Get from autoconf instead.
2126         (COMPILE.pre): Use COMPILER.
2127         (CC-LD): Rename to ...
2128         (CC_LD): ... this.  Use COMPILER.
2129         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2130         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2131         * acinclude.m4: Include build-with-cxx.m4.
2132         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2133         Disable -Werror by default if building in C++ mode.
2134         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2135         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2136         the C++ compiler.  Save/restore CXXFLAGS too.
2137         * configure: Regenerate.
2138
2139 2015-02-27  Pedro Alves  <palves@redhat.com>
2140
2141         * acinclude.m4: Include libiberty.m4.
2142         * configure.ac: Call libiberty_INIT.
2143         * config.in, configure: Regenerate.
2144
2145 2015-02-26  Pedro Alves  <palves@redhat.com>
2146
2147         * linux-low.c (linux_wait_1): When incrementing the PC past a
2148         program breakpoint always use the_low_target.breakpoint_len as
2149         increment, rather than the maximum between that and
2150         the_low_target.decr_pc_after_break.
2151
2152 2015-02-23  Pedro Alves  <palves@redhat.com>
2153
2154         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2155         thread was doing a step-over; always adjust the PC if
2156         we stepped over a permanent breakpoint.
2157         (linux_wait_1): If we stepped over breakpoint that was on top of a
2158         permanent breakpoint, manually advance the PC past it.
2159
2160 2015-02-23  Pedro Alves  <palves@redhat.com>
2161
2162         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2163         modes.
2164         (x86_fill_gregset, x86_store_gregset): Use it when handling
2165         $orig_eax.
2166
2167 2015-02-20  Pedro Alves  <palves@redhat.com>
2168
2169         * thread-db.c: Include "nat/linux-procfs.h".
2170         (thread_db_init): Skip listing new threads if the kernel supports
2171         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2172
2173 2015-02-20  Pedro Alves  <palves@redhat.com>
2174
2175         * linux-low.c (status_pending_p_callback): Use ptid_match.
2176
2177 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2178
2179         PR breakpoints/16812
2180         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2181         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2182         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2183
2184 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2185
2186         PR breakpoints/15956
2187         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2188
2189 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2190
2191         * linux-low.c (linux_low_btrace_conf): Print size.
2192         * server.c (handle_btrace_conf_general_set): New.
2193         (hanle_general_set): Call handle_btrace_conf_general_set.
2194         (handle_query): Report Qbtrace-conf:bts:size as supported.
2195
2196 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2197
2198         * linux-low.c (linux_low_enable_btrace): Update parameters.
2199         (linux_low_btrace_conf): New.
2200         (linux_target_ops)<to_btrace_conf>: Initialize.
2201         * server.c (current_btrace_conf): New.
2202         (handle_btrace_enable): Rename to ...
2203         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2204         to target_enable_btrace.  Update comment.  Update users.
2205         (handle_qxfer_btrace_conf): New.
2206         (qxfer_packets): Add btrace-conf entry.
2207         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2208         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2209         (target_ops)<read_btrace_conf>: New.
2210         (target_enable_btrace): Update parameters.
2211         (target_read_btrace_conf): New.
2212
2213 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2214
2215         * server.c (handle_btrace_general_set): Remove call to
2216         target_supports_btrace.
2217         (supported_btrace_packets): New.
2218         (handle_query): Call supported_btrace_packets.
2219         * target.h: include btrace-common.h.
2220         (btrace_target_info): Removed.
2221         (supports_btrace, target_supports_btrace): Update parameters.
2222
2223 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2224
2225         * Makefile.in (SFILES): Add common/btrace-common.c.
2226         (OBS): Add common/btrace-common.o.
2227         (btrace-common.o): Add build rules.
2228         * linux-low: Include btrace-common.h.
2229         (linux_low_read_btrace): Use struct btrace_data.  Call
2230         btrace_data_init and btrace_data_fini.
2231
2232 2015-02-06  Pedro Alves  <palves@redhat.com>
2233
2234         * thread-db.c (find_new_threads_callback): Add debug output.
2235
2236 2015-02-04  Pedro Alves  <palves@redhat.com>
2237
2238         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2239         (resume_stopped_resumed_lwps): New function.
2240         (linux_wait_for_event_filtered): Use it.
2241
2242 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2243
2244         * Makefile.in (SFILES): Add linux-personality.c.
2245         (linux-personality.o): New rule.
2246         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2247         list of objects to be built.
2248         * linux-low.c: Include nat/linux-personality.h.
2249         (linux_create_inferior): Remove code to disable address space
2250         randomization (moved to ../nat/linux-personality.c).  Create
2251         cleanup to disable address space randomization.
2252
2253 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2254
2255         * Makefile.in (posix-strerror.o): New rule.
2256         (mingw-strerror.o): Likewise.
2257         * configure: Regenerated.
2258         * configure.ac: Source file ../common/common.host.  Initialize new
2259         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2260
2261 2015-01-14  Yao Qi  <yao@codesourcery.com>
2262
2263         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2264         (ppc-linux.o): New rule.
2265         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2266         * configure.ac: AC_CHECK_FUNCS(getauxval).
2267         * config.in: Re-generated.
2268         * configure: Re-generated.
2269         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2270         ppc64_64bit_inferior_p
2271
2272 2015-01-14  Yao Qi  <yao@codesourcery.com>
2273
2274         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2275          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2276         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2277         (PT_ORIG_R3, PT_TRAP): Likewise.
2278         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2279         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2280         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2281
2282 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2283
2284         * i387-fp.c (i387_cache_to_xsave): In look over
2285         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2286         zmmh_low_space field by use of zmmh_high_space.
2287
2288 2015-01-09  Pedro Alves  <palves@redhat.com>
2289
2290         * linux-low.c (step_over_bkpt): Move higher up in the file.
2291         (handle_extended_wait): Don't store the stop_pc here.
2292         (get_stop_pc): Adjust comments and rename to ...
2293         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2294         stopped for a software breakpoint or hardware breakpoint.
2295         (thread_still_has_status_pending_p): New function.
2296         (status_pending_p_callback): Use
2297         thread_still_has_status_pending_p.  If the event is no longer
2298         interesting, resume the LWP.
2299         (handle_tracepoints): Add assert.
2300         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2301         (wstatus_maybe_breakpoint): New function.
2302         (cancel_breakpoint): Delete function.
2303         (check_stopped_by_watchpoint): New function, factored out from
2304         linux_low_filter_event.
2305         (lp_status_maybe_breakpoint): Delete function.
2306         (linux_low_filter_event): Remove filter_ptid argument.
2307         Leave thread group exits pending here.  Store the LWP's stop PC.
2308         Always leave events pending.
2309         (linux_wait_for_event_filtered): Pull all events out of the
2310         kernel, and leave them all pending.
2311         (count_events_callback, select_event_lwp_callback): Consider all
2312         events.
2313         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2314         (select_event_lwp): Only give preference to the stepping LWP in
2315         all-stop mode.  Adjust comments.
2316         (ignore_event): New function.
2317         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2318         references to cancel_breakpoints.  Adjust to renames.  Also give
2319         equal priority to all LWPs that have had events in non-stop mode.
2320         If reporting a software breakpoint event, unadjust the LWP's PC.
2321         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2322         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2323         Adjust.
2324         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2325         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2326         (linux_stopped_by_watchpoint): Adjust.
2327         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2328         * linux-low.h (enum lwp_stop_reason): New.
2329         (struct lwp_info) <stop_pc>: Adjust comment.
2330         <stopped_by_watchpoint>: Delete field.
2331         <stop_reason>: New field.
2332         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2333         * mem-break.c (software_breakpoint_inserted_here)
2334         (hardware_breakpoint_inserted_here): New function.
2335         * mem-break.h (software_breakpoint_inserted_here)
2336         (hardware_breakpoint_inserted_here): Declare.
2337         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2338         (cancel_breakpoints): Delete.
2339         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2340         (upload_fast_traceframes): Remove references to
2341         cancel_breakpoints.
2342
2343 2015-01-09  Pedro Alves  <palves@redhat.com>
2344
2345         * thread-db.c (find_new_threads_callback): Ignore thread if the
2346         kernel thread ID is -1.
2347
2348 2015-01-09  Pedro Alves  <palves@redhat.com>
2349
2350         * linux-low.c (linux_attach_fail_reason_string): Move to
2351         nat/linux-ptrace.c, and rename.
2352         (linux_attach_lwp): Update comment.
2353         (attach_proc_task_lwp_callback): New function.
2354         (linux_attach): Adjust to rename and use
2355         linux_proc_attach_tgid_threads.
2356         (linux_attach_fail_reason_string): Delete declaration.
2357
2358 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2359
2360         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2361         * server.c (gdbserver_version): Likewise.
2362
2363 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2364
2365         * remote-utils.c: Include ctype.h.
2366         (input_interrupt): Explicitly handle the case when the char
2367         received is the NUL byte.  Improve the printing of non-ASCII
2368         characters.
2369
2370 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2371
2372         * linux-low.c (linux_low_filter_event): Update call to
2373         linux_enable_event_reporting following the addition of
2374         a new parameter to that function.
2375
2376 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2377
2378         PR server/17457
2379         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2380         (AARCH64_FPCR_REGNO): Likewise.
2381         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2382         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2383         (aarch64_store_fpregset): Likewise.
2384
2385 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2386
2387         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2388         Remove FIXME comment about assumption about N.
2389
2390 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
2391
2392         * configure.ac: If large-file support is disabled in GDBserver,
2393         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
2394         * configure: Regenerate.
2395
2396 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2397
2398         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
2399         warning upon ENODATA from ptrace.
2400         * linux-s390-low.c (s390_store_tdb): New.
2401         (s390_regsets): Add regset for NT_S390_TDB.
2402
2403 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2404
2405         * linux-low.c (regsets_store_inferior_registers): Skip regsets
2406         without a fill_function.
2407         * linux-s390-low.c (s390_fill_last_break): Remove.
2408         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
2409         (s390_arch_setup): Use regset's size instead of fill_function for
2410         loop end condition.
2411
2412 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2413
2414         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
2415         the regset's store function when ptrace returned an error.
2416         * regcache.c (get_thread_regcache): Invalidate register cache
2417         before fetching inferior's registers.
2418
2419 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2420
2421         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
2422         while-loop as for-loop.
2423         (regsets_store_inferior_registers): Likewise.
2424
2425 2014-11-28  Yao Qi  <yao@codesourcery.com>
2426
2427         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
2428         * config.in, configure: Re-generate.
2429         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
2430         is defined.
2431
2432 2014-11-21  Yao Qi  <yao@codesourcery.com>
2433
2434         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
2435         (AC_CHECK_HEADERS): Remove malloc.h.
2436         * configure: Re-generated.
2437         * config.in: Re-generated.
2438         * server.h: Don't include alloca.h and malloc.h.
2439         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
2440         Don't include malloc.h.
2441
2442 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
2443
2444         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
2445         corresponding ERRNO check in same block.
2446
2447 2014-11-12  Pedro Alves  <palves@redhat.com>
2448
2449         * server.c (cont_thread): Update comment.
2450         (start_inferior, attach_inferior): No longer clear cont_thread.
2451         (handle_v_cont): No longer set cont_thread.
2452         (captured_main): Clear cont_thread each time a GDB connects.
2453
2454 2014-11-12  Pedro Alves  <palves@redhat.com>
2455
2456         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
2457         thread, and don't resume all threads if the Hc thread has exited.
2458
2459 2014-11-12  Pedro Alves  <palves@redhat.com>
2460
2461         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
2462         the process group instead of to a specific LWP.
2463
2464 2014-10-15  Pedro Alves  <palves@redhat.com>
2465
2466         PR server/17487
2467         * win32-arm-low.c (arm_set_thread_context): Remove current_event
2468         parameter.
2469         (arm_set_thread_context): Delete.
2470         (the_low_target): Adjust.
2471         * win32-i386-low.c (debug_registers_changed)
2472         (debug_registers_used): Delete.
2473         (update_debug_registers_callback): New function.
2474         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
2475         needing to update their debug registers.
2476         (win32_get_current_dr): New function.
2477         (x86_dr_low_get_addr, x86_dr_low_get_control)
2478         (x86_dr_low_get_status): Fetch the debug register from the thread
2479         record's context.
2480         (i386_initial_stuff): Adjust.
2481         (i386_get_thread_context): Remove current_event parameter.  Don't
2482         clear debug_registers_changed nor copy DR values to
2483         debug_reg_state.
2484         (i386_set_thread_context): Delete.
2485         (i386_prepare_to_resume): New function.
2486         (i386_thread_added): Mark the thread as needing to update irs
2487         debug registers.
2488         (the_low_target): Remove i386_set_thread_context and install
2489         i386_prepare_to_resume.
2490         * win32-low.c (win32_get_thread_context): Adjust.
2491         (win32_set_thread_context): Use SetThreadContext
2492         directly.
2493         (win32_prepare_to_resume): New function.
2494         (win32_require_context): New function, factored out from ...
2495         (thread_rec): ... this.
2496         (continue_one_thread): Call win32_prepare_to_resume on each thread
2497         we're about to continue.
2498         (win32_resume): Call win32_prepare_to_resume on the event thread.
2499         * win32-low.h (struct win32_thread_info)
2500         <debug_registers_changed>: New field.
2501         (struct win32_target_ops): Change prototype of set_thread_context,
2502         delete set_thread_context and add prepare_to_resume.
2503         (win32_require_context): New declaration.
2504
2505 2014-10-08  Gary Benson  <gbenson@redhat.com>
2506
2507         * server.h: Do not include common-exceptions.h.
2508
2509 2014-10-08  Gary Benson  <gbenson@redhat.com>
2510
2511         * server.h: Do not include cleanups.h.
2512
2513 2014-09-30  James Hogan  <james.hogan@imgtec.com>
2514
2515         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
2516         mips64-dsp-linux.c.
2517
2518 2014-09-23  Yao Qi  <yao@codesourcery.com>
2519
2520         * linux-low.c (lp_status_maybe_breakpoint): New function.
2521         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
2522         (count_events_callback): Likewise.
2523         (select_event_lwp_callback): Likewise.
2524         (cancel_breakpoints_callback): Likewise.
2525
2526 2014-09-19  Don Breazeal  <donb@codesourcery.com>
2527
2528         * linux-low.c (handle_extended_wait): Call
2529         linux_ptrace_get_extended_event.
2530         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
2531         linux_is_extended_waitstatus.
2532
2533 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
2534
2535         * Makefile.in (CPPFLAGS): Define.
2536         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
2537         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
2538
2539 2014-09-16  Gary Benson  <gbenson@redhat.com>
2540
2541         * inferiors.h (current_inferior): Renamed as...
2542         (current_thread): New variable.  All uses updated.
2543         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
2544         (maybe_move_out_of_jump_pad): Likewise.
2545         (cancel_breakpoint): Likewise.
2546         (linux_low_filter_event): Likewise.
2547         (wait_for_sigstop): Likewise.
2548         (linux_resume_one_lwp): Likewise.
2549         (need_step_over_p): Likewise.
2550         (start_step_over): Likewise.
2551         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
2552         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
2553         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
2554         and save_inferior as saved_thread.
2555         * regcache.c (get_thread_regcache): Renamed saved_inferior as
2556         saved_thread.
2557         (regcache_invalidate_thread): Likewise.
2558         * remote-utils.c (prepare_resume_reply): Likewise.
2559         * thread-db.c (thread_db_get_tls_address): Likewise.
2560         (disable_thread_event_reporting): Likewise.
2561         (remove_thread_event_breakpoints): Likewise.
2562         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
2563         as saved_thread.
2564         * target.h (set_desired_inferior): Renamed as...
2565         (set_desired_thread): New declaration.  All uses updated.
2566         * server.c (myresume): Updated comment to reference thread instead
2567         of inferior.
2568         (handle_serial_event): Likewise.
2569         (handle_target_event): Likewise.
2570
2571 2014-09-12  Tom Tromey  <tromey@redhat.com>
2572             Gary Benson  <gbenson@redhat.com>
2573
2574         * regcache.h: Include common-regcache.h.
2575         (regcache_read_pc): Don't declare.
2576         * regcache.c (get_thread_regcache_for_ptid): New function.
2577
2578 2014-09-11  Tom Tromey  <tromey@redhat.com>
2579             Gary Benson  <gbenson@redhat.com>
2580
2581         * symbol.c: New file.
2582         * Makefile.in (SFILES): Add symbol.c.
2583         (OBS): Add symbol.o.
2584
2585 2014-09-11  Gary Benson  <gbenson@redhat.com>
2586
2587         * target.c (target_stop_ptid, target_continue_ptid): New
2588         functions.
2589
2590 2014-09-11  Tom Tromey  <tromey@redhat.com>
2591             Gary Benson  <gbenson@redhat.com>
2592
2593         * target.h: Include target/target.h.
2594         * target.c (target_read_memory, target_read_uint32)
2595         (target_write_memory): New functions.
2596
2597 2014-09-11  Gary Benson  <gbenson@redhat.com>
2598
2599         * server.h (debug_hw_points): Don't declare.
2600         * server.c (debug_hw_points): Don't define.  Replace all uses
2601         with show_debug_regs.
2602         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
2603         all uses with show_debug_regs.
2604
2605 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
2606
2607         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
2608         endianness into account.
2609         (ppc_supply_ptrace_register): Likewise.
2610
2611 2014-09-03  James Hogan  <james.hogan@imgtec.com>
2612
2613         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
2614         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2615
2616 2014-09-03  Gary Benson  <gbenson@redhat.com>
2617
2618         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
2619         ALL_DEBUG_ADDRESS_REGISTERS.
2620
2621 2014-09-02  Gary Benson  <gbenson@redhat.com>
2622
2623         * i386-low.h: Renamed as...
2624         * x86-low.h: New file.  All type, function and variable name
2625         prefixes changed from "i386_" to "x86_".  All references updated.
2626         * i386-low.c: Renamed as...
2627         * x86-low.c: New file.  All type, function and variable name
2628         prefixes changed from "i386_" to "x86_".  All references updated.
2629
2630 2014-09-02  Gary Benson  <gbenson@redhat.com>
2631
2632         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
2633         (x86_linux_new_thread): Likewise.
2634
2635 2014-08-29  Gary Benson  <gbenson@redhat.com>
2636
2637         * server.h (setjmp.h): Do not include.
2638         (toplevel): Do not declare.
2639         (common-exceptions.h): Include.
2640         (cleanups.h): Likewise.
2641         * server.c (toplevel): Do not define.
2642         (exit_code): New static global.
2643         (detach_or_kill_for_exit_cleanup): New function.
2644         (main): New function.  Original main renamed to...
2645         (captured_main): New function.
2646         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
2647
2648 2014-08-29  Gary Benson  <gbenson@redhat.com>
2649
2650         * Makefile.in (SFILES): Add common/common-exceptions.c.
2651         (OBS): Add common-exceptions.o.
2652         (common-exceptions.o): New rule.
2653         * utils.c (prepare_to_throw_exception): New function.
2654
2655 2014-08-29  Gary Benson  <gbenson@redhat.com>
2656
2657         * config.in: Regenerate.
2658         * configure: Likewise.
2659
2660 2014-08-29  Gary Benson  <gbenson@redhat.com>
2661
2662         * Makefile.in (SFILES): Add common/cleanups.c.
2663         (OBS): cleanups.o.
2664         (cleanups.o): New rule.
2665
2666 2014-08-29  Gary Benson  <gbenson@redhat.com>
2667
2668         * utils.c (internal_vwarning): New function.
2669
2670 2014-08-28  Gary Benson  <gbenson@redhat.com>
2671
2672         * utils.h (fatal): Remove declaration.
2673         * utils.c (fatal): Remove function.
2674
2675 2014-08-28  Gary Benson  <gbenson@redhat.com>
2676
2677         * tracepoint.c (gdb_agent_init): Replace fatal with
2678         perror_with_name.
2679         (initialize_tracepoint): Likewise.
2680
2681 2014-08-28  Gary Benson  <gbenson@redhat.com>
2682
2683         * remote-utils.c (remote_prepare): Replace fatal with error.
2684
2685 2014-08-28  Gary Benson  <gbenson@redhat.com>
2686
2687         * linux-low.c (linux_async): Replace fatal with warning.
2688         Tidy up and return.
2689         (linux_start_non_stop): Return -1 if linux_async failed.
2690
2691 2014-08-28  Gary Benson  <gbenson@redhat.com>
2692
2693         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
2694         gdb_assert.
2695         (i386_dr_low_get_addr): Remove vague comment.
2696         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
2697         gdb_assert.
2698
2699 2014-08-28  Gary Benson  <gbenson@redhat.com>
2700
2701         * inferiors.c (get_thread_process): Replace check with gdb_assert.
2702         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
2703         internal_error.
2704         (linux_resume_one_lwp): Likewise.
2705         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
2706         gdb_assert.
2707         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
2708         with internal_error.
2709         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
2710         (init_register_cache): Replace fatal with gdb_assert_not_reached.
2711         (find_register_by_name): Replace fatal with internal_error.
2712         (find_regno): Likewise.
2713         * tdesc.c (init_target_desc): Replace check with gdb_assert.
2714         * thread-db.c (thread_db_create_event): Likewise.
2715         (thread_db_load_search): Likewise.
2716         (try_thread_db_load_1): Likewise.
2717         * tracepoint.c (get_jump_space_head): Replace fatal with
2718         internal_error.
2719         (claim_trampoline_space): Likewise.
2720         (have_fast_tracepoint_trampoline_buffer): Likewise.
2721         (cmd_qtstart): Likewise.
2722         (stop_tracing): Likewise.
2723         (fast_tracepoint_collecting): Likewise.
2724         (target_malloc): Likewise.
2725         (download_tracepoint): Likewise.
2726         (download_trace_state_variables): Replace check with gdb_assert.
2727         (upload_fast_traceframes): Replace fatal with internal_error.
2728
2729 2014-08-19  Tom Tromey  <tromey@redhat.com>
2730             Gary Benson  <gbenson@redhat.com>
2731
2732         * Makefile.in (SFILES): Add common/common-debug.c.
2733         (OBS): Add common-debug.o.
2734         (common-debug.o): New rule.
2735         * debug.h (debug_printf): Don't declare.
2736         * debug.c (debug_printf): Renamed and rewritten as...
2737         (debug_vprintf): New function.
2738
2739 2014-08-19  Gary Benson  <gbenson@redhat.com>
2740
2741         * utils.h: Do not include print-utils.h.
2742
2743 2014-08-19  Tom Tromey  <tromey@redhat.com>
2744             Gary Benson  <gbenson@redhat.com>
2745
2746         * server.h: Add static assertion.
2747         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
2748
2749 2014-08-19  Tom Tromey  <tromey@redhat.com>
2750             Gary Benson  <gbenson@redhat.com>
2751
2752         * Makefile.in (SFILES): Add common/errors.c.
2753         (OBS): Add errors.o.
2754         (IPA_OBS): Add errors-ipa.o.
2755         (errors.o): New rule.
2756         (errors-ipa.o): Likewise.
2757         * utils.h (perror_with_name, error, warning): Don't declare.
2758         * utils.c (warning): Renamed and rewritten as...
2759         (vwarning): New function.
2760         (error): Renamed and rewritten as...
2761         (verror): New function.
2762         (internal_error): Renamed and rewritten as...
2763         (internal_verror): New function.
2764
2765 2014-08-07  Gary Benson  <gbenson@redhat.com>
2766
2767         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
2768         * configure: Regenerate.
2769         * config.in: Likewise.
2770         * server.h: Do not include errno.h.
2771         * event-loop.c: Likewise.
2772         * hostio-errno.c: Likewise.
2773         * linux-low.c: Likewise.
2774         * remote-utils.c: Likewise.
2775         * spu-low.c: Likewise.
2776         * utils.c: Likewise.
2777         * gdbreplay.c: Unconditionally include errno.h.
2778
2779 2014-08-07  Gary Benson  <gbenson@redhat.com>
2780
2781         * server.h: Do not include string.h.
2782         * event-loop.c: Likewise.
2783         * linux-low.c: Likewise.
2784         * regcache.c: Likewise.
2785         * remote-utils.c: Likewise.
2786         * spu-low.c: Likewise.
2787         * utils.c: Likewise.
2788
2789 2014-08-07  Gary Benson  <gbenson@redhat.com>
2790
2791         * server.h: Do not include gdb_assert.h.
2792
2793 2014-08-07  Gary Benson  <gbenson@redhat.com>
2794
2795         * server.h: Do not include common-utils.h.
2796
2797 2014-08-07  Gary Benson  <gbenson@redhat.com>
2798
2799         * server.h: Do not include ptid.h.
2800         * notif.h: Likewise.
2801
2802 2014-08-07  Gary Benson  <gbenson@redhat.com>
2803
2804         * server.h: Do not include gdb_locale.h.
2805
2806 2014-08-07  Gary Benson  <gbenson@redhat.com>
2807
2808         * server.h: Do not include gdb/signals.h.
2809         * win32-low.c: Likewise.
2810
2811 2014-08-07  Gary Benson  <gbenson@redhat.com>
2812
2813         * server.h: Do not include pathmax.h.
2814
2815 2014-08-07  Gary Benson  <gbenson@redhat.com>
2816
2817         * server.h: Do not include libiberty.h.
2818         * linux-bfin-low.c: Likewise.
2819
2820 2014-08-07  Gary Benson  <gbenson@redhat.com>
2821
2822         * server.h: Do not include ansidecl.h.
2823
2824 2014-08-07  Gary Benson  <gbenson@redhat.com>
2825
2826         * linux-x86-low.c: Do not include stddef.h.
2827         * lynx-ppc-low.c: Likewise.
2828         * tracepoint.c: Likewise.
2829
2830 2014-08-07  Gary Benson  <gbenson@redhat.com>
2831
2832         * server.h: Do not include stdarg.h.
2833         * nto-low.c: Likewise.
2834
2835 2014-08-07  Gary Benson  <gbenson@redhat.com>
2836
2837         * server.h: Do not include stdlib.h.
2838         * inferiors.c: Likewise.
2839         * linux-low.c: Likewise.
2840         * regcache.c: Likewise.
2841         * spu-low.c: Likewise.
2842         * tracepoint.c: Likewise.
2843         * utils.c: Likewise.
2844
2845 2014-08-07  Gary Benson  <gbenson@redhat.com>
2846
2847         * server.h: Do not include stdio.h.
2848         * linux-low.c: Likewise.
2849         * remote-utils.c: Likewise.
2850         * spu-low.c: Likewise.
2851         * utils.c: Likewise.
2852         * wincecompat.c: Likewise.
2853
2854 2014-08-06  Gary Benson  <gbenson@redhat.com>
2855
2856         * regcache.c (init_register_cache): Move conditionals inside if.
2857
2858 2014-08-06  Gary Benson  <gbenson@redhat.com>
2859
2860         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
2861
2862 2014-07-31  Gary Benson  <gbenson@redhat.com>
2863
2864         * ax.h: Do not include server.h.
2865         * gdbthread.h: Likewise.
2866         * lynx-low.h: Likewise.
2867         * notif.h: Likewise.
2868
2869 2014-07-30  Gary Benson  <gbenson@redhat.com>
2870
2871         * server.h: Include common-defs.h.
2872         Do not include config.h or build-gnulib-gdbserver/config.h.
2873
2874 2014-07-30  Gary Benson  <gbenson@redhat.com>
2875
2876         * hostio-errno.c: Move server.h to top of includes list.
2877         * inferiors.c: Likewise.
2878         * linux-x86-low.c: Likewise.
2879         * notif.c: Include server.h.
2880
2881 2014-07-24  Tom Tromey  <tromey@redhat.com>
2882             Gary Benson  <gbenson@redhat.com>
2883
2884         * server.h (CORE_ADDR): Now unsigned.
2885
2886 2014-07-16  Pedro Alves  <palves@redhat.com>
2887
2888         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
2889
2890 2014-07-15  Pedro Alves  <palves@redhat.com>
2891
2892         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
2893         copy.
2894
2895 2014-07-11  Pedro Alves  <palves@redhat.com>
2896
2897         * linux-low.c (kill_wait_lwp): New function, based on
2898         kill_one_lwp_callback, but use my_waitpid directly.
2899         (kill_one_lwp_callback, linux_kill): Use it.
2900
2901 2014-06-23  Pedro Alves  <palves@redhat.com>
2902
2903         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
2904         before setting DR0..DR3.
2905
2906 2014-06-20  Gary Benson  <gbenson@redhat.com>
2907
2908         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
2909         * configure: Regenerated.
2910         * config.in: Likewise.
2911
2912 2014-06-20  Gary Benson  <gbenson@redhat.com>
2913
2914         * Makefile.in (SFILES): Update locations for files moved
2915         from common to nat.
2916         (object file files): Reordered.
2917
2918 2014-06-20  Gary Benson  <gbenson@redhat.com>
2919
2920         * i386-low.h (i386_dr_low_can_set_addr): Removed.
2921         (i386_dr_low_set_addr): Likewise.
2922         (i386_dr_low_get_addr): Likewise.
2923         (i386_dr_low_can_set_control): Likewise.
2924         (i386_dr_low_set_control): Likewise.
2925         (i386_dr_low_get_control): Likewise.
2926         (i386_dr_low_get_status): Likewise.
2927         (i386_get_debug_register_length): Likewise.
2928         * linux-x86-low.c (i386_dr_low_set_addr):
2929         Changed signature.  Made static.
2930         (i386_dr_low_get_addr): Likewise.
2931         (i386_dr_low_set_control): Likewise.
2932         (i386_dr_low_get_control): Likewise.
2933         (i386_dr_low_get_status): Likewise.
2934         (i386_dr_low): New global variable.
2935         * win32-i386-low.c (i386_dr_low_set_addr):
2936         Changed signature.  Made static.
2937         (i386_dr_low_get_addr): Likewise.
2938         (i386_dr_low_set_control): Likewise.
2939         (i386_dr_low_get_control): Likewise.
2940         (i386_dr_low_get_status): Likewise.
2941         (i386_dr_low): New global variable.
2942
2943 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2944
2945         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
2946         * Makefile.in (AR, AR_FLAGS): Define.
2947         * configure: Regenerate.
2948
2949 2014-06-19  Gary Benson  <gbenson@redhat.com>
2950
2951         * Makefile.in (i386-dregs.o): New rule.
2952         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
2953         * i386-low.c (target.h): Remove include.
2954         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
2955         (DR_CONTROL_SHIFT): Likewise.
2956         (DR_CONTROL_SIZE): Likewise.
2957         (DR_RW_EXECUTE): Likewise.
2958         (DR_RW_WRITE): Likewise.
2959         (DR_RW_READ): Likewise.
2960         (DR_RW_IORW): Likewise.
2961         (DR_LEN_1): Likewise.
2962         (DR_LEN_2): Likewise.
2963         (DR_LEN_4): Likewise.
2964         (DR_LEN_8): Likewise.
2965         (DR_LOCAL_ENABLE_SHIFT): Likewise.
2966         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
2967         (DR_ENABLE_SIZE): Likewise.
2968         (DR_LOCAL_SLOWDOWN): Likewise.
2969         (DR_GLOBAL_SLOWDOWN): Likewise.
2970         (DR_CONTROL_RESERVED): Likewise.
2971         (I386_DR_CONTROL_MASK): Likewise.
2972         (I386_DR_VACANT): Likewise.
2973         (I386_DR_LOCAL_ENABLE): Likewise.
2974         (I386_DR_GLOBAL_ENABLE): Likewise.
2975         (I386_DR_DISABLE): Likewise.
2976         (I386_DR_SET_RW_LEN): Likewise.
2977         (I386_DR_GET_RW_LEN): Likewise.
2978         (I386_DR_WATCH_HIT): Likewise.
2979         (i386_wp_op_t): Likewise.
2980         (i386_show_dr): Likewise.
2981         (i386_length_and_rw_bits): Likewise.
2982         (i386_insert_aligned_watchpoint): Likewise.
2983         (i386_remove_aligned_watchpoint): Likewise.
2984         (i386_handle_nonaligned_watchpoint): Likewise.
2985         i386_update_inferior_debug_regs(): Likewise.
2986         (i386_dr_insert_watchpoint): Likewise.
2987         (i386_dr_remove_watchpoint): Likewise.
2988         (i386_dr_region_ok_for_watchpoint): Likewise.
2989         (i386_dr_stopped_data_address): Likewise.
2990         (i386_dr_stopped_by_watchpoint): Likewise.
2991
2992 2014-06-19  Gary Benson  <gbenson@redhat.com>
2993
2994         * i386-low.c (i386_dr_show): Renamed to
2995         i386_show_dr and made static.  All uses updated.
2996         (i386_dr_length_and_rw_bits): Renamed to
2997         i386_length_and_rw_bits and made static.
2998         All uses updated.
2999         (i386_dr_insert_aligned_watchpoint): Renamed to
3000         i386_insert_aligned_watchpoint and made static.
3001         All uses updated.
3002         (i386_dr_remove_aligned_watchpoint): Renamed to
3003         i386_remove_aligned_watchpoint and made static.
3004         All uses updated.
3005         (i386_dr_update_inferior_debug_regs): Renamed to
3006         i386_update_inferior_debug_regs and made static.
3007         All uses updated.
3008
3009 2014-06-18  Gary Benson  <gbenson@redhat.com>
3010
3011         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3012         (i386_dr_low_can_set_control): Likewise.
3013         (i386_get_debug_register_length): Likewise.
3014         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3015         (i386_dr_low_can_set_control): Likewise.
3016         (i386_get_debug_register_length): Likewise.
3017
3018 2014-06-17  Gary Benson  <gbenson@redhat.com>
3019
3020         * i386-low.h (i386-dregs.h): New include.
3021         (DR_FIRSTADDR): Now in i386-dregs.h.
3022         (DR_LASTADDR): Likewise.
3023         (DR_NADDR): Likewise.
3024         (DR_STATUS): Likewise.
3025         (DR_CONTROL): Likewise.
3026         (i386_debug_reg_state): Likewise.
3027         (i386_dr_insert_watchpoint): Likewise.
3028         (i386_dr_remove_watchpoint): Likewise.
3029         (i386_dr_region_ok_for_watchpoint): Likewise.
3030         (i386_dr_stopped_data_address): Likewise.
3031         (i386_dr_stopped_by_watchpoint): Likewise.
3032         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3033
3034 2014-06-18  Gary Benson  <gbenson@redhat.com>
3035
3036         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3037         i386_dr_insert_watchpoint.
3038         (i386_low_remove_watchpoint): Renamed to
3039         i386_dr_remove_watchpoint.
3040         (i386_low_region_ok_for_watchpoint): Renamed to
3041         i386_dr_region_ok_for_watchpoint.
3042         (i386_low_stopped_data_address): Renamed to
3043         i386_dr_stopped_data_address.
3044         (i386_low_stopped_by_watchpoint): Renamed to
3045         i386_dr_stopped_by_watchpoint.
3046         * i386-low.c (i386_show_dr): Renamed to
3047         i386_dr_show and made nonstatic.  All uses updated.
3048         (i386_length_and_rw_bits): Renamed to
3049         i386_dr_length_and_rw_bits and made nonstatic.
3050         All uses updated.
3051         (i386_insert_aligned_watchpoint): Renamed to
3052         i386_dr_insert_aligned_watchpoint and made nonstatic.
3053         All uses updated.
3054         (i386_remove_aligned_watchpoint): Renamed to
3055         i386_dr_remove_aligned_watchpoint and made nonstatic.
3056         All uses updated.
3057         (i386_update_inferior_debug_regs): Renamed to
3058         i386_dr_update_inferior_debug_regs and made nonstatic.
3059         All uses updated.
3060         (i386_low_insert_watchpoint): Renamed to
3061         i386_dr_insert_watchpoint.  All uses updated.
3062         (i386_low_remove_watchpoint): Renamed to
3063         i386_dr_remove_watchpoint.  All uses updated.
3064         (i386_low_region_ok_for_watchpoint): Renamed to
3065         i386_dr_region_ok_for_watchpoint.  All uses updated.
3066         (i386_low_stopped_data_address): Renamed to
3067         i386_dr_stopped_data_address.  All uses updated.
3068         (i386_low_stopped_by_watchpoint): Renamed to
3069         i386_dr_stopped_by_watchpoint.  All uses updated.
3070
3071 2014-06-18  Gary Benson  <gbenson@redhat.com>
3072
3073         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3074         (i386_dr_low_can_set_control): Likewise.
3075         (i386_insert_aligned_watchpoint): New check.
3076
3077 2014-06-18  Gary Benson  <gbenson@redhat.com>
3078
3079         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3080         Renamed to state.
3081
3082 2014-06-18  Gary Benson  <gbenson@redhat.com>
3083
3084         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3085         instead of fatal and error.
3086         (i386_handle_nonaligned_watchpoint): Likewise.
3087
3088 2014-06-18  Gary Benson  <gbenson@redhat.com>
3089
3090         * i386-low.c (i386_get_debug_register_length): New macro.
3091         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3092         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3093         phex to format values.
3094
3095 2014-06-18  Gary Benson  <gbenson@redhat.com>
3096
3097         * i386-low.h: Comment changes.
3098         * i386-low.c: Likewise.
3099
3100 2014-06-18  Gary Benson  <gbenson@redhat.com>
3101
3102         * i386-low.c: Whitespace changes.
3103
3104 2014-06-12  Tom Tromey  <tromey@redhat.com>
3105
3106         * utils.c (freeargv): Remove.
3107
3108 2014-06-12  Tom Tromey  <tromey@redhat.com>
3109
3110         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3111         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3112         (parse_debug_format_options): Likewise.
3113         (gdbserver_usage): Likewise.
3114         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3115         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3116         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3117         against libiberty.
3118         ($(LIBGNU)): Depend on libiberty.
3119         (all-lib): Recurse into all subdirs.
3120         (install-only): Invoke "install" target in subdirs.
3121         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3122         targets.
3123         * configure: Rebuild.
3124         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3125         for vasprintf, vsnprintf, or gettimeofday.
3126         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3127         srv_tgtobj.
3128
3129 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3130
3131         * development.sh: Delete.
3132         * Makefile.in (config.status): Adjust dependency on development.sh.
3133         * configure.ac: Adjust development.sh source call.
3134         * configure: Regenerate.
3135
3136 2014-06-02  Pedro Alves  <palves@redhat.com>
3137
3138         * ax.c (gdb_free_agent_expr): New function.
3139         * ax.h (gdb_free_agent_expr): New declaration.
3140         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3141         list.
3142         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3143         static.
3144         (clear_breakpoint_conditions_and_commands): New function.
3145         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3146         (clear_breakpoint_conditions_and_commands): New declaration.
3147
3148 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3149
3150         * linux-aarch64-low.c (asm/ptrace.h): Include.
3151
3152 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3153
3154         Fix TLS access for -static -pthread.
3155         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3156         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3157         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3158
3159 2014-05-20  Pedro Alves  <palves@redhat.com>
3160
3161         * linux-aarch64-low.c (aarch64_insert_point)
3162         (aarch64_remove_point): No longer check whether the type is
3163         supported here.  Adjust to new interface.
3164         (the_low_target): Install aarch64_supports_z_point_type as
3165         supports_z_point_type method.
3166         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3167         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3168         instead of a Z packet char.  Adjust.
3169         (arm_supports_z_point_type): New function.
3170         (arm_insert_point, arm_remove_point): Adjust to new interface.
3171         (the_low_target): Install arm_supports_z_point_type.
3172         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3173         (cris_insert_point, cris_remove_point): Adjust to new interface.
3174         Don't check whether the type is supported here.
3175         (the_low_target): Install cris_supports_z_point_type.
3176         * linux-low.c (linux_supports_z_point_type): New function.
3177         (linux_insert_point, linux_remove_point): Adjust to new interface.
3178         * linux-low.h (struct linux_target_ops) <insert_point,
3179         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3180         raw_breakpoint pointer parameter.
3181         <supports_z_point_type>: New method.
3182         * linux-mips-low.c (mips_supports_z_point_type): New function.
3183         (mips_insert_point, mips_remove_point): Adjust to new interface.
3184         Use mips_supports_z_point_type.
3185         (the_low_target): Install mips_supports_z_point_type.
3186         * linux-ppc-low.c (the_low_target): Install NULL as
3187         supports_z_point_type method.
3188         * linux-s390-low.c (the_low_target): Install NULL as
3189         supports_z_point_type method.
3190         * linux-sparc-low.c (the_low_target): Install NULL as
3191         supports_z_point_type method.
3192         * linux-x86-low.c (x86_supports_z_point_type): New function.
3193         (x86_insert_point): Adjust to new insert_point interface.  Use
3194         insert_memory_breakpoint.  Adjust to new
3195         i386_low_insert_watchpoint interface.
3196         (x86_remove_point): Adjust to remove_point interface.  Use
3197         remove_memory_breakpoint.  Adjust to new
3198         i386_low_remove_watchpoint interface.
3199         (the_low_target): Install x86_supports_z_point_type.
3200         * lynx-low.c (lynx_target_ops): Install NULL as
3201         supports_z_point_type callback.
3202         * nto-low.c (nto_supports_z_point_type): New.
3203         (nto_insert_point, nto_remove_point): Adjust to new interface.
3204         (nto_target_ops): Install nto_supports_z_point_type.
3205         * mem-break.c: Adjust intro comment.
3206         (struct raw_breakpoint) <raw_type, size>: New fields.
3207         <inserted>: Update comment.
3208         <shlib_disabled>: Delete field.
3209         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3210         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3211         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3212         (raw_bkpt_type_to_target_hw_bp_type): New function.
3213         (find_enabled_raw_code_breakpoint_at): New function.
3214         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3215         (insert_memory_breakpoint): New function, based off
3216         set_raw_breakpoint_at.
3217         (remove_memory_breakpoint): New function.
3218         (set_raw_breakpoint_at): Reimplement.
3219         (set_breakpoint): New, based on set_breakpoint_at.
3220         (set_breakpoint_at): Reimplement.
3221         (delete_raw_breakpoint): Go through the_target->remove_point
3222         instead of assuming memory breakpoints.
3223         (find_gdb_breakpoint_at): Delete.
3224         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3225         (find_gdb_breakpoint): New function.
3226         (set_gdb_breakpoint_at): Delete.
3227         (z_type_supported): New function.
3228         (set_gdb_breakpoint_1): New function, loosely based off
3229         set_gdb_breakpoint_at.
3230         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3231         (delete_gdb_breakpoint_at): Delete.
3232         (delete_gdb_breakpoint_1): New function, loosely based off
3233         delete_gdb_breakpoint_at.
3234         (delete_gdb_breakpoint): New function.
3235         (clear_gdb_breakpoint_conditions): Rename to ...
3236         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3237         breakpoint.
3238         (add_condition_to_breakpoint): Make static.
3239         (add_breakpoint_condition): Take a struct breakpoint pointer
3240         instead of an address.  Adjust.
3241         (gdb_condition_true_at_breakpoint): Rename to ...
3242         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3243         z_type parameter.
3244         (gdb_condition_true_at_breakpoint): Reimplement.
3245         (add_breakpoint_commands): Take a struct breakpoint pointer
3246         instead of an address.  Adjust.
3247         (gdb_no_commands_at_breakpoint): Rename to ...
3248         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3249         parameter.  Return true if no breakpoint was found.  Change debug
3250         output.
3251         (gdb_no_commands_at_breakpoint): Reimplement.
3252         (run_breakpoint_commands): Rename to ...
3253         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3254         and change return type to boolean.
3255         (run_breakpoint_commands): New function.
3256         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3257         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3258         breakpoint.  Go through the_target->remove_point instead of
3259         assuming memory breakpoint.
3260         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3261         software and hardware breakpoints.
3262         (reinsert_raw_breakpoint): Go through the_target->insert_point
3263         instead of assuming memory breakpoint.
3264         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3265         software and hardware breakpoints.
3266         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3267         Check both software and hardware breakpoints.
3268         (validate_inserted_breakpoint): Assert the breakpoint is a
3269         software breakpoint.  Set the inserted flag to -1 instead of
3270         setting shlib_disabled.
3271         (delete_disabled_breakpoints): Adjust.
3272         (validate_breakpoints): Only validate software breakpoints.
3273         Adjust to inserted flag change.
3274         (check_mem_read, check_mem_write): Skip breakpoint types other
3275         than software breakpoints.  Adjust to inserted flag change.
3276         * mem-break.h (enum raw_bkpt_type): New enum.
3277         (raw_breakpoint, struct process_info): Forward declare.
3278         (Z_packet_to_target_hw_bp_type): Delete declaration.
3279         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3280         (set_gdb_breakpoint, delete_gdb_breakpoint)
3281         (clear_breakpoint_conditions): New declarations.
3282         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3283         (breakpoint_inserted_here): Update comment.
3284         (add_breakpoint_condition, add_breakpoint_commands): Replace
3285         address parameter with a breakpoint pointer parameter.
3286         (gdb_breakpoint_here): Update comment.
3287         (delete_gdb_breakpoint_at): Delete.
3288         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3289         * server.c (process_point_options): Take a struct breakpoint
3290         pointer instead of an address.  Adjust.
3291         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3292         delete_gdb_breakpoint.
3293         * spu-low.c (spu_target_ops): Install NULL as
3294         supports_z_point_type method.
3295         * target.h: Include mem-break.h.
3296         (struct target_ops) <prepare_to_access_memory>: Update comment.
3297         <supports_z_point_type>: New field.
3298         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3299         instead of a char.  Also take a raw breakpoint pointer.
3300         * win32-arm-low.c (the_low_target): Install NULL as
3301         supports_z_point_type.
3302         * win32-i386-low.c (i386_supports_z_point_type): New function.
3303         (i386_insert_point, i386_remove_point): Adjust to new interface.
3304         (the_low_target): Install i386_supports_z_point_type.
3305         * win32-low.c (win32_supports_z_point_type): New function.
3306         (win32_insert_point, win32_remove_point): Adjust to new interface.
3307         (win32_target_ops): Install win32_supports_z_point_type.
3308         * win32-low.h (struct win32_target_ops):
3309         <supports_z_point_type>: New method.
3310         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3311         instead of a char.  Also take a raw breakpoint pointer.
3312
3313 2014-05-20  Pedro Alves  <palves@redhat.com>
3314
3315         * mem-break.h: Include break-common.h.
3316         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3317         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3318         (Z_packet_to_target_hw_bp_type): New declaration.
3319         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3320         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3321         (Z_PACKET_ACCESS_WP): Delete macros.
3322         (Z_packet_to_hw_type): Delete function.
3323         * i386-low.h: Don't include break-common.h here.
3324         (Z_packet_to_hw_type): Delete declaration.
3325         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3326         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3327         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3328         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3329         * linux-aarch64-low.c: Don't include break-common.h here.
3330         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3331         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3332         (Z_packet_to_target_hw_bp_type): Delete function.
3333         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3334         function.
3335         (mips_insert_point, mips_remove_point): Use
3336         Z_packet_to_target_hw_bp_type.
3337
3338 2014-05-20  Pedro Alves  <palves@redhat.com>
3339
3340         * linux-aarch64-low.c: Include break-common.h.
3341         (enum target_point_type): Delete.
3342         (Z_packet_to_point_type): Rename to ...
3343         (Z_packet_to_target_hw_bp_type): ... this, and return a
3344         target_hw_bp_type instead.
3345         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3346         instead of an enum target_point_type.
3347         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3348         breakpoint type.
3349         (aarch64_dr_state_insert_one_point)
3350         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3351         (aarch64_handle_aligned_watchpoint)
3352         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3353         Take an enum target_hw_bp_type instead of an enum
3354         target_point_type.
3355         (aarch64_supports_z_point_type): New function.
3356         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3357         use Z_packet_to_target_hw_bp_type.
3358
3359 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3360
3361         * configure.ac: Only use -Werror by default when DEVELOPMENT
3362         is true.
3363         * configure: Regenerate.
3364
3365 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3366
3367         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3368         * linux-x86-low.c (X86_64_USER_REGS): New.
3369         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3370
3371 2014-04-28  Yao Qi  <yao@codesourcery.com>
3372
3373         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3374         name.
3375
3376 2014-04-25  Pedro Alves  <palves@redhat.com>
3377
3378         PR server/16255
3379         * linux-low.c (linux_attach_fail_reason_string): New function.
3380         (linux_attach_lwp): Delete.
3381         (linux_attach_lwp_1): Rename to ...
3382         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3383         argument.  Remove "initial" parameter.  Return int instead of
3384         void.  Don't error or warn here.
3385         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3386         failure to attach to the tgid.  Call warning when failing to
3387         attach to an lwp.
3388         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3389         argument.  Remove "initial" parameter.  Return int instead of
3390         void.  Don't error or warn here.
3391         (linux_attach_fail_reason_string): New declaration.
3392         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
3393         interface change.  Use linux_attach_fail_reason_string.
3394
3395 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
3396             Walfred Tedeschi  <walfred.tedeschi@intel.com>
3397
3398         * Makefile.in: Added rules to handle new files
3399         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
3400         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
3401         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
3402         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
3403         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
3404         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
3405         x32-avx512-linux.o.
3406         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
3407         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
3408         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
3409         i386/x32-avx512.xml.
3410         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
3411         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
3412         i386/x32-avx512-linux.xml.
3413         * i387-fp.c (num_avx512_k_registers): New constant for number
3414         of K registers.
3415         (num_avx512_zmmh_low_registers): New constant for number of
3416         lower ZMM registers (0-15).
3417         (num_avx512_zmmh_high_registers): New constant for number of
3418         higher ZMM registers (16-31).
3419         (num_avx512_ymmh_registers): New contant for number of higher
3420         YMM registers (ymm16-31 added by avx521 on x86_64).
3421         (num_avx512_xmm_registers): New constant for number of higher
3422         XMM registers (xmm16-31 added by AVX512 on x86_64).
3423         (struct i387_xsave): Add space for AVX512 registers.
3424         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
3425         Add code to handle AVX512 registers.
3426         (i387_xsave_to_cache): Add code to handle AVX512 registers.
3427         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
3428         prototypei from generated file.
3429         (tdesc_amd64_avx512_linux): Likewise.
3430         (init_registers_x32_avx512_linux): Likewise.
3431         (tdesc_x32_avx512_linux): Likewise.
3432         (init_registers_i386_avx512_linux): Likewise.
3433         (tdesc_i386_avx512_linux): Likewise.
3434         (x86_64_regmap): Add AVX512 registers.
3435         (x86_linux_read_description): Add code to handle AVX512 XSTATE
3436         mask.
3437         (initialize_low_arch): Add code to initialize AVX512 registers.
3438
3439 2014-04-23  Pedro Alves  <palves@redhat.com>
3440
3441         * mem-break.c (find_gdb_breakpoint_at): Make static.
3442         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
3443
3444 2014-04-23  Pedro Alves  <palves@redhat.com>
3445
3446         * i386-low.c: Don't include break-common.h here.
3447         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3448         prototype to take target_hw_bp_type as argument instead of a Z
3449         packet char.
3450         * i386-low.h: Include break-common.h here.
3451         (Z_packet_to_hw_type): Declare.
3452         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3453         prototypes.
3454         * linux-x86-low.c (x86_insert_point): Convert the packet number to
3455         a target_hw_bp_type before calling i386_low_insert_watchpoint.
3456         (x86_remove_point): Convert the packet number to a
3457         target_hw_bp_type before calling i386_low_remove_watchpoint.
3458         * win32-i386-low.c (i386_insert_point): Convert the packet number
3459         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
3460         (i386_remove_point): Convert the packet number to a
3461         target_hw_bp_type before calling i386_low_remove_watchpoint.
3462
3463 2014-04-23  Pedro Alves  <palves@redhat.com>
3464
3465         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
3466
3467 2014-04-10  Pedro Alves  <palves@redhat.com>
3468
3469         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
3470         Check if the condition or command is NULL before checking if the
3471         breakpoint is known.  On success, return true.
3472         * mem-break.h (add_breakpoint_condition): Document return.
3473         (add_breakpoint_commands): Add describing comment.
3474         * server.c (skip_to_semicolon): New function.
3475         (process_point_options): Use it.
3476
3477 2014-04-09  Pedro Alves  <palves@redhat.com>
3478
3479         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
3480         to lwpid_of.
3481
3482 2014-02-27  Pedro Alves  <palves@redhat.com>
3483
3484         PR 12702
3485         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
3486         macros.
3487         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
3488         output.
3489         (last_thread_of_process_p): Take a PID argument instead of a
3490         thread pointer.
3491         (linux_wait_for_lwp): Delete.
3492         (num_lwps, check_zombie_leaders, not_stopped_callback): New
3493         functions.
3494         (linux_low_filter_event): New function, party factored out from
3495         linux_wait_for_event.
3496         (linux_wait_for_event): Rename to ...
3497         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
3498         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
3499         sigsuspend.  Check for zombie leaders.
3500         (linux_wait_for_event): Reimplement as wrapper around
3501         linux_wait_for_event_filtered.
3502         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
3503         a normal or signal exit is seen, it's the whole process exiting.
3504         (wait_for_sigstop): No longer a for_each_inferior callback.
3505         Rewrite on top of linux_wait_for_event_filtered.
3506         (stop_all_lwps): Call wait_for_sigstop directly.
3507         * server.c (resume, handle_target_event): Handle
3508         TARGET_WAITKIND_NO_RESUMED.
3509
3510 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3511
3512         * win32-low.c (psapi_get_dll_name,
3513         * win32_CreateToolhelp32Snapshot): Delete.
3514         (win32_CreateToolhelp32Snapshot, win32_Module32First)
3515         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
3516         Delete.
3517         (handle_load_dll): Add function description.
3518         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
3519
3520 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3521
3522         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
3523         Add comment.
3524         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
3525         base address when calling win32_add_one_solib.
3526         (handle_load_dll): Delete local variable load_addr.
3527         Remove 0x1000 offset applied to DLL base address when calling
3528         win32_add_one_solib.
3529         (handle_unload_dll): Add comment.
3530
3531 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3532
3533         * win32-low.c (win32_add_all_dlls): Renames
3534         win32_ensure_ntdll_loaded.  Rewrite function documentation.
3535         Adjust implementation to always load all DLLs.
3536         Add 0x1000 offset to DLL base address when calling
3537         win32_add_one_solib.
3538         (child_initialization_done): New static global.
3539         (do_initial_child_stuff): Set child_initialization_done to
3540         zero during child initialization, and 1 after.  Replace call
3541         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
3542         Add comment.
3543         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
3544         (handle_unload_dll): Add function documentation.
3545         (get_child_debug_event): Ignore load and unload DLL events
3546         during child initialization.
3547
3548 2014-02-20  Doug Evans  <dje@google.com>
3549
3550         Remove global all_lwps.
3551         * inferiors.h (ptid_of): Move here from linux-low.h.
3552         (pid_of, lwpid_of): Ditto.
3553         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
3554         parameter is a struct thread_info * now.
3555         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
3556         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
3557         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
3558         directly.
3559         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
3560         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
3561         * linux-arm-low.c (update_registers_callback): Update, "entry"
3562         parameter is a struct thread_info * now.
3563         Fetch lwpid from current_inferior directly.
3564         (arm_insert_point): Pass &all_threads to find_inferior instead of
3565         &all_lwps.
3566         (arm_remove_point): Ditto.
3567         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
3568         (arm_prepare_to_resume): Fetch pid from thread.
3569         (arm_read_description): Fetch lwpid from current_inferior directly.
3570         * linux-low.c (all_lwps): Delete.
3571         (delete_lwp): Delete call to remove_inferior.
3572         (handle_extended_wait): Fetch lwpid from thread.
3573         (add_lwp): Don't set lwp->entry.id.  Remove call to
3574         add_inferior_to_list.
3575         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
3576         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
3577         (kill_one_lwp_callback): Ditto.
3578         (linux_kill): Don't dereference NULL pointer.
3579         Fetch ptid,lwpid from thread.
3580         (get_detach_signal): Fetch ptid from thread.
3581         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
3582         Simplify call to regcache_invalidate_thread.
3583         (delete_lwp_callback): Update, "entry" parameter is a
3584         struct thread_info * now.  Fetch pid from thread.
3585         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
3586         (status_pending_p_callback): Update, "entry" parameter is a
3587         struct thread_info * now.  Fetch ptid from thread.
3588         (find_lwp_pid): Update, "entry" parameter is a
3589         struct thread_info * now.
3590         (linux_wait_for_lwp): Fetch pid from thread.
3591         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
3592         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
3593         (enqueue_one_deferred_signal): Fetch lwpid from thread.
3594         (dequeue_one_deferred_signal): Ditto.
3595         (cancel_breakpoint): Fetch ptid from current_inferior.
3596         (linux_wait_for_event): Pass &all_threads to find_inferior,
3597         not &all_lwps.  Fetch ptid, lwpid from thread.
3598         (count_events_callback): Update, "entry" parameter is a
3599         struct thread_info * now.
3600         (select_singlestep_lwp_callback): Ditto.
3601         (select_event_lwp_callback): Ditto.
3602         (cancel_breakpoints_callback): Ditto.
3603         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
3604         not &all_lwps.
3605         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
3606         (unsuspend_one_lwp): Update, "entry" parameter is a
3607         struct thread_info * now.
3608         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
3609         not &all_lwps.
3610         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
3611         Fetch lwpid from thread, not lwp.
3612         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
3613         Pass &all_threads to find_inferior, not &all_lwps.
3614         (send_sigstop): Fetch lwpid from thread, not lwp.
3615         (send_sigstop_callback): Update, "entry" parameter is a
3616         struct thread_info * now.
3617         (suspend_and_send_sigstop_callback): Ditto.
3618         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
3619         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
3620         struct thread_info * now.
3621         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
3622         from thread, lwp.
3623         (lwp_running): Update, "entry" parameter is a
3624         struct thread_info * now.
3625         (stop_all_lwps): Fetch ptid from thread.
3626         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
3627         (linux_resume_one_lwp): Fetch lwpid from thread.
3628         (linux_set_resume_request): Update, "entry" parameter is a
3629         struct thread_info * now.  Fetch pid, lwpid from thread.
3630         (resume_status_pending_p): Update, "entry" parameter is a
3631         struct thread_info * now.
3632         (need_step_over_p): Ditto.  Fetch lwpid from thread.
3633         (start_step_over): Fetch lwpid from thread.
3634         (linux_resume_one_thread): Update, "entry" parameter is a
3635         struct thread_info * now.  Fetch lwpid from thread.
3636         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
3637         (proceed_one_lwp): Update, "entry" parameter is a
3638         struct thread_info * now.  Fetch lwpid from thread.
3639         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
3640         struct thread_info * now.
3641         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
3642         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
3643         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
3644         directly.
3645         (regsets_store_inferior_registers): Ditto.
3646         (fetch_register, store_register): Ditto.
3647         (linux_read_memory, linux_write_memory): Ditto.
3648         (linux_request_interrupt): Ditto.
3649         (linux_read_auxv): Ditto.
3650         (linux_xfer_siginfo): Ditto.
3651         (linux_qxfer_spu): Ditto.
3652         (linux_qxfer_libraries_svr4): Ditto.
3653         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
3654         moved to inferiors.h.
3655         (get_lwp): Delete.
3656         (get_thread_lwp): Update.
3657         (struct lwp_info): Delete member "entry".  Simplify comment for
3658         member "thread".
3659         (all_lwps): Delete.
3660         * linux-mips-low.c (mips_read_description): Fetch lwpid from
3661         current_inferior directly.
3662         (update_watch_registers_callback): Update, "entry" parameter is a
3663         struct thread_info * now.  Fetch pid from thread.
3664         (mips_linux_prepare_to_resume): Fetch ptid from thread.
3665         (mips_insert_point): Fetch lwpid from current_inferior.
3666         Pass &all_threads to find_inferior, not &all_lwps.
3667         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
3668         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
3669         directly.
3670         (mips_stopped_data_address): Ditto.
3671         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
3672         directly.
3673         * linux-tile-low.c (tile_arch_setup): Ditto.
3674         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
3675         (update_debug_registers_callback): Update, "entry" parameter is a
3676         struct thread_info * now.  Fetch pid from thread.
3677         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
3678         Pass &all_threads to find_inferior, not &all_lwps.
3679         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
3680         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
3681         Pass &all_threads to find_inferior, not &all_lwps.
3682         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
3683         (i386_dr_low_get_status): Ditto.
3684         (x86_linux_prepare_to_resume): Fetch ptid from thread.
3685         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
3686         (x86_linux_read_description): Ditto.
3687         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
3688
3689 2014-02-20  Doug Evans  <dje@google.com>
3690
3691         * inferiors.c (get_first_inferior): Fix buglet.
3692
3693 2014-02-19  Doug Evans  <dje@google.com>
3694
3695         * gdbthread.h (add_thread): Change result type to struct thread_info *.
3696         * inferiors.c (add_thread): Change result type to struct thread_info *.
3697         All callers updated.
3698         (add_lwp): Call add_thread here instead of in callers.
3699         All callers updated.
3700         * linux-low.h (get_lwp_thread): Rewrite.
3701         (struct lwp_info): New member "thread".
3702
3703 2014-02-19  Doug Evans  <dje@google.com>
3704
3705         * linux-low.c (add_lwp): Change result to struct lwp_info *.
3706         All callers updated.
3707
3708 2014-02-19  Doug Evans  <dje@google.com>
3709
3710         * inferiors.c (add_thread): Fix whitespace.
3711
3712 2014-02-19  Doug Evans  <dje@google.com>
3713
3714         * dll.c (clear_dlls): Replace accessing list implemention details
3715         with API function.
3716         * gdbthread.h (get_first_thread): Declare.
3717         * inferiors.c (for_each_inferior_with_data): New function.
3718         (get_first_thread): New function.
3719         (find_thread_ptid): Simplify.
3720         (get_first_inferior): New function.
3721         (clear_list): Delete.
3722         (one_inferior_p): New function.
3723         (clear_inferior_list): New function.
3724         (clear_inferiors): Update.
3725         * inferiors.h (for_each_inferior_with_data): Declare.
3726         (clear_inferior_list): Declare.
3727         (one_inferior_p): Declare.
3728         (get_first_inferior): Declare.
3729         * linux-low.c (linux_wait_for_event): Replace accessing list
3730         implemention details with API function.
3731         * server.c (target_running): Ditto.
3732         (accumulate_file_name_length): New function.
3733         (emit_dll_description): New function.
3734         (handle_qxfer_libraries): Replace accessing list implemention
3735         details with API function.
3736         (handle_qxfer_threads_worker): New function.
3737         (handle_qxfer_threads_proper): Replace accessing list implemention
3738         details with API function.
3739         (handle_query): Ditto.
3740         (visit_actioned_threads_callback_ftype): New typedef.
3741         (visit_actioned_threads_data): New struct.
3742         (visit_actioned_threads): Rewrite to be find_inferior callback.
3743         (resume): Call find_inferior.
3744         (handle_status): Replace accessing list implemention
3745         details with API function.
3746         (process_serial_event): Replace accessing list implemention details
3747         with API function.
3748         * target.c (set_desired_inferior): Replace accessing list implemention
3749         details with API function.
3750         * tracepoint.c (same_process_p): New function.
3751         (gdb_agent_about_to_close): Replace accessing list implemention
3752         details with API function.
3753         * win32-low.c (child_delete_thread): Replace accessing list
3754         implemention details with API function.
3755         (match_dll_by_basename): New function.
3756         (dll_is_loaded_by_basename): New function.
3757         (win32_ensure_ntdll_loaded): Replace accessing list implemention
3758         details call to dll_is_loaded_by_basename.
3759
3760 2014-02-19  Doug Evans  <dje@google.com>
3761
3762         * dll.h (struct dll_info): Add comment.
3763         * gdbthread.h (struct thread_info): Add comment.
3764         (current_ptid): Simplify.
3765         * inferiors.c (add_process): Update.
3766         (remove_process): Update.
3767         * inferiors.h (struct process_info): Rename member "head" to "entry".
3768         * linux-low.c (delete_lwp): Update.
3769         (add_lwp): Update.
3770         (last_thread_of_process_p): Update.
3771         (kill_one_lwp_callback, linux_kill): Update.
3772         (status_pending_p_callback): Update.
3773         (wait_for_sigstop): Update.  Simplify read of ptid.
3774         (start_step_over): Update.
3775         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
3776         (get_lwp_thread): Update.
3777         (struct lwp_info): Rename member "head" to "entry".
3778         * regcache.h (inferior_list_entry): Delete.
3779         * server.c (kill_inferior_callback): Update.
3780         (detach_or_kill_inferior_callback): Update.
3781         (print_started_pid): Update.
3782         (print_attached_pid): Update.
3783         (process_serial_event): Simplify read of ptid.
3784         * thread-db.c (thread_db_create_event): Update.
3785         (thread_db_get_tls_address): Update.
3786         * win32-low.c (current_inferior_ptid): Simplify.
3787
3788 2014-02-19  Tom Tromey  <tromey@redhat.com>
3789
3790         * target.h (struct target_ops) <supports_btrace>: Add target_ops
3791         argument.
3792         (target_supports_btrace): Update.
3793
3794 2014-02-14  Yao Qi  <yao@codesourcery.com>
3795
3796         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
3797         (rsp-low-ipa.o): New target.
3798
3799 2014-02-12  Tom Tromey  <tromey@redhat.com>
3800
3801         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
3802         convert_ascii_to_int.
3803         * regcache.c (registers_to_string): Likewise.
3804         * remote-utils.c (decode_M_packet): Likewise.
3805         * server.c (process_serial_event): Likewise.
3806
3807 2014-02-12  Tom Tromey  <tromey@redhat.com>
3808
3809         * server.c (handle_query, handle_v_run): Use hex2bin, not
3810         unhexify.
3811         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
3812
3813 2014-02-12  Tom Tromey  <tromey@redhat.com>
3814
3815         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
3816         convert_int_to_ascii.
3817         * regcache.c (registers_to_string, collect_register_as_string):
3818         Likewise.
3819         * remote-utils.c (look_up_one_symbol, relocate_instruction):
3820         Likewise.
3821         * server.c (process_serial_event): Likewise.
3822         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
3823         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
3824
3825 2014-02-12  Tom Tromey  <tromey@redhat.com>
3826
3827         * remote-utils.c (look_up_one_symbol, monitor_output): Use
3828         bin2hex, not hexify.
3829         * tracepoint.c (cmd_qtstatus): Likewise.
3830
3831 2014-02-12  Tom Tromey  <tromey@redhat.com>
3832
3833         * remote-utils.c (monitor_output): Pass explicit length to
3834         hexify.
3835
3836 2014-02-12  Tom Tromey  <tromey@redhat.com>
3837
3838         * tracepoint.c: Include rsp-low.h.
3839         * server.c: Include rsp-low.h.
3840         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
3841         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
3842         declare.
3843         * remote-utils.c: Include rsp-low.h.
3844         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
3845         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
3846         (convert_int_to_ascii, convert_ascii_to_int): Move to
3847         common/rsp-low.c.
3848         * regcache.c: Include rsp-low.h.
3849         * ax.c: Include rsp-low.h.
3850         * Makefile.in (SFILES): Add common/rsp-low.c.
3851         (OBS): Add rsp-low.o.
3852         (rsp-low.o): New target.
3853
3854 2014-02-12  Tom Tromey  <tromey@redhat.com>
3855
3856         * utils.h (pulongest, plongest, phex_nz): Don't declare.
3857         Include print-utils.h.
3858         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
3859         (plongest, thirty_two, phex_nz): Remove.
3860         * Makefile.in (SFILES): Add common/print-utils.c.
3861         (OBS): Add print-utils.o.
3862         (print-utils-ipa.o): New target.
3863         (print-utils.o): New target.
3864         (IPA_OBJS): Add print-utils-ipa.o.
3865
3866 2014-02-06  Tom Tromey  <tromey@redhat.com>
3867
3868         * Makefile.in (SFILES): Fix indentation.
3869
3870 2014-02-05  Doug Evans  <dje@google.com>
3871
3872         * linux-low.c (linux_wait_for_event): Improve comment.
3873         (linux_wait_1): Keep current_inferior in sync with event_child.
3874
3875 2014-01-22  Doug Evans  <dje@google.com>
3876
3877         * gdbthread.h (gdb_id_to_thread): Delete, unused.
3878
3879 2014-01-22  Doug Evans  <dje@google.com>
3880
3881         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
3882         * configure: Regenerate.
3883         * config.in: Regenerate.
3884         * Makefile.in (SFILES): Add debug.c.
3885         (OBS): Add debug.o.
3886         * debug.c: New file.
3887         * debug.h: New file.
3888         * linux-aarch64-low.c (*): Update all debugging printfs to use
3889         debug_printf instead of fprintf.
3890         * linux-arm-low.c (*): Ditto.
3891         * linux-cris-low.c (*): Ditto.
3892         * linux-crisv32-low.c (*): Ditto.
3893         * linux-m32r-low.c (*): Ditto.
3894         * linux-sparc-low.c (*): Ditto.
3895         * linux-x86.c (*): Ditto.
3896         * linux-low.c (*): Ditto.
3897         (linux_wait_1): Add calls to debug_enter, debug_exit.
3898         (linux_wait): Remove redundant debugging printf.
3899         (stop_all_lwps): Add calls to debug_enter, debug_exit.
3900         (linux_resume, unstop_all_lwps): Ditto.
3901         * mem-break.c (*): Update all debugging printfs to use
3902         debug_printf instead of fprintf.
3903         * remote-utils.c (*): Ditto.
3904         * thread-db.c (*): Ditto.
3905         * server.c #include <ctype.h>, "gdb_vecs.h".
3906         (debug_threads): Moved to debug.c.
3907         (*): Update all debugging printfs to use debug_printf instead of
3908         fprintf.
3909         (start_inferior): Replace call to fflush with call to debug_flush.
3910         (monitor_show_help): Mention set debug-format.
3911         (parse_debug_format_options): New function.
3912         (handle_monitor_command): Handle "monitor set debug-format".
3913         (gdbserver_usage): Mention --debug-format.
3914         (main): Parse --debug-format.
3915         * server.h (debug_threads): Declaration moved to debug.h.
3916         #include "debug.h".
3917         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
3918         trace_debug_1 that uses debug_printf.
3919         (tracepoint_look_up_symbols): Update all debugging printfs to use
3920         debug_printf instead of fprintf.
3921
3922 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
3923
3924         * linux-xtensa-low.c: Include asm/ptrace.h instead of
3925         sys/ptrace.h.
3926
3927 2014-01-17  Pedro Alves  <palves@redhat.com>
3928
3929         PR build/16445
3930         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
3931         defined after including gdb_proc_service.h.
3932
3933 2014-01-16  Doug Evans  <dje@google.com>
3934
3935         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
3936         (match_dll): Use it.
3937
3938 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
3939
3940         * target.h (target_ops) <read_btrace>: Change parameters and
3941         return type to allow error reporting.
3942         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
3943         trace reading errors on.
3944         * linux-low.c (linux_low_read_btrace): Pass trace reading
3945         errors on.
3946         (linux_low_disable_btrace): New.
3947
3948 2014-01-15  Doug Evans  <dje@google.com>
3949
3950         * inferiors.c (thread_id_to_gdb_id): Delete.
3951         * inferiors.h (thread_id_to_gdb_id): Delete.
3952
3953 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
3954
3955         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
3956         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
3957         versions.
3958
3959 2014-01-08  Pedro Alves  <palves@redhat.com>
3960
3961         * server.c (handle_status): Don't discard previous queued stop
3962         replies or thread's pending status here.
3963         (main) <disconnection>: Do it here instead.
3964
3965 2014-01-08  Pedro Alves  <palves@redhat.com>
3966
3967         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
3968         * server.c (visit_actioned_threads, handle_pending_status): New
3969         function.
3970         (handle_v_cont): Factor out parts to ...
3971         (resume): ... this new function.  If in all-stop, and a thread
3972         being resumed has a pending status, report it without actually
3973         resuming.
3974         (myresume): Adjust to use the new 'resume' function.
3975         (clear_pending_status_callback, set_pending_status_callback)
3976         (find_status_pending_thread_callback): New functions.
3977         (handle_status): Handle the case of multiple threads having
3978         interesting statuses to report.  Report threads' real last signal
3979         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
3980         with an interesting thread to report the status for, instead of
3981         always reporting the status of the first thread.
3982
3983 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
3984
3985         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
3986         * gdbreplay.c (gdbreplay_version): Likewise.
3987
3988 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
3989
3990         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
3991         iov.iov_len with the real length in use.
3992
3993 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
3994
3995         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
3996         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
3997         for all targets that use win32-low.c.
3998         * win32-low.c (win32_ensure_ntdll_loaded): New function.
3999         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4000
4001 2013-12-13  Pedro Alves  <palves@redhat.com>
4002
4003         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4004         if equal to TARGET_WAITKIND_LOADED.
4005         * win32-low.c (cached_status): New static global.
4006         (win32_wait): Add declaration.
4007         (do_initial_child_stuff): Flush all initial pending debug events
4008         up to the initial breakpoint.
4009         (win32_wait): If CACHED_STATUS was set, return that instead
4010         of doing a real wait.  Remove the code resuming the execution
4011         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4012         during the initial phase.  Also remove the code changing
4013         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4014         TARGET_WAITKIND_STOPPED.
4015
4016 2013-12-11  Yao Qi  <yao@codesourcery.com>
4017
4018         * notif.c (handle_notif_ack): Return 0 if no notification
4019         matches.
4020
4021 2013-11-20  Doug Evans  <dje@google.com>
4022
4023         * linux-low.c (linux_set_resume_request): Fix comment.
4024
4025 2013-11-20  Doug Evans  <dje@google.com>
4026
4027         * linux-low.c (resume_status_pending_p): Tweak comment.
4028
4029 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4030
4031         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4032         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4033         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4034         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4035         (srv_amd64_regobj): Add amd64-mpx.o.
4036         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4037         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4038         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4039         * i387-fp.c (num_pl_bnd_register) Added constant.
4040         (num_pl_bnd_cfg_registers) Added constant.
4041         (struct i387_xsave) Added reserved area and MPX fields.
4042         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4043         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4044         function.
4045         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4046         (init_registers_amd64_mpx_linux): Declare new function.
4047         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4048         (x86_64_regmap): Add MPX registers.
4049         (x86_linux_read_description): Add MPX case.
4050         (initialize_low_arch): Initialize MPX targets.
4051
4052 2013-11-18  Tom Tromey  <tromey@redhat.com>
4053
4054         * configure: Rebuild.
4055         * configure.ac: Don't check for stdlib.h.
4056         * gdbreplay.c: Unconditionally include stdlib.h.
4057
4058 2013-11-18  Tom Tromey  <tromey@redhat.com>
4059
4060         * config.in: Rebuild.
4061         * configure: Rebuild.
4062         * configure.ac: Don't use AC_HEADER_DIRENT.
4063
4064 2013-11-18  Tom Tromey  <tromey@redhat.com>
4065
4066         * server.h: Don't check HAVE_STRING_H.
4067         * gdbreplay.c: Don't check HAVE_STRING_H.
4068         * configure: Rebuild.
4069
4070 2013-11-18  Tom Tromey  <tromey@redhat.com>
4071
4072         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4073         LIBGNU.
4074
4075 2013-11-08  Tom Tromey  <tromey@redhat.com>
4076
4077         * configure, config.in: Rebuild.
4078         * configure.ac: Remove unused configury.
4079
4080 2013-11-08  Tom Tromey  <tromey@redhat.com>
4081
4082         * acinclude.m4: Include common.m4, codeset.m4.
4083         * configure, config.in: Rebuild.
4084         * configure.ac: Use GDB_AC_COMMON.
4085
4086 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4087
4088         * linux-s390-low.c (HWCAP_S390_TE): New define.
4089         (s390_arch_setup): Consider the TE field in the HWCAP for
4090         determining 'have_regset_tdb'.
4091
4092 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4093
4094         PR gdb/16014
4095         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4096         call to sizeof.
4097
4098 2013-10-02  Pedro Alves  <palves@redhat.com>
4099
4100         * server.c (process_serial_event): Don't output "GDBserver
4101         exiting" if GDB is connected through stdio.
4102         * target.c (mywait): Likewise, be silent if GDB is connected
4103         through stdio.
4104
4105 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4106
4107         * lynx-low.c (lynx_add_threads_after_attach): New function.
4108         (lynx_attach): Remove call to add_thread.  Add call to
4109         lynx_add_threads_after_attach instead.
4110
4111 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4112
4113         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4114         * config.in, configure: Regenerated.
4115
4116 2013-09-18  Yao Qi  <yao@codesourcery.com>
4117
4118         PR server/15959
4119         * server.c (start_inferior): Clear 'resume_info'.
4120
4121 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4122
4123         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4124         for each register.
4125
4126 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4127
4128         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4129         linux-tile-low.o to srv_tgtobj.
4130
4131 2013-09-16  Will Newton  <will.newton@linaro.org>
4132
4133         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4134         out regs.
4135
4136 2013-09-06  Pedro Alves  <palves@redhat.com>
4137
4138         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4139         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4140         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4141         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4142         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4143         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4144
4145 2013-09-06  Pedro Alves  <palves@redhat.com>
4146
4147         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4148         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4149
4150 2013-09-06  Pedro Alves  <palves@redhat.com>
4151
4152         * linux-amd64-ipa.c: Include tracepoint.h.
4153         * linux-i386-ipa.c: Include tracepoint.h.
4154
4155 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4156
4157         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4158         (ps_get_thread_area): New function.
4159
4160 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4161
4162         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4163         (initialize_low_arch): Call init_registers_crisv32 rather than
4164         init_register_crisv32.
4165
4166 2013-09-05  Pedro Alves  <palves@redhat.com>
4167
4168         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4169         to ...
4170         * hostio.h: ... this new file.
4171         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4172         win32-low.c: Include hostio.h.
4173
4174 2013-09-05  Pedro Alves  <palves@redhat.com>
4175
4176         * server.h (gdb_client_data, handler_func, callback_handler_func)
4177         (delete_file_handler, add_file_handler, append_callback_event)
4178         (delete_callback_event, start_event_loop, initialize_event_loop):
4179         Move to event-loop.h and include it.
4180         * event-loop.h: New file.
4181
4182 2013-09-05  Pedro Alves  <palves@redhat.com>
4183
4184         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4185         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4186         (loaded_dll, unloaded_dll): Move to ...
4187         * dll.h: ... this new file.
4188         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4189
4190 2013-09-05  Pedro Alves  <palves@redhat.com>
4191
4192         * server.h (current_process, get_thread_process, all_processes)
4193         (add_inferior_to_list, for_each_inferior, current_inferior)
4194         (remove_inferior, add_process, remove_process, find_process_pid)
4195         (have_started_inferiors_p, have_attached_inferiors_p)
4196         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4197         (clear_inferiors, find_inferior, find_inferior_id)
4198         (inferior_target_data, set_inferior_target_data)
4199         (inferior_regcache_data, set_inferior_regcache_data): Move to
4200         inferiors.h, and include it.
4201         * inferiors.h: New file.
4202
4203 2013-09-05  Pedro Alves  <palves@redhat.com>
4204
4205         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4206         Move ...
4207         * ax.h: ... here.
4208
4209 2013-09-05  Pedro Alves  <palves@redhat.com>
4210
4211         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4212         tracepoint.h.
4213         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4214         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4215         (handle_tracepoint_general_set, handle_tracepoint_query)
4216         (tracepoint_finished_step, tracepoint_was_hit)
4217         (release_while_stepping_state_list, current_traceframe)
4218         (in_readonly_region, traceframe_read_mem)
4219         (fetch_traceframe_registers, traceframe_read_sdata)
4220         (traceframe_read_info, struct fast_tpoint_collect_status)
4221         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4222         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4223         (supply_fast_tracepoint_registers)
4224         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4225         (ipa_tdesc, claim_trampoline_space)
4226         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4227         (agent_mem_read, agent_get_trace_state_variable_value)
4228         (agent_set_trace_state_variable_value, agent_tsv_read)
4229         (agent_mem_read_string, get_raw_reg_func_addr)
4230         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4231         * tracepoint.h: ... this new file.
4232
4233 2013-09-05  Pedro Alves  <palves@redhat.com>
4234
4235         * server.h (perror_with_name, error, fatal, warning, paddress)
4236         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4237         include it.
4238         * utils.h: New file.
4239
4240 2013-09-05  Pedro Alves  <palves@redhat.com>
4241
4242         * server.h (remote_debug, noack_mode, transport_is_reliable)
4243         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4244         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4245         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4246         (write_enn, initialize_async_io, enable_async_io)
4247         (disable_async_io, check_remote_input_interrupt_request)
4248         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4249         (dead_thread_notify, prepare_resume_reply)
4250         (decode_address_to_semicolon, decode_address, decode_m_packet)
4251         (decode_M_packet, decode_X_packet, decode_xfer_write)
4252         (decode_search_memory_packet, unhexify, hexify)
4253         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4254         (look_up_one_symbol, relocate_instruction)
4255         (monitor_output): Move to remote-utils.h, and include it.
4256         * remote-utils.h: New file.
4257
4258 2013-09-05  Pedro Alves  <palves@redhat.com>
4259
4260         * server.h (_): Delete.
4261
4262 2013-09-02  Pedro Alves  <palves@redhat.com>
4263
4264         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4265         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4266         allocated.
4267         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4268
4269 2013-09-02  Pierre Muller  <muller@sourceware.org>
4270
4271         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4272         or WriteProcessMemory complete successfully and handle
4273         ERROR_PARTIAL_COPY error.
4274
4275 2013-09-02  Pedro Alves  <palves@redhat.com>
4276
4277         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4278         error instead of EIO.
4279
4280 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4281
4282         PR server/15604
4283         * linux-low.c: Include filestuff.h.
4284         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4285         * lynx-low.c: Include filestuff.h.
4286         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4287         * server.c: Include filestuff.h.
4288         (main): Call notice_open_fds.
4289         * spu-low.c: Include filestuff.h.
4290         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4291
4292 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4293
4294         * Makefile.in: Explain why ../target and ../nat are not
4295         listed as include file search paths.
4296         (linux-waitpid.o): New object file rule.
4297         * configure.srv (srv_native_linux_obj): New variable.
4298         Replace all occurrences of linux native object files with
4299         $srv_native_linux_obj.
4300         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4301         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4302         (linux_enable_event_reporting): Remove declaration.
4303         (my_waitpid): Moved to common/linux-waitpid.c.
4304         (linux_wait_for_event): Pass ptid when calling
4305         linux_enable_event_reporting.
4306         (linux_supports_tracefork_flag): Remove.
4307         (linux_enable_event_reporting): Likewise.
4308         (linux_tracefork_grandchild): Remove.
4309         (STACK_SIZE): Moved to common/linux-ptrace.c.
4310         (linux_tracefork_child): Remove.
4311         (linux_test_for_tracefork): Remove.
4312         (linux_look_up_symbols): Call linux_supports_traceclone.
4313         (initialize_low): Remove call to linux_test_for_tracefork.
4314         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4315         common/linux-ptrace.h.
4316         (PTRACE_TYPE_ARG4): Likewise.
4317         Include linux-ptrace.h.
4318
4319 2013-08-21  Pedro Alves  <palves@redhat.com>
4320
4321         * config.in: Renegerate.
4322
4323 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4324
4325         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4326         (SFILES): Remove $(srcdir)/common/target-common.c and
4327         add $(srcdir)/target/waitstatus.c.
4328         (OBS): Remove target-common.o and add waitstatus.o.
4329         (server_h): Remove $(srcdir)/../common/target-common.h and
4330         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4331         and $(srcdir)/../target/waitstatus.h.
4332         (target-common.o): Remove.
4333         (waitstatus.o): New target object file.
4334         * target.h: Do not include target-common.h and
4335         include target/resume.h, target/wait.h and
4336         target/waitstatus.h.
4337
4338 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4339
4340         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4341         to PTRACE_TYPE_ARG3.
4342         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4343         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4344         PTRACE_TYPE_ARG4.
4345         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4346         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4347
4348 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4349             Daniel Jacobowitz  <dan@codesourcery.com>
4350             Yao Qi  <yao@codesourcery.com>
4351
4352         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4353         (mips-linux-watch.o): New rule.
4354         (mips_linux_watch_h): New variable.
4355         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4356         srv_tgtobj.
4357         * linux-mips-low.c: Include mips-linux-watch.h.
4358         (struct arch_process_info, struct arch_lwp_info): New.
4359         (update_watch_registers_callback): New function.
4360         (mips_linux_new_process, mips_linux_new_thread) New functions.
4361         (mips_linux_prepare_to_resume, mips_insert_point): New
4362         functions.
4363         (mips_remove_point, mips_stopped_by_watchpoint): New
4364         functions.
4365         (rsp_bp_type_to_target_hw_bp_type): New function.
4366         (mips_stopped_data_address): New function.
4367         (the_low_target): Add watchpoint support functions.
4368
4369 2013-07-27  Yao Qi  <yao@codesourcery.com>
4370
4371         * i386-low.c: Include break-common.h.
4372         (enum target_hw_bp_type): Remove.
4373
4374 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4375
4376         * Makefile.in (SFILES): /common/target-common.c.
4377         (OBS): Add target-common.o.
4378         (server_h): Add $(srcdir)/../common/target-common.h.
4379         (target-common.o): New target.
4380         * server.c (queue_stop_reply_callback): Free
4381         status string after use.
4382         * target.c (target_waitstatus_to_string): Remove.
4383         * target.h: Include target-common.h.
4384         (resume_kind): Likewise.
4385         (target_waitkind): Likewise.
4386         (target_waitstatus): Likewise.
4387         (TARGET_WNOHANG): Likewise.
4388
4389 2013-07-04  Yao Qi  <yao@codesourcery.com>
4390
4391         * Makefile.in (host_alias): Use @host_noncanonical@.
4392         (target_alias): Use @target_noncanonical@.
4393         * configure.ac: Use ACX_NONCANONICAL_TARGET and
4394         ACX_NONCANONICAL_HOST.
4395         * configure: Regenerated.
4396
4397         Revert:
4398         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4399
4400         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4401         * configure: Rebuild.
4402         * Makefile.in (version_host, version_target): Get from configure.
4403         (version.c): Use $(version_host) and $(version_target).
4404
4405 2013-07-03  Pedro Alves  <palves@redhat.com>
4406
4407         * Makefile.in (config.status): Depend on development.sh.
4408         * acinclude.m4: Include libmcheck.m4.
4409         * configure: Regenerate.
4410
4411 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4412
4413         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
4414         attribute inside the parentheses.
4415         (winapi_DebugSetProcessKillOnExit): Ditto.
4416         (winapi_DebugBreakProcess): Ditto.
4417         (winapi_GenerateConsoleCtrlEvent): Ditto.
4418
4419 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4420
4421         * notif.h (notif_event): Add a dummy member to avoid compiler
4422         errors.
4423
4424 2013-07-01  Pedro Alves  <palves@redhat.com>
4425
4426         * hostio.c (HOSTIO_PATH_MAX): Define.
4427         (require_filename, handle_open, handle_unlink, handle_readlink):
4428         Use it.
4429
4430 2013-07-01  Pedro Alves  <palves@redhat.com>
4431
4432         * server.h: Include "pathmax.h".
4433         * linux-low.c: Don't include sys/param.h.
4434         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
4435         MAXPATHLEN.
4436         * win32-low.c: Don't include sys/param.h.
4437         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
4438
4439 2013-07-01  Pedro Alves  <palves@redhat.com>
4440
4441         * event-loop.c: Don't check HAVE_UNISTD_H before including
4442         <unistd.h>.
4443         * gdbreplay.c: Likewise.
4444         * remote-utils.c: Likewise.
4445         * server.c: Likewise.
4446         * configure.ac: Don't check for unistd.h.
4447         * configure: Regenerate.
4448
4449 2013-06-28  Tom Tromey  <tromey@redhat.com>
4450
4451         * Makefile.in (version.c): Use version.in, not
4452         common/version.in.
4453
4454 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4455
4456         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4457         * configure: Rebuild.
4458         * Makefile.in (version_host, version_target): Get from configure.
4459         (version.c): Use $(version_host) and $(version_target).
4460
4461 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4462
4463         Fix trace-status to output user name without trailing colon.
4464         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
4465
4466 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4467
4468         Fix trace-status to output proper start-time and stop-time.
4469         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
4470         output start time and stop time in hex as gdb expects.
4471
4472 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
4473
4474         * tracepoint.c (build_traceframe_info_xml): Output trace state
4475         variables present in the trace buffer.
4476
4477 2013-06-24  Tom Tromey  <tromey@redhat.com>
4478
4479         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
4480         create-version.sh.
4481         (version.o): Remove.
4482         * gdbreplay.c: Include version.h.
4483         (version, host_name): Don't declare.
4484         * server.h: Include version.h.
4485         (version, host_name): Don't declare.
4486
4487 2013-06-12  Pedro Alves  <palves@redhat.com>
4488
4489         * linux-x86-low.c (linux_is_elf64): Delete global.
4490         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
4491         with local linux_pid_exe_is_elf_64_file use.
4492
4493 2013-06-11  Pedro Alves  <palves@redhat.com>
4494
4495         * linux-low.c (regset_disabled, disable_regset): New functions.
4496         (regsets_fetch_inferior_registers)
4497         (regsets_store_inferior_registers): Use them.
4498         (initialize_regsets_info); Don't allocate the disabled_regsets
4499         array here.
4500         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
4501         comment.
4502
4503 2013-06-11  Pedro Alves  <palves@redhat.com>
4504
4505         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
4506         xmalloc.
4507
4508 2013-06-11  Pedro Alves  <palves@redhat.com>
4509
4510         * linux-x86-low.c (initialize_low_arch): Call
4511         init_registers_x32_avx_linux.
4512
4513 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
4514
4515         Fix compatibility with Android Bionic.
4516         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
4517         it is not empty.
4518
4519 2013-06-07  Pedro Alves  <palves@redhat.com>
4520
4521         PR server/14823
4522         * Makefile.in (OBS): Add tdesc.o.
4523         (IPA_OBJS): Add tdesc-ipa.o.
4524         (tdesc-ipa.o): New rule.
4525         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
4526         interface.
4527         * linux-low.c (new_inferior): Delete.
4528         (disabled_regsets, num_regsets): Delete.
4529         (linux_add_process): Adjust to set the new per-process
4530         new_inferior flag.
4531         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
4532         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
4533         was a stop.  When calling arch_setup, switch the current inferior
4534         to the thread that got an event.
4535         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
4536         (regsets_fetch_inferior_registers)
4537         (regsets_store_inferior_registers): New regsets_info parameter.
4538         Adjust to use it.
4539         (linux_register_in_regsets): New regs_info parameter.  Adjust to
4540         use it.
4541         (register_addr, fetch_register, store_register): New usrregs_info
4542         parameter.  Adjust to use it.
4543         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
4544         parameter regs_info.  Adjust to use it.
4545         (linux_fetch_registers): Get the current inferior's regs_info, and
4546         adjust to use it.
4547         (linux_store_registers): Ditto.
4548         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
4549         (initialize_low): Don't initialize the target_regsets here.  Call
4550         initialize_low_arch.
4551         * linux-low.h (target_regsets): Delete declaration.
4552         (struct regsets_info): New.
4553         (struct usrregs_info): New.
4554         (struct regs_info): New.
4555         (struct process_info_private) <new_inferior>: New field.
4556         (struct linux_target_ops): Delete the num_regs, regmap, and
4557         regset_bitmap fields.  New field regs_info.
4558         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
4559         * i387-fp.c (num_xmm_registers): Delete.
4560         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
4561         calls to new interface.
4562         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
4563         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
4564         Infer the number of xmm registers from the regcache's target
4565         description.
4566         * i387-fp.h (num_xmm_registers): Delete.
4567         * inferiors.c (add_thread): Don't install the thread's regcache
4568         here.
4569         * proc-service.c (gregset_info): Fetch the current inferior's
4570         regs_info.  Adjust to use it.
4571         * regcache.c: Include tdesc.h.
4572         (register_bytes, reg_defs, num_registers)
4573         (gdbserver_expedite_regs): Delete.
4574         (get_thread_regcache): If the thread doesn't have a regcache yet,
4575         create one, instead of aborting gdbserver.
4576         (regcache_invalidate_one): Rename to ...
4577         (regcache_invalidate_thread): ... this.
4578         (regcache_invalidate_one): New.
4579         (regcache_invalidate): Only invalidate registers of the current
4580         process.
4581         (init_register_cache): Add target_desc parameter, and use it.
4582         (new_register_cache): Ditto.  Assert the target description has a
4583         non zero registers_size.
4584         (regcache_cpy): Add assertions.  Adjust.
4585         (realloc_register_cache, set_register_cache): Delete.
4586         (registers_to_string, registers_from_string): Adjust.
4587         (find_register_by_name, find_regno, find_register_by_number)
4588         (register_cache_size): Add target_desc parameter, and use it.
4589         (free_register_cache_thread, free_register_cache_thread_one)
4590         (regcache_release, register_cache_size): New.
4591         (register_size): Add target_desc parameter, and use it.
4592         (register_data, supply_register, supply_register_zeroed)
4593         (supply_regblock, supply_register_by_name, collect_register)
4594         (collect_register_as_string, collect_register_by_name): Adjust.
4595         * regcache.h (struct target_desc): Forward declare.
4596         (struct regcache) <tdesc>: New field.
4597         (init_register_cache, new_register_cache): Add target_desc
4598         parameter.
4599         (regcache_invalidate_thread): Declare.
4600         (regcache_invalidate_one): Delete declaration.
4601         (regcache_release): Declare.
4602         (find_register_by_number, register_cache_size, register_size)
4603         (find_regno): Add target_desc parameter.
4604         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
4605         declarations.
4606         * remote-utils.c: Include tdesc.h.
4607         (outreg, prepare_resume_reply): Adjust.
4608         * server.c: Include tdesc.h.
4609         (gdbserver_xmltarget): Delete declaration.
4610         (get_features_xml, process_serial_event): Adjust.
4611         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
4612         declare.
4613         (struct process_info) <tdesc>: New field.
4614         (ipa_tdesc): Declare.
4615         * tdesc.c: New file.
4616         * tdesc.h: New file.
4617         * tracepoint.c: Include tdesc.h.
4618         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
4619         (get_context_regcache): Adjust to pass ipa_tdesc down.
4620         (do_action_at_tracepoint): Adjust to get the register cache size
4621         from the context regcache's description.
4622         (traceframe_walk_blocks): Adjust to get the register cache size
4623         from the current trace frame's description.
4624         (traceframe_get_pc): Adjust to get current trace frame's
4625         description and pass it down.
4626         (gdb_collect): Adjust to get the register cache size from the
4627         IPA's description.
4628         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
4629         (gdbserver_xmltarget): Delete.
4630         (initialize_low_tracepoint): Set the ipa's target description.
4631         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
4632         (initialize_low_tracepoint): Set the ipa's target description.
4633         * linux-x86-low.c: Include tdesc.h.
4634         [__x86_64__] (is_64bit_tdesc): New.
4635         (ps_get_thread_area, x86_get_thread_area): Use it.
4636         (i386_cannot_store_register): Rename to ...
4637         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
4638         (i386_cannot_fetch_register): Rename to ...
4639         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
4640         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
4641         to new interface.
4642         (target_regsets): Rename to ...
4643         (x86_regsets): ... this.
4644         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
4645         interface.
4646         (x86_siginfo_fixup): Use is_64bit_tdesc.
4647         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
4648         (tdesc_x32_avx_linux, tdesc_x32_linux)
4649         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
4650         Declare.
4651         (x86_linux_update_xmltarget): Delete.
4652         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
4653         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
4654         (AMD64_LINUX_USER64_CS): New.
4655         (x86_linux_read_description): New, based on
4656         x86_linux_update_xmltarget.
4657         (same_process_callback): New.
4658         (x86_arch_setup_process_callback): New.
4659         (x86_linux_update_xmltarget): New.
4660         (x86_regsets_info): New.
4661         (amd64_linux_regs_info): New.
4662         (i386_linux_usrregs_info): New.
4663         (i386_linux_regs_info): New.
4664         (x86_linux_regs_info): New.
4665         (x86_arch_setup): Reimplement.
4666         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
4667         (x86_emit_ops): Ditto.
4668         (the_low_target): Adjust.  Install x86_linux_regs_info,
4669         x86_cannot_fetch_register, and x86_cannot_store_register.
4670         (initialize_low_arch): New.
4671         * linux-ia64-low.c (tdesc_ia64): Declare.
4672         (ia64_fetch_register): Adjust.
4673         (ia64_usrregs_info, regs_info): New globals.
4674         (ia64_regs_info): New function.
4675         (the_low_target): Adjust.
4676         (initialize_low_arch): New function.
4677         * linux-sparc-low.c (tdesc_sparc64): Declare.
4678         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
4679         Adjust.
4680         (sparc_arch_setup): New function.
4681         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
4682         (the_low_target): Adjust.
4683         (initialize_low_arch): New function.
4684         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
4685         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
4686         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
4687         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
4688         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
4689         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
4690         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
4691         (tdesc_powerpc_isa205_vsx64l): Declare.
4692         (ppc_cannot_store_register, ppc_collect_ptrace_register)
4693         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
4694         (ppc_set_pc, ppc_get_hwcap): Adjust.
4695         (ppc_usrregs_info): Forward declare.
4696         (!__powerpc64__) ppc_regmap_adjusted: New global.
4697         (ppc_arch_setup): Adjust to the current process'es target
4698         description.
4699         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
4700         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
4701         (ppc_store_evrregset): Adjust.
4702         (target_regsets): Rename to ...
4703         (ppc_regsets): ... this, and make static.
4704         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
4705         (ppc_regs_info): New function.
4706         (the_low_target): Adjust.
4707         (initialize_low_arch): New function.
4708         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
4709         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
4710         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
4711         (tdesc_s390x_linux64v2): Declare.
4712         (s390_collect_ptrace_register, s390_supply_ptrace_register)
4713         (s390_fill_gregset, s390_store_last_break): Adjust.
4714         (target_regsets): Rename to ...
4715         (s390_regsets): ... this, and make static.
4716         (s390_get_pc, s390_set_pc): Adjust.
4717         (s390_get_hwcap): New target_desc parameter, and use it.
4718         [__s390x__] (have_hwcap_s390_high_gprs): New global.
4719         (s390_arch_setup): Adjust to set the current process'es target
4720         description.  Don't adjust the regmap.
4721         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
4722         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
4723         (regs_info_3264): New globals.
4724         (s390_regs_info): New function.
4725         (the_low_target): Adjust.
4726         (initialize_low_arch): New function.
4727         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
4728         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
4729         [__mips64] (init_registers_mips_linux)
4730         (init_registers_mips_dsp_linux): Delete defines.
4731         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
4732         (have_dsp): New global.
4733         (mips_read_description): New, based on mips_arch_setup.
4734         (mips_arch_setup): Reimplement.
4735         (get_usrregs_info): New function.
4736         (mips_cannot_fetch_register, mips_cannot_store_register)
4737         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
4738         (mips_fill_fpregset, mips_store_fpregset): Adjust.
4739         (target_regsets): Rename to ...
4740         (mips_regsets): ... this, and make static.
4741         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
4742         (dsp_regs_info, regs_info): New globals.
4743         (mips_regs_info): New function.
4744         (the_low_target): Adjust.
4745         (initialize_low_arch): New function.
4746         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
4747         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
4748         Declare.
4749         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
4750         (arm_read_description): New, with bits factored from
4751         arm_arch_setup.
4752         (arm_arch_setup): Reimplement.
4753         (target_regsets): Rename to ...
4754         (arm_regsets): ... this, and make static.
4755         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
4756         (arm_regs_info): New function.
4757         (the_low_target): Adjust.
4758         (initialize_low_arch): New function.
4759         * linux-m68k-low.c (tdesc_m68k): Declare.
4760         (target_regsets): Rename to ...
4761         (m68k_regsets): ... this, and make static.
4762         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
4763         (m68k_regs_info): New function.
4764         (m68k_arch_setup): New function.
4765         (the_low_target): Adjust.
4766         (initialize_low_arch): New function.
4767         * linux-sh-low.c (tdesc_sharch): Declare.
4768         (target_regsets): Rename to ...
4769         (sh_regsets): ... this, and make static.
4770         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
4771         (sh_regs_info, sh_arch_setup): New functions.
4772         (the_low_target): Adjust.
4773         (initialize_low_arch): New function.
4774         * linux-bfin-low.c (tdesc_bfin): Declare.
4775         (bfin_arch_setup): New function.
4776         (bfin_usrregs_info, regs_info): New globals.
4777         (bfin_regs_info): New function.
4778         (the_low_target): Adjust.
4779         (initialize_low_arch): New function.
4780         * linux-cris-low.c (tdesc_cris): Declare.
4781         (cris_arch_setup): New function.
4782         (cris_usrregs_info, regs_info): New globals.
4783         (cris_regs_info): New function.
4784         (the_low_target): Adjust.
4785         (initialize_low_arch): New function.
4786         * linux-cris-low.c (tdesc_crisv32): Declare.
4787         (cris_arch_setup): New function.
4788         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
4789         (cris_regs_info): New function.
4790         (the_low_target): Adjust.
4791         (initialize_low_arch): New function.
4792         * linux-m32r-low.c (tdesc_m32r): Declare.
4793         (m32r_arch_setup): New function.
4794         (m32r_usrregs_info, regs_info): New globals.
4795         (m32r_regs_info): Adjust.
4796         (initialize_low_arch): New function.
4797         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
4798         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
4799         (tic6x_usrregs_info): Forward declare.
4800         (tic6x_read_description): New function, based on ...
4801         (tic6x_arch_setup): ... this.  Reimplement.
4802         (target_regsets): Rename to ...
4803         (tic6x_regsets): ... this, and make static.
4804         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
4805         (tic6x_regs_info): New function.
4806         (the_low_target): Adjust.
4807         (initialize_low_arch): New function.
4808         * linux-xtensa-low.c (tdesc_xtensa): Declare.
4809         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
4810         (target_regsets): Rename to ...
4811         (xtensa_regsets): ... this, and make static.
4812         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
4813         globals.
4814         (xtensa_arch_setup, xtensa_regs_info): New functions.
4815         (the_low_target): Adjust.
4816         (initialize_low_arch): New function.
4817         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
4818         (nios2_arch_setup): Set the current process'es tdesc.
4819         (target_regsets): Rename to ...
4820         (nios2_regsets): ... this.
4821         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
4822         (nios2_regs_info): New function.
4823         (the_low_target): Adjust.
4824         (initialize_low_arch): New function.
4825         * linux-aarch64-low.c (tdesc_aarch64): Declare.
4826         (aarch64_arch_setup): Set the current process'es tdesc.
4827         (target_regsets): Rename to ...
4828         (aarch64_regsets): ... this.
4829         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
4830         (aarch64_regs_info): New function.
4831         (the_low_target): Adjust.
4832         (initialize_low_arch): New function.
4833         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
4834         globals.
4835         (target_regsets): Rename to ...
4836         (tile_regsets): ... this.
4837         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
4838         (tile_regs_info): New function.
4839         (tile_arch_setup): Set the current process'es tdesc.
4840         (the_low_target): Adjust.
4841         (initialize_low_arch): New function.
4842         * spu-low.c (tdesc_spu): Declare.
4843         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
4844         * win32-arm-low.c (tdesc_arm): Declare.
4845         (arm_arch_setup): New function.
4846         (the_low_target): Install arm_arch_setup instead of
4847         init_registers_arm.
4848         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
4849         (init_windows_x86): Rename to ...
4850         (i386_arch_setup): ... this.  Set `win32_tdesc'.
4851         (the_low_target): Adjust.
4852         * win32-low.c (win32_tdesc): New global.
4853         (child_add_thread): Don't create the thread cache here.
4854         (do_initial_child_stuff): Set the new process'es tdesc.
4855         * win32-low.h (struct target_desc): Forward declare.
4856         (win32_tdesc): Declare.
4857         * lynx-i386-low.c (tdesc_i386): Declare global.
4858         (lynx_i386_arch_setup): Set `lynx_tdesc'.
4859         * lynx-low.c (lynx_tdesc): New global.
4860         (lynx_add_process): Set the new process'es tdesc.
4861         * lynx-low.h (struct target_desc): Forward declare.
4862         (lynx_tdesc): Declare global.
4863         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
4864         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
4865         * nto-low.c (nto_tdesc): New global.
4866         (do_attach): Set the new process'es tdesc.
4867         * nto-low.h (struct target_desc): Forward declare.
4868         (nto_tdesc): Declare.
4869         * nto-x86-low.c (tdesc_i386): Declare.
4870         (nto_x86_arch_setup): Set `nto_tdesc'.
4871
4872 2013-06-04  Gary Benson  <gbenson@redhat.com>
4873
4874         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
4875         to qSupported response when appropriate.
4876         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
4877         with nonzero-length annex.
4878         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
4879         arguments supplied in annex.
4880
4881 2013-05-31  Doug Evans  <dje@google.com>
4882
4883         PR server/15594
4884         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
4885         64 bits in 64-cross-32 environment.
4886
4887 2013-05-28  Pedro Alves  <palves@redhat.com>
4888
4889         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
4890         (aarch64-without-fpu.c): Delete rule.
4891         * configure.srv (aarch64*-*-linux*): Remove references to
4892         aarch64-without-fpu.o and aarch64-without-fpu.xml.
4893         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
4894         declaration.
4895
4896 2013-05-24  Pedro Alves  <palves@redhat.com>
4897
4898         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
4899         instead of strchr/decode_address.  Error if the range isn't split
4900         with a ','.  Don't assume there's be a ':' in the action.
4901
4902 2013-05-23  Yao Qi  <yao@codesourcery.com>
4903             Pedro Alves  <palves@redhat.com>
4904
4905         * linux-low.c (lwp_in_step_range): New function.
4906         (linux_wait_1): If the thread was range stepping and stopped
4907         outside the stepping range, report the stop to GDB.  Otherwise,
4908         continue stepping.  Add range stepping debug output.
4909         (linux_set_resume_request): Copy the step range from the resume
4910         request to the lwp.
4911         (linux_supports_range_stepping): New.
4912         (linux_target_ops) <supports_range_stepping>: Set to
4913         linux_supports_range_stepping.
4914         * linux-low.h (struct linux_target_ops)
4915         <supports_range_stepping>: New field.
4916         (struct lwp_info) <step_range_start, step_range_end>: New fields.
4917         * linux-x86-low.c (x86_supports_range_stepping): New.
4918         (the_low_target) <supports_range_stepping>: Set to
4919         x86_supports_range_stepping.
4920         * server.c (handle_v_cont): Handle 'r' action.
4921         (handle_v_requests): Append ";r" if the target supports range
4922         stepping.
4923         * target.h (struct thread_resume) <step_range_start,
4924         step_range_end>: New fields.
4925         (struct target_ops) <supports_range_stepping>:
4926         New field.
4927         (target_supports_range_stepping): New macro.
4928
4929 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
4930
4931         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
4932         confusion in comment.
4933
4934 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
4935
4936         * lynx-low.c (struct process_info_private): New type.
4937         (lynx_add_process): New function.
4938         (lynx_create_inferior, lynx_attach): Replace calls to
4939         add_process by calls to lynx_add_process.
4940         (lynx_resume): If PTID is null, then try using
4941         current_process()->private->last_wait_event_ptid.
4942         Add comments.
4943         (lynx_clear_inferiors): Delete.  The contents of that function
4944         has been inlined in lynx_mourn;
4945         (lynx_wait_1): Save the ptid in the process's private data.
4946         (lynx_mourn): Free the process' private data.  Replace call
4947         to lynx_clear_inferiors by call to clear_inferiors.
4948
4949 2013-05-17  Yao Qi  <yao@codesourcery.com>
4950
4951         * i386-low.c (i386_length_and_rw_bits): Move the comment to
4952         the right place.
4953
4954 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
4955
4956         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
4957         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
4958         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
4959         PT_TEXT_END_ADDR guards.  Update comments.
4960         (linux_target_op) <read_offsets>: Conditionally define to
4961         linux_read_offsets if the target is UCLIBC and if it defines
4962         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
4963
4964 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
4965             Andrew Jenner  <andrew@codesourcery.com>
4966
4967         * Makefile.in (SFILES): Add linux-nios2-low.c.
4968         (clean): Add action to delete nios2-linux.c.
4969         (nios2-linux.c): New rule.
4970         * configure.srv: Add nios2*-*-linux*.
4971         * linux-nios2-low.c: New.
4972
4973 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
4974
4975         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
4976
4977 2013-04-25  Hui Zhu  <hui@codesourcery.com>
4978
4979         PR gdb/15186
4980         * ax.c (ax_printf): Add fflush.
4981
4982 2013-04-22  Tom Tromey  <tromey@redhat.com>
4983
4984         * Makefile.in (SFILES): Add filestuff.c.
4985         (OBS): Add filestuff.o.
4986         (filestuff.o): New target.
4987         * config.in, configure: Rebuild.
4988         * configure.ac: Check for fdwalk, pipe2.
4989
4990 2013-04-17  Pedro Alves  <palves@redhat.com>
4991
4992         * configure.ac (USE_THREAD_DB): Delete variable.
4993         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
4994         Don't AC_SUBST USE_THREAD_DB.
4995         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
4996         * config.in, configure: Regenerate.
4997
4998 2013-04-16  Pedro Alves  <palves@redhat.com>
4999
5000         * linux-low.h (struct lwp_info) <thread_known>: Move under
5001         the USE_THREAD_DB #ifdef.
5002
5003 2013-04-16  Pedro Alves  <palves@redhat.com>
5004
5005         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5006         (linux-low.o): Delete rule.
5007         * linux-low.h: Always include "gdb_thread_db.h" instead of
5008         conditionally including thread_db.h.
5009         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5010         HAVE_THREAD_DB_H.
5011
5012 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5013
5014         * Makefile.in (install-only): Fix make install regression.
5015
5016 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5017
5018         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5019         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5020         installation.
5021         * gdbserver.1: Remove.
5022
5023 2013-03-22  Pedro Alves  <palves@redhat.com>
5024
5025         * linux-low.c (handle_extended_wait): Don't call
5026         linux_enable_event_reporting.
5027
5028 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5029
5030         PR build/9098:
5031         * Makefile.in (SHELL): Use @SHELL@.
5032
5033 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5034
5035         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5036         compiler warning.
5037
5038 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5039
5040         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5041         Remove extraneous NULL element.
5042
5043 2013-03-13  Yao Qi  <yao@codesourcery.com>
5044
5045         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5046         'V' block in trace frame.
5047
5048 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5049
5050         * target.h (struct target_ops): Add btrace ops.
5051         (target_supports_btrace): New macro.
5052         (target_enable_btrace): New macro.
5053         (target_disable_btrace): New macro.
5054         (target_read_btrace): New macro.
5055         * gdbthread.h (struct thread_info): Add btrace field.
5056         * server.c: Include btrace-common.h.
5057         (handle_btrace_general_set): New function.
5058         (handle_btrace_enable): New function.
5059         (handle_btrace_disable): New function.
5060         (handle_general_set): Call handle_btrace_general_set.
5061         (handle_qxfer_btrace): New function.
5062         (struct qxfer qxfer_packets[]): Add btrace entry.
5063         * inferiors.c (remove_thread): Disable btrace.
5064         * linux-low: Include linux-btrace.h.
5065         (linux_low_enable_btrace): New function.
5066         (linux_low_read_btrace): New function.
5067         (linux_target_ops): Add btrace ops.
5068         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5069         Add srv_linux_btrace=yes.
5070         (x86_64-*-linux*): Add linux-btrace.o.
5071         Add srv_linux_btrace=yes.
5072         * configure.ac: Define HAVE_LINUX_BTRACE.
5073         * config.in: Regenerated.
5074         * configure: Regenerated.
5075
5076 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5077
5078         * server.c (handle_qxfer): Preserve error message if -3 is
5079         returned.
5080         (qxfer): Document the -3 return value.
5081
5082 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5083
5084         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5085         (linux_btrace_h): New variable.
5086         (linux-btrace.o): New rule.
5087
5088 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5089             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5090
5091         * tracepoint.c (trace_buffer_size): New global.
5092         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5093         (init_trace_buffer): Change to one-argument function. Allocate
5094         trace buffer memory.
5095         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5096         handle QTBuffer:size packet.
5097         (cmd_bigqtbuffer_size): New function.
5098         (initialize_tracepoint): Call init_trace_buffer with
5099         DEFAULT_TRACE_BUFFER_SIZE.
5100         * server.c (handle_query): Add QTBuffer:size in the
5101         supported packets.
5102
5103 2013-03-07  Yao Qi  <yao@codesourcery.com>
5104
5105         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5106         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5107         of -1.
5108         (cmd_qtsp): Adjust condition.  Do post increment.
5109         Set cur_action and cur_step_action back to 0.
5110
5111 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5112
5113         PR server/15236
5114         * linux-low.c (linux_write_memory): Return early success if LEN is
5115         zero.
5116
5117 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5118
5119         * configure.srv: Add x86_64-*-cygwin* as target.
5120
5121 2013-02-28  Tom Tromey  <tromey@redhat.com>
5122
5123         * configure.ac: Invoke AC_SYS_LARGEFILE.
5124         * configure, config.in: Rebuild.
5125
5126 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5127
5128         * win32-low.c: Throughout, fix format strings and casts of
5129         printf-like functions to avoid type related warnings on all
5130         platforms.
5131         (get_child_debug_event): Print dwDebugEventCode as hex since
5132         that's how it's usually documented.
5133
5134 2013-02-28  Yao Qi  <yao@codesourcery.com>
5135
5136         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5137         pulongest.
5138
5139 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5140
5141         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5142         (reg-tilegx32.c): New rule.
5143         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5144         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5145         different register info initializer according to elf class.
5146         (init_registers_tilgx32): New function.  The tilegx32 register info
5147         initializer.
5148         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5149         (tile_store_gregset): Likewise.
5150
5151 2013-02-27  Yao Qi  <yao@codesourcery.com>
5152
5153         * server.c (process_point_options): Print debug message when
5154         debug_threads is true.
5155
5156 2013-02-26  Yao Qi  <yao@codesourcery.com>
5157
5158         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5159
5160 2013-02-19  Pedro Alves  <palves@redhat.com>
5161             Kai Tietz <ktietz@redhat.com>
5162
5163         PR gdb/15161
5164
5165         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5166         instead of strtoul to extract address from packet.
5167         (process_serial_event) <'z'>: Likewise.
5168
5169 2013-02-18  Yao Qi  <yao@codesourcery.com>
5170
5171         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5172
5173 2013-02-14  Pedro Alves  <palves@redhat.com>
5174
5175         Plug memory leak.
5176
5177         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5178         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5179
5180 2013-02-14  Pedro Alves  <palves@redhat.com>
5181
5182         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5183
5184 2013-02-14  Pedro Alves  <palves@redhat.com>
5185
5186         * tracepoint.c (save_string): Delete.
5187         (add_tracepoint_action): Use savestring instead of save_string.
5188
5189 2013-02-12  Pedro Alves  <palves@redhat.com>
5190
5191         * linux-xtensa-low.c: Ditto.
5192         * xtensa-xtregs.c: Ditto.
5193
5194 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5195
5196         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5197         thread_db.
5198
5199 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5200
5201         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5202         aarch64_num_wp_regs and aarch64_num_bp_regs to
5203         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5204
5205 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5206
5207         * linux-aarch64-low.c (ps_get_thread_area): Replace
5208         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5209
5210 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5211             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5212             Nigel Stephens  <nigel.stephens@arm.com>
5213             Yufeng Zhang  <yufeng.zhang@arm.com>
5214
5215         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5216         (aarch64.c, aarch64-without-fpu.c): New targets.
5217         * configure.srv (aarch64*-*-linux*): New.
5218         * linux-aarch64-low.c: New file.
5219
5220 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5221
5222         * linux-low.c (handle_extended_wait, linux_create_inferior)
5223         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5224         (dequeue_one_deferred_signal, linux_resume_one_thread)
5225         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5226         (linux_tracefork_grandchild, linux_test_for_tracefork)
5227         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5228         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5229         where the argument is 0.
5230
5231 2013-01-25  Yao Qi  <yao@codesourcery.com>
5232
5233         * event-loop.c: Include "queue.h".
5234         (gdb_event_p): New typedef.
5235         (struct gdb_event) <next_event>: Remove.
5236         (event_queue): Change to QUEUE(gdb_event_p).
5237         (async_queue_event): Remove.
5238         (gdb_event_xfree): New.
5239         (initialize_event_loop): New.
5240         (process_event): Use API from QUEUE.
5241         (wait_for_event): Likewise.
5242         * server.c (main): Call initialize_event_loop.
5243         * server.h (initialize_event_loop): Declare.
5244
5245 2013-01-18  Yao Qi  <yao@codesourcery.com>
5246
5247         * ax.h (struct eval_agent_expr_context): New.
5248         (gdb_eval_agent_expr): Update declaration.
5249         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5250         TFRAME.  Add new argument CTX.
5251         * server.h (struct eval_agent_expr_context): Declare.
5252         (agent_mem_read, agent_tsv_read): Update declaration.
5253         (agent_mem_read_string): Likewise.
5254         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5255         (add_traceframe_block): Add new argument TPOINT.
5256         Increase TPOINT->traceframe_usage.
5257         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5258         eval_tracepoint_agent_expr.
5259         (condition_true_at_tracepoint): Likewise.
5260         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5261         (agent_mem_read_string, agent_tsv_read): Likewise.
5262
5263 2013-01-16  Yao Qi  <yao@codesourcery.com>
5264
5265         * linux-low.c (linux_resume_one_lwp): Don't check
5266         'lwp->bp_reinsert != 0'.
5267
5268 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5269             Pedro Alves  <palves@redhat.com>
5270
5271         * lynx-low.c (ptrace_request_to_str): Define a temporary
5272         macro and use it to simplify this function's implementation.
5273
5274 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5275
5276         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5277         sets errno.
5278
5279 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5280
5281         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5282
5283 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5284
5285         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5286
5287 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5288
5289         * lynx-low.c (lynx_resume): Use the resume_info parameter
5290         to determine the ptid for the lynx_ptrace call, unless
5291         it is equal to minus_one_ptid, in which case we use the
5292         ptid of the current_inferior.
5293         (lynx_wait_1): After having received a thread create/exit
5294         event, resume the inferior's execution using the signaling
5295         thread's ptid, rather than the old ptid.
5296
5297 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5298
5299         * lynx-low.c (lynx_resume): Delete variable ret.
5300
5301 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5302
5303         * gdbreplay.c (gdbreplay_version): Update copyright year.
5304         * server.c (gdbserver_version): Likewise.
5305
5306 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5307
5308         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5309         new thread.
5310
5311 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5312
5313         * lynx-low.c (ptrace_request_to_str): Add handling for
5314         PTRACE_GETTRACESIG.
5315
5316 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5317
5318         * lynx-low.c (lynx_attach): Delete variable new_process.
5319
5320 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5321
5322         * lynx-low.c (lynx_create_inferior): Delete variable
5323         new_process.
5324
5325 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5326
5327         * lynx-low.c (ptrace_request_to_str): Do not handle
5328         PTRACE_GETTHREADLIST if this macro does not exist.
5329
5330 2012-12-15  Yao Qi  <yao@codesourcery.com>
5331
5332         * Makefile.in (OBS): Add notif.o.
5333         * notif.c, notif.h: New.
5334         * server.c: Include "notif.h".
5335         (struct vstop_notif) <next>: Remove.
5336         <base>: New field.
5337         (queue_stop_reply): Update.
5338         (push_event, send_next_stop_reply): Remove.
5339         (discard_queued_stop_replies): Update.
5340         (notif_stop): New variable.
5341         (handle_v_stopped): Remove.
5342         (handle_v_requests): Don't call handle_v_stopped.  Call
5343         handle_ack_notif instead.
5344         (queue_stop_reply_callback): Call notif_event_enque instead
5345         of queue_stop_reply.
5346         (handle_status): Don't call send_next_stop_reply, call
5347         notif_write_event instead.
5348         (kill_inferior_callback): Likewise.
5349         (detach_or_kill_inferior_callback): Likewise.
5350         (main): Call initialize_notif.
5351         (process_serial_event): Call QUEUE_is_empty.
5352         (handle_target_event): Call notif_push instead of push event.
5353         * server.h (push_event): Remove declaration.
5354
5355 2012-12-10  Tom Tromey  <tromey@redhat.com>
5356
5357         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5358         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5359         macros.
5360         (.c.o): Rewrite.
5361         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5362         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5363         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5364         (amd64-linux-ipa.o, ax.o): Rewrite.
5365         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5366         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5367         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5368         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5369         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5370         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5371         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5372         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5373         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5374         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5375         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5376         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5377         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5378         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5379         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5380         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5381         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5382         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5383         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5384         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5385         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5386         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5387         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5388         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5389         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
5390         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
5391         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
5392         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
5393         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
5394         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
5395         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
5396         (reg-tilegx.o): Remove.
5397         (all_object_files): New macro.
5398         Include .deps files.
5399         * aclocal.m4, configure: Rebuild.
5400         * acinclude.m4: Include depstand.m4, lead-dot.m4.
5401         * configure.ac: Invoke ZW_CREATE_DEPDIR,
5402         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
5403
5404 2012-12-05  Tom Tromey  <tromey@redhat.com>
5405
5406         PR gdb/14917:
5407         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
5408
5409 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
5410
5411         * configure.ac: Check for linux/perf_event.h.
5412         * config.in: Regenerated.
5413         * configure: Regenerated.
5414
5415 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
5416
5417         * hostio.c (handle_readlink): Decrease buffer size
5418         parameter passed to readlink by one byte.
5419
5420 2012-11-26  Yao Qi  <yao@codesourcery.com>
5421
5422         * configure.ac (build_warnings): Append '-Wempty-body'.
5423         * configure: Regenerated.
5424         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
5425         body.
5426
5427 2012-11-15  Pierre Muller  <muller@sourceware.org>
5428
5429         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
5430         * config.in: Regenerate.
5431         * configure: Regenerate.
5432         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
5433         Use "gdb_wait.h" header instead of <sys/wait.h> header.
5434         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5435         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
5436         header.
5437         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
5438         instead of <sys/wait.h> header.
5439         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5440
5441 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
5442
5443         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
5444         (various make rules): Remove -DGDBSERVER
5445
5446 2012-11-09  Yao Qi  <yao@codesourcery.com>
5447
5448         * spu-low.c (current_ptid): Move it to ..
5449         * gdbthread.h: ... here.  New.
5450         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
5451         * server.c (myresume, process_serial_event): Likewise.
5452         * thread-db.c (thread_db_find_new_threads): Likewise.
5453         * tracepoint.c (run_inferior_command): Likewise.
5454
5455 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
5456
5457         * server.c (handle_search_memory_1): Include access length in
5458         warning message.
5459
5460 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
5461
5462         * linux-crisv32-low.c: Fix compile errors.
5463
5464 2012-09-04  Yao Qi  <yao@codesourcery.com>
5465
5466         * tracepoint.c (cmd_qtsv): Adjust debug message.
5467         Don't check CUR_TPOINT.
5468
5469 2012-08-28  Yao Qi  <yao@codesourcery.com>
5470
5471         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
5472         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
5473         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
5474         Remove declarations of xmalloc, xreallloc, xstrdup and
5475         freeargv.
5476         * Makefile.in (libiberty_h): New.
5477         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
5478         (linux-bfin-low.o): Append dependency 'libiberty.h'.
5479
5480 2012-08-23  Yao Qi  <yao@codesourcery.com>
5481
5482         * server.h: Remove declaration of 'xsnprintf'.
5483
5484 2012-08-22  Keith Seitz  <keiths@redhat.com>
5485
5486         * server.h: Include build-gnulib-gbserver/config.h.
5487         * gdbreplay.c: Likewise.
5488
5489 2012-08-08  Doug Evans  <dje@google.com>
5490
5491         * Makefile.in (SFILES): Add gdb_vecs.c.
5492         (OBS): Add gdb_vecs.o.
5493         (gdb_vecs_h, host_defs_h): New variables.
5494         (thread-db.o): Add $(gdb_vecs_h) dependency.
5495         (gdb_vecs.o): New rule.
5496         * thread-db.c: #include "gdb_vecs.h".
5497         (thread_db_load_search): Use a vector to iterate over path elements.
5498         Handle text appearing after "$pdir".
5499
5500         * configure.ac: Add check for strstr.
5501         * config.in: Regenerate.
5502         * configure: Regenerate.
5503
5504 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
5505
5506         * hostio.c (handle_pread): If pread fails, fall back to attempting
5507         lseek/read.
5508         (handle_pwrite): Likewise for pwrite.
5509
5510 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
5511
5512         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
5513         between unsupported TYPE and unimplementable ADDR/LEN combination.
5514         (arm_insert_point): Act on new return value.
5515
5516 2012-07-31  Pedro Alves  <palves@redhat.com>
5517
5518         * server.c (process_point_options): Only skip tokens if we find
5519         one that is unrecognized.  Don't treat 'X' specially while
5520         skipping unrecognized tokens.
5521
5522 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
5523
5524         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
5525         to 4-byte-align HW breakpoint addresses for Thumb.
5526
5527 2012-07-27  Yao Qi  <yao@codesourcery.com>
5528
5529         PR remote/14161.
5530
5531         * server.h: Declare gdb_agent_about_to_close.
5532         * target.c (kill_inferior): Include "agent.h".
5533         New.  Send command 'kill'.
5534         * target.h (kill_inferior): Removed macro.
5535         * tracepoint.c (gdb_agent_about_to_close): New.
5536         (gdb_agent_helper_thread): Handle command 'close'.
5537         Wait endlessly until the inferior stops.
5538         Install gdb_agent_remove_socket to atexit hook.
5539         (agent_socket_name): New static variable.
5540         (gdb_agent_socket_init): Replace local variable 'name' with
5541         'agent_socket_name'.
5542         (gdb_agent_remove_socket): New.
5543
5544 2012-07-27  Yao Qi  <yao@codesourcery.com>
5545
5546         * server.c (process_point_options): Stop at 'X' when parsing.
5547
5548 2012-07-19  Michael Eager  <eager@eagercon.com>
5549
5550         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
5551         to hw_execute.
5552         * linux-x86-low.c (x86_insert_point, x86_remove_point):
5553         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
5554         hardware breakpoint.
5555
5556 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5557
5558         * gdbserver/linux-low.c (initialize_low): Call
5559         linux_ptrace_init_warnings.
5560
5561 2012-07-02  Doug Evans  <dje@google.com>
5562
5563         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
5564         pointer to int.
5565
5566 2012-07-02  Stan Shebs  <stan@codesourcery.com>
5567
5568         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
5569         (ax.o): Add it to build rule.
5570         (ax-ipa.o): Ditto.
5571         (OBS): Add format.o.
5572         (IPA_OBS): Add format.o.
5573         * server.c (handle_query): Claim support for breakpoint commands.
5574         (process_point_options): Add command case.
5575         (process_serial_event): Leave running if there are printfs in
5576         effect.
5577         * mem-break.h (any_persistent_commands): Declare.
5578         (add_breakpoint_commands): Declare.
5579         (gdb_no_commands_at_breakpoint): Declare.
5580         (run_breakpoint_commands): Declare.
5581         * mem-break.c (struct point_command_list): New struct.
5582         (struct breakpoint): New field command_list.
5583         (any_persistent_commands): New function.
5584         (add_commands_to_breakpoint): New function.
5585         (add_breakpoint_commands): New function.
5586         (gdb_no_commands_at_breakpoint): New function.
5587         (run_breakpoint_commands): New function.
5588         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
5589         locally.
5590         * ax.c: Include format.h.
5591         (ax_printf): New function.
5592         (gdb_eval_agent_expr): Add printf opcode.
5593
5594 2012-06-13  Yao Qi  <yao@codesourcery.com>
5595
5596         * server.c (start_inferior): Remove duplicated writes to fields
5597         'last_resume_kind' and 'last_status' of 'current_inferior'.
5598
5599 2012-06-12  Yao Qi  <yao@codesourcery.com>
5600             Pedro Alves  <palves@redhat.com>
5601
5602         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
5603         comment.
5604         * server.c (handle_v_cont): Extend comment.
5605
5606 2012-06-11  Yao Qi  <yao@codesourcery.com>
5607
5608         * linux-low.c (linux_attach): Add 'static'.
5609
5610 2012-06-06  Yao Qi  <yao@codesourcery.com>
5611
5612         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
5613
5614 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
5615
5616         Fix gcc -flto compilation warning.
5617         * server.c (main): Make variable multi_mode and attach volatile.
5618
5619 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5620
5621         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
5622         if the platform doesn't know about it.
5623
5624 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
5625
5626         * Makefile.in (SFILES): Add linux-tile-low.c.
5627         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
5628         * configure.srv: Handle tilegx-*-linux*.
5629         * linux-tile-low.c: New file.
5630
5631 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5632
5633         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
5634
5635 2012-05-24  Pedro Alves  <palves@redhat.com>
5636
5637         PR gdb/7205
5638
5639         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
5640
5641 2012-05-24  Pedro Alves  <palves@redhat.com>
5642
5643         PR gdb/7205
5644
5645         Replace target_signal with gdb_signal throughout.
5646
5647 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
5648
5649         * linux-low.c (linux_store_registers): Avoid the copying sequence
5650         when no data has been retrieved by ptrace.
5651
5652 2012-05-22  Will Deacon  <will.deacon@arm.com>
5653
5654         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
5655         Include asm/ptrace.h.
5656         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
5657         already defined.
5658
5659 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
5660
5661         * linux-low.c (linux_store_registers): Don't re-retrieve data
5662         with ptrace that has already been obtained from /proc.  Always
5663         copy any data retrieved with ptrace to the buffer supplied.
5664
5665 2012-05-11  Yao Qi  <yao@codesourcery.com>
5666             Pedro Alves  <palves@redhat.com>
5667
5668         * linux-low.c (enum stopping_threads_kind): New.
5669         (stopping_threads): Change type to `enum stopping_threads_kind'.
5670         (handle_extended_wait): If stopping and suspending threads, leave
5671         the new_lwp suspended too.
5672         (linux_wait_for_event): Adjust.
5673         (stop_all_lwps): Set `stopping_threads' to
5674         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
5675         whether we're suspending threads or just stopping them.  Assert no
5676         recursion happens.
5677
5678 2012-04-29  Yao Qi  <yao@codesourcery.com>
5679
5680         * server.h: Move some code to ...
5681         * gdbthread.h: ... here.  New.
5682         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
5683         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
5684         (nto-low.o, win32-low.o): Likewise.
5685         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
5686         * regcache.c, remote-utils.c, server.c: Likewise.
5687         * target.c, tracepoint.c, win32-low.c: Likewise.
5688
5689 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5690
5691         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
5692         (PTRACE_ARG4_TYPE): Likewise.
5693         (PTRACE_XFER_TYPE): Likewise.
5694         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
5695         ptrace to PTRACE_ARG3_TYPE.
5696         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
5697         (PTRACE_ARG4_TYPE): Likewise.
5698         (PTRACE_XFER_TYPE): Likewise.
5699         (linux_detach_one_lwp): Cast fourth argument of
5700         ptrace to long then PTRACE_ARG4_TYPE.
5701         (regsets_fetch_inferior_registers): Cast third argument of
5702         ptrace to long then PTRACE_ARG3_TYPE.
5703         (regsets_store_inferior_registers): Likewise.
5704
5705 2012-04-20  Pedro Alves  <palves@redhat.com>
5706
5707         * configure: Regenerate.
5708
5709 2012-04-19  Pedro Alves  <palves@redhat.com>
5710
5711         * Makefile.in (GNULIB_BUILDDIR): New.
5712         (LIBGNU, INCGNU, GNULIB_H): Adjust.
5713         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
5714         (all, install-only, uninstall, clean-info, all-lib, clean): No
5715         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
5716         (maintainer-clean realclean distclean): Use subdir_do.
5717         (subdir_do): New.
5718         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
5719         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
5720         * acinclude.m4: Include acx_configure_dir.m4.
5721         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
5722         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
5723         ACX_CONFIGURE_DIR.
5724         (GNULIB): New.
5725         (GNULIB_STDINT_H): Adjust.
5726         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
5727         * gdbreplay.c: Include build-gnulib/config.h.
5728         * server.h: Likewise.
5729         * aclocal.m4: Regenerate.
5730         * config.in: Regenerate.
5731         * configure: Regenerate.
5732
5733 2012-04-19  Pedro Alves  <palves@redhat.com>
5734
5735         * Makefile.in (LIBGNU, INCGNU): Adjust.
5736         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
5737         (all, install-only, uninstall, clean-info, all-lib, clean)
5738         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
5739         * configure.ac: Adjust AC_OUTPUT output.
5740         * aclocal.m4: Regenerate.
5741         * configure: Regenerate.
5742
5743 2012-04-19  Pedro Alves  <palves@redhat.com>
5744
5745         * Makefile.in (generated_files): New.
5746         (server_h): Remove the explicit dependency on config.h, and depend
5747         on $generated_files.
5748
5749 2012-04-19  Pedro Alves  <palves@redhat.com>
5750
5751         * Makefile.in (INCGNU): Add -Ignulib.
5752
5753 2012-04-19  Pedro Alves  <palves@redhat.com>
5754
5755         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
5756         (INCGNU): ... this, and spell out -I here.
5757         (GNULIB_LIB): Rename to ...
5758         (LIBGNU): ... this.
5759         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
5760
5761 2012-04-19  Pedro Alves  <palves@redhat.com>
5762
5763         * config.in: Regenerate.
5764
5765 2012-04-19  Pedro Alves  <palves@redhat.com>
5766
5767         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
5768         * server.h (memmem): Remove declaration.
5769         * config.in: Regenerate.
5770         * configure: Regenerate.
5771
5772 2012-04-19  Yao Qi  <yao@codesourcery.com>
5773
5774         * Makefile.in (SFILES): Add common/vec.c.
5775         (OBS): Add vec.o.
5776         (vec.o): New rule.
5777
5778 2012-04-19  Yao Qi  <yao@codesourcery.com>
5779
5780         * remote-utils.c (prepare_resume_reply): Replace with macro
5781         target_core_of_thread.
5782         * server.c (handle_qxfer_threads_proper): Likewise.
5783         * target.h (traget_core_of_thread): New macro.
5784
5785 2012-04-18  Pedro Alves  <palves@redhat.com>
5786
5787         * aclocal.m4: Regenerate.
5788         * configure: Regenerate.
5789
5790 2012-04-16  Yao Qi  <yao@codesourcery.com>
5791
5792         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
5793         duplicated on address.
5794
5795 2012-04-16  Yao Qi  <yao@codesourcery.com>
5796
5797         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
5798         (struct tracepoint_action_ops) <send>: New field.
5799         (m_tracepoint_action_send, r_tracepoint_action_send): New.
5800         (agent_expr_send, x_tracepoint_action_send): New.
5801         (l_tracepoint_action_send): New.
5802         (cmd_qtdp): Download and install tracepoint
5803         according to `use_agent'.
5804         (run_inferior_command): Add one more parameter `len'.
5805         Update callers.
5806         (tracepoint_send_agent): New.
5807         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
5808
5809 2012-04-16  Yao Qi  <yao@codesourcery.com>
5810
5811         * tracepoint.c (download_tracepoints): Moved to ...
5812         (cmd_qtstart): ... here.
5813
5814 2012-04-14  Yao Qi  <yao@codesourcery.com>
5815
5816         * tracepoint.c: Include inttypes.h.
5817         (struct collect_memory_action): Use sized types.
5818         (struct tracepoint): Likewise.
5819         (cmd_qtdp, stop_tracing): Update print specifiers.
5820         (cmd_qtp, response_tracepoint): Likewise.
5821         (collect_data_at_tracepoint): Likewise.
5822         (collect_data_at_step): Likewise.
5823
5824 2012-04-14  Yao Qi  <yao@codesourcery.com>
5825
5826         Import gnulib module inttypes.
5827         * aclocal.m4, config.in, configure: Regenerated.
5828
5829 2012-04-14  Yao Qi  <yao@codesourcery.com>
5830
5831         * Makefile.in (maintainer-clean, realclean, distclean): Remove
5832         Makefile and config.status at last.
5833
5834 2012-04-13  Yao Qi  <yao@codesourcery.com>
5835
5836         * tracepoint.c: Include stdint.h unconditionally.
5837
5838 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5839
5840         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
5841         on BFD_HAVE_SYS_PROCFS_TYPE.
5842         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
5843         * configure: Regenerate.
5844         * config.in: Likewise.
5845
5846 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
5847
5848         * Makefile.in (clean): Also remove x32.c x32-linux.c
5849         x32-avx.c x32-avx-linux.c.
5850         (x32.o): New target.
5851         (x32.c): Likewise.
5852         (x32-linux.o): Likewise.
5853         (x32-linux.c): Likewise.
5854         (x32-avx.o): Likewise.
5855         (x32-avx.c): Likewise.
5856         (x32-avx-linux.o): Likewise.
5857         (x32-avx-linux.c): Likewise.
5858
5859         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
5860         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
5861         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
5862         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
5863         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
5864         i386/x32-avx-linux.xml.
5865
5866         * linux-x86-low.c (init_registers_x32_linux): New prototype.
5867         (init_registers_x32_avx_linux): Likwise.
5868         (x86_linux_update_xmltarget): Call init_registers_x32_linux
5869         or init_registers_x32_avx_linux if linux_is_elf64 is false.
5870
5871 2012-04-13  Pedro Alves  <palves@redhat.com>
5872
5873         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
5874         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
5875         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
5876         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
5877         the sub-make.
5878
5879 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
5880
5881         * linux-x86-low.c (compat_x32_clock_t): New.
5882         (compat_x32_siginfo_t): Likewise.
5883         (compat_x32_siginfo_from_siginfo): Likewise.
5884         (siginfo_from_compat_x32_siginfo): Likewise.
5885         (linux_is_elf64): Likewise.
5886         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
5887         and siginfo_from_compat_x32_siginfo for x32.
5888         (x86_arch_setup): Set linux_is_elf64.
5889
5890 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
5891
5892         PR gdb/13969
5893         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
5894         e_machine field.
5895         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
5896         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
5897         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
5898         compatible with process.
5899
5900 2012-04-12  Yao Qi  <yao@codesourcery.com>
5901
5902         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
5903         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
5904         (install-only, install-info, clean): Handle sub dir gnulib.
5905         (all-lib, am--refresh): New targets.
5906         (memmem.o): Remove target.
5907         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
5908         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
5909         (AC_REPLACE_FUNCS): Remove memmem.
5910         Invoke gl_INIT and AM_INIT_AUTOMAKE.
5911         (AC_OUTPUT): Generate Makefile in gnulib/.
5912         * aclocal.m4, config.in, configure: Regenerated.
5913
5914 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
5915
5916         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
5917
5918 2012-04-05  Pedro Alves  <palves@redhat.com>
5919
5920         -Werror=strict-aliasing
5921
5922         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
5923         pointer.
5924
5925 2012-04-04  Pedro Alves  <palves@redhat.com>
5926
5927         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
5928         (sparc_store_gregset_from_stack, sparc_store_gregset)
5929         (sparc_breakpoint_at): Fix formatting.
5930
5931 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5932
5933         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
5934         are available.
5935         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
5936         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
5937         * config.in: Regenerate.
5938         * configure: Likewise.
5939
5940 2012-03-29  Pedro Alves  <palves@redhat.com>
5941
5942         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
5943         Correct ptrace arguments.
5944
5945 2012-03-28  Pedro Alves  <palves@redhat.com>
5946
5947         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
5948         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
5949         (IA64_FR1_REGNUM): New defines.
5950         (ia64_fetch_register): New.
5951         (the_low_target): Install it.
5952         * linux-low.h (struct linux_target_ops) <fetch_register>: New
5953         field.
5954         * linux-low.c (linux_fetch_registers): Try the
5955         the_low_target.fetch_register hook first.
5956
5957         * linux-arm-low.c (the_low_target): Adjust.
5958         * linux-bfin-low.c (the_low_target): Adjust.
5959         * linux-cris-low.c (the_low_target): Adjust.
5960         * linux-crisv32-low.c (the_low_target): Adjust.
5961         * linux-m32r-low.c (the_low_target): Adjust.
5962         * linux-m68k-low.c (the_low_target): Adjust.
5963         * linux-mips-low.c (the_low_target): Adjust.
5964         * linux-ppc-low.c (the_low_target): Adjust.
5965         * linux-s390-low.c (the_low_target): Adjust.
5966         * linux-sh-low.c (the_low_target): Adjust.
5967         * linux-sparc-low.c (the_low_target): Adjust.
5968         * linux-tic6x-low.c (the_low_target): Adjust.
5969         * linux-x86-low.c (the_low_target): Adjust.
5970         * linux-xtensa-low.c (the_low_target): Adjust.
5971
5972 2012-03-26  Pedro Alves  <palves@redhat.com>
5973
5974         * server.c (handle_qxfer_libraries): Don't bail early if
5975         the_target->qxfer_libraries_svr4 is not NULL.
5976
5977 2012-03-26  Pedro Alves  <palves@redhat.com>
5978
5979         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
5980
5981 2012-03-23  Pedro Alves  <palves@redhat.com>
5982
5983         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
5984         "library-list-svr4" element's start tag when the the DSO list is
5985         empty.
5986
5987 2012-03-23  Pedro Alves  <palves@redhat.com>
5988
5989         * linux-low.c (read_one_ptr): Read the inferior's pointer through
5990         a variable whose type size is the same as the inferior's pointer
5991         size.
5992
5993 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
5994
5995         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
5996         struct siginfo.
5997         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
5998         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
5999         * linux-low.h: Include <signal.h>.
6000         (struct siginfo): Remove forward declaration.
6001         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6002         struct siginfo.
6003
6004 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6005
6006         * .gitignore: Ignore more files.
6007
6008 2012-03-19  Pedro Alves  <palves@redhat.com>
6009             Jan Kratochvil  <jan.kratochvil@redhat.com>
6010
6011         * server.c (cont_thread, general_thread): Add describing comments.
6012         (start_inferior): Clear `cont_thread'.
6013         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6014         of a process.
6015
6016 2012-03-15  Yao Qi  <yao@codesourcery.com>
6017
6018         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6019         handling to ...
6020         (cmd_qtdp): ... here.
6021
6022 2012-03-15  Yao Qi  <yao@codesourcery.com>
6023
6024         * tracepoint.c (struct tracepoint_action_ops): New.
6025         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6026         (m_tracepoint_action_download): New.
6027         (r_tracepoint_action_download): New.
6028         (x_tracepoint_action_download): New.
6029         (l_tracepoint_action_download): New.
6030         (add_tracepoint_action): Install `action->ops' according type.
6031         (download_tracepoint_1): Move code `download' function pointer
6032         of various tracepoint_action_ops.
6033
6034 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6035
6036         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6037         linux_ptrace_attach_warnings.
6038
6039 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6040
6041         * Makefile.in (linux-ptrace.o): New.
6042         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6043         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6044         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6045         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6046         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6047         of these targets.
6048         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6049
6050 2012-03-08  Yao Qi  <yao@codesourcery.com>
6051             Pedro Alves  <palves@redhat.com>
6052
6053         Fix PR server/13392.
6054         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6055         offset of JMP insn.
6056         * tracepoint.c (remove_tracepoint): New.
6057         (cmd_qtdp): Call remove_tracepoint when failed to install.
6058
6059 2012-03-07  Pedro Alves  <palves@redhat.com>
6060
6061         * linux-low.c (get_detach_signal): New.
6062         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6063         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6064         ptrace call.
6065         * server.c (program_signals, program_signals_p): New.
6066         (handle_general_set): Handle QProgramSignals.
6067         * server.h (program_signals, program_signals_p): Declare.
6068
6069 2012-03-05  Pedro Alves  <palves@redhat.com>
6070             Jan Kratochvil  <jan.kratochvil@redhat.com>
6071
6072         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6073         New comment why.
6074
6075 2012-03-03  Yao Qi  <yao@codesourcery.com>
6076
6077         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6078         agent_look_up_symbols.
6079
6080 2012-03-03  Yao Qi  <yao@codesourcery.com>
6081
6082         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6083         (linux-x86-low.o): Likewise.
6084         * server.h: Remove in_process_agent_loaded.
6085         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6086         common/agent.c.
6087         Update callers.
6088
6089 2012-03-03  Yao Qi  <yao@codesourcery.com>
6090
6091         * tracepoint.c (gdb_agent_capability): New global.
6092         (in_process_agent_loaded_ust): Renamed to
6093         `in_process_agent_supports_ust'.
6094         Update callers.
6095         (in_process_agent_supports_ust): Call agent_capability_check.
6096         (clear_installed_tracepoints): Assert that agent supports
6097         agent.
6098
6099 2012-03-03  Yao Qi  <yao@codesourcery.com>
6100
6101         * linux-low.c (linux_supports_agent): New.
6102         (linux_target_ops): Initialize field `supports_agent' with
6103         linux_supports_agent.
6104         * target.h (struct target_ops) <supports_agent>: New.
6105         (target_supports_agent): New macro.
6106         * server.c (handle_general_set): Handle packet 'QAgent'.
6107         (handle_query): Send `QAgent+'.
6108         * Makefile.in (server.o): Depends on agent.h.
6109
6110 2012-03-03  Yao Qi  <yao@codesourcery.com>
6111
6112         * Makefile.in (OBS): Add agent.o.
6113         Add new rule for agent.o.
6114         Track dependence of tracepoint.c on agent.h.
6115         * tracepoint.c (run_inferior_command_1):
6116         (run_inferior_command): Call agent_run_command.
6117         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6118         common/agent.c.
6119         (resume_thread, stop_thread): Likewise.
6120         (gdb_ust_socket_init): Renamed to ...
6121         (gdb_agent_socket_init): ... New.
6122         (gdb_ust_thread): Renamed to ...
6123         (gdb_agent_helper_thread): ... New.
6124         (gdb_ust_init): Move some code to ...
6125         (gdb_agent_init): ... here.  New.
6126         [HAVE_UST]: Call gdb_ust_init.
6127         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6128         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6129         * config.in, configure: Regenerated.
6130
6131 2012-03-02  Pedro Alves  <palves@redhat.com>
6132
6133         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6134         * linux-low.c (struct simple_pid_list): New.
6135         (stopped_pids): New a struct simple_pid_list pointer.
6136         (add_to_pid_list, pull_pid_from_list): New.
6137         (handle_extended_wait): Don't assume the first signal new children
6138         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6139         (linux_wait_for_lwp): Adjust.
6140
6141 2012-03-02  Yao Qi  <yao@codesourcery.com>
6142
6143         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6144         debug log.
6145
6146 2012-03-02  Yao Qi  <yao@codesourcery.com>
6147
6148         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6149         `stop_pc' and `tpoint'.  Update caller.
6150
6151 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6152
6153         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6154         * linux-low.c (use_linux_regsets): New macro.
6155         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6156         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6157         (linux_register_in_regsets): New function.
6158         (usr_fetch_inferior_registers): Skip registers covered by
6159         regsets.
6160         (usr_store_inferior_registers): Likewise.
6161         (usr_fetch_inferior_registers): New macro.
6162         (usr_store_inferior_registers): Likewise.
6163         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6164         (linux_store_registers): Likewise.
6165         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6166         prototype.
6167         (init_registers_mips64_dsp_linux): Likewise.
6168         (init_registers_mips_linux): New macro.
6169         (init_registers_mips_dsp_linux): Likewise.
6170         (mips_dsp_num_regs): Likewise.
6171         (DSP_BASE, DSP_CONTROL): New fallback macros.
6172         (mips_base_regs): New macro.
6173         (mips_regmap): Use it.  Fix the size.
6174         (mips_dsp_regmap): New variable.
6175         (mips_dsp_regset_bitmap): Likewise.
6176         (mips_arch_setup): New function.
6177         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6178         than mips_regmap.
6179         (mips_cannot_store_register): Likewise.
6180         (the_low_target): Update .arch_setup, .num_regs and .regmap
6181         initializers.  Add .regset_bitmap initializer.
6182         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6183         initializer.
6184         * linux-bfin-low.c (the_low_target): Likewise.
6185         * linux-cris-low.c (the_low_target): Likewise.
6186         * linux-crisv32-low.c (the_low_target): Likewise.
6187         * linux-ia64-low.c (the_low_target): Likewise.
6188         * linux-m32r-low.c (the_low_target): Likewise.
6189         * linux-m68k-low.c (the_low_target): Likewise.
6190         * linux-ppc-low.c (the_low_target): Likewise.
6191         * linux-s390-low.c (the_low_target): Likewise.
6192         * linux-sh-low.c (the_low_target): Likewise.
6193         * linux-sparc-low.c (the_low_target): Likewise.
6194         * linux-tic6x-low.c (the_low_target): Likewise.
6195         * linux-x86-low.c (the_low_target): Likewise.
6196         * linux-xtensa-low.c (the_low_target): Likewise.
6197         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6198         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6199         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6200         srv_xmlfiles.
6201         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6202         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6203
6204 2012-02-29  Yao Qi  <yao@codesourcery.com>
6205             Pedro Alves  <palves@redhat.com>
6206
6207         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6208         `step_over_finished' is true.
6209
6210 2012-02-27  Pedro Alves  <palves@redhat.com>
6211
6212         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6213         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6214
6215 2012-02-27  Pedro Alves  <palves@redhat.com>
6216
6217         PR server/9684
6218         * linux-low.c (pid_is_stopped): New.
6219         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6220
6221 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6222
6223         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6224         of conditions.
6225
6226 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6227
6228         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6229
6230 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6231
6232         * server.c (handle_query): Advertise support for target-side
6233         breakpoint condition evaluation.
6234         (process_point_options): New function.
6235         (process_serial_event): When inserting a breakpoint, check for
6236         a target-side condition that should be evaluated.
6237
6238         * mem-break.c: Include regcache.h and ax.h.
6239         (point_cond_list_t): New data structure.
6240         (breakpoint) <cond_list>: New field.
6241         (find_gdb_breakpoint_at): Make non-static.
6242         (delete_gdb_breakpoint_at): Clear any target-side
6243         conditions.
6244         (clear_gdb_breakpoint_conditions): New function.
6245         (add_condition_to_breakpoint): Likewise.
6246         (add_breakpoint_condition): Likewise.
6247         (gdb_condition_true_at_breakpoint): Likewise.
6248         (gdb_breakpoint_here): Return result directly instead
6249         of going through a local variable.
6250
6251         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6252         (clear_gdb_breakpoint_conditions): Likewise.
6253         (add_breakpoint_condition): Likewise.
6254         (gdb_condition_true_at_breakpoint): Likewise.
6255
6256         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6257         (need_step_over_p): Take target-side breakpoint condition into
6258         consideration.
6259
6260 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6261
6262         * server.h: Include tracepoint.h.
6263         (agent_mem_read, agent_get_trace_state_variable_value,
6264         agent_set_trace_state_variable_value,
6265         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6266         get_set_tsv_func_addr): New prototypes.
6267
6268         * ax.h: New include file.
6269         * ax.c: New source file.
6270
6271         * tracepoint.c: Include ax.h.
6272         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6273         agent_expr, eval_result_type): Move to ax.h.
6274         (parse_agent_expr): Rename to ...
6275         (gdb_parse_agent_expr): ... this, make it non-static and move
6276         to ax.h.
6277         (unparse_agent_expr) Rename to ...
6278         (gdb_unparse_agent_expr): ... this, make it non-static and move
6279         to ax.h.
6280         (eval_agent_expr): Rename to ...
6281         (eval_tracepoint_agent_expr): ... this.
6282         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6283         forward declarations.
6284         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6285         (agent_get_trace_state_variable_value): New function.
6286         (agent_set_trace_state_variable_value): New function.
6287         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6288         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6289         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6290         (condition_true_at_tracepoint): Likewise.
6291         (parse_agent_expr): Rename to ...
6292         (gdb_parse_agent_expr): ... this and move to ax.c.
6293         (unparse_agent_expr): Rename to ...
6294         (gdb_unparse_agent_expr): ... this and move to ax.c.
6295         (gdb_agent_op_name): Move to ax.c.
6296         (eval_agent_expr): Rename to ...
6297         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6298         and move to ax.c.
6299         (eval_tracepoint_agent_expr): New function.
6300         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6301         non-static.
6302         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6303         ax.c.
6304         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6305         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6306         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6307         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6308         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6309         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6310         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6311         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6312         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6313         (compile_bytecodes): Remove forward declaration.
6314         (is_goto_target): Move to ax.c.
6315         (compile_bytecodes): Move to ax.c and call
6316         agent_get_trace_state_variable_value (...) and
6317         agent_set_trace_state_variable_value (...).
6318
6319         * Makefile.in: Update ax.c and IPA dependencies.
6320
6321 2012-02-24  Pedro Alves  <palves@redhat.com>
6322
6323         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6324         (cmd_bigqtbuffer_circular): ... this.  Only handle
6325         'QTBuffer:circular:'.
6326         (handle_tracepoint_general_set): Adjust.
6327
6328 2012-02-16  Yao Qi  <yao@codesourcery.com>
6329
6330         * inferiors.c: Move code to ...
6331         * dll.c: .... here.  New.
6332         * server.h: Declare clear_dlls.
6333         * Makefile.in (SFILES): Add dll.c.
6334         (OBS): Add dll.o
6335         (dll.o): New rule.
6336
6337 2012-02-11  Yao Qi  <yao@codesourcery.com>
6338
6339         * server.c: (handle_monitor_command): Add a new parameter
6340         `own_buf'.
6341         (handle_query): Update caller.
6342
6343 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6344
6345         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6346         * configure, config.in: Regenerate.
6347         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6348         is not defined.
6349
6350 2012-02-02  Pedro Alves  <palves@redhat.com>
6351
6352         Try SIGKILL first, then PTRACE_KILL.
6353         * linux-low.c (linux_kill_one_lwp): New.
6354         (linux_kill_one_lwp): Rename to ...
6355         (kill_one_lwp_callback): ... this.  Use the new
6356         linux_kill_one_lwp.
6357
6358 2012-02-02  Pedro Alves  <palves@redhat.com>
6359
6360         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6361         inferior.
6362
6363 2012-01-27  Pedro Alves  <palves@redhat.com>
6364
6365         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6366         (elf_64_file_p): Make static.
6367         (linux_pid_exe_is_elf_64_file): New.
6368         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6369         Delete declarations.
6370         (linux_pid_exe_is_elf_64_file): Declare.
6371         * linux-x86-low.c (x86_arch_setup): Use
6372         linux_pid_exe_is_elf_64_file.
6373
6374 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6375
6376         * linux-low.c (linux_wait_for_event_1): Rename to ...
6377         (linux_wait_for_event): ... here and merge it with former
6378         linux_wait_for_event - new variable wait_ptid, use it.
6379         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6380
6381 2012-01-23  Pedro Alves  <palves@redhat.com>
6382
6383         * server.c (main): Avoid yet another case of infinite loop while
6384         detaching/killing after a longjmp.
6385
6386 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6387
6388         Code cleanup.
6389         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
6390
6391 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
6392
6393         * hostio.c (handle_readlink): New function.
6394         (handle_vFile): Call it to handle "vFile:readlink" packets.
6395
6396 2012-01-20  Pedro Alves  <palves@redhat.com>
6397             Ulrich Weigand  <ulrich.weigand@linaro.org>
6398
6399         * server.c (handle_v_requests): Only support vAttach and vRun to
6400         start multiple processes when in extended protocol mode.
6401
6402 2012-01-17  Pedro Alves  <palves@redhat.com>
6403
6404         * tracepoint.c (initialize_tracepoint): Use mmap instead of
6405         memalign plus mprotect to allocate the scratch buffer.
6406
6407 2012-01-13  Pedro Alves  <palves@redhat.com>
6408
6409         * server.c (attach_inferior): Clear `cont_thread'.
6410
6411 2012-01-13  Pedro Alves  <palves@redhat.com>
6412
6413         * server.c (main): Avoid infinite loop while detaching/killing
6414         after a longjmp.
6415
6416 2012-01-09  Doug Evans  <dje@google.com>
6417
6418         * server.c (start_inferior): Set last_ptid in --wrapper case.
6419
6420 2012-01-06  Yao Qi  <yao@codesourcery.com>
6421
6422         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
6423         defined.
6424         [IN_PROCESS_AGENT] (debug_agent): New global variable.
6425
6426 2012-01-04  Yao Qi  <yao@codesourcery.com>
6427
6428         * tracepoint.c (cmd_qtdp): Print debug message
6429         for static tracepoint.
6430
6431 2012-01-04  Yao Qi  <yao@codesourcery.com>
6432
6433         * tracepoint.c (trace_vdebug): Differentiate debug message
6434         between gdbserver and IPA.
6435
6436 2012-01-03  Yao Qi  <yao@codesourcery.com>
6437
6438         * tracepoint.c (tracepoint_was_hit): Don't collect for
6439         static tracepoint.
6440
6441 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6442
6443         * terminal.h: Reformat copyright header.
6444
6445 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6446
6447         * server.c (gdbserver_version): Update copyright year.
6448         * gdbreplay.c (gdbreplay_version): Likewise.
6449
6450 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
6451
6452         * linux-low.c (linux_create_inferior): Put empty if clause for write.
6453
6454         Revert:
6455         2011-12-18  Hui Zhu  <teawater@gmail.com>
6456         * linux-low.c (linux_create_inferior): Save return value to ret.
6457
6458 2011-12-18  Hui Zhu  <teawater@gmail.com>
6459
6460         * linux-low.c (linux_create_inferior): Save return value to ret.
6461
6462 2011-12-16  Doug Evans  <dje@google.com>
6463
6464         * linux-low.c (linux_create_inferior): If stdio connection,
6465         redirect stdin from /dev/null, stdout to stderr.
6466         * remote-utils.c (remote_is_stdio): New static global.
6467         (remote_connection_is_stdio): New function.
6468         (remote_prepare): Handle stdio connection.
6469         (remote_open): Ditto.
6470         (remote_close): Don't close stdin for stdio connections.
6471         (read_prim,write_prim): New functions.  Replace all calls to
6472         read/write to these.
6473         * server.c (main): Watch for "-" argument.  Move call to
6474         remote_prepare before start_inferior.
6475         * server.h (STDIO_CONNECTION_NAME): New macro.
6476         (remote_connection_is_stdio): Declare.
6477
6478         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
6479         in debugging output.
6480
6481 2011-12-15  Yao Qi  <yao@codesourcery.com>
6482
6483         * tracepoint.c: Include sys/syscall.h.
6484         (gdb_ust_thread): Remove preprocessor conditional.
6485
6486 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
6487
6488         * linux-low.c (linux_detach_one_lwp): Call
6489         the_low_target.prepare_to_resume before detaching.
6490
6491 2011-12-14  Yao Qi  <yao@codesourcery.com>
6492
6493         * tracepoint.c (gdb_ust_thread): Don't ignore return value
6494         of write.
6495
6496 2011-12-14  Yao Qi  <yao@codesourcery.com>
6497
6498         * i386-low.c (i386_low_stopped_data_address): Initialize local
6499         variable `control'.
6500
6501 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
6502
6503         PR remote/13492
6504
6505         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
6506         DR_CONTROL unless necessary.  Extend comments.
6507         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
6508         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
6509
6510 2011-12-13  Yao Qi  <yao@codesourcery.com>
6511
6512         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
6513         macros.
6514         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
6515
6516 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
6517
6518         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
6519         Print new debug message for such case.
6520
6521 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6522
6523         Fix overlapping memcpy.
6524         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
6525         the read_inferior_memory transfer.
6526         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
6527         write_inferior_memory transfer.
6528         (set_fast_tracepoint_jump): New variable buf.  Use it for the
6529         read_inferior_memory and write_inferior_memory transfers.
6530         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
6531         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
6532         Use it for the write_inferior_memory transfer.
6533         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
6534         buffers.
6535
6536 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6537
6538         * linux-low.c (fetch_register, store_register): Make code
6539         consistent, fix formatting.
6540
6541 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6542
6543         * linux-low.c (usr_store_inferior_registers): Factor out code
6544         to handle individual registers into...
6545         (store_register): ... this new function.
6546
6547 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
6548
6549         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
6550         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
6551         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
6552         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
6553         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
6554         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
6555         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
6556         (srv_xmlfiles): Add new XML files.
6557
6558         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
6559         and <sys/uio.h>.
6560         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
6561         (init_registers_s390_linux32v1): Add prototype.
6562         (init_registers_s390_linux32v2): Likewise.
6563         (init_registers_s390_linux64v1): Likewise.
6564         (init_registers_s390_linux64v2): Likewise.
6565         (init_registers_s390x_linux64v1): Likewise.
6566         (init_registers_s390x_linux64v2): Likewise.
6567         (s390_num_regs): Increment to 52.
6568         (s390_regmap): Add orig_r2 register.
6569         (s390_num_regs_3264): Increment to 68.
6570         (s390_regmap_3264): Add orig_r2 register.
6571         (s390_collect_ptrace_register): Handle orig_r2 register.
6572         (s390_supply_ptrace_register): Likewise.
6573         (s390_fill_last_break): New function.
6574         (s390_store_last_break): Likewise.
6575         (s390_fill_system_call): New function.
6576         (s390_store_system_call): Likewise.
6577         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
6578         register sets.
6579         (s390_check_regset): New function.
6580         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
6581         NT_S390_SYSTEM_CALL regsets and use appropriate description.
6582         Update target_regsets for available register sets.
6583
6584 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
6585             Jan Kratochvil  <jan.kratochvil@redhat.com>
6586
6587         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
6588         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
6589         New.
6590         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
6591         * linux-low.h (struct process_info_private): New member r_debug.
6592         * server.c (handle_qxfer_libraries): Call
6593         the_target->qxfer_libraries_svr4.
6594         (handle_qxfer_libraries_svr4): New function.
6595         (qxfer_packets): New entry "libraries-svr4".
6596         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
6597         * target.h (struct target_ops): New member qxfer_libraries_svr4.
6598         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
6599         PACKET_qXfer_libraries_svr4.
6600
6601 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
6602
6603         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
6604         PSW address/mask between 8-byte and 16-byte formats.
6605         (s390_supply_ptrace_register): Likewise.
6606         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
6607         basic addressing mode bit.
6608
6609 2011-11-24  Stan Shebs  <stan@codesourcery.com>
6610
6611         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
6612
6613 2011-11-17  Stan Shebs  <stan@codesourcery.com>
6614
6615         * tracepoint.c (struct tracepoint): New field traceframe_usage.
6616         (tracing_start_time): New global.
6617         (tracing_stop_time): New global.
6618         (tracing_user_name): New global.
6619         (tracing_notes): New global.
6620         (tracing_stop_note): New global.
6621         (cmd_qtstart): Set traceframe_usage, start_time.
6622         (stop_tracing): Set stop_time.
6623         (cmd_qtstatus): Report additional status.
6624         (cmd_qtp): New function.
6625         (handle_tracepoint_query): Call it.
6626         (cmd_qtnotes): New function.
6627         (handle_tracepoint_general_set): Call it.
6628         (get_timestamp): Rename from tsv_get_timestamp.
6629
6630 2011-11-14  Stan Shebs  <stan@codesourcery.com>
6631             Kwok Cheung Yeung  <kcy@codesourcery.com>
6632
6633         * linux-x86-low.c (small_jump_insn): New.
6634         (i386_install_fast_tracepoint_jump_pad): Add arguments for
6635         trampoline and error message, build a trampoline and issue a small
6636         jump instruction to it.
6637         (x86_install_fast_tracepoint_jump_pad): Add arguments for
6638         trampoline and error message.
6639         (x86_get_min_fast_tracepoint_insn_len): New.
6640         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
6641         * linux-low.h (struct linux_target_ops): Add arguments to
6642         install_fast_tracepoint_jump_pad operation, add new operation.
6643         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
6644         arguments.
6645         (linux_get_min_fast_tracepoint_insn_len): New function.
6646         (linux_target_op): Add new operation.
6647         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
6648         (gdb_trampoline_buffer_end): Ditto.
6649         (gdb_trampoline_buffer_error): Ditto.
6650         (struct ipa_sym_addresses): Add fields for new IPA variables.
6651         (symbol_list): Add entries for new IPA variables.
6652         (struct tracepoint): Add fields to hold the address range of the
6653         trampoline used by the tracepoint.
6654         (trampoline_buffer_head): New static variable.
6655         (trampoline_buffer_tail): Ditto.
6656         (claim_trampoline_space): New function.
6657         (have_fast_tracepoint_trampoline_buffer): New function.
6658         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
6659         structure.
6660         (install_fast_tracepoint): Ditto, also add error buffer argument.
6661         (cmd_qtminftpilen): New function.
6662         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
6663         (fast_tracepoint_from_trampoline_address): New function.
6664         (fast_tracepoint_collecting): Handle trampoline as part of jump
6665         pad space.
6666         (set_trampoline_buffer_space): New function.
6667         (initialize_tracepoint): Initialize new IPA variables.
6668         * target.h (struct target_ops): Add arguments to
6669         install_fast_tracepoint_jump_pad operation, add new
6670         get_min_fast_tracepoint_insn_len operation.
6671         (target_get_min_fast_tracepoint_insn_len): New.
6672         (install_fast_tracepoint_jump_pad): Add arguments.
6673         * server.h (IPA_BUFSIZ): Define.
6674         * linux-i386-ipa.c: Include extra header files.
6675         (initialize_fast_tracepoint_trampoline_buffer): New function.
6676         (initialize_low_tracepoint): Call it.
6677         * server.h (set_trampoline_buffer_space): Declare.
6678         (claim_trampoline_space): Ditto.
6679         (have_fast_tracepoint_trampoline_buffer): Ditto.
6680
6681 2011-11-14  Yao Qi  <yao@codesourcery.com>
6682
6683         * server.c (handle_query): Handle InstallInTrace for qSupported.
6684         * tracepoint.c (add_tracepoint): Sort list.
6685         (install_tracepoint, download_tracepoint): New.
6686         (cmd_qtdp): Call them to install and download tracepoints.
6687         (sort_tracepoints): Removed.
6688         (cmd_qtstart): Update.
6689
6690 2011-11-14  Yao Qi  <yao@codesourcery.com>
6691
6692         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
6693         * mem-break.h: Declare.
6694         * tracepoint.c (cmd_qtstart): Move some code to ...
6695         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
6696         New.
6697         (download_tracepoints): Move some code to ...
6698         (download_tracepoint_1): ... here.  New.
6699
6700 2011-11-08  Yao Qi  <yao@codesourcery.com>
6701
6702         * remote-utils.c (relocate_instruction): A comment fix.
6703
6704 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
6705
6706         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
6707         (i386_dr_low_get_control, i386_dr_low_get_status): Use
6708         dr_status_mirror and dr_control_mirror from debug_reg_state.
6709         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
6710         (i386_initial_stuff): Remove use of deleted globals.
6711         (i386_get_thread_context, i386_set_thread_context,
6712         i386_thread_added): Use dr_status_mirror and dr_control_mirror
6713         from debug_reg_state.
6714
6715 2011-11-05  Yao Qi  <yao@codesourcery.com>
6716
6717         * tracepoint.c (gdb_collect): Loop over tracepoints of same
6718         address as TPOINT's.
6719
6720 2011-11-02  Stan Shebs  <stan@codesourcery.com>
6721
6722         * tracepoint.c (agent_mem_read_string): New function.
6723         (eval_agent_expr): Call it for tracenz.
6724         * server.c (handle_query): Report support for tracenz.
6725
6726 2011-11-02  Yao Qi  <yao@codesourcery.com>
6727
6728         * tracepoint.c (cmd_qtstart): Remove unused local variables.
6729
6730 2011-11-02  Yao Qi  <yao@codesourcery.com>
6731
6732         * target.h: Fix a typo in comment.
6733
6734 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
6735
6736         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
6737         clobber the breakpoints' shadows with fast tracepoint jumps.
6738         * mem-break.h (check_mem_write): Add `myaddr' parameter.
6739         * target.c (write_inferior_memory): Also pass MYADDR down to
6740         check_mem_write.
6741
6742 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
6743
6744         * configure.ac: Check support for personality routine.
6745         * configure: Regenerate.
6746         * config.in: Likewise.
6747         * linux-low.c: Include <sys/personality.h>.
6748         Define ADDR_NO_RANDOMIZE if necessary.
6749         (linux_create_inferior): Disable address space randomization when
6750         forking inferior, if requested.
6751         (linux_supports_disable_randomization): New function.
6752         (linux_target_ops): Install it.
6753         * server.h (disable_randomization): Declare.
6754         * server.c (disable_randomization): New global variable.
6755         (handle_general_set): Handle QDisableRandomization.
6756         (handle_query): Likewise for qSupported.
6757         (main): Support --disable-randomization and --no-disable-randomization
6758         command line arguments.
6759         * target.h (struct target_ops): Add supports_disable_randomization.
6760         (target_supports_disable_randomization): New macro.
6761
6762 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
6763
6764         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
6765         ifdef check.
6766         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
6767         [!PT_GETDSBT] (target_loadmap): New definition.
6768         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
6769         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
6770         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
6771         and PT_GETDSBT to LINUX_LOADMAP.
6772         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
6773         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
6774
6775 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
6776
6777         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
6778         (arm_linux_hwbp_cap): New static variable.
6779         (arm_linux_get_hwbp_cap): Replace by ...
6780         (arm_linux_init_hwbp_cap): ... this new function.
6781         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
6782         (arm_linux_get_hw_watchpoint_count): Likewise.
6783         (arm_linux_get_hw_watchpoint_max_length): Likewise.
6784         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
6785         (arm_prepare_to_resume): Use perror_with_name instead of error.
6786
6787 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
6788
6789         * linux-arm-low.c: Include <signal.h>.
6790         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
6791         (struct arm_linux_hwbp_cap): New data type.
6792         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
6793         (struct arm_linux_hw_breakpoint): New data type.
6794         (MAX_BPTS, MAX_WPTS): Define.
6795         (struct arch_process_info, struct arch_lwp_info): New data types.
6796         (arm_linux_get_hwbp_cap): New function.
6797         (arm_linux_get_hw_breakpoint_count): Likewise.
6798         (arm_linux_get_hw_watchpoint_count): Likewise.
6799         (arm_linux_get_hw_watchpoint_max_length): Likewise.
6800         (arm_hwbp_control_initialize): Likewise.
6801         (arm_hwbp_control_is_enabled): Likewise.
6802         (arm_hwbp_control_is_initialized): Likewise.
6803         (arm_hwbp_control_disable): Likewise.
6804         (arm_linux_hw_breakpoint_equal): Likewise.
6805         (arm_linux_hw_point_initialize): Likewise.
6806         (struct update_registers_data): New data structure.
6807         (update_registers_callback: New function.
6808         (arm_insert_point): Likewise.
6809         (arm_remove_point): Likewise.
6810         (arm_stopped_by_watchpoint): Likewise.
6811         (arm_stopped_data_address): Likewise.
6812         (arm_new_process): Likewise.
6813         (arm_new_thread): Likewise.
6814         (arm_prepare_to_resume): Likewise.
6815         (the_low_target): Register arm_insert_point, arm_remove_point,
6816         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
6817         arm_new_thread, and arm_prepare_to_resume.
6818
6819 2011-09-15  Stan Shebs  <stan@codesourcery.com>
6820
6821         * server.h (struct emit_ops): Add compare-goto fields.
6822         * tracepoint.c (gdb_agent_op_sizes): New table.
6823         (emit_eq_goto): New function.
6824         (emit_ne_goto): New function.
6825         (emit_lt_goto): New function.
6826         (emit_le_goto): New function.
6827         (emit_gt_goto): New function.
6828         (emit_ge_goto): New function.
6829         (is_goto_target): New function.
6830         (compile_bytecodes): Recognize special cases of compare-goto
6831         combinations and call specialized emitters for them.
6832         * linux-x86-low.c (amd64_emit_eq_goto): New function.
6833         (amd64_emit_ne_goto): New function.
6834         (amd64_emit_lt_goto): New function.
6835         (amd64_emit_le_goto): New function.
6836         (amd64_emit_gt_goto): New function.
6837         (amd64_emit_ge_goto): New function.
6838         (amd64_emit_ops): Add the new functions.
6839         (i386_emit_eq_goto): New function.
6840         (i386_emit_ne_goto): New function.
6841         (i386_emit_lt_goto): New function.
6842         (i386_emit_le_goto): New function.
6843         (i386_emit_gt_goto): New function.
6844         (i386_emit_ge_goto): New function.
6845         (i386_emit_ops): Add the new functions.
6846
6847 2011-09-08  Stan Shebs  <stan@codesourcery.com>
6848
6849         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
6850         (i386_emit_epilogue): Restore %ebx.
6851
6852 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
6853
6854         * server.c (step_thread): Remove definition.
6855         (process_serial_event): Don't handle Hs.
6856         * server.h (step_thread): Remove declaration.
6857         * target.c (set_desired_inferior): Remove use of step_thread.
6858
6859 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
6860
6861         * linux-low.c: Include linux-procfs.h.
6862         (linux_attach_lwp_1): Update comments.
6863         (linux_attach): Scan for existing threads when attaching to a
6864         process that is the tgid.
6865         * Makefile.in: Update dependencies.
6866
6867 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
6868
6869         * configure.srv: Add linux-procfs.o dependencies.
6870
6871 2011-08-14  Yao Qi  <yao@codesourcery.com>
6872
6873         * target.h (struct target_ops): Fix indent.
6874         * win32-low.c (win32_target_ops): Fix comment.
6875
6876 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
6877             Yao Qi  <yao@codesourcery.com>
6878
6879         * Makefile.in (clean): Remove tic6x-*.c files.
6880         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
6881         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
6882         (tic6x-c64xp-linux.c): Likewise.
6883         * configure.srv: Add support for tic6x-*-uclinux.
6884         * linux-tic6x-low.c: New.
6885         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
6886
6887 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
6888             Yao Qi  <yao@codesourcery.com>
6889
6890         * target.h (struct target_ops): Add read_loadmap.
6891         * linux-low.c (struct target_loadseg): New type.
6892         (struct target_loadmap): New type.
6893         (linux_read_loadmap): New function.
6894         (linux_target_ops): Add linux_read_loadmap.
6895         * server.c (handle_query): Support qXfer:fdpic:read packet.
6896         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
6897         to NULL.
6898
6899 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
6900
6901         * win32-low.c: Include <stdint.h>.
6902
6903 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
6904
6905         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
6906         to the inferior here.
6907         (i386_remove_aligned_watchpoint): Ditto.
6908         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
6909         fit part of the watchpoint in the debug registers.
6910         (i386_update_inferior_debug_regs): New.
6911         (i386_low_insert_watchpoint): Work on a local mirror of the debug
6912         registers, and only update the inferior on success.
6913         (i386_low_remove_watchpoint): Ditto.
6914
6915 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
6916
6917         * linux-low.c (compare_ints, unique, list_threads, show_process,
6918         linux_core_of_thread): Delete.
6919         (linux_target_ops): Change linux_core_of_thread to
6920         linux_common_core_of_thread.
6921         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
6922         * utils.c (malloc_failure): Change type of argument.
6923         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
6924         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
6925         common/linux-osdata.c, common/ptid.c and common/buffer.c.
6926         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
6927         (IPA_OBJS): Add common-utils-ipa.o.
6928         (ptid_h, linux_osdata_h): New macros.
6929         (server_h): Add common/common-utils.h, common/xml-utils.h,
6930         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
6931         common/ptid.h.
6932         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
6933         ptid.o, buffer.o): New rules.
6934         (linux-low.o): Add common/linux-osdata.h as a dependency.
6935         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
6936         * configure.ac: Add AC_HEADER_DIRENT check.
6937         * config.in: Regenerate.
6938         * configure: Regenerate.
6939         * remote-utils.c (xml_escape_text): Delete.
6940         (buffer_grow, buffer_free, buffer_init, buffer_finish,
6941         buffer_xml_printf): Move to common/buffer.c.
6942         * server.c (main): Remove call to initialize_inferiors.
6943         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
6944         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
6945         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
6946         internal_error, gdb_assert, gdb_assert_fail): Delete.
6947         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
6948         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
6949         common/buffer.h.
6950         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
6951         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
6952         initialize_inferiors): Delete.
6953
6954 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
6955
6956         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
6957         symbol error.
6958
6959 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
6960
6961         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
6962         assertion.
6963         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
6964
6965 2011-05-26  Yao Qi  <yao@codesourcery.com>
6966
6967         * Makefile.in (thread-db.o): Track dependence to
6968         common/gdb_thread_db.h.
6969         * thread-db.c: include gdb_thread_db.h from right place.
6970
6971 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
6972
6973         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
6974         __FILE__ and __LINE__ to internal_error.
6975
6976 2011-05-13  Doug Evans  <dje@google.com>
6977
6978         * thread-db.c (try_thread_db_load_from_sdir): New function.
6979         (try_thread_db_load_from_dir): New function.
6980         (thread_db_load_search): Handle $sdir, ignore $pdir.
6981         Remove trying of system directories if search of
6982         libthread-db-search-path fails, that is now done via $sdir.
6983
6984 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
6985
6986         * server.c (handle_query): Add EnableDisableTracepoints to the list
6987         of supported features.
6988         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
6989         tracepoints.
6990         (cmd_qtenable_disable): New.
6991         (cmd_qtstart): Install tracepoints even if disabled.
6992         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
6993         receiving a QTEnable or QTDisable packet.
6994         (gdb_collect): Skip data collection if fast tracepoint is disabled.
6995         (ust_marker_to_static_tracepoint): Do not ignore disabled static
6996         tracepoints.
6997         (gdb_probe): Skip data collection if static tracepoint is disabled.
6998
6999 2011-05-10  Doug Evans  <dje@google.com>
7000
7001         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7002
7003 2011-05-04  Doug Evans  <dje@google.com>
7004
7005         * linux-low.c (linux_join): Skip process lookup.
7006         * spu-low.c (spu_join): Ditto.
7007         * server.c (join_inferiors_callback): Delete.
7008         (process_serial_event): For 'D' packet (detach) call join_inferior
7009         directly.
7010
7011 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7012
7013         * README: Don't mention xscale*-*-linux*.
7014         * configure.srv (xscale*-*-linux*): Don't handle target.
7015
7016 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7017
7018         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7019         casting pointers.
7020         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7021         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7022         (i386_emit_void_call_2): Likewise.
7023
7024 2011-04-26  Yao Qi  <yao@codesourcery.com>
7025
7026         * linux-low.c: Move common macros to linux-ptrace.h.
7027         Include linux-ptrace.h.
7028         * Makefile.in (linux_ptrace_h): New.
7029         (linux-low.o): Depends on linux-ptrace.h.
7030
7031 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7032
7033         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7034         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7035         (remote_prepare): New function with most of the TCP code from ...
7036         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7037         setting transport_is_reliable.
7038         * server.c (run_once): New variable.
7039         (gdbserver_usage): Document it.
7040         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7041         the first run if RUN_ONCE.
7042         * server.h (run_once, remote_prepare): New declarations.
7043
7044 2011-04-19  Tom Tromey  <tromey@redhat.com>
7045
7046         * win32-low.c (handle_load_dll): Remove duplicate "the".
7047
7048 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7049
7050         Remove support for old Cygwin 1.5 versions.
7051         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7052         function to avoid warning.
7053         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7054         warning.
7055
7056 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7057
7058         * gdbserver/server.h (Macro _): Define it if not available.
7059
7060 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7061
7062         * hostio.c (handle_close): Remove unnecessary null test.
7063
7064 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7065
7066         * Makefile.in (maintainer-clean realclean distclean): Remove
7067         "make ...  subdir_do" command.
7068
7069 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7070
7071         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7072
7073         * server.c (handle_v_run): Free alloced buffer on early return.
7074
7075 2011-03-09  Yao Qi  <yao@codesourcery.com>
7076
7077         Revert:
7078         2011-03-04  Yao Qi  <yao@codesourcery.com>
7079
7080         * Makefile.in: Remove GNU make feature --directory.
7081
7082         2011-03-05  Yao Qi  <yao@codesourcery.com>
7083
7084         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7085         (subdir_do): New make target.  Copied from gdb/Makefile.
7086         (maintainer-clean, realclean, distclean, clean): Call corresponding
7087         make targets in common/Makefile.
7088
7089         2011-02-11  Yao Qi  <yao@codesourcery.com>
7090
7091         * configure.ac: Call AC_PROG_RANLIB.
7092         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7093         * configure: Regenerate.
7094
7095 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7096
7097         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7098
7099 2011-03-06  Yao Qi  <yao@codesourcery.com>
7100
7101         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7102
7103 2011-03-05  Yao Qi  <yao@codesourcery.com>
7104
7105         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7106         (subdir_do): New make target.  Copied from gdb/Makefile.
7107         (maintainer-clean, realclean, distclean, clean): Call corresponding
7108         make targets in common/Makefile.
7109
7110 2011-03-04  Yao Qi  <yao@codesourcery.com>
7111
7112         * Makefile.in: Remove GNU make feature --directory.
7113
7114 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7115
7116         * server.c (queue_stop_reply): Call xmalloc not malloc.
7117
7118 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7119
7120         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7121
7122 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7123
7124         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7125         (cmd_qtframe): Ditto.
7126         (cmd_qtbuffer): Ditto.
7127         (cmd_bigqtbuffer): Ditto.
7128
7129         * utils.c (decimal2str): Initialize 'width' to nine, then
7130         don't mess with it.
7131
7132 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7133
7134         * hostio.c (require_data): Free *data, not data.
7135
7136 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7137
7138         * hostio.c (require_data): Use free, not xfree.
7139
7140 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7141
7142         * server.c (handle_query): Discard unused value.
7143
7144         * hostio.c (require_data): Free malloc memory before returning
7145         error.
7146
7147 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7148
7149         * linux-low.c (list_threads): Call closedir for dirent.
7150
7151 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7152
7153         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7154         a case statement falls through.
7155
7156         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7157
7158         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7159         in comparison.
7160
7161 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7162
7163         * utils.c (decimal2str): Eliminate dead code and dead param.
7164         (pulongest): Drop dead param from call to decimal2str.
7165         (plongest): Ditto.
7166
7167 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7168
7169         Revert the following patch (not approved yet):
7170         2011-02-21  Hui Zhu  <teawater@gmail.com>
7171         * tracepoint.c (tp_printf): New function.
7172         (eval_agent_expr): Handle gdb_agent_op_printf.
7173
7174 2011-02-21  Hui Zhu  <teawater@gmail.com>
7175
7176         * tracepoint.c (tp_printf): New function.
7177         (eval_agent_expr): Handle gdb_agent_op_printf.
7178
7179 2011-02-18  Tom Tromey  <tromey@redhat.com>
7180
7181         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7182         (tracepoint.o): Likewise.
7183         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7184         (gdb_agent_op_names): Likewise.
7185
7186 2011-02-18  Tom Tromey  <tromey@redhat.com>
7187
7188         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7189         gdb_agent_op_rot>: New constants.
7190         (gdb_agent_op_names): Add pick and roll.
7191         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7192         cases.
7193
7194 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7195
7196         * aclocal.m4: Regenerated with aclocal-1.11.1.
7197
7198 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7199
7200         * server.c (handle_qxfer_traceframe_info): New.
7201         (qxfer_packets): Register "traceframe-info".
7202         (handle_query): Report support for qXfer:traceframe-info:read+.
7203         * tracepoint.c (match_blocktype): New.
7204         (traceframe_find_block_type): Rename to ...
7205         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7206         and use it.
7207         (traceframe_find_block_type): New, reimplemented on top of
7208         traceframe_walk_blocks.
7209         (build_traceframe_info_xml): New.
7210         (traceframe_read_info): New.
7211         * server.h (traceframe_read_info): Declare.
7212
7213 2011-02-11  Yao Qi  <yao@codesourcery.com>
7214
7215         * configure.ac: Call AC_PROG_RANLIB.
7216         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7217         * configure: Regenerate.
7218
7219 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7220
7221         * server.c (gdb_read_memory): Change return semantics to allow
7222         partial transfers.
7223         (handle_search_memory_1): Adjust.
7224         (process_serial_event) <'m' packet>: Handle partial transfers.
7225         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7226
7227 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7228
7229         * regcache.c (init_register_cache): Initialize
7230         regcache->register_status.
7231         (free_register_cache): Release regcache->register_status.
7232         (regcache_cpy): Copy register_status.
7233         (registers_to_string): Print 'x's for unavailable registers.
7234         (supply_register): Mark the register's status valid or
7235         unavailable, depending on whether a buffer was passed in or not.
7236         (supply_register_zeroed): New.
7237         (supply_regblock): Mark the registers' status valid or
7238         unavailable, depending on whether a buffer was passed in or not.
7239         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7240         (struct regcache): New `register_status' field.
7241         (supply_register_zeroed): Declare.
7242         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7243         supply_register_zeroed, rather than passing a NULL buffer to
7244         supply_register.
7245         * tracepoint.c (fetch_traceframe_registers): Update comment.
7246
7247 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7248
7249         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7250         buffer explicit.
7251
7252 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7253
7254         * server.h (decode_xfer_write): Change prototype.
7255         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7256         and don't extract the annex here.
7257         * server.c (decode_xfer_read): Remove `annex' parameter,
7258         and don't extract the annex here.
7259         (decode_xfer): New.
7260         (struct qxfer): New.
7261         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7262         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7263         (handle_qxfer_statictrace): New functions, abstracted out from
7264         handle_query, and made to use the struct qxfer interface.
7265         (handle_threads_qxfer_proper): Rename to ...
7266         (handle_qxfer_threads_proper): ... this.
7267         (handle_threads_qxfer): Rename to ...
7268         (handle_qxfer_threads): ... this.  Adjust.
7269         (qxfer_packets): New array.
7270         (handle_qxfer): New function.
7271         (handle_query): Use handle_qxfer.
7272
7273 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7274
7275         * gdbreplay.c: Shorten lines of >= 80 columns.
7276         * linux-low.c: Ditto.
7277         * linux-ppc-low.c: Ditto.
7278         * linux-s390-low.c: Ditto.
7279         * linux-sparc-low.c: Ditto.
7280         * linux-x86-low.c: Ditto.
7281         * linux-xtensa-low.c: Ditto.
7282         * mem-break.c: Ditto.
7283         * nto-low.c: Ditto.
7284         * regcache.h: Ditto.
7285         * remote-utils.c: Ditto.
7286         * server.c: Ditto.
7287         * server.h: Ditto.
7288         * thread-db.c: Ditto.
7289         * tracepoint.c: Ditto.
7290         * utils.c: Ditto.
7291         * win32-low.h: Ditto.
7292
7293 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7294
7295         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7296         update.
7297
7298 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7299
7300         * server.c (gdbserver_version): Update copyright year in version
7301         output.
7302         * gdbreplay.c (gdbreplay_version): Ditto.
7303
7304 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7305
7306         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7307         * linux-bfin-low.c: New file.
7308         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7309         PT_DATA_ADDR for BFIN targets.
7310         * Makefile.in (SFILES): Add linux-bfin-low.c.
7311         (clean): Remove reg-bfin.c.
7312         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7313         * README: Mention supported Blackfin targets.
7314
7315 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7316
7317         * .gitignore: New file.
7318
7319 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7320
7321         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7322
7323 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7324
7325         * Makefile.in: Add FLAGS_TO_PASS variable.
7326         (install): Remove dependency of install-only and recursively
7327         invoke make for install-only.
7328
7329 2010-10-04  Doug Evans  <dje@google.com>
7330
7331         * Makefile.in (uninstall): Use $(DESTDIR).
7332
7333 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7334
7335         PR gdb/11842
7336
7337         * linux-x86-low.c (compat_siginfo_from_siginfo)
7338         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7339         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7340         si_code < 0.
7341
7342 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7343
7344         * lynx-i386-low.c: New file.
7345         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7346
7347 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7348
7349         * lynx-low.c (ptrace_request_to_str): Remove handling for
7350         request values that have been removed in LynxOS 5.x.
7351
7352 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7353
7354         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7355         <ptrace.h>
7356
7357 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7358
7359         * configure.ac: Add --enable-inprocess-agent option.
7360         * configure: Rebuilt.
7361
7362 2010-09-06  Yao Qi  <yao@codesourcery.com>
7363
7364         * linux-low.c (linux_kill): Remove unused variable.
7365         (linux_stabilize_threads): Likewise.
7366         * server.c (start_inferior): Likewise.
7367         (queue_stop_reply_callback): Likewise.
7368         * tracepoint.c (do_action_at_tracepoint): Likewise.
7369
7370 2010-09-06  Yao Qi  <yao@codesourcery.com>
7371
7372         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7373         on return.
7374
7375 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7376
7377         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7378
7379 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7380
7381         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7382         "$(IPA_DEPFILES)".
7383
7384 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7385
7386         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7387         gdbserver/lynx-ppc-low.c: New files.
7388         * Makefile.in (lynx_low_h): New variable.
7389         (lynx-low.o, lynx-ppc-low.o): New rules.
7390         * configure.ac: On LynxOS, link with -lnetinet.
7391         * configure.srv: Add handling of powerpc-*-lynxos* targets.
7392         * configure: regenerate.
7393
7394 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7395
7396         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
7397         * configure.ac: Add check for vasprintf and vsnprintf.
7398         * configure, config.in: Regenerate.
7399         * server.h (vasprintf, vsnprintf): Add conditional declarations.
7400
7401 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7402
7403         * gdbreplay.c: Move include of alloca.h up, next to include of
7404         malloc.h.
7405         * server.h: Add include of malloc.h.
7406         * mem-break.c: Remove include of malloc.h.
7407         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
7408
7409 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7410
7411         * Makefile.in (memmem.o): Build with -Wno-error.
7412
7413 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7414
7415         * utils.c (xsnprintf): Make non-static.
7416         * server.h: Add xsnprintf declaration.
7417         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
7418         replace calls to snprintf by calls to xsnprintf throughout.
7419
7420 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7421
7422         * configure.ac: Add configure check for alloca.
7423         * configure, config.in: Regenerate.
7424         * server.h: Include alloca.h if it exists.
7425         * gdbreplay.c: Include alloca.h if it exists.
7426
7427 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7428
7429         * linux-low.c (__SIGRTMIN): Define if not already defined.
7430         (linux_create_inferior): Check for __ANDROID__ rather than
7431         __SIGRTMIN.
7432         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
7433         are already deferred.
7434         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
7435         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
7436         stopped and already has a pending signal to report.
7437         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
7438         a pending signal to report or is moving out of a jump pad.
7439         (linux_init_signals): Check for __ANDROID__ rather than
7440         __SIGRTMIN.
7441
7442 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7443
7444         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
7445         debug_threads check.  Avoid a linear search when not doing debug
7446         output.
7447
7448 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7449
7450         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
7451         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
7452         (struct file_handler) <fd>: Change type to gdb_fildes_t.
7453         (process_event): Change local fd's type to gdb_fildes_t.
7454         (create_file_handler): Adjust prototype.
7455         (delete_file_handler): Adjust prototype.
7456         (handle_file_event): Adjust prototype.  Use pfildes.
7457         (create_file_event): Adjsut prototype.
7458         * remote-utils.c (remote_desc, listen_desc): Change type to
7459         gdb_fildes_t.
7460         * server.h: New gdb_fildes_t typedef.
7461         [USE_WIN32API]: Include winsock2.h.
7462         (delete_file_handler, add_file_handler): Adjust prototypes.
7463         (pfildes): Declare.
7464         * utils.c (pfildes): New.
7465
7466 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7467
7468         * configure.ac (build_warnings): Add -Wno-char-subscripts.
7469         * configure: Regenerate.
7470
7471 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7472
7473         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
7474         (linux_done_accessing_memory): ... this.
7475         (linux_target_ops): Adjust.
7476         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
7477         * nto-low.c (nto_target_ops): Adjust comment.
7478         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
7479         * spu-low.c (spu_target_ops): Adjust comment.
7480         * target.h (target_ops): Rename unprepare_to_access_memory field
7481         to done_accessing_memory.
7482         (unprepare_to_access_memory): Rename to ...
7483         (done_accessing_memory): ... this.
7484
7485 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7486
7487         * linux-low.c (linux_prepare_to_access_memory): New.
7488         (linux_unprepare_to_access_memory): New.
7489         (linux_target_ops): Install them.
7490         * server.c (read_memory): Rename to ...
7491         (gdb_read_memory): ... this.  Use
7492         prepare_to_access_memory/prepare_to_access_memory.
7493         (write_memory): Rename to ...
7494         (gdb_write_memory): ... this.  Use
7495         prepare_to_access_memory/prepare_to_access_memory.
7496         (handle_search_memory_1): Adjust.
7497         (process_serial_event): Adjust.
7498         * target.h (struct target_ops): New fields
7499         prepare_to_access_memory and unprepare_to_access_memory.
7500         (prepare_to_access_memory, unprepare_to_access_memory): New.
7501         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
7502         prepare_to_access_memory/prepare_to_access_memory.
7503         * nto-low.c (nto_target_ops): Adjust.
7504         * spu-low.c (spu_target_ops): Adjust.
7505         * win32-low.c (win32_target_ops): Adjust.
7506
7507 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7508
7509         * Makefile.in (WARN_CFLAGS): Get it from configure.
7510         (WERROR_CFLAGS): New.
7511         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
7512         * configure.ac: Introduce --enable-werror, which adds -Werror to
7513         the compiler command line.  Enabled by default.  Disable with
7514         --disable-werror.  Add -Wdeclaration-after-statement
7515         Wpointer-arith and -Wformat-nonliteral to warning flags.
7516         * configure: Regenerate.
7517
7518 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7519
7520         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
7521
7522 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7523
7524         * gdbreplay.c (remote_error): New.
7525         (gdbchar): New.
7526         (expect): Use gdbchar.  Check for error reading from GDB.
7527         Clarify sync error output.
7528         (play): Check for errors writing to GDB.
7529         * linux-low.c (sigchld_handler): Really ignore `write' errors.
7530         * remote-utils.c (getpkt): Check for errors writing to the remote
7531         descriptor.
7532
7533 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7534
7535         * linux-low.c (linux_wait_1): Move non-debugging code out of
7536         `debug_threads' control.
7537
7538 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7539
7540         * linux-low.c (linux_wait_1): Don't set last_status here.
7541         * server.c (push_event, queue_stop_reply_callback): Assert we're
7542         not pushing a TARGET_WAITKIND_IGNORE event.
7543         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
7544         (myresume, handle_target_event): Set the thread's last_resume_kind
7545         and last_status from the target returned status.
7546
7547 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7548
7549         PR threads/10729
7550
7551         * linux-x86-low.c (update_debug_registers_callback): New.
7552         (i386_dr_low_set_addr): Use it.
7553         (i386_dr_low_get_addr): New.
7554         (i386_dr_low_set_control): Use update_debug_registers_callback.
7555         (i386_dr_low_get_control): New.
7556         (i386_dr_low_get_status): Adjust.
7557         * linux-low.c (linux_stop_lwp): New.
7558         * linux-low.h (linux_stop_lwp): Declare.
7559
7560         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
7561         argument instead of a i386_debug_reg_state.
7562         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
7563         a i386_debug_reg_state.
7564         (i386_insert_aligned_watchpoint): Adjust.
7565         (i386_remove_aligned_watchpoint): Adjust.
7566         (i386_low_stopped_data_address): Read the debug registers from the
7567         inferior instead of from the mirrors.
7568         * i386-low.h (struct i386_debug_reg_state): Extend comment.
7569         (i386_dr_low_get_addr): Declare.
7570         (i386_dr_low_get_control): Declare.
7571         (i386_dr_low_get_status): Change prototype.
7572
7573         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
7574         (i386_dr_low_get_addr): New.
7575         (i386_dr_low_get_control): New.
7576         (i386_dr_low_get_status): Adjust prototype.  Return
7577         dr_status_mirror.
7578         (i386_initial_stuff): Clear dr_status_mirror and
7579         dr_control_mirror.
7580         (i386_get_thread_context): Adjust.
7581         (i386_set_thread_context): Adjust.
7582         (i386_thread_added): Adjust.
7583
7584 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
7585
7586         * linux-low.h (linux_thread_area): Delete declaration.
7587
7588 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
7589
7590         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
7591         after its termination.
7592
7593 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
7594
7595         * linux-low.c (gdb_wants_lwp_stopped): Delete.
7596         (gdb_wants_all_stopped): Delete.
7597         (linux_wait_1): Don't call them.
7598         * server.c (handle_v_cont): Tag all threads as want-stopped.
7599         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
7600         stopped as "client-wants-stopped".
7601
7602 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
7603
7604         * Makefile.in (signals_h): New.
7605         (server_h): Depend on it.
7606         (server.o): Don't depend on $(signals_def).
7607         (signals.o): Depend on $(signals_def).
7608
7609 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
7610
7611         * Makefile.in (signals_def): New.
7612         (server_h): Append include/gdb/signals.h and signals_def.
7613         (server.o): Append signals_def.
7614
7615 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7616
7617         * server.c (handle_target_event): Use target_signal_to_host for
7618         resume_info.sig initialization.
7619         * target.h (struct thread_resume) <sig>: New comment.
7620
7621 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
7622
7623         * server.c (handle_query): strcpy() the returned string from paddress()
7624         instead of sprintf().
7625         * utils.c (paddress): Return phex_nz().
7626
7627 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
7628
7629         * server.c (handle_v_cont): Call mourn_inferior if process
7630         just exited.
7631         (myresume): Likewise.
7632
7633 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
7634
7635         Static tracepoints, and integration with UST.
7636
7637         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
7638         * mem-break.c (uninsert_all_breakpoints)
7639         (reinsert_all_breakpoints): New.
7640         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
7641         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
7642         (gdb_agent_ust_loaded, helper_thread_id)
7643         (gdb_agent_helper_thread_id): New macros.
7644         (struct ipa_sym_addresses): Add addr_ust_loaded,
7645         addr_helper_thread_id, addr_cmd_buf.
7646         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
7647         (in_process_agent_loaded_ust): New.
7648         (write_e_ust_not_loaded): New.
7649         (maybe_write_ipa_ust_not_loaded): New.
7650         (struct collect_static_trace_data_action): New.
7651         (enum tracepoint_type) <static_tracepoint>: New.
7652         (struct tracepoint) <handle>: Mention static tracepoints.
7653         (struct static_tracepoint_ctx): New.
7654         (CMD_BUF_SIZE): New.
7655         (add_tracepoint_action): Handle static tracepoint actions.
7656         (unprobe_marker_at): New.
7657         (clear_installed_tracepoints): Handle static tracepoints.
7658         (cmd_qtdp): Handle static tracepoints.
7659         (probe_marker_at): New.
7660         (cmd_qtstart): Handle static tracepoints.
7661         (response_tracepoint): Handle static tracepoints.
7662         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
7663         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
7664         (get_context_regcache): Handle static tracepoints.
7665         (do_action_at_tracepoint): Handle static tracepoint actions.
7666         (traceframe_find_block_type): Handle static trace data blocks.
7667         (traceframe_read_sdata): New.
7668         (download_tracepoints): Download static tracepoint actions.
7669         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
7670         (GDB_PROBE_NAME): New.
7671         (ust_ops): New.
7672         (GET_UST_SYM): New.
7673         (USTF): New.
7674         (dlsym_ust): New.
7675         (ust_marker_to_static_tracepoint): New.
7676         (gdb_probe): New.
7677         (collect_ust_data_at_tracepoint): New.
7678         (gdb_ust_probe): New.
7679         (UNIX_PATH_MAX, SOCK_DIR): New.
7680         (gdb_ust_connect_sync_socket): New.
7681         (resume_thread, stop_thread): New.
7682         (run_inferior_command): New.
7683         (init_named_socket): New.
7684         (gdb_ust_socket_init): New.
7685         (cstr_to_hexstr): New.
7686         (next_st): New.
7687         (first_marker, next_marker): New.
7688         (response_ust_marker): New.
7689         (cmd_qtfstm, cmd_qtsstm): New.
7690         (unprobe_marker_at, probe_marker_at): New.
7691         (cmd_qtstmat, gdb_ust_thread): New.
7692         (gdb_ust_init): New.
7693         (initialize_tracepoint_ftlib): Call gdb_ust_init.
7694         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
7695         (ST_REGENTRY): New.
7696         (x86_64_st_collect_regmap): New.
7697         (X86_64_NUM_ST_COLLECT_GREGS): New.
7698         (AMD64_RIP_REGNUM): New.
7699         (supply_static_tracepoint_registers): New.
7700         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
7701         (ST_REGENTRY): New.
7702         (i386_st_collect_regmap): New.
7703         (i386_NUM_ST_COLLECT_GREGS): New.
7704         (supply_static_tracepoint_registers): New.
7705         * server.c (handle_query): Handle qXfer:statictrace:read.
7706         <qSupported>: Report support for StaticTracepoints, and
7707         qXfer:statictrace:read features.
7708         * server.h (traceframe_read_sdata)
7709         (supply_static_tracepoint_registers): Declare.
7710         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
7711         (unpack_varlen_hex): Include in IPA build.
7712         * Makefile.in (ustlibs, ustinc): New.
7713         (IPA_OBJS): Add remote-utils-ipa.o.
7714         ($(IPA_LIB)): Link -ldl and -lpthread.
7715         (UST_CFLAGS): New.
7716         (IPAGENT_CFLAGS): Add UST_CFLAGS.
7717         * config.in, configure: Regenerate.
7718
7719 2010-06-20  Ian Lance Taylor  <iant@google.com>
7720             Pedro Alves  <pedro@codesourcery.com>
7721
7722         * linux-x86-low.c (always_true): Delete.
7723         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
7724         trying to fool the compiler with always_true.
7725
7726 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
7727
7728         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
7729         conditions in gdbserver.
7730
7731 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
7732
7733         * spu-low.c (spu_read_memory): Wrap around local store limit.
7734         (spu_write_memory): Likewise.
7735
7736 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
7737
7738         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
7739         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
7740         LONGEST uses.
7741         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
7742         uses.
7743         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
7744         uses with LONGEST uses.
7745
7746 2010-06-14  Stan Shebs  <stan@codesourcery.com>
7747             Pedro Alves  <pedro@codesourcery.com>
7748
7749         Bytecode compiler.
7750
7751         * linux-x86-low.c: Include limits.h.
7752         (add_insns): New.
7753         (always_true): New.
7754         (EMIT_ASM): New.
7755         (EMIT_ASM32): New.
7756         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
7757         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
7758         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
7759         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
7760         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
7761         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
7762         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
7763         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
7764         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
7765         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
7766         (amd64_emit_void_call_2): New.
7767         (amd64_emit_ops): New.
7768         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
7769         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
7770         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
7771         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
7772         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
7773         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
7774         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
7775         (i386_emit_call, i386_emit_reg, i386_emit_pop)
7776         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
7777         (i386_emit_stack_adjust, i386_emit_int_call_1)
7778         (i386_emit_void_call_2): New.
7779         (i386_emit_ops): New.
7780         (x86_emit_ops): New.
7781         (the_low_target): Install x86_emit_ops.
7782         * server.h (struct emit_ops): New.
7783         (get_raw_reg_func_addr): Declare.
7784         (current_insn_ptr, emit_error): Declare.
7785         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
7786         (set_trace_state_variable_value): New defines.
7787         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
7788         addr_get_trace_state_variable_value and
7789         addr_set_trace_state_variable_value.
7790         (symbol_list): New fields for get_raw_reg,
7791         get_trace_state_variable_value and set_trace_state_variable_value.
7792         (condfn): New typedef.
7793         (struct tracepoint): New field `compiled_cond'.
7794         (do_action_at_tracepoint): Clear compiled_cond.
7795         (get_trace_state_variable_value, set_trace_state_variable_value):
7796         Export in the IPA.
7797         (condition_true_at_tracepoint): If there's a compiled condition,
7798         run that.
7799         (current_insn_ptr, emit_error): New globals.
7800         (struct bytecode_address): New.
7801         (get_raw_reg_func_addr): New.
7802         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
7803         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
7804         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
7805         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
7806         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
7807         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
7808         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
7809         (compile_tracepoint_condition, compile_bytecodes): New.
7810         * target.h (emit_ops): Forward declare.
7811         (struct target_ops): New field emit_ops.
7812         (target_emit_ops): New.
7813         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
7814         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
7815         * linux-low.c (linux_emit_ops): New.
7816         (linux_target_ops): Install it.
7817         * linux-low.h (struct linux_target_ops): New field emit_ops.
7818
7819 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
7820
7821         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
7822         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
7823
7824 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
7825             Stan Shebs  <stan@codesourcery.com>
7826
7827         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
7828         (all): Depend on $(extra_libraries).
7829         (install-only): Install the IPA.
7830         (IPA_OBJS, IPA_LIB): New.
7831         (clean): Remove the IPA lib.
7832         (IPAGENT_CFLAGS): New.
7833         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
7834         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
7835         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
7836         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
7837         * configure.ac: Check for atomic builtins support in the compiler.
7838         (IPA_DEPFILES, extra_libraries): Define.
7839         * configure.srv (ipa_obj): Add description.
7840         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
7841         (i[34567]86-*-linux*): Set ipa_obj.
7842         (x86_64-*-linux*): Set ipa_obj.
7843         * linux-low.c (stabilizing_threads): New.
7844         (supports_fast_tracepoints): New.
7845         (linux_detach): Stabilize threads before detaching.
7846         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
7847         the lwp is either not stabilizing, or is moving out of a jump pad.
7848         (linux_fast_tracepoint_collecting): New.
7849         (maybe_move_out_of_jump_pad): New.
7850         (enqueue_one_deferred_signal): New.
7851         (dequeue_one_deferred_signal): New.
7852         (linux_wait_for_event_1): If moving out of a jump pad, defer
7853         pending signals to later.
7854         (linux_stabilize_threads): New.
7855         (linux_wait_1): Check if threads need moving out of jump pads, and
7856         do it if so.
7857         (stuck_in_jump_pad_callback): New.
7858         (move_out_of_jump_pad_callback): New.
7859         (lwp_running): New.
7860         (linux_resume_one_lwp): Handle moving out of jump pads.
7861         (linux_set_resume_request): Dequeue deferred signals.
7862         (need_step_over_p): Also step over fast tracepoint jumps.
7863         (start_step_over): Also uninsert fast tracepoint jumps.
7864         (finish_step_over): Also reinsert fast tracepoint jumps.
7865         (linux_install_fast_tracepoint_jump): New.
7866         (linux_target_ops): Install linux_stabilize_threads and
7867         linux_install_fast_tracepoint_jump_pad.
7868         * linux-low.h (linux_target_ops) <get_thread_area,
7869         install_fast_tracepoint_jump_pad>: New fields.
7870         (struct lwp_info) <collecting_fast_tracepoint,
7871         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
7872         (linux_get_thread_area): Declare.
7873         * linux-x86-low.c (jump_insn): New.
7874         (x86_get_thread_area): New.
7875         (append_insns): New.
7876         (push_opcode): New.
7877         (amd64_install_fast_tracepoint_jump_pad): New.
7878         (i386_install_fast_tracepoint_jump_pad): New.
7879         (x86_install_fast_tracepoint_jump_pad): New.
7880         (the_low_target): Install x86_get_thread_area and
7881         x86_install_fast_tracepoint_jump_pad.
7882         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
7883         (struct fast_tracepoint_jump): New.
7884         (fast_tracepoint_jump_insn): New.
7885         (fast_tracepoint_jump_shadow): New.
7886         (find_fast_tracepoint_jump_at): New.
7887         (fast_tracepoint_jump_here): New.
7888         (delete_fast_tracepoint_jump): New.
7889         (set_fast_tracepoint_jump): New.
7890         (uninsert_fast_tracepoint_jumps_at): New.
7891         (reinsert_fast_tracepoint_jumps_at): New.
7892         (set_breakpoint_at): Use write_inferior_memory.
7893         (uninsert_raw_breakpoint): Use write_inferior_memory.
7894         (check_mem_read): Mask out fast tracepoint jumps.
7895         (check_mem_write): Mask out fast tracepoint jumps.
7896         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
7897         (set_fast_tracepoint_jump): Declare.
7898         (delete_fast_tracepoint_jump)
7899         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
7900         (reinsert_fast_tracepoint_jumps_at): Declare.
7901         * regcache.c: Don't compile many functions when building the
7902         in-process agent library.
7903         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
7904         the register buffer in the heap.
7905         (free_register_cache): If the register buffer isn't owned by the
7906         regcache, don't free it.
7907         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
7908         pre-existing register caches.
7909         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
7910         type.
7911         (convert_ascii_to_int): : Constify `from' parameter type.
7912         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
7913         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
7914         the needed buffer in-place.
7915         (relocate_instruction): New.
7916         * server.c (handle_query) <qSymbols>: If the target supports
7917         tracepoints, give it a chance of looking up symbols.  Report
7918         support for fast tracepoints.
7919         (handle_status): Stabilize threads.
7920         (process_serial_event): Adjust.
7921         * server.h (struct fast_tracepoint_jump): Forward declare.
7922         (struct process_info) <fast_tracepoint_jumps>: New field.
7923         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
7924         (decode_X_packet, decode_M_packet): Adjust.
7925         (relocate_instruction): Declare.
7926         (in_process_agent_loaded): Declare.
7927         (tracepoint_look_up_symbols): Declare.
7928         (struct fast_tpoint_collect_status): Declare.
7929         (fast_tracepoint_collecting): Declare.
7930         (force_unlock_trace_buffer): Declare.
7931         (handle_tracepoint_bkpts): Declare.
7932         (initialize_low_tracepoint)
7933         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
7934         * target.h (struct target_ops) <stabilize_threads,
7935         install_fast_tracepoint_jump_pad>: New fields.
7936         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
7937         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
7938         [HAVE_STDINT_H]: Include stdint.h.
7939         (trace_debug_1): Rename to ...
7940         (trace_vdebug): ... this.
7941         (trace_debug): Rename to ...
7942         (trace_debug_1): ... this.  Add `level' parameter.
7943         (trace_debug): New.
7944         (ATTR_USED, ATTR_NOINLINE): New.
7945         (IP_AGENT_EXPORT): New.
7946         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
7947         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
7948         (about_to_request_buffer_space, trace_buffer_is_full)
7949         (stopping_tracepoint, expr_eval_result, error_tracepoint)
7950         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
7951         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
7952         (traceframe_write_count, traceframes_created)
7953         (trace_state_variables)
7954         New renaming defines.
7955         (struct ipa_sym_addresses): New.
7956         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
7957         (symbol_list): New.
7958         (ipa_sym_addrs): New.
7959         (all_tracepoint_symbols_looked_up): New.
7960         (in_process_agent_loaded): New.
7961         (write_e_ipa_not_loaded): New.
7962         (maybe_write_ipa_not_loaded): New.
7963         (tracepoint_look_up_symbols): New.
7964         (debug_threads) [IN_PROCESS_AGENT]: New.
7965         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
7966         (UNKNOWN_SIDE_EFFECTS): New.
7967         (stop_tracing): New.
7968         (flush_trace_buffer): New.
7969         (stop_tracing_bkpt): New.
7970         (flush_trace_buffer_bkpt): New.
7971         (read_inferior_integer): New.
7972         (read_inferior_uinteger): New.
7973         (read_inferior_data_pointer): New.
7974         (write_inferior_data_pointer): New.
7975         (write_inferior_integer): New.
7976         (write_inferior_uinteger): New.
7977         (struct collect_static_trace_data_action): Delete.
7978         (enum tracepoint_type): New.
7979         (struct tracepoint) <type>: New field `type'.
7980         <actions_str, step_actions, step_actions_str>: Only include in
7981         GDBserver.
7982         <orig_size, obj_addr_on_target, adjusted_insn_addr>
7983         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
7984         (tracepoints): Use IP_AGENT_EXPORT.
7985         (last_tracepoint): Don't include in the IPA.
7986         (stopping_tracepoint): Use IP_AGENT_EXPORT.
7987         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
7988         (alloced_trace_state_variables): New.
7989         (trace_state_variables): Use IP_AGENT_EXPORT.
7990         (traceframe_t): Delete unused variable.
7991         (circular_trace_buffer): Don't include in the IPA.
7992         (trace_buffer_start): Delete.
7993         (struct trace_buffer_control): New.
7994         (trace_buffer_free): Delete.
7995         (struct ipa_trace_buffer_control): New.
7996         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
7997         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
7998         New.
7999         (trace_buffer_ctrl): New.
8000         (TRACE_BUFFER_CTRL_CURR): New.
8001         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8002         Reimplement as macros.
8003         (trace_buffer_wrap): Delete.
8004         (traceframe_write_count, traceframe_read_count)
8005         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8006         (struct tracepoint_hit_ctx) <type>: New field.
8007         (struct fast_tracepoint_ctx): New.
8008         (memory_barrier): New.
8009         (cmpxchg): New.
8010         (record_tracepoint_error): Update atomically in the IPA.
8011         (clear_inferior_trace_buffer): New.
8012         (about_to_request_buffer_space): New.
8013         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8014         updating the same buffer.
8015         (add_tracepoint): Default the tracepoint's type to trap
8016         tracepoint, and orig_size to -1.
8017         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8018         internal variables.
8019         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8020         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8021         (cmd_qtdp): Handle fast tracepoints.
8022         (cmd_qtdv): Adjust.
8023         (max_jump_pad_size): New.
8024         (gdb_jump_pad_head): New.
8025         (get_jump_space_head): New.
8026         (claim_jump_space): New.
8027         (sort_tracepoints): New.
8028         (MAX_JUMP_SIZE): New.
8029         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8030         IPA.
8031         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8032         support.  Upload fast traceframes, and delete internal IPA
8033         breakpoints.
8034         (stop_tracing_handler): New.
8035         (flush_trace_buffer_handler): New.
8036         (cmd_qtstop): Upload fast tracepoints.
8037         (response_tracepoint): Handle fast tracepoints.
8038         (tracepoint_finished_step): Upload fast traceframes.  Set the
8039         tracepoint hit context's tracepoint type.
8040         (handle_tracepoint_bkpts): New.
8041         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8042         type.  Add comment about fast tracepoints.
8043         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8044         non-existing action_str field.
8045         (get_context_regcache): Handle fast tracepoints.
8046         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8047         to the regcache.
8048         (fast_tracepoint_from_jump_pad_address): New.
8049         (fast_tracepoint_from_ipa_tpoint_address): New.
8050         (collecting_t): New.
8051         (force_unlock_trace_buffer): New.
8052         (fast_tracepoint_collecting): New.
8053         (collecting): New.
8054         (gdb_collect): New.
8055         (write_inferior_data_ptr): New.
8056         (target_tp_heap): New.
8057         (target_malloc): New.
8058         (download_agent_expr): New.
8059         (UALIGN): New.
8060         (download_tracepoints): New.
8061         (download_trace_state_variables): New.
8062         (upload_fast_traceframes): New.
8063         (IPA_FIRST_TRACEFRAME): New.
8064         (IPA_NEXT_TRACEFRAME_1): New.
8065         (IPA_NEXT_TRACEFRAME): New.
8066         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8067         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8068         (gdb_jump_pad_buffer_end): New.
8069         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8070         (initialize_tracepoint): Adjust.
8071         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8072         buffer.  Initialize the low module.
8073         * utils.c (PREFIX, TOOLNAME): New.
8074         (malloc_failure): Use PREFIX.
8075         (error): In the IPA, an error causes an exit.
8076         (fatal, warning): Use PREFIX.
8077         (internal_error): Use TOOLNAME.
8078         (NUMCELLS): Increase to 10.
8079         * configure, config.in: Regenerate.
8080
8081 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8082
8083         * server.c (handle_query) <qSupported>: Do two passes over the
8084         qSupported string to avoid nesting strtok.
8085
8086 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8087
8088         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8089         (CDEPS): New.
8090         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8091         -Wl,--dynamic-list.
8092         * configure: Regenerate.
8093         * proc-service.list: New.
8094
8095 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8096
8097         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8098         New comment.
8099
8100 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8101
8102         * gdbreplay.c (remote_open): Check error return from socket() call by
8103         its equality to -1 not by it being negative.
8104         * remote-utils.c (remote_open): Likewise.
8105
8106 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8107
8108         * config.h: Regenerate.
8109
8110 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8111
8112         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8113         doesn't provide PTRACE_GET_THREAD_AREA.
8114
8115 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8116
8117         * linux-m68k-low.c: Include <asm/ptrace.h>
8118         (ps_get_thread_area): Implement.
8119
8120 2010-05-03  Doug Evans  <dje@google.com>
8121
8122         * event-loop.c (struct callback_event): New struct.
8123         (callback_list): New global.
8124         (append_callback_event, delete_callback_event): New functions.
8125         (process_callback): New function.
8126         (start_event_loop): Call it.
8127         * remote-utils.c (NOT_SCHEDULED): Define.
8128         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8129         moved out of readchar.
8130         (readchar): Rewrite.  Call reschedule before returning.
8131         (reset_readchar): New function.
8132         (remote_close): Call it.
8133         (process_remaining, reschedule): New functions.
8134         * server.h (callback_handler_func): New typedef.
8135         (append_callback_event, delete_callback_event): Declare.
8136
8137 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8138
8139         * proc-service.c (ps_pglobal_lookup): Use
8140         thread_db_look_up_one_symbol.
8141         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8142         parameter.  Use it instead of all_symbols_looked_up.
8143         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8144         field.
8145         (all_symbols_looked_up): Don't declare.
8146         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8147         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8148         field.
8149         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8150         Set all_symbols_looked_up here.
8151         (thread_db_look_up_one_symbol): New.
8152         (thread_db_get_tls_address): Adjust.
8153         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8154         thread_db object on the heap, and tentatively set it in the
8155         process structure.
8156         (thread_db_init): Don't set all_symbols_looked_up here.
8157         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8158
8159 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8160
8161         * linux-low.c (linux_kill, linux_detach): Adjust.
8162         (status_pending_p_callback): Remove redundant statement.  Check
8163         for !TARGET_WAITIKIND_IGNORE, instead of
8164         TARGET_WAITKIND_STOPPED.
8165         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8166         (linux_wait_for_event_1): Adjust.
8167         (linux_cancel_breakpoints): New.
8168         (unsuspend_one_lwp): New.
8169         (unsuspend_all_lwps): New.
8170         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8171         (send_sigstop_callback): Change return type to int, add new
8172         `except' parameter and handle it.
8173         (suspend_and_send_sigstop_callback): New.
8174         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8175         pass them down.  If SUSPEND, also increment the lwp's suspend
8176         count.
8177         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8178         (need_step_over_p): Don't consider suspended LWPs.
8179         (start_step_over): Adjust.
8180         (proceed_one_lwp): Change return type to int, add new `except'
8181         parameter and handle it.
8182         (unsuspend_and_proceed_one_lwp): New.
8183         (proceed_all_lwps): Use find_inferior instead of
8184         for_each_inferior.
8185         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8186         also decrement the suspend count of LWPs.  Pass `except' down,
8187         instead of hacking its suspend count.
8188         (linux_pause_all): Add `freeze' parameter.  Adjust.
8189         (linux_unpause_all): New.
8190         (linux_target_ops): Install linux_unpause_all.
8191         * server.c (handle_status): Adjust.
8192         * target.h (struct target_ops): New fields `unpause_all' and
8193         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8194         (pause_all): Add new `freeze' parameter.
8195         (unpause_all): New.
8196         (cancel_breakpoints): New.
8197         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8198         cancel breakpoints.
8199         (cmd_qtstart): Pause threads.
8200         (stop_tracing): Pause threads, and cancel breakpoints.
8201         * win32-low.c (win32_target_ops): Adjust.
8202
8203 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8204
8205         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8206         the inferior right away from here...
8207         (linux_wait_1): ... to here, and adjust to check the thread's
8208         last_resume_kind instead of the lwp's step or stop_expected flags.
8209
8210 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8211
8212         * README: Use consistent `GDB' and `GDBserver' spellings.
8213
8214 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8215
8216         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8217         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8218         (linux_detach_one_lwp): Assume the lwp is stopped.
8219         (any_thread_of): Delete.
8220         (linux_detach): Stop all lwps here.  Don't blindly delete all
8221         breakpoints.
8222         (delete_lwp_callback): New.
8223         (linux_mourn): Delete all lwps of the process that is gone.
8224         (linux_wait_1): Don't delete the last lwp of the process here.
8225         * mem-break.h (mark_breakpoints_out): Declare.
8226         * mem-break.c (mark_breakpoints_out): New.
8227         (free_all_breakpoints): Use it.
8228         * server.c (handle_target_event): If the process is gone, mark
8229         breakpoints out.
8230         * thread-db.c (struct thread_db) <create_bp>: New field.
8231         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8232         breakpoint reference in the thread_db struct.
8233         (thread_db_load_search): Clear the thread_db object.
8234         (try_thread_db_load_1): Ditto.
8235         (switch_to_process): New.
8236         (disable_thread_event_reporting): Use it.
8237         (remove_thread_event_breakpoints): New.
8238         (thread_db_detach, thread_db_mourn): Use it.
8239
8240 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8241
8242         * linux-low.c (linux_enable_event_reporting): New.
8243         (linux_wait_for_event_1, handle_extended_wait): Use it.
8244
8245 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8246
8247         * linux-low.c (linux_kill_one_lwp, linux_kill)
8248         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8249         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8250         SIGSTOP even if the LWP is stopped.
8251         (send_sigstop_callback): New.
8252         (stop_all_lwps): Use send_sigstop_callback instead.
8253         (linux_resume_one_thread): Adjust.
8254         (proceed_one_lwp): Still proceed an LWP that the client has
8255         requested to stop, if we haven't reported it as stopped yet.  Make
8256         sure that LWPs the client want stopped, have a pending SIGSTOP.
8257
8258 2010-04-26  Doug Evans  <dje@google.com>
8259
8260         * server.c (handle_general_set): Make static.
8261
8262         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8263         Print received char after testing for error/eof instead of before.
8264         (input_interrupt): Tweak comment.
8265
8266 2010-04-23  Doug Evans  <dje@google.com>
8267
8268         * server.c (start_inferior): Print inferior argv if --debug.
8269
8270 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8271
8272         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8273         * nto-x86-low.c: Include server.h
8274
8275 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8276
8277         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8278         be consistent with other sources of this directory.
8279         (init_registers_amd64): Correct name of source file of this function
8280         in the comment.
8281
8282 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8283
8284         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8285         64-bit executables.
8286
8287 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8288
8289         * win32-i386-low.c: Add 64-bit support.
8290         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8291         (init_registers_amd64): Declare.
8292         (mappings): Add 64-bit version of array.
8293         (init_windows_x86): New function.
8294         (the_low_target): Change init_arch field to init_windows_x86.
8295
8296 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8297
8298         * win32-low.c: Adapt to support also 64-bit architecture.
8299         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8300         (get_image_name): Use SIZE_T type for local variable `done'.
8301         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8302         (toolhelp_get_dll_name): Idem.
8303         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8304         Use uintptr_t typecast to avoid warning.
8305         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8306         (handle_exception): Use phex_nz to avoid warning.
8307         (win32_wait): Remove unused local variable `process'.
8308
8309 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8310
8311         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8312         `amd64-avx.o'.
8313
8314 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8315
8316         * configure.ac: Use `ws2_32' library for srv_mingw.
8317         * configure: Regenerate.
8318         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8319         * remote-utils.c: Likewise.
8320
8321 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8322
8323         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8324         if __x86_64__ is defined.
8325
8326 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8327
8328         * configure: Regenerate.
8329
8330 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8331
8332         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8333         * target.h (target_ops): New get_tib_address field.
8334         * win32-low.h (win32_thread_info): Add thread_local_base field.
8335         * win32-low.c (child_add_thread): Add tlb argument.
8336         Set thread_local_base field to TLB.
8337         (get_child_debug_event): Adapt to child_add_thread change.
8338         (win32_get_tib_address): New function.
8339         (win32_target_ops): Set get_tib_address field to
8340         win32_get_tib_address.
8341         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8342
8343 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8344
8345         * linux-low.c (linux_mourn): Also remove the process.
8346         * server.c (handle_target_event): Don't remove the process here.
8347         * nto-low.c (nto_mourn): New.
8348         (nto_target_ops): Install it.
8349         * spu-low.c (spu_mourn): New.
8350         (spu_target_ops): Install it.
8351         * win32-low.c (win32_mourn): New.
8352         (win32_target_ops): Install it.
8353
8354 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8355
8356         * server.h (buffer_xml_printf): Remove redundant `;'.
8357
8358 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8359
8360         * regcache.c (set_register_cache): Invalidate regcaches before
8361         changing the register cache layout.
8362         (regcache_invalidate_one): Allow a NULL regcache.
8363         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8364         regcaches before changing the register cache layout or the target
8365         regsets.
8366
8367 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8368
8369         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8370         variable warning on Linux/x86-64.
8371
8372 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8373
8374         GDBserver disconnected tracing support.
8375
8376         * linux-low.c (linux_remove_process): Delete.
8377         (add_lwp): Don't set last_resume_kind here.
8378         (linux_kill): Use `mourn'.
8379         (linux_detach): Use `thread_db_detach', and `mourn'.
8380         (linux_mourn): New.
8381         (linux_attach_lwp_1): Adjust comment.
8382         (linux_attach): last_resume_kind moved the thread_info; adjust.
8383         (status_pending_p_callback): Adjust.
8384         (linux_wait_for_event_1): Adjust.
8385         (count_events_callback, select_singlestep_lwp_callback)
8386         (select_event_lwp_callback, cancel_breakpoints_callback)
8387         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8388         (proceed_one_lwp): Adjust.
8389         (linux_async): Add debug output.
8390         (linux_thread_stopped): New.
8391         (linux_pause_all): New.
8392         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
8393         linux_pause_all.
8394         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
8395         (thread_db_free): Delete declaration.
8396         (thread_db_detach, thread_db_mourn): Declare.
8397         * thread-db.c (thread_db_init): Use thread_db_mourn.
8398         (thread_db_free): Delete, split in two.
8399         (disable_thread_event_reporting): New.
8400         (thread_db_detach): New.
8401         (thread_db_mourn): New.
8402
8403         * server.h (struct thread_info) <last_resume_kind>: New field.
8404         <attached>: Add comment.
8405         <gdb_detached>: New field.
8406         (handler_func): Change return type to int.
8407         (handle_serial_event, handle_target_event): Ditto.
8408         (gdb_connected): Declare.
8409         (tracing): Delete.
8410         (disconnected_tracing): Declare.
8411         (stop_tracing): Declare.
8412
8413         * server.c (handle_query) <qSupported>: Report support for
8414         disconnected tracing.
8415         (queue_stop_reply_callback): Account for running threads.
8416         (gdb_wants_thread_stopped): New.
8417         (gdb_wants_all_threads_stopped): New.
8418         (gdb_reattached_process): New.
8419         (handle_status): Clear the `gdb_detached' flag of all processes.
8420         In all-stop, stop all threads.
8421         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
8422         (process_serial_event): If the remote connection breaks, or if an
8423         exit was forced with "monitor exit", force an event loop exit.
8424         Handle disconnected tracing on detach.
8425         (handle_serial_event): Adjust.
8426         (handle_target_event): If GDB isn't connected, forward events back
8427         to the inferior, unless the last process exited, in which case,
8428         exit gdbserver.  Adjust interface.
8429
8430         * remote-utils.c (remote_open): Don't block in accept.  Instead
8431         register an event loop source on the listen socket file
8432         descriptor.  Refactor bits into ...
8433         (listen_desc): ... this new global.
8434         (gdb_connected): ... this new function.
8435         (enable_async_notification): ... this new function.
8436         (handle_accept_event): ... this new function.
8437         (remote_close): Clear remote_desc.
8438
8439         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
8440
8441         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
8442         New fields.
8443         (mourn_inferior): Define.
8444         (target_process_qsupported): Avoid the dangling else problem.
8445         (thread_stopped): Define.
8446         (pause_all): Define.
8447         (target_waitstatus_to_string): Declare.
8448         * target.c (target_waitstatus_to_string): New.
8449
8450         * tracepoint.c (tracing): Make extern.
8451         (disconnected_tracing): New.
8452         (stop_tracing): Make extern.  Handle tracing stops due to GDB
8453         disconnecting.
8454         (cmd_qtdisconnected): New.
8455         (cmd_qtstatus): Report disconnected tracing status in trace reply.
8456         (handle_tracepoint_general_set): Handle QTDisconnected.
8457
8458         * event-loop.c (event_handler_func): Change return type to int.
8459         (process_event): Bail out if the event handler wants the event
8460         loop to stop.
8461         (handle_file_event): Ditto.
8462         (start_event_loop): Bail out if the event handler wants the event
8463         loop to stop.
8464
8465         * nto-low.c (nto_target_ops): Adjust.
8466         * spu-low.c (spu_wait): Don't remove the process here.
8467         (spu_target_ops): Adjust.
8468         * win32-low.c (win32_wait): Don't remove the process here.
8469         (win32_target_ops): Adjust.
8470
8471 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8472
8473         * regcache.c (realloc_register_cache): Invalidate inferior's
8474         regcache before recreating it.
8475
8476 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
8477
8478         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
8479
8480 2010-04-09  Stan Shebs  <stan@codesourcery.com>
8481             Pedro Alves  <pedro@codesourcery.com>
8482
8483         * server.h (LONGEST): New.
8484         (struct thread_info) <while_stepping>: New field.
8485         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
8486         Declare.
8487         (initialize_tracepoint, handle_tracepoint_general_set)
8488         (handle_tracepoint_query, tracepoint_finished_step)
8489         (tracepoint_was_hit, release_while_stepping_state_list):
8490         (current_traceframe): Declare.
8491         * server.c (handle_general_set): Handle tracepoint packets.
8492         (read_memory): New.
8493         (write_memory): New.
8494         (handle_search_memory_1): Use read_memory.
8495         (handle_query): Report support for conditional tracepoints, trace
8496         state variables, and tracepoint sources.  Handle tracepoint
8497         queries.
8498         (main): Initialize the tracepoints module.
8499         (process_serial_event): Handle traceframe reads/writes.
8500
8501         * linux-low.c (handle_tracepoints): New.
8502         (linux_wait_1): Call it.
8503         (linux_resume_one_lwp): Handle while-stepping.
8504         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
8505         (linux_target_ops): Install them.
8506         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
8507         New field.
8508         * linux-x86-low.c (x86_supports_tracepoints): New.
8509         (the_low_target). Install it.
8510
8511         * mem-break.h (delete_breakpoint): Declare.
8512         * mem-break.c (delete_breakpoint): Make external.
8513
8514         * target.h (struct target_ops): Add `supports_tracepoints',
8515         `read_pc', and `write_pc' fields.
8516         (target_supports_tracepoints): Define.
8517         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
8518         (phex_nz): New.
8519
8520         * regcache.h (struct regcache) <registers_owned>: New field.
8521         (init_register_cache, regcache_cpy): Declare.
8522         (regcache_read_pc, regcache_write_pc): Declare.
8523         (register_cache_size): Declare.
8524         (supply_regblock): Declare.
8525         * regcache.c (init_register_cache): New.
8526         (new_register_cache): Use it.
8527         (regcache_cpy): New.
8528         (register_cache_size): New.
8529         (supply_regblock): New.
8530         (regcache_read_pc, regcache_write_pc): New.
8531
8532         * tracepoint.c: New.
8533
8534         * Makefile.in (OBS): Add tracepoint.o.
8535         (tracepoint.o): New rule.
8536
8537 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
8538
8539         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
8540         (i386-mmx.o): New.
8541         (i386-mmx.c): Likewise.
8542         (i386-mmx-linux.o): Likewise.
8543         (i386-mmx-linux.c): Likewise.
8544
8545         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
8546         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
8547         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
8548         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
8549
8550         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
8551         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
8552         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
8553
8554 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
8555
8556         * Makefile.in (clean): Updated.
8557         (i386-avx.o): New.
8558         (i386-avx.c): Likewise.
8559         (i386-avx-linux.o): Likewise.
8560         (i386-avx-linux.c): Likewise.
8561         (amd64-avx.o): Likewise.
8562         (amd64-avx.c): Likewise.
8563         (amd64-avx-linux.o): Likewise.
8564         (amd64-avx-linux.c): Likewise.
8565
8566         * configure.srv (srv_i386_regobj): Add i386-avx.o.
8567         (srv_i386_linux_regobj): Add i386-avx-linux.o.
8568         (srv_amd64_regobj): Add amd64-avx.o.
8569         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
8570         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
8571         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
8572         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
8573         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
8574         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
8575         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
8576
8577         * i387-fp.c: Include "i386-xstate.h".
8578         (i387_xsave): New.
8579         (i387_cache_to_xsave): Likewise.
8580         (i387_xsave_to_cache): Likewise.
8581         (x86_xcr0): Likewise.
8582
8583         * i387-fp.h (i387_cache_to_xsave): Likewise.
8584         (i387_xsave_to_cache): Likewise.
8585         (x86_xcr0): Likewise.
8586
8587         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
8588         * linux-crisv32-low.c (target_regsets): Likewise.
8589         * linux-m68k-low.c (target_regsets): Likewise.
8590         * linux-mips-low.c (target_regsets): Likewise.
8591         * linux-ppc-low.c (target_regsets): Likewise.
8592         * linux-s390-low.c (target_regsets): Likewise.
8593         * linux-sh-low.c (target_regsets): Likewise.
8594         * linux-sparc-low.c (target_regsets): Likewise.
8595         * linux-xtensa-low.c (target_regsets): Likewise.
8596
8597         * linux-low.c: Include <sys/uio.h>.
8598         (regsets_fetch_inferior_registers): Support nt_type.
8599         (regsets_store_inferior_registers): Likewise.
8600         (linux_process_qsupported): New.
8601         (linux_target_ops): Add linux_process_qsupported.
8602
8603         * linux-low.h (regset_info): Add nt_type.
8604         (linux_target_ops): Add process_qsupported.
8605
8606         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
8607         and <sys/uio.h>.
8608         (init_registers_i386_avx_linux): New.
8609         (init_registers_amd64_avx_linux): Likewise.
8610         (xmltarget_i386_linux_no_xml): Likewise.
8611         (xmltarget_amd64_linux_no_xml): Likewise.
8612         (PTRACE_GETREGSET): Likewise.
8613         (PTRACE_SETREGSET): Likewise.
8614         (x86_fill_xstateregset): Likewise.
8615         (x86_store_xstateregset): Likewise.
8616         (use_xml): Likewise.
8617         (x86_linux_update_xmltarget): Likewise.
8618         (x86_linux_process_qsupported): Likewise.
8619         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
8620         (x86_arch_setup): Don't call init_registers_amd64_linux nor
8621         init_registers_i386_linux here.  Call
8622         x86_linux_update_xmltarget.
8623         (the_low_target): Add x86_linux_process_qsupported.
8624
8625         * server.c (handle_query): Call target_process_qsupported.
8626
8627         * target.h (target_ops): Add process_qsupported.
8628         (target_process_qsupported): New.
8629
8630 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
8631
8632         * inferiors.c (add_thread): Set last_status kind to
8633         TARGET_WAITKIND_IGNORE.
8634         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
8635         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
8636         (linux_wait_1): Move `thread' local definition to block that uses
8637         it.  Don't NULL initialize `event_child'.
8638         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
8639         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
8640         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
8641
8642 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8643
8644         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
8645         an extended waitstatus, or by a watchpoint.
8646         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
8647         thread was stepping or has been stopped by a watchpoint.
8648
8649 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8650
8651         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
8652         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
8653         of another, then delete the previous, and validate all
8654         breakpoints.
8655         (validate_inserted_breakpoint): New.
8656         (delete_disabled_breakpoints): New.
8657         (validate_breakpoints): New.
8658         (check_mem_read): Validate breakpoints before trusting their
8659         shadow.  Delete disabled breakpoints.
8660         (check_mem_write): Validate breakpoints before trusting they
8661         should be inserted.  Delete disabled breakpoints.
8662         * mem-break.h (validate_breakpoints):
8663         * server.c (handle_query): Validate breakpoints when we see a
8664         qSymbol query.
8665
8666 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8667
8668         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
8669         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
8670         if we could tell there's a GDB breakpoint at stop_pc.
8671         (need_step_over_p): Don't do a step over if we find a GDB
8672         breakpoint at the resume PC.
8673
8674         * mem-break.c (struct raw_breakpoint): New.
8675         (enum bkpt_type): New type `gdb_breakpoint'.
8676         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
8677         fields.  New field `raw'.
8678         (find_raw_breakpoint_at): New.
8679         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
8680         breakpoint instead.
8681         (set_breakpoint_at): Adjust.
8682         (delete_raw_breakpoint): New.
8683         (release_breakpoint): New.
8684         (delete_breakpoint): Rename to...
8685         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
8686         release_breakpoint.  Return ENOENT.
8687         (delete_breakpoint): Reimplement.
8688         (find_breakpoint_at): Delete.
8689         (find_gdb_breakpoint_at): New.
8690         (delete_breakpoint_at): Delete.
8691         (set_gdb_breakpoint_at): New.
8692         (delete_gdb_breakpoint_at): New.
8693         (gdb_breakpoint_here): New.
8694         (set_reinsert_breakpoint): Use release_breakpoint.
8695         (uninsert_breakpoint): Rename to ...
8696         (uninsert_raw_breakpoint): ... this.
8697         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
8698         (reinsert_raw_breakpoint): Change parameter type to
8699         raw_breakpoint.
8700         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
8701         instead.
8702         (check_breakpoints): Adjust.  Use release_breakpoint.
8703         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
8704         (breakpoint_inserted_here): Ditto.
8705         (check_mem_read): Adjust to iterate over raw breakpoints instead.
8706         Don't trust the breakpoint's shadow if it is not inserted.
8707         (check_mem_write): Adjust to iterate over raw breakpoints instead.
8708         (delete_all_breakpoints): Adjust.
8709         (free_all_breakpoints): Mark all breakpoints as uninserted, and
8710         use delete_breakpoint_1.
8711
8712         * mem-break.h (breakpoints_supported): Delete declaration.
8713         (set_gdb_breakpoint_at): Declare.
8714         (gdb_breakpoint_here): Declare.
8715         (delete_breakpoint_at): Delete.
8716         (delete_gdb_breakpoint_at): Declare.
8717
8718         * server.h (struct raw_breakpoint): Forward declare.
8719         (struct process_info): New field `raw_breakpoints'.
8720
8721         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
8722         breakpoints.
8723
8724 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8725
8726         * linux-low.c (status_pending_p_callback): Fix comment.
8727         (linux_wait_for_event_1): Move most of the internal breakpoint
8728         handling from here...
8729         (linux_wait_1): ... to here.
8730         (count_events_callback): New.
8731         (select_singlestep_lwp_callback): New.
8732         (select_event_lwp_callback): New.
8733         (cancel_breakpoints_callback): New.
8734         (select_event_lwp): New.
8735         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
8736         priority to all LWPs that have had events that should be reported
8737         to the client.  Cancel breakpoints when about to reporting the
8738         event to the client, not while stopping lwps.  No longer cancel
8739         finished single-steps here.
8740         (cancel_finished_single_step): Delete.
8741         (cancel_finished_single_steps): Delete.
8742
8743 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8744
8745         * mem-break.c (enum bkpt_type): New.
8746         (struct breakpoint): New field `type'.
8747         (set_breakpoint_at): Change return type to struct breakpoint
8748         pointer.  Set type to `other_breakpoint' by default.
8749         (delete_breakpoint): Rewrite, supporting more than one breakpoint
8750         in the breakpoint list.
8751         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
8752         (reinsert_breakpoint): Rename to ...
8753         (reinsert_raw_breakpoint): ... this.
8754         (reinsert_breakpoints_at): Adjust.
8755         * mem-break.h (struct breakpoint): Declare.
8756         (set_breakpoint_at): Change return type to struct breakpoint
8757         pointer.
8758
8759 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8760
8761         * server.c (handle_query): Assign, not compare.
8762
8763 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8764
8765         Teach linux gdbserver to step-over-breakpoints.
8766
8767         * linux-low.c (can_hardware_single_step): New.
8768         (supports_breakpoints): New.
8769         (handle_extended_wait): If stopping threads, read the stop pc of
8770         the new cloned LWP.
8771         (get_pc): New.
8772         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
8773         low target doesn't support retrieving the PC.
8774         (add_lwp): Set last_resume_kind to resume_continue.
8775         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
8776         (linux_attach): Don't clear stop_expected.  Set the lwp's
8777         last_resume_kind to resume_stop.
8778         (linux_detach_one_lwp): Don't check for removed breakpoints.
8779         (check_removed_breakpoint): Delete.
8780         (status_pending_p): Rename to ...
8781         (status_pending_p_callback): ... this.  Don't check for removed
8782         breakpoints.  Don't consider threads that are stopped from GDB's
8783         perspective.
8784         (linux_wait_for_lwp): Always read the stop_pc here.
8785         (cancel_breakpoint): New.
8786         (step_over_bkpt): New global.
8787         (linux_wait_for_event_1): Implement stepping over breakpoints.
8788         (gdb_wants_lwp_stopped): New.
8789         (gdb_wants_all_stopped): New.
8790         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
8791         single-step traps here.  Store the thread's last reported target
8792         wait status.
8793         (send_sigstop): Don't clear stop_expected.  Always set it,
8794         instead.
8795         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
8796         (cancel_finished_single_step): New.
8797         (cancel_finished_single_steps): New.
8798         (wait_for_sigstop): Don't cancel finished single-step traps here.
8799         (linux_resume_one_lwp): Don't check for removed breakpoints.
8800         Don't set `step' on non-hardware step archs.
8801         (linux_set_resume_request): Ignore resume_stop requests if already
8802         stopping or stopped.  Set the lwp's last_resume_kind.
8803         (resume_status_pending_p): Don't check for removed breakpoints.
8804         (need_step_over_p): New.
8805         (start_step_over): New.
8806         (finish_step_over): New.
8807         (linux_resume_one_thread): Always queue a sigstop for resume_stop
8808         requests.  Clear the thread's last reported target waitstatus.
8809         Don't use the `suspended' flag.  Don't consider pending breakpoints.
8810         (linux_resume): Start a step-over if necessary.
8811         (proceed_one_lwp): New.
8812         (proceed_all_lwps): New.
8813         (unstop_all_lwps): New.
8814         * linux-low.h (struct lwp_info): Rewrite comment for the
8815         `suspended' flag.  Add the `stop_pc' field.  Delete the
8816         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
8817         Add `'last_resume_kind' and `need_step_over' fields.
8818         * inferiors.c (struct thread_info): Delete, moved elsewhere.
8819         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
8820         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
8821         (set_raw_breakpoint_at): New.
8822         (set_breakpoint_at): Rewrite to use it.
8823         (reinsert_breakpoint_handler): Delete.
8824         (set_reinsert_breakpoint): New.
8825         (reinsert_breakpoint_by_bp): Delete.
8826         (delete_reinsert_breakpoints): New.
8827         (uninsert_breakpoint): Rewrite.
8828         (uninsert_breakpoints_at): New.
8829         (reinsert_breakpoint): Rewrite.
8830         (reinsert_breakpoints_at): New.
8831         (check_breakpoints): Rewrite.
8832         (breakpoint_here): New.
8833         (breakpoint_inserted_here): New.
8834         (check_mem_read): Adjust.
8835         * mem-break.h (breakpoints_supported, breakpoint_here)
8836         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
8837         (reinsert_breakpoint_by_bp): Delete declaration.
8838         (delete_reinsert_breakpoints): Declare.
8839         (reinsert_breakpoint): Delete declaration.
8840         (reinsert_breakpoints_at): Declare.
8841         (uninsert_breakpoint): Delete declaration.
8842         (uninsert_breakpoints_at): Declare.
8843         (check_breakpoints): Adjust prototype.
8844         * server.h: Adjust include order.
8845         (struct thread_info): Declare here.  Add a `last_status' field.
8846
8847 2010-03-23  Michael Snyder  <msnyder@vmware.com>
8848
8849         * server.c (crc32): New function.
8850         (handle_query): Add handling for 'qCRC:' request.
8851
8852 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
8853
8854         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
8855         lwp had been stopped by a watchpoint.
8856
8857 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
8858
8859         * server.h (internal_error): Declare.
8860         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
8861         * utils.c (internal_error): New function.
8862
8863 2010-03-15  Andreas Schwab  <schwab@redhat.com>
8864
8865         * configure.srv: Fix typo setting srv_regobj.
8866
8867 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
8868
8869         * linux-low.c (fetch_register): Avoid passing a non string literal
8870         format to `error'.
8871         (usr_store_inferior_registers): Ditto.
8872
8873 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
8874
8875         * linux-low.c (linux_write_memory): Bail out early if peeking
8876         memory failed.
8877
8878 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
8879
8880         * linux-low.h (struct lwp_info): New fields
8881         `stopped_by_watchpoint' and `stopped_data_address'.
8882         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
8883         here, and cache them in the lwp object.
8884         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
8885         directly.
8886         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
8887         field.
8888         (linux_stopped_by_watchpoint): Rewrite.
8889         (linux_stopped_data_address): Rewrite.
8890
8891 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
8892
8893         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
8894         switching the current inferior, not before.
8895
8896 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
8897
8898         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
8899         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
8900         i386-linux.c and amd64-linux.c.
8901         (reg-i386.o): Removed.
8902         (reg-i386.c): Likewise.
8903         (reg-i386-linux.o): Likewise.
8904         (reg-i386-linux.c): Likewise.
8905         (reg-x86-64.o): Likewise.
8906         (reg-x86-64.c): Likewise.
8907         (reg-x86-64-linux.o): Likewise.
8908         (reg-x86-64-linux.c): Likewise.
8909         (i386.o): New.
8910         (i386.c): Likewise.
8911         (i386-linux.o): Likewise.
8912         (i386-linux.c): Likewise.
8913         (amd64.o): Likewise.
8914         (amd64.c): Likewise.
8915         (amd64-linux.o): Likewise.
8916         (amd64-linux.c): Likewise.
8917
8918         * configure.srv (srv_i386_regobj): New.
8919         (srv_i386_linux_regobj): Likewise.
8920         (srv_amd64_regobj): Likewise.
8921         (srv_amd64_linux_regobj): Likewise.
8922         (srv_i386_32bit_xmlfiles): Likewise.
8923         (srv_i386_64bit_xmlfiles): Likewise.
8924         (srv_i386_xmlfiles): Likewise.
8925         (srv_amd64_xmlfiles): Likewise.
8926         (srv_i386_linux_xmlfiles): Likewise.
8927         (srv_amd64_linux_xmlfiles): Likewise.
8928         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
8929         srv_xmlfiles to $srv_i386_xmlfiles.
8930         (i[34567]86-*-mingw32ce*): Likewise.
8931         (i[34567]86-*-mingw*): Likewise.
8932         (i[34567]86-*-nto*): Likewise.
8933         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
8934         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
8935         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
8936         (x86_64-*-linux*): Likewise.
8937
8938         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
8939         (init_registers_amd64_linux): New.
8940         (x86_arch_setup): Replace init_registers_x86_64_linux with
8941         init_registers_amd64_linux.
8942
8943 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
8944
8945         * configure.ac: Check for libdl.  If it is not available link against
8946         static libthread_db.
8947         * configure: Regenerate.
8948
8949 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
8950
8951         PR9605
8952
8953         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
8954         handing a read watchpoint.
8955         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
8956
8957 2010-02-12  Doug Evans  <dje@google.com>
8958
8959         * linux-low.c (linux_supports_tracefork_flag): Document.
8960         (linux_look_up_symbols): Add comment.
8961
8962 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
8963
8964         * regcache.c (supply_register): Clear regcache if buf is NULL.
8965
8966 2010-02-02  Nicolas Roche  <roche@sourceware.org>
8967             Joel Brobecker  <brobecker@adacore.com>
8968
8969         * inferiors.c (find_inferior): Add function documentation.
8970         (unloaded_dll): Handle the case where the unloaded dll has not
8971         been previously registered in the dll list.
8972
8973 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
8974
8975         * linux-arm-low.c (thumb_breakpoint_len): Delete.
8976         (thumb2_breakpoint): New.
8977         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
8978
8979 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
8980
8981         * linux-low.c (get_stop_pc): Check for SIGTRAP.
8982         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
8983         breakpoints.
8984
8985 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
8986
8987         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
8988
8989 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
8990
8991         * linux-s390-low.c (s390_collect_ptrace_register)
8992         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
8993
8994 2010-01-21  Doug Evans  <dje@google.com>
8995
8996         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
8997         (PTRACE_ARG4_TYPE): New macro.
8998         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
8999         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9000         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9001         (usr_store_inferior_registers): Ditto.
9002         (linux_read_memory, linux_write_memory): Ditto.
9003         (linux_test_for_tracefork): Ditto.
9004
9005         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9006         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9007
9008 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9009
9010         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9011         target.
9012
9013 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9014
9015         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9016         prototype to take a regcache.  Adjust.
9017
9018 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9019
9020         * regcache.h (struct thread_info): Forward declare.
9021         (struct regcache): New.
9022         (new_register_cache): Adjust prototype.
9023         (get_thread_regcache): Declare.
9024         (free_register_cache): Adjust prototype.
9025         (registers_to_string, registers_from_string): Ditto.
9026         (supply_register, supply_register_by_name, collect_register)
9027         (collect_register_as_string, collect_register_by_name): Ditto.
9028         * regcache.c (struct inferior_regcache_data): Delete.
9029         (get_regcache): Rename to ...
9030         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9031         fetching registers.
9032         (regcache_invalidate_one): Adjust.
9033         (regcache_invalidate): Fix prototype.
9034         (new_register_cache): Return the new register cache.
9035         (free_register_cache): Change prototype.
9036         (realloc_register_cache): Adjust.
9037         (registers_to_string): Change prototype to take a regcache.  Adjust.
9038         (registers_from_string): Ditto.
9039         (register_data): Ditto.
9040         (supply_register): Ditto.
9041         (supply_register_by_name): Ditto.
9042         (collect_register): Ditto.
9043         (collect_register_as_string): Ditto.
9044         (collect_register_by_name): Ditto.
9045         * server.c (process_serial_event): Adjust.
9046         * linux-low.h (regset_fill_func, regset_store_func): Change
9047         prototype.
9048         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9049         Change prototype.
9050         * linux-low.c (get_stop_pc): Adjust.
9051         (check_removed_breakpoint): Adjust.
9052         (linux_wait_for_event): Adjust.
9053         (linux_resume_one_lwp): Adjust.
9054         (fetch_register): Add regcache parameter.  Adjust.
9055         (usr_store_inferior_registers): Ditto.
9056         (regsets_fetch_inferior_registers): Ditto.
9057         (regsets_store_inferior_registers): Ditto.
9058         (linux_fetch_registers, linux_store_registers): Ditto.
9059         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9060         regcache.  Adjust.
9061         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9062         Ditto.
9063         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9064         prototype to take a regcache.
9065         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9066         * remote-utils.c (convert_ascii_to_int, outreg)
9067         (prepare_resume_reply): Change prototype to take a regcache.
9068         Adjust.
9069         * target.h (struct target_ops) <fetch_registers, store_registers>:
9070         Change prototype to take a regcache.
9071         (fetch_inferior_registers, store_inferior_registers): Change
9072         prototype to take a regcache.  Adjust.
9073         * proc-service.c (ps_lgetregs): Adjust.
9074         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9075         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9076         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9077         take a regcache.  Adjust.
9078         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9079         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9080         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9081         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9082         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9083         (cris_cannot_fetch_register):
9084         (cris_breakpoint_at): Change prototype to take a regcache.
9085         Adjust.
9086         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9087         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9088         to take a regcache.  Adjust.
9089         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9090         Adjust.
9091         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9092         take a regcache.  Adjust.
9093         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9094         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9095         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9096         * linux-mips-low.c (mips_get_pc):
9097         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9098         (mips_reinsert_addr): Adjust.
9099         (mips_collect_register): Change prototype to take a regcache.
9100         Adjust.
9101         (mips_supply_register):
9102         (mips_collect_register_32bit, mips_supply_register_32bit)
9103         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9104         (mips_store_fpregset): Ditto.
9105         * linux-ppc-low.c (ppc_supply_ptrace_register)
9106         (ppc_supply_ptrace_register): Ditto.
9107         (parse_spufs_run): Adjust.
9108         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9109         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9110         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9111         take a regcache.  Adjust.
9112         * linux-s390-low.c (s390_collect_ptrace_register)
9113         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9114         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9115         (s390_arch_setup): Adjust.
9116         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9117         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9118         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9119         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9120         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9121         regcache.  Adjust.
9122         (sparc_breakpoint_at): Adjust.
9123         * linux-xtensa-low.c (xtensa_fill_gregset):
9124         (xtensa_store_gregset):
9125         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9126         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9127         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9128         prototype to take a regcache.  Adjust.
9129         * win32-arm-low.c (arm_fetch_inferior_register)
9130         (arm_store_inferior_register): Change prototype to take a
9131         regcache.  Adjust.
9132         * win32-i386-low.c (i386_fetch_inferior_register)
9133         (i386_store_inferior_register): Change prototype to take a
9134         regcache.  Adjust.
9135         * win32-low.c (child_fetch_inferior_registers)
9136         (child_store_inferior_registers): Change prototype to take a
9137         regcache.  Adjust.
9138         (win32_wait): Adjust.
9139         (win32_fetch_inferior_registers): Change prototype to take a
9140         regcache.  Adjust.
9141         (win32_store_inferior_registers): Adjust.
9142         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9143         store_inferior_register>: Change prototype to take a regcache.
9144
9145 2010-01-20  Doug Evans  <dje@google.com>
9146
9147         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9148         #ifdef.
9149         (linux_wait_for_event1, linux_init_signals): Ditto.
9150         (W_STOPCODE): Provide definition if missing.
9151
9152 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9153
9154         * linux-low.c (linux_core_of_thread): New.
9155         (compare_ints, show_process, list_threads): New.
9156         (linux_qxfer_osdata): Report threads and cores.
9157         (linux_target_op): Register linux_core_of_thread.
9158         * remote-utils.c (prepare_resume_reply): Report the core.
9159         (buffer_xml_printf): Support %d specifier.
9160         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9161         New.
9162         (handle_query): Handle qXfer:threads.  Announce availability
9163         thereof.
9164         * target.h (struct target_ops): New field core_of_thread.
9165
9166 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9167
9168         * Makefile.in (clean): Remove new generated files.
9169         (reg-s390.o, reg-s390.c): Remove rules.
9170         (reg-s390x.o, reg-s390x.c): Likewise.
9171         (s390-linux32.o, s390-linux32.c): Add rules.
9172         (s390-linux64.o, s390-linux64.c): Likewise.
9173         (s390x-linux64.o, s390x-linux64.c): Likewise.
9174         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9175         * linux-s390-low.c: Include <elf.h>.
9176         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9177         (init_registers_s390): Remove prototype.
9178         (init_registers_s390x): Likewise.
9179         (init_registers_s390_linux32): Add prototype.
9180         (init_registers_s390_linux64): Likewise.
9181         (init_registers_s390x_linux64): Likewise.
9182         (s390_num_regs_3264): New define.
9183         (s390_regmap_3264): New global variable.
9184         (s390_cannot_fetch_register): Remove obsolete check.
9185         (s390_cannot_store_register): Likewise.
9186         (s390_collect_ptrace_register): Handle upper/lower register halves.
9187         (s390_supply_ptrace_register): Likewise.
9188         (s390_fill_gregset): Update to register number changes.
9189         (s390_get_hwcap): New routine.
9190         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9191         Install appropriate regmap and register set.
9192
9193 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9194
9195         * server.c (gdbserver_version): Update copyright year to 2010.
9196         * gdbreplay.c (gdbreplay_version): Likewise.
9197
9198 2009-12-28  Doug Evans  <dje@google.com>
9199
9200         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9201         elf/external.h.  Include <elf.h> instead but only if necessary.
9202
9203 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9204
9205         * linux-low.c (linux_remove_process): Remove `detaching'
9206         parameter.  Don't release/detach from thread_db here.
9207         (linux_kill): Release/detach from thread_db here, ...
9208         (linux_detach): ... and here, before actually detaching.
9209         (linux_wait_1): ... and here, when a process exits.
9210         * thread-db.c (any_thread_of): New.
9211         (thread_db_free): Switch the current inferior to a thread of the
9212         passed in process.
9213
9214 2009-12-21  Doug Evans  <dje@google.com>
9215
9216         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9217
9218         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9219         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9220         warning ifndef __NR_tkill.  Move setting of errno there too.
9221         Delete unnecessary resetting of errno after syscall.
9222         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9223
9224         * configure.ac: Check for dladdr.
9225         * config.in: Regenerate.
9226         * configure: Regenerate.
9227         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9228         (try_thread_db_load): Update.
9229
9230         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9231
9232 2009-12-18  Doug Evans  <dje@google.com>
9233
9234         * event-loop.c: Include unistd.h if it exists.
9235
9236         * linux-low.c (my_waitpid): Move definition away from being in
9237         between linux_tracefork_child/linux_test_for_tracefork.
9238
9239         * gdb_proc_service.h (psaddr_t): Fix type.
9240         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9241         signature to match glibc.
9242
9243 2009-12-16  Doug Evans  <dje@google.com>
9244
9245         * linux-low.c (linux_read_memory): Fix argument to read.
9246
9247 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9248
9249         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9250         events, don't leave current_inferior pointing at null.
9251
9252 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9253
9254         * win32-low.c (LOG): Delete.
9255         (OUTMSG): Output to stderr.
9256         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9257         on compile time LOG macro.
9258         (win32_wait): Fix debug output.
9259
9260 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9261
9262         * win32-low.c (win32_add_one_solib): If the dll name is
9263         "ntdll.dll", prepend the system directory to the dll path.
9264
9265 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9266
9267         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9268
9269 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9270             Vladimir Prus  <vladimir@codesourcery.com>
9271
9272         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9273         * configure.ac: Check for __mcoldfire__ and set
9274         gdb_cv_m68k_is_coldfire.
9275         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9276         reg-cf.o and reg-m68k.o.
9277         * configure: Regenerated.
9278
9279 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9280
9281         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9282         Pass it to thread_db_free.
9283         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9284         proper `detaching' argument to linux_remove_process.
9285         * linux-low.h (thread_db_free): Add `detaching' parameter.
9286         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9287         to thread_db_free.
9288         (thread_db_free): Add `detaching' parameter.  Only
9289         call td_ta_clear_event if detaching from process.
9290
9291 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9292
9293         * thread-db.c (thread_db_free): Fix typo.
9294
9295 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9296
9297         PR gdb/10838
9298         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9299
9300 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9301
9302         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9303         with an i686 compiler.
9304         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9305         needed.
9306         * configure: Rebuilt.
9307
9308 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9309
9310         PR gdb/10783
9311
9312         * server.c (handle_search_memory_1): Correct read_addr initialization
9313         in loop for searching subsequent chunks.
9314
9315 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9316
9317         * configure.ac: New --with-libthread-db option.
9318         * thread-db.c: Allow direct dependence on libthread_db.
9319         (thread_db_free): Adjust.
9320         * config.in: Regenerate.
9321         * configure: Likewise.
9322
9323 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9324
9325         PR gdb/10757
9326         * thread-db.c (attach_thread): New function.
9327         (maybe_attach_thread): Return success/failure.
9328         (find_new_threads_callback): Adjust.
9329         (thread_db_find_new_threads): Loop until no new threads.
9330
9331 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9332
9333         * proc-service.c (ps_lgetregs): Formatting.
9334
9335 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9336
9337         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9338         * configure.ac: Adjust.
9339         * linux-low.h (struct process_info_private): Move members to struct
9340         thread_db.
9341         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9342         * linux-low.c (linux_remove_process): Adjust.
9343         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9344         * server.c (handle_query): Move code ...
9345         (handle_monitor_command): ... here. New function.
9346         * target.h (struct target_ops): New member.
9347         * thread-db.c (struct thread_db): New.
9348         (libthread_db_search_path): New variable.
9349         (thread_db_create_event, thread_db_enable_reporting)
9350         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9351         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9352         (try_thread_db_load_1, dladdr_to_soname): New functions.
9353         (try_thread_db_load, thread_db_load_search): New functions.
9354         (thread_db_init): Search for libthread_db.
9355         (thread_db_free): New function.
9356         (thread_db_handle_monitor_command): Likewise.
9357         * config.in: Regenerate.
9358         * configure: Regenerate.
9359
9360 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9361
9362         * spu-low.c (spu_kill): Wait for inferior to terminate.
9363         Call clear_inferiors.
9364         (spu_detach): Call clear_inferiors.
9365
9366 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9367
9368         * aclocal.m4: Regenerate.
9369         * config.in: Likewise.
9370         * configure: Likewise.
9371
9372 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9373
9374         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9375         (parse_spufs_run): New function.
9376         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9377         (ppc_breakpoint_at): Handle SPU breakpoints.
9378
9379 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9380
9381         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9382         (SPUFS_MAGIC): Define.
9383         (spu_enumerate_spu_ids): New function.
9384         (linux_qxfer_spu): New function.
9385         (linux_target_ops): Install linux_qxfer_spu.
9386
9387 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9388
9389         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
9390         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
9391         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
9392         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
9393         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
9394         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
9395         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
9396         (init_registers_powerpc_cell32l): Add prototype.
9397         (init_registers_powerpc_cell64l): Likewise.
9398         (ppc_arch_setup): Detect Cell/B.E. architecture.
9399
9400 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9401
9402         * Makefile.in (datarootdir): New variable.
9403
9404 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9405
9406         * linux-low.c (linux_write_memory): Update debugging output.
9407         * Makefile.in (clean): Add new descriptions.
9408         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
9409         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
9410         * configure.srv: Add new files for arm*-*-linux*.
9411         * linux-arm-low.c: Add new declarations.
9412         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
9413         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
9414         (HWCAP_VFPv3D16): New.
9415         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
9416         instead of __IWMMXT__.
9417         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
9418         (arm_arch_setup): New.
9419         (target_regsets): Remove #ifdef.  Add VFP regset.
9420         (the_low_target): Use arm_arch_setup.
9421
9422 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9423
9424         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
9425         the main thread again.
9426
9427 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
9428
9429         Adding Neutrino gdbserver.
9430         * configure: Regenerated.
9431         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
9432         * configure.srv (i[34567]86-*-nto*): New target.
9433         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
9434         * remote-utils.c [__QNX__]: Include sys/iomgr.h
9435         (nto_comctrl) [__QNX__]: New function.
9436         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
9437
9438 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
9439
9440         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
9441         srv_tgtobj.
9442
9443 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
9444             Pedro Alves  <pedro@codesourcery.com>
9445
9446         * win32-i386-low.c (i386_get_thread_context): Handle systems that
9447         don't support CONTEXT_EXTENDED_REGISTERS.
9448         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
9449         (the_low_target): Install them.
9450         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
9451         failing with ERROR_PIPE_NOT_CONNECTED.
9452
9453 2009-06-30  Doug Evans  <dje@google.com>
9454             Pierre Muller  <muller@ics.u-strasbg.fr>
9455
9456         Add h/w watchpoint support to x86-linux, win32-i386.
9457         * Makefile.in (SFILES): Add i386-low.c
9458         (i386_low_h): Define.
9459         (i386-low.o): Add dependencies.
9460         (linux-x86-low.o): Add i386-low.h dependency.
9461         (win32-i386-low.o): Ditto.
9462         * i386-low.c: New file.
9463         * i386-low.h: New file.
9464         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
9465         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
9466         * linux-low.c (linux_add_process): Initialize arch_private.
9467         (linux_remove_process): Free arch_private.
9468         (add_lwp): Initialize arch_private.
9469         (delete_lwp): Free arch_private.
9470         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
9471         provided.
9472         * linux-low.h (process_info_private): New member arch_private.
9473         (lwp_info): New member arch_private.
9474         (linux_target_ops): New members new_process, new_thread,
9475         prepare_to_resume.
9476         (ptid_of): New macro.
9477         * linux-x86-low.c: Include stddef.h, i386-low.h.
9478         (arch_process_info): New struct.
9479         (arch_lwp_info): New struct.
9480         (x86_linux_dr_get, x86_linux_dr_set): New functions.
9481         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9482         (i386_dr_low_get_status): New function.
9483         (x86_insert_point, x86_remove_point): New functions.
9484         (x86_stopped_by_watchpoint): New function.
9485         (x86_stopped_data_address): New function.
9486         (x86_linux_new_process, x86_linux_new_thread): New functions.
9487         (x86_linux_prepare_to_resume): New function.
9488         (the_low_target): Add entries for insert_point, remove_point,
9489         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
9490         prepare_to_resume.
9491         * server.c (debug_hw_points): New global.
9492         (monitor_show_help): Document set debug-hw-points.
9493         (handle_query): Process "set debug-hw-points".
9494         * server.h (debug_hw_points): Declare.
9495         (paddress): Declare.
9496         * utils.c (NUMCELLS, CELLSIZE): New macros.
9497         (get_sell, xsnprintf, paddress): New functions.
9498         * win32-arm-low.c (the_low_target): Add entries for insert_point,
9499         remove_point, stopped_by_watchpoint, stopped_data_address.
9500         * win32-i386-low.c: Include i386-low.h.
9501         (debug_reg_state): Replaces dr.
9502         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9503         (i386_dr_low_get_status): New function.
9504         (i386_insert_point, i386_remove_point): New functions.
9505         (i386_stopped_by_watchpoint): New function.
9506         (i386_stopped_data_address): New function.
9507         (i386_initial_stuff): Update.
9508         (get_thread_context,set_thread_context,i386_thread_added): Update.
9509         (the_low_target): Add entries for insert_point,
9510         remove_point, stopped_by_watchpoint, stopped_data_address.
9511         * win32-low.c (win32_insert_watchpoint): New function.
9512         (win32_remove_watchpoint): New function.
9513         (win32_stopped_by_watchpoint): New function.
9514         (win32_stopped_data_address): New function.
9515         (win32_target_ops): Add entries for insert_watchpoint,
9516         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
9517         * win32-low.h (win32_target_ops): New members insert_point,
9518         remove_point, stopped_by_watchpoint, stopped_data_address.
9519
9520 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
9521
9522         * server.c (process_serial_event): Re-return unsupported, not
9523         error, if the type isn't recognized.  Re-allow supporting only
9524         insert or remove packets.  Also call require_running for
9525         breakpoints.  Add missing break statement to default case.  Tidy.
9526         * target.h (struct target_ops): Rename insert_watchpoint to
9527         insert_point, and remove_watchpoint to remove_point.
9528
9529         * linux-low.h (struct linux_target_ops): Likewise.
9530         * linux-low.c (linux_insert_watchpoint): Rename to ...
9531         (linux_insert_point): ... this.  Adjust.
9532         (linux_remove_watchpoint): Rename to ...
9533         (linux_remove_point): ... this.  Adjust.
9534         (linux_target_ops): Adjust.
9535         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
9536         (cris_insert_point): ... this.
9537         (cris_remove_watchpoint): Rename to ...
9538         (cris_remove_point): ... this.
9539         (the_low_target): Adjust.
9540
9541 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
9542
9543         * server.c (handle_v_kill): Pass signal_pid to
9544         kill_inferior if multi_process is zero.
9545
9546 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
9547
9548         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
9549         * target.h (target_ops): Comment for *_watchpoint to make it clear
9550         the functions can get types '0' and '1'.
9551
9552 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
9553
9554         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
9555         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
9556         * regcache.c (get_regcache): Likewise.
9557         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
9558         * win32-low.c (child_fetch_inferior_registers): Remove check for
9559         regno 0.
9560
9561 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
9562             Pedro Alves <pedro@codesourcery.com>
9563
9564         * target.h (struct target_ops) <supports_multi_process>: New
9565         callback.
9566         (target_supports_multi_process): New.
9567         * server.c (handle_query): Even if GDB reports support, only
9568         enable multi-process if the target also supports it.  Report
9569         multi-process support only if the target backend supports it.
9570         * linux-low.c (linux_supports_multi_process): New function.
9571         (linux_target_ops): Install it as target_supports_multi_process
9572         callback.
9573
9574 2009-05-24  Doug Evans  <dje@google.com>
9575
9576         Global renaming of find_thread_pid to find_thread_ptid.
9577         * server.h (find_thread_ptid): Renamed from find_thread_pid.
9578         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
9579         All callers updated.
9580
9581         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
9582         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
9583         directly.
9584
9585         * linux-low.c (get_stop_pc): Print pc if debug_threads.
9586         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
9587         (linux_resume_one_lwp): Ditto.
9588
9589 2009-05-23  Doug Evans  <dje@google.com>
9590
9591         * linux-low.c (linux_resume_one_lwp): Change type of first arg
9592         from struct inferior_list_entry * to struct lwp_info *.
9593         All callers updated.
9594
9595 2009-05-13  Doug Evans  <dje@google.com>
9596
9597         * linux-x86-low.c: Don't include assert.h.
9598         (x86_siginfo_fixup): Use fatal, not assert.
9599         (x86_arch_setup): Fix comment.
9600
9601 2009-05-12  Doug Evans  <dje@google.com>
9602
9603         Biarch support for i386/amd64 gdbserver.
9604         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
9605         Add linux-x86-low.c.
9606         (linux-i386-low.o, linux-x86-64-low.o): Delete.
9607         (linux-x86-low.o): Add.
9608         * linux-x86-64-low.c: Delete.
9609         * linux-i386-low.c: Delete.
9610         * linux-x86-low.c: New file.
9611         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
9612         linux-x86-low.o.
9613         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
9614         linux-x86-low.o.
9615         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
9616         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
9617         (linux_child_pid_to_exec_file): New function.
9618         (elf_64_header_p, elf_64_file_p): New functions.
9619         (siginfo_fixup): New function.
9620         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
9621         give target a chance to convert layout.
9622         * linux-low.h (linux_target_ops): New member siginfo_fixup.
9623         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
9624
9625 2009-05-07  Doug Evans  <dje@google.com>
9626
9627         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
9628         (regsets_store_inferior_registers): Ditto.
9629
9630 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
9631
9632         PR server/10048
9633
9634         * linux-low.c (must_set_ptrace_flags): Delete.
9635         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
9636         of the global.
9637         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
9638         `lwp->must_set_ptrace_flags' instead.
9639         (linux_wait_for_event_1): Set ptrace options here.
9640         (linux_wait_1): ... not here.
9641
9642 2009-04-30  Doug Evans  <dje@google.com>
9643
9644         * inferiors.c (started_inferior_callback): New function.
9645         (attached_inferior_callback): New function.
9646         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
9647         * server.c (print_started_pid, print_attached_pid): New functions.
9648         (detach_or_kill_for_exit): New function.
9649         (main): Call it instead of for_each_inferior (kill_inferior_callback).
9650         * server.h (have_started_inferiors_p): Declare.
9651         (have_attached_inferiors_p): Declare.
9652
9653         * inferiors.c (remove_process): Fix memory leak, free process.
9654         * linux-low.c (linux_remove_process): New function.
9655         (linux_kill): Call it instead of remove_process.
9656         (linux_detach, linux_wait_1): Ditto.
9657
9658 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
9659
9660         * configure.srv: Add x86 Windows CE target.
9661
9662 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9663
9664         * inferiors.c (get_thread_process): Make global.
9665         * server.h (get_thread_process): Add prototype.
9666         * thread-db.c (find_one_thread): Use get_thread_process
9667         instead of current_process.
9668         (thread_db_get_tls_address): Do not crash if called when
9669         thread layer is not yet initialized.
9670
9671 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9672
9673         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
9674         * spu-low.c (current_tid): Rename to ...
9675         (current_ptid): ... this.
9676         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
9677         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
9678         ptid_get_lwp (current_ptid) instead of current_tid.
9679         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
9680         instead of current_tid.  Use find_process_pid to verify pid
9681         argument is valid.  Pass proper argument to remove_process.
9682         (spu_thread_alive): Compare current_ptid instead of current_tid.
9683         (spu_resume): Likewise.
9684
9685 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
9686
9687         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
9688         variable.
9689
9690 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9691
9692         Implement the multiprocess extensions, and add linux multiprocess
9693         support.
9694
9695         * server.h (ULONGEST): Declare.
9696         (struct ptid, ptid_t): New.
9697         (minus_one_ptid, null_ptid): Declare.
9698         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9699         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
9700         (struct inferior_list_entry): Change `id' type from unsigned from
9701         to ptid_t.
9702         (struct sym_cache, struct breakpoint, struct
9703         process_info_private): Forward declare.
9704         (struct process_info): Declare.
9705         (current_process): Declare.
9706         (all_processes): Declare.
9707         (initialize_inferiors): Declare.
9708         (add_thread): Adjust to use ptid_t.
9709         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
9710         (add_process, remove_process, find_thread_pid): Declare.
9711         (find_inferior_id): Adjust to use ptid_t.
9712         (cont_thread, general_thread, step_thread): Change type to ptid_t.
9713         (multi_process): Declare.
9714         (push_event): Adjust to use ptid_t.
9715         (read_ptid, write_ptid): Declare.
9716         (prepare_resume_reply): Adjust to use ptid_t.
9717         (clear_symbol_cache): Declare.
9718         * inferiors.c (all_processes): New.
9719         (null_ptid, minus_one_ptid): New.
9720         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9721         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
9722         (add_thread): Change unsigned long to ptid.  Remove gdb_id
9723         parameter.  Adjust.
9724         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
9725         (gdb_id_to_thread): Rename to ...
9726         (find_thread_pid): ... this.  Change unsigned long to ptid.
9727         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
9728         (loaded_dll, pull_pid_from_list): Adjust.
9729         (add_process, remove_process, find_process_pid)
9730         (get_thread_process, current_process, initialize_inferiors): New.
9731         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
9732         (struct target_waitstatus) <related_pid>: Ditto.
9733         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
9734         return type to int.
9735         (struct target_ops) <join>: Add `pid' argument.
9736         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
9737         (struct target_ops) <wait>: Add `ptid' field.  Change return type
9738         to ptid.
9739         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
9740         (mywait): Add `ptid' argument.  Change return type to ptid_t.
9741         (target_pid_to_str): Declare.
9742         * target.c (set_desired_inferior): Adjust to use ptids.
9743         (mywait): Add new `ptid' argument.  Adjust.
9744         (target_pid_to_str): New.
9745         * mem-break.h (free_all_breakpoints): Declare.
9746         * mem-break.c (breakpoints): Delelete.
9747         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
9748         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
9749         to use per-process breakpoint list.
9750         (free_all_breakpoints): New.
9751         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
9752         (symbol_cache, all_symbols_looked_up): Delete.
9753         (hexchars): New.
9754         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
9755         read_ptid): New.
9756         (prepare_resume_reply): Change ptid argument's type from unsigned
9757         long to ptid_t.  Adjust.  Implement W;process and X;process.
9758         (free_sym_cache, clear_symbol_cache): New.
9759         (look_up_one_symbol): Adjust to per-process symbol cache.  *
9760         * server.c (cont_thread, general_thread, step_thread): Change type
9761         to ptid_t.
9762         (attached): Delete.
9763         (multi_process): New.
9764         (last_ptid): Change type to ptid_t.
9765         (struct vstop_notif) <ptid>: Change type to ptid_t.
9766         (queue_stop_reply, push_event): Change `ptid' argument's type to
9767         ptid_t.
9768         (discard_queued_stop_replies): Add `pid' argument.
9769         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
9770         changes.  Don't reference the `attached' global.
9771         (attach_inferior): Adjust to mywait interface changes.
9772         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
9773         features.  Handle and report "multiprocess+".  Handle
9774         "qAttached:PID".
9775         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
9776         changes.
9777         (handle_v_kill): New.
9778         (handle_v_stopped): Adjust to use target_pid_to_str.
9779         (handle_v_requests): Allow multiple attaches and runs when
9780         multiprocess extensions are in effect.  Handle "vKill".
9781         (myresume): Adjust to use ptids.
9782         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
9783         (handle_status): Adjust to discard_queued_stop_replies interface
9784         change.
9785         (first_thread_of, kill_inferior_callback)
9786         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
9787         (main): Call initialize_inferiors.  Adjust to use ptids, killing
9788         and detaching from all inferiors.  Handle multiprocess packet
9789         variants.
9790         * linux-low.h: Include gdb_proc_service.h.
9791         (struct process_info_private): New.
9792         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
9793         <lwpid_of>: Use ptid_get_lwp.
9794         (get_lwp_thread): Adjust.
9795         (struct lwp_info): Add `dead' member.
9796         (find_lwp_pid): Declare.
9797         * linux-low.c (thread_db_active): Delete.
9798         (new_inferior): Adjust comment.
9799         (inferior_pid): Delete.
9800         (linux_add_process): New.
9801         (handle_extended_wait): Adjust.
9802         (add_lwp): Change unsigned long to ptid.
9803         (linux_create_inferior): Add process to processes table.  Adjust
9804         to use ptids.  Don't set new_inferior here.
9805         (linux_attach_lwp): Rename to ...
9806         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
9807         it.  Adjust to use ptids.
9808         (linux_attach_lwp): New.
9809         (linux_attach): Add process to processes table.  Don't set
9810         new_inferior here.
9811         (struct counter): New.
9812         (second_thread_of_pid_p, last_thread_of_process_p): New.
9813         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
9814         multiple processes.
9815         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
9816         processes.  Remove process from process table.
9817         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
9818         to multiple processes.
9819         (any_thread_of): New.
9820         (linux_detach): Add `pid' argument, and handle it.  Remove process
9821         from processes table.
9822         (linux_join): Add `pid' argument.  Handle it.
9823         (linux_thread_alive): Change unsighed long argument to ptid_t.
9824         Consider dead lwps as not being alive.
9825         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
9826         threads we're not interested in.
9827         (same_lwp, find_lwp_pid): New.
9828         (linux_wait_for_lwp): Change `pid' argument's type from int to
9829         ptid_t.  Adjust.
9830         (linux_wait_for_event): Rename to ...
9831         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
9832         from int to ptid_t.  Adjust.
9833         (linux_wait_for_event): New.
9834         (linux_wait_1): Add `ptid' argument.  Change return type to
9835         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
9836         that exit from the process table.
9837         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
9838         Adjust.
9839         (mark_lwp_dead): New.
9840         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
9841         stopping all threads, mark its main lwp as dead.
9842         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
9843         ptids.
9844         (fetch_register, usr_store_inferior_registers)
9845         (regsets_fetch_inferior_registers)
9846         (regsets_store_inferior_registers, linux_read_memory)
9847         (linux_write_memory): Inline `inferior_pid'.
9848         (linux_look_up_symbols): Adjust to use per-process
9849         `thread_db_active'.
9850         (linux_request_interrupt): Adjust to use ptids.
9851         (linux_read_auxv): Inline `inferior_pid'.
9852         (initialize_low): Don't reference thread_db_active.
9853         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
9854         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
9855         (ps_getpid): Return the pid of the current inferior.
9856         * thread-db.c (proc_handle, thread_agent): Delete.
9857         (thread_db_create_event, thread_db_enable_reporting): Adjust to
9858         per-process data.
9859         (find_one_thread): Change argument type to ptid_t.  Adjust to
9860         per-process data.
9861         (maybe_attach_thread): Adjust to per-process data and ptids.
9862         (thread_db_find_new_threads): Ditto.
9863         (thread_db_init): Ditto.
9864         * spu-low.c (spu_create_inferior, spu_attach): Add process to
9865         processes table.  Adjust to use ptids.
9866         (spu_kill, spu_detach): Adjust interface.  Remove process from
9867         processes table.
9868         (spu_join, spu_thread_alive): Adjust interface.
9869         (spu_wait): Adjust interface.  Remove process from processes
9870         table.  Adjust to use ptids.
9871         * win32-low.c (current_inferior_tid): Delete.
9872         (current_inferior_ptid): New.
9873         (debug_event_ptid): New.
9874         (thread_rec): Take a ptid.  Adjust.
9875         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
9876         (child_delete_thread): Ditto.
9877         (do_initial_child_stuff): Add `attached' argument.  Add process to
9878         processes table.
9879         (child_fetch_inferior_registers, child_store_inferior_registers):
9880         Adjust.
9881         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
9882         (win32_attach): Pass 1 to do_initial_child_stuff.
9883         (win32_kill): Adjust interface.  Remove process from processes
9884         table.
9885         (win32_detach): Ditto.
9886         (win32_join): Adjust interface.
9887         (win32_thread_alive): Take a ptid.
9888         (win32_resume): Adjust to use ptids.
9889         (get_child_debug_event): Ditto.
9890         (win32_wait): Adjust interface.  Remove exiting process from
9891         processes table.
9892
9893 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9894
9895         Non-stop mode support.
9896
9897         * server.h (non_stop): Declare.
9898         (gdb_client_data, handler_func): Declare.
9899         (delete_file_handler, add_file_handler, start_event_loop):
9900         Declare.
9901         (handle_serial_event, handle_target_event, push_event)
9902         (putpkt_notif): Declare.
9903         * target.h (enum resume_kind): New.
9904         (struct thread_resume): Replace `step' field by `kind' field.
9905         (TARGET_WNOHANG): Define.
9906         (struct target_ops) <wait>: Add `options' argument.
9907         <supports_non_stop, async, start_non_stop>: New fields.
9908         (target_supports_non_stop, target_async): New.
9909         (start_non_stop): Declare.
9910         (mywait): Add `options' argument.
9911         * target.c (mywait): Add `options' argument.  Print child exit
9912         notifications here.
9913         (start_non_stop): New.
9914         * server.c (non_stop, own_buf, mem_buf): New globals.
9915         (struct vstop_notif): New.
9916         (notif_queue): New global.
9917         (queue_stop_reply, push_event, discard_queued_stop_replies)
9918         (send_next_stop_reply): New.
9919         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
9920         interface changes.
9921         (attach_inferior): In non-stop mode, don't wait for the target
9922         here.
9923         (handle_general_set): Handle QNonStop.
9924         (handle_query): When handling qC, return the current general
9925         thread, instead of the first thread of the list.
9926         (handle_query): If the backend supports non-stop mode, include
9927         QNonStop+ in the qSupported query response.
9928         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
9929         and non-stop mode.
9930         (handle_v_attach, handle_v_run): Handle non-stop mode.
9931         (handle_v_stopped): New.
9932         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
9933         (myresume): Adjust to use resume_kind.  Handle non-stop.
9934         (queue_stop_reply_callback): New.
9935         (handle_status): Handle non-stop mode.
9936         (main): Clear non_stop flag on reconnection.  Use the event-loop.
9937         Refactor serial protocol handling from here ...
9938         (process_serial_event): ... to this new function.  When GDB
9939         selects any thread, select one here.  In non-stop mode, wait until
9940         GDB acks all pending events before exiting.
9941         (handle_serial_event, handle_target_event): New.
9942         * remote-utils.c (remote_open): Install remote_desc in the event
9943         loop.
9944         (remote_close): Remove remote_desc from the event loop.
9945         (putpkt_binary): Rename to...
9946         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
9947         (putpkt_binary): New as wrapper around putpkt_binary_1.
9948         (putpkt_notif): New.
9949         (prepare_resume_reply): In non-stop mode, don't change the
9950         general_thread.
9951         * event-loop.c: New.
9952         * Makefile.in (OBJ): Add event-loop.o.
9953         (event-loop.o): New rule.
9954
9955         * linux-low.h (pid_of): Moved here.
9956         (lwpid_of): New.
9957         (get_lwp_thread): Use lwpid_of.
9958         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
9959         * linux-low.c (pid_of): Delete.
9960         (inferior_pid): Use lwpid_of.
9961         (linux_event_pipe): New.
9962         (target_is_async_p): New.
9963         (delete_lwp): New.
9964         (handle_extended_wait): Use lwpid_of.
9965         (add_lwp): Don't set lwpid field.
9966         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
9967         (linux_kill_one_lwp): If killing a running lwp, stop it first.
9968         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
9969         (linux_detach_one_lwp): If detaching from a running lwp, stop it
9970         first.  Adjust to linux_wait_for_event interface changes.  Use
9971         lwpid_of.
9972         (linux_detach): Don't delete the main lwp here.
9973         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
9974         (status_pending_p): Don't consider explicitly suspended lwps.
9975         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
9976         pointer.  Add OPTIONS argument.  Change return type to int.  Use
9977         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
9978         (linux_wait_for_event): Take an integer pid instead of a lwp_info
9979         pointer.  Add status pointer argument.  Return a pid instead of a
9980         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
9981         changes.  In non-stop mode, don't switch to a random thread.
9982         (linux_wait): Rename to...
9983         (linux_wait_1): ... this.  Add target_options argument, and handle
9984         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
9985         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
9986         clean exit and signal exit code.  Don't stop all threads in
9987         non-stop mode.  In all-stop mode, only stop all threads when
9988         reporting a stop to GDB.  Handle explicit thread stop requests.
9989         (async_file_flush, async_file_mark): New.
9990         (linux_wait): New.
9991         (send_sigstop): Use lwpid_of.
9992         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
9993         interface changes.  In non-stop mode, don't switch to a random
9994         thread.
9995         (linux_resume_one_lwp): Use lwpid_of.
9996         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
9997         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
9998         non-stop mode, don't look for pending flag in all threads.
9999         (resume_status_pending_p): Don't consider explicitly suspended
10000         threads.
10001         (my_waitpid): Reimplement.  Emulate __WALL.
10002         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10003         Use lwpid_of.
10004         (sigchld_handler, linux_supports_non_stop, linux_async)
10005         (linux_start_non_stop): New.
10006         (linux_target_ops): Register linux_supports_non_stop, linux_async
10007         and linux_start_non_stop.
10008         (initialize_low): Install SIGCHLD handler.
10009         * thread-db.c (thread_db_create_event, find_one_thread)
10010         (thread_db_get_tls_address): Use lwpid_of.
10011         * win32-low.c (win32_detach): Adjust to use resume_kind.
10012         (win32_wait): Add `options' argument.
10013         * spu-low.c (spu_resume): Adjust to use resume_kind.
10014         (spu_wait): Add `options' argument.
10015
10016 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10017
10018         Decouple target code from remote protocol.
10019
10020         * target.h (enum target_waitkind): New.
10021         (struct target_waitstatus): New.
10022         (struct target_ops) <wait>: Return an unsigned long.  Take a
10023         target_waitstatus pointer instead of a char pointer.
10024         (mywait): Likewise.
10025         * target.c (mywait): Change prototype to return an unsigned long.
10026         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10027         * server.h (thread_from_wait, old_thread_from_wait): Delete
10028         declarations.
10029         (prepare_resume_reply): Change prototype to take a
10030         target_waitstatus.
10031         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10032         (last_status, last_ptid): New.
10033         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10034         pid instead of a signal.
10035         (attach_inferior): Remove "status" and "signal" parameters.
10036         Adjust.
10037         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10038         not as an address.
10039         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10040         (handle_v_requests, myresume): Remove "status" and "signal"
10041         parameters.  Adjust.
10042         (handle_status): New.
10043         (main): Delete local `status'.  Adjust.
10044         * remote-utils.c: Include target.h.
10045         (prepare_resume_reply): Change prototype to take a
10046         target_waitstatus.  Adjust.
10047
10048         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10049         interface.
10050         * spu-low.c (spu_wait): Adjust.
10051         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10052         Delete.
10053         (win32_wait): Adjust.
10054
10055 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10056
10057         * target.h (struct thread_resume): Delete leave_stopped member.
10058         (struct target_ops): Add a `n' argument to the `resume' callback.
10059         * server.c (start_inferior): Adjust.
10060         (handle_v_cont, myresume): Adjust.
10061         * linux-low.c (check_removed_breakpoint): Adjust to resume
10062         interface change, and to removed leave_stopped field.
10063         (resume_ptr): Delete.
10064         (struct thread_resume_array): New.
10065         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10066         resume interface change.
10067         (linux_continue_one_thread, linux_queue_one_thread)
10068         (resume_status_pending_p): Check if the resume field is NULL
10069         instead of checking the leave_stopped member.
10070         (linux_resume): Adjust to the target resume interface change.
10071         * spu-low.c (spu_resume): Adjust to the target resume interface
10072         change.
10073         * win32-low.c (win32_detach, win32_resume): Ditto.
10074
10075 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10076
10077         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10078         flag.
10079         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10080         pending.
10081         (linux_continue_one_thread): Only preserve the stepping flag if
10082         there's a pending breakpoint.
10083
10084 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10085
10086         * server.c (main): After the inferior having exited, call
10087         remote_close before exiting gdbserver.
10088
10089 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10090
10091         Fix size of FPSCR in Power 7 processors.
10092         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10093         (PPC_FEATURE_HAS_DFP): New #define.
10094         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10095         size of the FPSCR.
10096
10097 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10098
10099         * server.c (handle_query) Whitespace and formatting.
10100
10101 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10102
10103         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10104         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10105         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10106         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10107         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10108         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10109         Makefile.in, configure.ac: Fix whitespace throughout.
10110         * configure: Regenerate.
10111
10112 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10113
10114         * inferiors.c (find_inferior): Make it safe for the callback
10115         function to delete the currently iterated inferior.
10116
10117 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10118
10119         * Makefile.in (linuw_low_h): Move higher.
10120         (thread-db.o): Depend on $(linux_low_h).
10121
10122 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10123
10124         Rename "process" to "lwp" throughout.
10125
10126         * linux-low.c (all_processes): Rename to...
10127         (all_lwps): ... this.
10128         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10129         (add_process): Rename to ...
10130         (add_lwp): ... this.  Adjust.
10131         (linux_create_inferior): Adjust.
10132         (linux_attach_lwp): Adjust.
10133         (linux_attach): Adjust.
10134         (linux_kill_one_process): Rename to ...
10135         (linux_kill_one_lwp): ... this.  Adjust.
10136         (linux_kill): Adjust.
10137         (linux_detach_one_process): Rename to ...
10138         (linux_detach_one_lwp): ... this.  Adjust.
10139         (linux_detach): Adjust.
10140         (check_removed_breakpoint): Adjust.
10141         (status_pending_p): Adjust.
10142         (linux_wait_for_process): Rename to ...
10143         (linux_wait_for_lwp): ... this.  Adjust.
10144         (linux_wait_for_event): Adjust.
10145         (send_sigstop): Adjust.
10146         (wait_for_sigstop): Adjust.
10147         (stop_all_processes): Rename to ...
10148         (stop_all_lwps): ... this.
10149         (linux_resume_one_process): Rename to ...
10150         (linux_resume_one_lwp): ... this.  Adjust.
10151         (linux_set_resume_request, linux_continue_one_thread)
10152         (linux_queue_one_thread, resume_status_pending_p)
10153         (usr_store_inferior_registers, regsets_store_inferior_registers)
10154         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10155         Adjust.
10156         * linux-low.h (get_process): Rename to ...
10157         (get_lwp): ... this.  Adjust.
10158         (get_thread_process): Rename to ...
10159         (get_thread_lwp): ... this.  Adjust.
10160         (get_process_thread): Rename to ...
10161         (get_lwp_thread): ... this.  Adjust.
10162         (struct process_info): Rename to ...
10163         (struct lwp_info): ... this.
10164         (all_processes): Rename to ...
10165         (all_lwps): ... this.
10166         * proc-service.c (ps_lgetregs): Adjust.
10167         * thread-db.c (thread_db_create_event, find_one_thread)
10168         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10169
10170 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10171
10172         * server.c (handle_query): Handle "qAttached".
10173
10174 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10175
10176         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10177         GPLv3, update license URL.
10178
10179 2009-03-01  Doug Evans  <dje@google.com>
10180
10181         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10182         (server_h): Add gdb_signals.h.
10183         (signals.o): Update.
10184         * server.h (target_signal_from_host,target_signal_to_host_p)
10185         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10186
10187 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10188
10189         * remote-utils.c (getpkt): Also generate remote-debug
10190         information if noack_mode is set.
10191
10192 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10193
10194         * server.c (handle_query): Report qXfer:siginfo:read and
10195         qXfer:siginfo:write as supported and handle them.
10196         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10197         * linux-low.c (linux_xfer_siginfo): New.
10198         (linux_target_ops): Set it.
10199
10200 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10201
10202         * server.c (gdbserver_usage): Mention --remote-debug.
10203         (main): Accept '--remote-debug' switch.
10204
10205 2009-01-18  Doug Evans  <dje@google.com>
10206
10207         * regcache.c (new_register_cache): No need to check result of xcalloc.
10208         * server.c (handle_search_memory): Back out calls to xmalloc,
10209         result is checked and error is returned to user upon failure.
10210         (handle_query): Ditto.  Add more checks for result of malloc.
10211         (handle_v_cont): Check result of malloc, report error back to
10212         user upon failure.
10213         (handle_v_run): Ditto.  Call freeargv.
10214         * server.h (freeargv): Declare.
10215         * utils.c (freeargv): New fn.
10216
10217 2009-01-15  Doug Evans  <dje@google.com>
10218
10219         * gdbreplay.c (perror_with_name): Make arg const char *.
10220         * server.h (target_signal_to_name): Make return type const char *.
10221         * thread-db.c (thread_db_err_str): Make return type const char *.
10222         * utils.c (perror_with_name): Make arg const char *.
10223
10224 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10225
10226         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10227         when handling a EXIT_PROCESS_DEBUG_EVENT.
10228
10229 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10230
10231         * gdbreplay.c (gdbreplay_version): Update copyright year.
10232         * server.c (gdbserver_version): Likewise.
10233
10234 2009-01-05  Doug Evans  <dje@google.com>
10235
10236         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10237         (handle_extended_wait): Improve comment.
10238
10239 2008-12-13  Doug Evans  <dje@google.com>
10240
10241         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10242         * server.h (ATTR_MALLOC): New macro.
10243         (xmalloc,xcalloc,xstrdup): Declare.
10244         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10245         * inferiors.c: Ditto.
10246         * linux-low.c: Ditto.
10247         * mem-break.c: Ditto.
10248         * regcache.c: Ditto.
10249         * remote-utils.c: Ditto.
10250         * server.c: Ditto.
10251         * target.c: Ditto.
10252         * win32-low.c: Ditto.
10253
10254 2008-12-12  Doug Evans  <dje@google.com>
10255
10256         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10257         in debugging printf.
10258
10259         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10260
10261 2008-12-09  Doug Evans  <dje@google.com>
10262
10263         * linux-low.h (struct process_info): Delete member tid, unused.
10264         * thread-db.c (find_one_thread): Update.
10265         (maybe_attach_thread): Update.
10266
10267 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10268
10269         * target.h (struct target_ops): Add qxfer_osdata member.
10270         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10271         and dirent.h.
10272         (linux_qxfer_osdata): New functions.
10273         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10274         callback.
10275         * server.c (handle_query): Handle "qXfer:osdata:read:".
10276         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10277         (buffer_xml_printf): New functions.
10278         * server.h (struct buffer): New.
10279         (buffer_grow_str, buffer_grow_str0): New macros.
10280         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10281         (buffer_xml_printf): Declare.
10282
10283 2008-11-24  Doug Evans  <dje@google.com>
10284
10285         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10286
10287 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10288
10289         * server.c (handle_v_run): Always use the supplied argument list.
10290
10291 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10292
10293         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10294         (xtensa_regmap_table): Add entry for scompare1.
10295
10296 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10297
10298         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10299         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10300         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10301         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10302         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10303         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10304         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10305         XML target descriptions.
10306         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10307         when inferior is running on an ISA 2.05 or later processor.  Add
10308         special case to return offset for full 64-bit slot of FPSCR when
10309         in 32-bits.
10310
10311 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10312
10313         * Makefile.in (SFILES, clean): Added sparc64 files.
10314         (reg-sparc64.o, reg-sparc64.c): New.
10315         * configure.srv (sparc*-*-linux*): New configuration.
10316         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10317         syscall arguments for SPARC.
10318         (regsets_store_inferior_registers): Likewise.
10319         * linux-sparc-low.c: New file.
10320
10321 2008-10-21  Doug Evans  <dje@google.com>
10322
10323         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10324         (READLINE_DIR,READLINE_DEP): Delete.
10325         (INTERNAL_CFLAGS): Update.
10326         (LINTFLAGS): Update.
10327
10328 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10329
10330         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10331         whole argv from the last run, not just argv[0].
10332
10333 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10334
10335         * regcache.c (new_register_cache): Return NULL if the register
10336         cache size isn't known yet.
10337         (free_register_cache): Avoid dereferencing a NULL regcache.
10338
10339 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10340
10341         * configure.srv: Merge MIPS and MIPS64.
10342
10343 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10344
10345         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10346
10347 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10348
10349         * Makefile.in: Add required vsx dependencies.
10350
10351         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10352         Declare init_registers_powerpc_vsx32l.
10353         Declare init_registers_powerpc_vsx64l.
10354         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10355         (ppc_arch_setup): Check for VSX in hwcap.
10356         (ppc_fill_vsxregset): New function.
10357         (ppc_store_vsxregset): New function.
10358         Add new VSX entry in regset_info target_regsets.
10359
10360         * configure.srv: Add new VSX dependencies.
10361
10362 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10363
10364         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10365         (remote_open): Set or clear transport_is_reliable.
10366         (putpkt_binary): Don't expect acks in noack mode.
10367         (getpkt): Don't send ack/nac in noack mode.
10368         * server.c (handle_general_set): Handle QStartNoAckMode.
10369         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10370         qSupported.
10371         (main): Reset noack_mode on every connection.
10372         * server.h (noack_mode): Declare.
10373
10374 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10375
10376         * Makefile.in (GDBREPLAY_OBS): New variable.
10377         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10378
10379 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10380             Daniel Jacobowitz  <dan@codesourcery.com>
10381
10382         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10383         (usr_store_inferior_registers): Likewise.
10384         (regsets_store_inferior_registers): Likewise.
10385
10386 2008-07-31  Rolf Jansen  <rj@surtec.com>
10387             Pedro Alves  <pedro@codesourcery.com>
10388
10389         * configure.ac: Check for memmem declaration.
10390         * server.c [HAVE_MALLOC_H]: Include malloc.h.
10391         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
10392         (disable_packet_qfThreadInfo): Unconditionally compile.
10393         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
10394         * configure, config.in: Regenerate.
10395
10396 2008-07-28  Doug Kwan  <dougkwan@google.com>
10397
10398         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
10399         (linux_write_memory): Remove declaration of errno.
10400
10401 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
10402
10403         * linux-low.c (handle_extended_wait): Do not use "status"
10404         variable uninitialized.
10405
10406 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
10407
10408         * server.c (handle_v_attach): Inhibit reporting dll changes.
10409
10410 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
10411
10412         * remote-utils.c (prepare_resume_reply): If requested, don't
10413         output "thread:TID" in the T stop reply.
10414
10415         * server.c (disable_packet_vCont, disable_packet_Tthread)
10416         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
10417         (handle_query): If requested, disable support for qC, qfThreadInfo
10418         and qsThreadInfo.
10419         (handle_v_requests): If requested, disable support for vCont.
10420         (gdbserver_show_disableable): New.
10421         (main): Handle --disable-packet and --disable-packet=LIST.
10422
10423         * server.h (disable_packet_vCont, disable_packet_Tthread)
10424         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
10425
10426 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
10427
10428         * server.c (gdbserver_usage): Mention --version.
10429
10430 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
10431
10432         * Makefile.in (gdbreplay.o): New rule.
10433
10434 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
10435
10436         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
10437         message, not gdbserver.
10438
10439 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
10440             Nathan Sidwell  <nathan@codesourcery.com>
10441             Joseph Myers  <joseph@codesourcery.com>
10442
10443         * acinclude.m4: Include ../../config/acx.m4.
10444         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
10445         * configure, config.in: Regenerate.
10446         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
10447         * server.c (gdbserver_version): Print PKGVERSION.
10448         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
10449         (main): Adjust gdbserver_usage calls.
10450         * gdbreplay.c (version, host_name): Add declarations.
10451         (gdbreplay_version, gdbreplay_usage): New.
10452         (main): Accept --version and --help options.
10453
10454 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
10455
10456         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
10457         (arm_breakpoint_at): Handle Thumb.
10458         (the_low_target): Add comment.
10459
10460 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
10461
10462         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
10463
10464 2008-05-09  Doug Evans  <dje@google.com>
10465
10466         * server.h (decode_search_memory_packet): Declare.
10467         * remote-utils.c (decode_search_memory_packet): New fn.
10468         * server.c (handle_search_memory_1): New fn.
10469         (handle_search_memory): New fn.
10470         (handle_query): Process qSearch:memory packets.
10471
10472 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
10473
10474         * regcache.c (registers_length): Remove.
10475         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
10476         full register packet.
10477         * regcache.h (registers_length): Remove prototype.
10478         * server.h (PBUFSIZ): Define to 16384.
10479
10480 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
10481
10482         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
10483         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
10484         powerpc-64l.o, and powerpc-altivec64l.o.
10485         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
10486         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
10487         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
10488         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
10489         rs6000/power-linux.xml, and rs6000/power64-linux.xml
10490         to srv_xmlfiles.
10491
10492         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
10493         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
10494         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
10495         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
10496         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
10497         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
10498         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
10499         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
10500         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
10501         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
10502         (clean): Update.
10503
10504         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
10505         (init_registers_powerpc_32l): ... this new prototype.
10506         (init_registers_powerpc_32): Remove, replace by ...
10507         (init_registers_powerpc_altivec32l): ... this new prototype.
10508         (init_registers_powerpc_e500): Remove, replace by ...
10509         (init_registers_powerpc_e500l): ... this new prototype.
10510         (init_registers_ppc64): Remove, replace by ...
10511         (init_registers_powerpc_64l): ... this new prototype.
10512         (init_registers_powerpc_64): Remove, replace by ...
10513         (init_registers_powerpc_altivec64l): ... this new prototype.
10514         (ppc_num_regs): Set to 73.
10515         (PT_ORIG_R3, PT_TRAP): Define if necessary.
10516         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
10517         (ppc_cannot_store_register): Handle orig_r3 and trap.
10518         (ppc_arch_setup): Update init_registers_... calls.
10519         (ppc_fill_gregset): Handle orig_r3 and trap.
10520
10521         * inferiors.c (clear_inferiors): Reset current_inferior.
10522
10523 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
10524
10525         * acinclude.m4: Add override.m4.
10526         * configure: Regenerate.
10527
10528 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10529
10530         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
10531         initial call to init_register_ppc64.
10532
10533 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10534
10535         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
10536         single powerpc*-*-linux* case.
10537         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
10538
10539 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
10540
10541         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
10542         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
10543         from reg_xmlfiles.
10544         * linux-ppc-low.c: Include <elf.h>.
10545         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
10546         (ppc_hwcap): New global variable.
10547         (ppc_regmap): Remove __SPE__ #ifdef sections.
10548         (ppc_regmap_e500): New global variable.
10549         (ppc_cannot_store_register): Update __SPE__ special case.
10550         (ppc_get_hwcap): New function.
10551         (ppc_arch_setup): Use it to determine whether inferior supports
10552         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
10553         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
10554         Do not access registers if target does not support AltiVec.
10555         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
10556         Do not access registers if target does not support SPE.
10557         (target_regsets): Unconditionally include AltiVec and SPE regsets.
10558
10559 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
10560
10561         * linux-low.c (disabled_regsets, num_regsets): New.
10562         (use_regsets_p): Delete.
10563         (linux_wait_for_process): Clear disabled_regsets.
10564         (regsets_fetch_inferior_registers): Check and set it.
10565         (regsets_store_inferior_registers): Likewise.
10566         (linux_fetch_registers, linux_store_registers): Do not use
10567         use_regsets_p.
10568         (initialize_low): Allocate disabled_regsets.
10569
10570 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
10571
10572         * Makefile.in (LIBOBJS): New.
10573         (OBS): Use LIBOBJS.
10574         (memmem.o): New rule.
10575         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
10576         * configure: Regenerated.
10577
10578 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
10579
10580         * server.c (handle_query): Never return "unsupported" for
10581         qXfer:features:read queries.
10582
10583 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
10584
10585         * server.c (get_features_xml): Fix inverted condition.
10586         (handle_query): Always support qXfer:feature:read.
10587
10588 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
10589
10590         * server.c (wrapper_argv): New.
10591         (start_inferior): Handle wrapper_argv.  If set, expect an extra
10592         trap.
10593         (gdbserver_usage): Document --wrapper.
10594         (main): Parse --wrapper.
10595
10596 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10597
10598         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
10599         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
10600         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
10601         (ppc_set_pc): Likewise.
10602         (ppc_arch_setup): New function.
10603         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
10604         of collect_register.
10605         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
10606
10607 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10608
10609         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
10610         instead of linux-ppc64-low.o.
10611         * linux-ppc64-low.c: Remove file.
10612         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
10613         (linux-ppc64-low.o): Remove rule.
10614
10615         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
10616         (init_registers_powerpc_64): Likewise.
10617         (ppc_regmap): Conditionally define depending on __powerpc64__.
10618         (ppc_cannot_store_register): Do not special-case "fpscr" when
10619         compiled on __powerpc64__.
10620         (ppc_collect_ptrace_register): New function.
10621         (ppc_supply_ptrace_register): New function.
10622         (ppc_breakpoint): Change type to "unsigned int".
10623         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
10624         (the_low_target): Conditionally provide initializers for the
10625         arch_setup member depending on __powerpc64__.  Install
10626         collect_ptrace_register and supply_ptrace_register members.
10627
10628 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10629
10630         * regcache.h (gdbserver_xmltarget): Add extern declaration.
10631         * server.c (gdbserver_xmltarget): Define.
10632         (get_features_xml): Use it to replace "target.xml" and arch_string.
10633
10634         * configure.srv: Remove srv_xmltarget.  Add XML files that were
10635         mentioned there to srv_xmlfiles instead.  Remove conditional tests
10636         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
10637         srv_xmlfiles and srv_regobj to include all possible choices.
10638         * configure.ac (srv_xmltarget): Remove.
10639         (srv_xmlfiles): Do not add "target.xml".
10640         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
10641         checks for supplementary target information.
10642         * configure: Regenerate.
10643         * Makefile.in (XML_TARGET): Remove.
10644         (target.xml): Remove rule.
10645         (clean): Do not clean up target.xml.
10646         (.PRECIOUS): Do not mention target.xml.
10647
10648         * target.h (struct target_ops): Remove arch_string member.
10649         * linux-low.c (linux_arch_string): Remove.
10650         (linux_target_ops): Remove arch_string initializer.
10651         * linux-low.h (struct linux_target_ops): Remove arch_string member.
10652         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
10653         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
10654         * spu-low.c (spu_arch_string): Remove.
10655         (spu_target_ops): Remove arch_string initializer.
10656         * win32-low.c (win32_arch_string): Remove.
10657         (win32_target_ops): Remove arch_string initializer.
10658         * win32-low.h (struct win32_target_ops): Remove arch_string member.
10659         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
10660         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
10661
10662 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10663
10664         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
10665         by collect_ptrace_register and supply_ptrace_register hooks.
10666         * linux-low.c (fetch_register): Use supply_ptrace_register callback
10667         instead of checking for the_low_target.left_pad_xfer.
10668         (usr_store_inferior_registers): Use collect_ptrace_register callback
10669         instead of checking for the_low_target.left_pad_xfer.
10670
10671         * linux-s390-low.c (s390_collect_ptrace_register): New function.
10672         (s390_supply_ptrace_register): Likewise.
10673         (s390_fill_gregset): Call s390_collect_ptrace_register.
10674         (the_low_target): Update.
10675
10676         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
10677         (ppc_supply_ptrace_register): Likewise.
10678         (the_low_target): Update.
10679
10680         * linux-i386-low.c (the_low_target): Update.
10681         * linux-x86-64-low.c (the_low_target): Update.
10682
10683 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10684
10685         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
10686         reg-s390.o and reg-s390x.o.
10687
10688         * linux-low.c (new_inferior): New global variable.
10689         (linux_create_inferior, linux_attach): Set it.
10690         (linux_wait_for_process): Call the_low_target.arch_setup after the
10691         target has stopped for the first time.
10692         (initialize_low): Do not call the_low_target.arch_setup.
10693
10694         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
10695         (s390_set_pc): Likewise.
10696         (s390_arch_setup): New function.
10697         (the_low_target): Use s390_arch_setup as arch_setup routine.
10698
10699         * regcache.c (realloc_register_cache): New function.
10700         (set_register_cache): Call it for each existing regcache.
10701
10702 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10703
10704         * server.h (init_registers): Remove prototype.
10705
10706         * linux-low.h (struct linux_target_ops): Add arch_setup field.
10707         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
10708         instead of init_registers ().
10709         * linux-arm-low.c (init_registers_arm): Add prototype.
10710         (init_registers_arm_with_iwmmxt): Likewise.
10711         (the_low_target): Add initializer for arch_setup field.
10712         * linux-cris-low.c (init_registers_cris): Add prototype.
10713         (the_low_target): Add initializer for arch_setup field.
10714         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
10715         (the_low_target): Add initializer for arch_setup field.
10716         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
10717         (the_low_target): Add initializer for arch_setup field.
10718         * linux-ia64-low.c (init_registers_ia64): Add prototype.
10719         (the_low_target): Add initializer for arch_setup field.
10720         * linux-m32r-low.c (init_registers_m32r): Add prototype.
10721         (the_low_target): Add initializer for arch_setup field.
10722         * linux-m68k-low.c (init_registers_m68k): Add prototype.
10723         (the_low_target): Add initializer for arch_setup field.
10724         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
10725         (init_registers_mips64_linux): Likewise.
10726         (the_low_target): Add initializer for arch_setup field.
10727         * linux-ppc-low.c (init_registers_ppc): Add prototype.
10728         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
10729         (the_low_target): Add initializer for arch_setup field.
10730         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
10731         (init_registers_powerpc_64): Likewise.
10732         (the_low_target): Add initializer for arch_setup field.
10733         * linux-s390-low.c (init_registers_s390): Add prototype.
10734         (init_registers_s390x): Likewise.
10735         (the_low_target): Add initializer for arch_setup field.
10736         * linux-sh-low.c (init_registers_sh): Add prototype.
10737         (the_low_target): Add initializer for arch_setup field.
10738         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
10739         (the_low_target): Add initializer for arch_setup field.
10740         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
10741         (the_low_target): Add initializer for arch_setup field.
10742
10743         * win32-low.h (struct win32_target_ops): Add arch_setup field.
10744         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
10745         instead of init_registers ().
10746         * win32-arm-low.c (init_registers_arm): Add prototype.
10747         (the_low_target): Add initializer for arch_setup field.
10748         * win32-i386-low.c (init_registers_i386): Add prototype.
10749         (the_low_target): Add initializer for arch_setup field.
10750
10751         * spu-low.c (init_registers_spu): Add prototype.
10752         (initialize_low): Call initialie_registers_spu () instead of
10753         initialize_registers ().
10754
10755 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
10756
10757         * server.c (handle_v_requests): When handling the vRun and vAttach
10758         packets, if already debugging a process, don't kill it.  Return an
10759         error instead.
10760
10761 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
10762
10763         * server.c (handle_query): Correct length check.
10764
10765 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
10766
10767         * win32-low.c (do_initial_child_stuff): Add process handle
10768         parameter.  Set current_process_handle and current_process_id from the
10769         parameters. Clear globals.
10770         (win32_create_inferior): Don't set current_process_handle and
10771         current_process_id here.  Instead pass them on the call to
10772         do_initial_child_stuff.
10773         (win32_attach): Likewise.
10774         (win32_clear_inferiors): New.
10775         (win32_kill): Don't close the current process handle or the
10776         current thread handle here.  Instead call win32_clear_inferiors.
10777         (win32_detach): Don't open a new handle to the process.  Call
10778         win32_clear_inferiors.
10779         (win32_join): Don't rely on current_process_handle; open a new
10780         handle using the process id.
10781         (win32_wait): Call win32_clear_inferiors when the inferior process
10782         has exited.
10783
10784 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
10785
10786         * server.c (monitor_show_help): Add "exit".
10787
10788 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
10789
10790         * Makefile.in (SFILES): Add linux-xtensa-low.c.
10791         (clean): Add reg-xtensa.c.
10792         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
10793         * configure.srv (xtensa*-*-linux*) New target.
10794         * linux-xtensa-low.c: New.
10795         * xtensa-xtregs.c: New.
10796
10797 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
10798
10799         * hostio.c: Don't include errno.h.
10800         (errno_to_fileio_errno): Move to hostio-errno.
10801         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
10802         error number outputting to the target->hostio_last_error callback.
10803         (hostio_packet_error): Use FILEIO_EINVAL directly.
10804         (handle_open, handle_pread, hostio_error, handle_unlink): Update
10805         calls to hostio_error.
10806         * hostio-errno.c: New.
10807         * server.h (hostio_last_error_from_errno): Declare.
10808         * target.h (target_ops): Add hostio_last_error member.
10809         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
10810         as hostio_last_error handler.
10811         * spu-low.c (spu_target_ops): Likewise.
10812         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
10813         (wince_hostio_last_error): New functions.
10814         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
10815         as hostio_last_error handler.
10816         (win32_target_ops) [!_WIN32_WCE]: Register
10817         hostio_last_error_from_errno as hostio_last_error handler.
10818         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
10819         (hostio-errno.o): New rule.
10820         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
10821         * configure.srv (srv_hostio_err_objs): New variable.  Default to
10822         hostio-errno.o.
10823         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
10824         * configure: Regenerate.
10825
10826 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
10827
10828         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
10829         (linux_kill, linux_detach): Clean up the process list.
10830         * remote-utils.c (remote_open): Improve port number parsing.
10831         (putpkt_binary, input_interrupt): Only send interrupts if the target
10832         is running.
10833         * server.c (extended_protocol): Make static.
10834         (attached): Define earlier.
10835         (exit_requested, response_needed, program_argv): New variables.
10836         (target_running): New.
10837         (start_inferior): Clear attached here.
10838         (attach_inferior): Set attached here.
10839         (require_running): Define.
10840         (handle_query): Use require_running and target_running.  Implement
10841         "monitor exit".
10842         (handle_v_attach, handle_v_run): New.
10843         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
10844         (gdbserver_usage): Update.
10845         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
10846         --attach along with other options or after the port.  Save
10847         program_argv.  Support no initial program.  Resynchronize
10848         communication with GDB after an error.  Handle "monitor exit".
10849         Use require_running and target_running.  Always allow the extended
10850         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
10851         restart in extended mode.
10852         * README: Refer to the GDB manual.  Update --attach usage.
10853
10854 2007-12-20  Andreas Schwab  <schwab@suse.de>
10855
10856         * linux-low.c (STACK_SIZE): Define.
10857         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
10858         (linux_test_for_tracefork): Likewise.
10859
10860 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
10861
10862         * linux-low.c (linux_wait_for_event): Update messages.  Do not
10863         reinsert auto-delete breakpoints.
10864         * mem-break.c (struct breakpoint): Change return type of handler to
10865         int.
10866         (set_breakpoint_at): Update handler type.
10867         (reinsert_breakpoint_handler): Return 1 instead of calling
10868         delete_breakpoint.
10869         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
10870         setting a new one.
10871         (check_breakpoints): Delete auto-delete breakpoints and return 2.
10872         * mem-break.h (set_breakpoint_at): Update handler type.
10873         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
10874         * win32-low.c (auto_delete_breakpoint): New.
10875         (get_child_debug_event): Use it.
10876
10877 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
10878
10879         * configure.ac: Check for pread and pwrite.
10880         * hostio.c (handle_pread): Fall back to lseek and read.
10881         (handle_pwrite): Fall back to lseek and write.
10882         * config.in, configure: Regenerated.
10883
10884 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
10885
10886         * server.c (myresume): Add own_buf argument.
10887         (main): Update calls.
10888
10889 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
10890
10891         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
10892         * remote-utils.c (remote_open): Do not call disable_async_io.
10893         (block_async_io): Delete.
10894         (unblock_async_io): Make static.
10895         (initialize_async_io): New.
10896         * server.c (handle_v_cont): Handle async I/O here.
10897         (myresume): Likewise.  Move other common resume tasks here...
10898         (main): ... from here.  Call initialize_async_io.  Disable async
10899         I/O before the main loop.
10900         * server.h (initialize_async_io): Declare.
10901         (block_async_io, unblock_async_io): Delete prototypes.
10902         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
10903
10904 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
10905
10906         * remote-utils.c (readchar): Allow binary data in received messages.
10907
10908 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
10909
10910         * win32-low.c (attaching): New global.
10911         (win32_create_inferior): Clear the `attaching' global.
10912         (win32_attach): Set the `attaching' global.
10913         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
10914         attaching.  Only set a breakpoint at the entry point if not
10915         attaching.
10916
10917 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
10918
10919         * server.c (main): Don't report dll events on the initial
10920         connection on attaches.
10921
10922 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
10923
10924         * server.c (main): Relax numerical bases supported for the pid of
10925         the --attach command line argument.
10926
10927 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
10928
10929         * win32-low.c (win32_attach): Call OpenProcess before
10930         DebugActiveProcess, not after.  Add last error output to error
10931         call.
10932
10933 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
10934
10935         * win32-low.c (win32_get_thread_context)
10936         (win32_set_thread_context): New functions.
10937         (thread_rec): Use win32_get_thread_context.
10938         (continue_one_thread, win32_resume): Use win32_set_thread_context.
10939         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
10940         field.
10941
10942 2007-12-03  Leo Zayas
10943             Pedro Alves  <pedro_alves@portugalmail.pt>
10944
10945         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
10946         global variables.
10947         (child_add_thread): Minor cleanup.
10948         (child_continue): Resume artificially suspended threads before
10949         calling ContinueDebugEvent.
10950         (suspend_one_thread): New.
10951         (fake_breakpoint_event): New.
10952         (get_child_debug_event): Change return type to int.  Check here if
10953         gdb sent an interrupt request.  If a soft interrupt was requested,
10954         fake a breakpoint event.  Return 0 if there is no event to handle,
10955         and 1 otherwise.
10956         (win32_wait): Don't check here if gdb sent an interrupt request.
10957         Ensure there is a valid event to handle.
10958         (win32_request_interrupt): Add soft interruption method as last
10959         resort.
10960
10961 2007-12-03  Leo Zayas
10962             Pedro Alves  <pedro_alves@portugalmail.pt>
10963
10964         * win32-low.h (win32_thread_info): Add descriptions to the
10965         structure members.  Replace `suspend_count' counter by a
10966         `suspended' flag.
10967         * win32-low.c (thread_rec): Update condition of when to get the
10968         context from the inferior.  Rely on ContextFlags being set if it
10969         has already been retrieved.  Only suspend the inferior thread if
10970         we haven't already.  Warn if that fails.
10971         (continue_one_thread): s/suspend_count/suspended/.  Only call
10972         ResumeThread once.  Warn if that fails.
10973
10974 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
10975
10976         * win32-low.c (win32_wait): Don't read from the inferior when it
10977         has already exited.
10978
10979 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
10980
10981         * Makefile.in (win32_low_h): New variable.
10982         (win32-low.o): Add dependency on $(win32_low_h).
10983         (win32-arm-low.o, win32-i386-low.o): New rules.
10984
10985 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
10986
10987         * hostio.c: Correct copyright year.
10988
10989 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
10990
10991         * Makefile.in (OBS): Add hostio.o.
10992         (hostio.o): New rule.
10993         * server.h (handle_vFile): Declare.
10994         * hostio.c: New file.
10995         * server.c (handle_v_requests): Take packet_len and new_packet_len
10996         for binary packets.  Call handle_vFile.
10997         (main): Update call to handle_v_requests.
10998
10999 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11000
11001         * linux-low.c: Include <sched.h>.
11002
11003 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11004
11005         * linux-low.c (linux_tracefork_grandchild): New.
11006         (linux_tracefork_child): Use clone.
11007         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11008
11009 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11010
11011         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11012
11013 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11014
11015         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11016
11017 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11018
11019         * inferiors.c (change_inferior_id): Delete.
11020         (add_pid_to_list, pull_pid_from_list): New.
11021         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11022         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11023         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11024         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11025         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11026         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11027         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11028         (using_threads): Always set to 1.
11029         (handle_extended_wait): New.
11030         (add_process): Do not set TID.
11031         (linux_create_inferior): Set must_set_ptrace_flags.
11032         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11033         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11034         (linux_thread_alive): Rename TID argument to LWPID.
11035         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11036         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11037         call to dead_thread_notify.  Call handle_extended_wait.
11038         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11039         (send_sigstop): Delete sigstop_sent.
11040         (wait_for_sigstop): Avoid TID.
11041         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11042         (linux_test_for_tracefork): New.
11043         (linux_lookup_signals): Use thread_db_active and
11044         linux_supports_tracefork_flag.
11045         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11046         * linux-low.h (get_process_thread): Avoid TID.
11047         (struct process_ifo): Move thread_known and tid to the end.  Remove
11048         sigstop_sent.
11049         (linux_attach_lwp, thread_db_init): Update prototypes.
11050         * server.h (change_inferior_id): Delete prototype.
11051         (add_pid_to_list, pull_pid_from_list): New prototypes.
11052         * thread-db.c (thread_db_use_events): New.
11053         (find_first_thread): Rename to...
11054         (find_one_thread): ...this.  Update callers and messages.  Do not
11055         call fatal.  Check thread_db_use_events.  Do not call
11056         change_inferior_id or new_thread_notify.
11057         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11058         (thread_db_init): Set thread_db_use_events.  Check use_events.
11059         * utils.c (fatal, warning): Correct message prefix.
11060
11061 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11062
11063         * Makefile.in (clean): Remove new files.
11064         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11065         (powerpc-64.o, powerpc-64.c): New rules.
11066         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11067         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11068         with SPE.
11069         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11070         SPE targets.
11071         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11072         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11073         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11074         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11075         (target_regsets): Add AltiVec and SPE register sets.
11076         * configure.ac: Check for AltiVec and SPE.
11077         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11078         (ppc_fill_vrregset, ppc_store_vrregset): New.
11079         (target_regsets): Add AltiVec register set.
11080         * configure: Regenerated.
11081
11082 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11083
11084         * linux-low.c (O_LARGEFILE): Define.
11085         (linux_read_memory): Use /proc/PID/mem.
11086         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11087         * configure, config.in: Regenerated.
11088
11089 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11090
11091         * linux-low.c (linux_wait_for_event): Do not pass signals while
11092         single-stepping.
11093
11094 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11095
11096         * win32-low.c (create_process): New.
11097         (win32_create_inferior): Use create_process instead of
11098         CreateProcess.  If create_process failed retry appending an ".exe"
11099         suffix.  Store the GetLastError result immediatelly after
11100         create_process calls and use it on the call to error.
11101
11102 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11103
11104         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11105
11106 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11107
11108         * configure.ac: Switch license to GPLv3.
11109
11110 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11111
11112         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11113
11114 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11115
11116         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11117         typedef.
11118         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11119         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11120         CloseToolhelp32Snapshot.
11121         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11122         CloseToolhelp32Snapshot.
11123
11124 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11125
11126         * server.c (main): Check for inferior exit before main loop.
11127
11128 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11129
11130         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11131         instead of on tmp_desc.
11132
11133 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11134             Daniel Jacobowitz  <dan@codesourcery.com>
11135
11136         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11137         (add_thread): Minor cleanups.
11138         (clear_inferiors): Move lower in the file.  Clear the DLL
11139         list.
11140         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11141         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11142         (xml_escape_text): New.
11143         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11144         for qSupported.
11145         (handle_v_cont): Report errors.
11146         (gdbserver_version): Update.
11147         (main): Correct size of own_buf.  Do not report initial DLL events.
11148         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11149         (unloaded_dll, xml_escape_text): New.
11150         * win32-low.c (enum target_waitkind): Update comments.
11151         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11152         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11153         (win32_EnumProcessModules, win32_GetModuleInformation)
11154         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11155         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11156         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11157         (win32_Module32First, win32_Module32Next, load_toolhelp)
11158         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11159         (get_child_debug_event): Handle DLL events.
11160         (win32_wait): Likewise.
11161
11162 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11163
11164         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11165         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11166
11167 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11168
11169         * win32-low.c (handle_output_debug_string): Ignore event if not
11170         waiting.
11171
11172 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11173
11174         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11175
11176 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11177
11178         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11179
11180 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11181
11182         * inferiors.c (change_inferior_id): Add comment.
11183         * linux-low.c (check_removed_breakpoint): Add an early
11184         prototype.  Improve debug output.
11185         (linux_attach): Doc update.
11186         (linux_detach_one_process, linux_detach): Clean up before releasing
11187         each process.
11188         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11189         * linux-low.h (struct process_info): Doc improvement.
11190         * mem-break.c (delete_all_breakpoints): New.
11191         * mem-break.h (delete_all_breakpoints): New prototype.
11192         * thread-db.c (find_first_thread): New.
11193         (thread_db_create_event): Call it instead of
11194         thread_db_find_new_threads.  Clean up unused variables.
11195         (maybe_attach_thread): Remove first thread handling.
11196         (thread_db_find_new_threads): Use find_first_thread.
11197         (thread_db_get_tls_address): Likewise.
11198
11199 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11200
11201         * thread-db.c (thread_db_find_new_threads): Add prototype.
11202         (thread_db_create_event): Check for the main thread before adding
11203         a new thread.
11204         (maybe_attach_thread): Only enable event reporting if TID == 0.
11205         (thread_db_get_tls_address): Check for new threads.
11206
11207 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11208
11209         * linux-low.c (linux_create_inferior): Try execv before execvp.
11210         * spu-low.c (spu_create_inferior): Likewise.
11211
11212 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11213
11214         * linux-low.c (linux_create_inferior): Change execv to execvp.
11215         * spu-low.c (spu_create_inferior): Likewies.
11216
11217 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11218
11219         * Makefile.in (clean): Clean new files instead of deleted ones.
11220         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11221         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11222         rules.
11223         * configure.srv: Specify XML files and new regformats for MIPS and
11224         MIPS64 GNU/Linux.
11225         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11226         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11227         an entry for the restart register.
11228         (mips_cannot_fetch_register, mips_cannot_store_register)
11229         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11230         register names to match the XML descriptions.
11231         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11232         restart register instead of $0.
11233
11234 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11235             Markus Deuling  <deuling@de.ibm.com>
11236
11237         * remote-utils.c (decode_xfer_write): New function.
11238         * server.h (decode_xfer_write): Add prototype.
11239         * server.c (handle_query): Add PACKET_LEN argument.  Support
11240         qXfer:spu:read and qXfer:spu:write packets.
11241         (main): Pass packet_len to handle_query.
11242         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11243         * target.h (target_ops): Add qxfer_spu.
11244
11245 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11246
11247         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11248         accessing non-seekable spufs files.
11249
11250 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11251
11252         * server.c (handle_query): Add reply for qC packet.
11253
11254 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11255             Leo Zayas  <lerele@champenstudios@com>
11256
11257         * server.h (check_remote_input_interrupt_request): New function.
11258         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11259         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11260         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11261         (check_remote_input_interrupt_request): New function.
11262         * server.h (check_remote_input_interrupt_request): Declare.
11263         * win32-low.c (winapi_DebugBreakProcess,
11264         winapi_GenerateConsoleCtrlEvent): New typedefs.
11265         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11266         to 250 ms.
11267         (win32_wait): Check for remote interrupt request
11268         with check_remote_input_interrupt_request.
11269         (win32_request_interrupt): New function.
11270         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11271
11272 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11273
11274         * win32-low.c (debug_registers_changed,
11275         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11276         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11277         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11278         (thread_rec): Get context using the low target.
11279         (child_add_thread): Call thread_added on the low target,
11280         which does the same thing.
11281         (regptr): Delete.
11282         (do_initial_child_stuff): Remove debug registers references.
11283         Set context using the low target.  Resume threads after
11284         setting the contexts.
11285         (child_continue): Remove dead variable.  Remove debug
11286         registers references.
11287         (child_fetch_inferior_registers): Go through the low target.
11288         (do_child_store_inferior_registers): Remove.
11289         (child_store_inferior_registers): Go through the low target.
11290         (win32_resume): Remove debug registers references.
11291         Set context using the low target.
11292         (handle_exception): Change return type to void.  Don't record
11293         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11294         first chance exception.
11295         (get_child_debug_event): Change return type to void.  Remove
11296         goto loop.  Always return after waiting for debug event.
11297         (win32_wait): Convert to switch statement.  Handle spurious
11298         events.
11299
11300         * win32-i386-low.c (debug_registers_changed,
11301         debug_registers_used): New.
11302         (initial_stuff): Rename to ...
11303         (i386_initial_stuff): ... this.  Clear debug registers
11304         state variables.
11305         (store_debug_registers): Delete.
11306         (i386_get_thread_context): New.
11307         (load_debug_registers): Delete.
11308         (i386_set_thread_context): New.
11309         (i386_thread_added): New.
11310         (single_step): Rename to ...
11311         (i386_single_step): ... this.
11312         (do_fetch_inferior_registers): Rename to ...
11313         (i386_fetch_inferior_register): ... this.
11314         (i386_store_inferior_register): New.
11315         (the_low_target): Adapt to new interface.
11316
11317         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11318         (arm_get_thread_context): New.
11319         (arm_set_thread_context): New.
11320         (regptr): New.
11321         (do_fetch_inferior_registers): Rename to ...
11322         (arm_fetch_inferior_register): ... this.
11323         (arm_store_inferior_register): New.
11324         (arm_wince_breakpoint): Reimplement as unsigned long.
11325         (arm_wince_breakpoint_len): Define.
11326         (the_low_target): Adapt to new interface.
11327
11328         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11329         load_debug_registers.  Add get_thread_context, set_thread_context,
11330         thread_added and store_inferior_register.  Rename
11331         fetch_inferior_registers to fetch_inferior_register.
11332         (regptr): Remove declaration.
11333
11334 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11335
11336         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11337         * spu-low.c (spu_detach): Likewise.
11338
11339 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11340
11341         * target.h (target_ops): Change return type of detach to int.
11342         Add join.
11343         (join_inferior): New.
11344         * server.c (main): Don't skip detach support on mingw32.
11345         If the inferior doesn't support detaching return error.
11346         Call join_inferior instead of using waitpid.
11347         * linux-low.c (linux_join): New.
11348         (linux_target_op): Add linux_join.
11349         * spu-low.c (spu_join): New.
11350         (spu_target_ops): Add spu_join.
11351         * win32-low.c (win32_detach): Adapt to new interface.
11352         Reopen current_process_handle before detaching.  Issue a child
11353         resume before detaching.
11354         (win32_join): New.
11355         (win32_target_op): Add win32_join.
11356
11357 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11358
11359         * win32-low.c (win32-attach): Fix return value.
11360         * target.h (target_ops): Describe ATTACH return values.
11361
11362 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11363
11364         * win32-low.c (GETPROCADDRESS): Define.
11365         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11366         (winapi_DebugSetProcessKillOnExit): Likewise.
11367         (win32_create_inferior): Force usage of ansi CreateProcessA.
11368         (win32_attach): Use GETPROCADDRESS.
11369         (win32_detach): Likewise.
11370
11371 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11372
11373         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11374
11375 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11376
11377         * win32-low.c: Commit leftover changes from 2007-03-29.
11378
11379 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11380
11381         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11382         fields short instead of int.  Add explicit padding.
11383         (i387_cache_to_fsave): Remove unnecessary casts.
11384         (i387_fsave_to_cache): Doc fix.
11385         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11386
11387 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11388
11389         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
11390         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
11391
11392 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11393
11394         * configure.srv (arm*-*-mingw32ce*): Move near the other
11395         arm targets.
11396
11397 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11398
11399         * configure.ac: Add errno checking.
11400         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
11401         sys/file.h and malloc.h.
11402         (AC_CHECK_DECLS): Add perror.
11403         (srv_mingwce): Handle.
11404         * configure.srv (i[34567]86-*-cygwin*): Add
11405         win32-i386-low.o to srv_tgtobj.
11406         (i[34567]86-*-mingw*): Likewise.
11407         (arm*-*-mingw32ce*): Add case.
11408         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11409         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
11410         [__MINGW32CE__] (strerror): New function.
11411         [__MINGW32CE__] (errno): Define to GetLastError.
11412         [__MINGW32CE__] (COUNTOF): New macro.
11413         (remote_open): Remove extra close call.
11414         * mem-break.c (delete_breakpoint_at): New function.
11415         * mem-break.h (delete_breakpoint_at): Declare.
11416         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11417         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
11418         [USE_WIN32API] (read, write): Add char* casts.
11419         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
11420         * server.h: Include wincecompat.h on Windows CE.
11421         [HAVE_ERRNO_H]: Check.
11422         (perror): Declare if not declared.
11423         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
11424         (perror_with_name): Remove errno declaration.
11425         * wincecompat.h: New.
11426         * wincecompat.c: New.
11427         * win32-low.h: New.
11428         * win32-arm-low.c: New.
11429         * win32-i386-low.c: New.
11430         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
11431         (OUTMSG2): Make it safe.
11432         (_T): New macro.
11433         (COUNTOF): New macro.
11434         (NUM_REGS): Get it from the low target.
11435         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
11436         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
11437         (thread_rec): Let low target handle debug registers.
11438         (child_add_thread): Likewise.
11439         (child_init_thread_list): Likewise.
11440         (continue_one_thread): Likewise.
11441         (regptr): New.
11442         (do_child_fetch_inferior_registers): Move to ...
11443         * win32-i386-low.c: ... here, and rename to ...
11444         (do_fetch_inferior_registers): ... this.
11445         * win32-low.c (child_fetch_inferior_registers):
11446         Go through the low target.
11447         (do_child_store_inferior_registers): Use regptr.
11448         (strwinerror): New function.
11449         (win32_create_inferior): Handle Windows CE.
11450         Use strwinerror instead of strerror on Windows error
11451         codes.  Add program to the error output.
11452         Don't close the main thread handle on Windows CE.
11453         (win32_attach): Use coredll.dll on Windows CE.
11454         (win32_kill): Close current process and current
11455         thread handles.
11456         (win32_detach): Use coredll.dll on Windows CE.
11457         (win32_resume): Let low target handle debug registers, and
11458         step request.
11459         (handle_exception): Add/Remove initial breakpoint.  Avoid
11460         non-existant WSTOPSIG on Windows CE.
11461         (win32_read_inferior_memory): Cast to remove warning.
11462         (win32_arch_string): Go through the low target.
11463         (initialize_low): Call set_breakpoint_data with the low
11464         target's breakpoint.
11465         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
11466         FOP_REGNUM, mappings): Move to ...
11467         * win32-i386-low.c: ... here.
11468         * win32-low.c (win32_thread_info): Move to ...
11469         * win32-low.h: ... here.
11470         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
11471         win32-arm-low.c and wincecompat.c.
11472         (all:): Add $EXEEXT.
11473         (install-only:): Likewise.
11474         (gdbserver:): Likewise.
11475         (gdbreplay:): Likewise.
11476         * config.in: Regenerate.
11477         * configure: Regenerate.
11478
11479 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11480
11481         * win32-low.c: Rename typedef thread_info to
11482         win32_thread_info throughout.
11483
11484 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11485
11486         * win32-i386-low.c: Rename to ...
11487         * win32-low.c: ... this.
11488         * configure.srv: Replace win32-i386-low.o with win32-low.o.
11489         * Makefile.in: Likewise.
11490
11491 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
11492
11493         * remote-utils.c (monitor_output): Constify msg parameter.
11494         * server.h (monitor_output): Likewise.
11495         * win32-i386-low.c (handle_output_debug_string): New.
11496         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
11497         handle_output_debug_string.
11498         (get_child_debug_event): Likewise.
11499
11500 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
11501
11502         * server.c (main): Correct strtoul check.
11503
11504 2007-03-27  Jon Ringle  <jon@ringle.org>
11505
11506         * linux-low.c: Check __ARCH_HAS_MMU__ also.
11507
11508 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
11509
11510         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
11511
11512 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
11513
11514         * terminal.h: Check HAVE_SGTTY_H.
11515
11516 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
11517
11518         * remote-utils.c (remote_open): Print out the assigned port number.
11519
11520 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
11521
11522         * remote-utils.c (monitor_output): New function.
11523         * server.c (debug_threads): Define here.
11524         (monitor_show_help): New function.
11525         (handle_query): Handle qRcmd.
11526         (main): Do not handle 'd' packet.
11527         * server.h (debug_threads, remote_debug, monitor_output): Declare.
11528         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
11529         of debug_threads.
11530
11531 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11532
11533         * Makefile.in (EXEEXT): New.
11534         (clean): Use $(EXEEXT).
11535
11536 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11537
11538         * target.h (target_ops): Rename send_signal to request_interrupt,
11539         and remove enum target_signal parameter.
11540         * linux-low.c (linux_request_interrupt): Rename from
11541         linux_send_signal, and always send SIGINT.
11542         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
11543         and always send SIGINT.
11544         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
11545         of send_signal.
11546         (input_interrupt): Likewise.
11547
11548 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11549
11550         * server.c (get_features_xml): Check if target implemented
11551         arch_string.
11552         * win32-i386-low.c (win32_arch_string): New.
11553         (win32_target_ops): Add win32_arch_string as arch_string member.
11554
11555 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
11556
11557         * spu-low.c (spu_arch_string): New.
11558         (spu_target_ops): Add spu_arch_string.
11559
11560 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
11561
11562         * remote-utils.c: Remove HAVE_TERMINAL_H check.
11563         * configure.ac: Do not check for terminal.h.
11564         * configure, config.in: Regenerated.
11565
11566 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11567
11568         * Makefile.in (OBS): Add $(XML_BUILTIN).
11569         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
11570         (clean): Update.
11571         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
11572         (arm-with-iwmmxt.c): New.
11573         * config.in, configure: Regenerate.
11574         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
11575         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
11576         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
11577         (arm*-*-linux*): Add iWMMXt and regset support.
11578         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
11579         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
11580         (arm_store_wmmxregset, target_regsets): New.
11581         * server.c (get_features_xml): Take annex argument.  Check builtin
11582         XML documents.
11583         (handle_query): Handle multiple annexes.
11584
11585 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11586
11587         * remote-utils.c [USE_WIN32API] (read, write): Define.
11588         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
11589         write.
11590
11591 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
11592
11593         * linux-i386-low.c (the_low_target): Set arch_string.
11594         * linux-x86-64-low.c (the_low_target): Likewise.
11595         * linux-low.c (linux_arch_string): New.
11596         (linux_target_ops): Add it.
11597         * linux-low.h (struct linux_target_ops): Add arch_string.
11598         * server.c (write_qxfer_response): Use const void * for DATA.
11599         (get_features_xml): New.
11600         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
11601         * target.h (struct target_ops): Add arch_string method.
11602
11603 2007-01-03  Denis Pilat  <denis.pilat@st.com>
11604             Daniel Jacobowitz  <dan@codesourcery.com>
11605
11606         * linux-low.c (linux_kill): Handle being called with no threads.
11607         * win32-i386-low.c (win32_kill): Likewise.
11608         (get_child_debug_event): Clear current_process_handle.
11609
11610 2006-12-30  Denis PILAT  <denis.pilat@st.com>
11611             Daniel Jacobowitz  <dan@codesourcery.com>
11612
11613         * remote-utils.c (remote_open): Check the type of specified
11614         serial port devices before opening them.
11615         * server.c (main): Kill the inferior if an error occurs during
11616         the first remote_open.
11617
11618 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
11619
11620         * README: Update supported targets.
11621
11622 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
11623
11624         * Makefile.in (clean): Remove reg-mips64.c.
11625         (reg-mips64.c, reg-mips64.o): New rules.
11626         * configure.srv: Handle mips64.  Include regset support for mips.
11627         * linux-mips-low.c (union mips_register): New.
11628         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
11629         (mips_breakpoint, mips_breakpoint_at): Use int.
11630         (mips_collect_register, mips_supply_register)
11631         (mips_collect_register_32bit, mips_supply_register_32bit)
11632         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
11633         (mips_store_fpregset, target_regsets): New.
11634         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
11635
11636 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
11637
11638         * configure.srv: Add target "spu*-*-*".
11639         * Makefile.in (clean): Remove reg-spu.c.
11640         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
11641         * spu-low.c: New file.
11642
11643 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11644
11645         * configure.ac: Correct td_thr_tls_get_addr test.
11646         * configure: Regenerated.
11647
11648 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11649
11650         * linux-low.c (linux_wait_for_event): Reformat.  Use the
11651         pass_signals array.
11652         * remote-utils.c (decode_address_to_semicolon): New.
11653         * server.c (pass_signals, handle_general_set): New.
11654         (handle_query): Mention QPassSignals for qSupported.
11655         (main): Call handle_general_set.
11656         * server.h (pass_signals, decode_address_to_semicolon): New.
11657
11658 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
11659
11660         * server.c (handle_query): Correct error handling for read_auxv.
11661
11662 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
11663
11664         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
11665         and srv_linux_thread_db to yes.
11666         * linux-s390-low.c (s390_fill_gregset): New function.
11667         (target_regsets): Define data structure.
11668
11669 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
11670
11671         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
11672         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
11673         * config.in, configure: Regenerated.
11674         * inferiors.c (gdb_id_to_thread): New function.
11675         (gdb_id_to_thread_id): Use it.
11676         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
11677         * linux-low.h (struct process_info): Add th member.
11678         (thread_db_get_tls_address): New prototype.
11679         * remote-utils.c (decode_address): Make non-static.
11680         * server.c (handle_query): Handle qGetTLSAddr.
11681         * server.h (gdb_id_to_thread, decode_address): New prototypes.
11682         * target.h (struct target_ops): Add get_tls_address.
11683         * thread-db.c (maybe_attach_thread): Save the thread handle.
11684         (thread_db_get_tls_address): New.
11685
11686 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
11687
11688         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
11689         (linux_resume_one_process): Take a siginfo_t *.  Update all
11690         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
11691         (struct pending_signals): Add a siginfo_t.
11692         (linux_wait_for_process): Always set last_status.
11693         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
11694         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
11695         * linux-low.h (struct process_info): Add last_status.
11696
11697 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
11698
11699         * remote-utils.c (try_rle): New function.
11700         (putpkt_binary): Use it.
11701
11702 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
11703
11704         * Makefile.in (clean): Clean reg-x86-64-linux.c.
11705         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
11706         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
11707         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
11708         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
11709         point registers.
11710
11711 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
11712
11713         * server.c (terminal_fd): New variable.
11714         (old_foreground_pgrp): Likewise.
11715         (restore_old_foreground_pgrp): New function.
11716         (start_inferior): Record the terminal file descriptor in terminal_fd
11717         and its original foreground group in old_foreground_pgrp.  Register
11718         restore_old_foreground_pgrp with atexit().
11719
11720 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
11721
11722         * server.c (handle_query): Correct qPart to qXfer.
11723
11724 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
11725
11726         * configure.ac: Check for more headers which are missing on
11727         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
11728         * configure.srv: Add Cygwin and mingw32.
11729         * remote-utils.c: Don't include headers unconditionally which
11730         are missing on mingw32.  Include <winsock.h> for mingw32.
11731         (remote_open): Adjust for mingw32 support.  Flush
11732         standard error after writing to it.
11733         (remote_close, putpkt_binary, input_interrupt, block_async_io)
11734         (unblock_async_io, enable_async_io, disable_async_io)
11735         (readchar, getpkt): Update for Winsock support.
11736         (prepare_resume_reply): Expect a protocol signal number.
11737         * server.c: Disable <sys/wait.h> on mingw32.
11738         (start_inferior): Adjust for mingw32 support.  Flush
11739         standard error after writing to it.
11740         (attach_inferior): Likewise.  Use protocol signal
11741         numbers.
11742         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
11743         and names.
11744         * win32-i386-low.c: New file.
11745         * Makefile.in (XM_CLIBS): Set.
11746         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
11747         (win32-i386-low.o): New dependency rule.
11748         * linux-low.c (linux_wait): Use target signal numbers.
11749         * target.h (struct target_ops): Doc fix.
11750         * server.h (target_signal_to_name): New prototype.
11751         * gdbreplay.c: Don't include headers unconditionally which
11752         are missing on mingw32.  Include <winsock.h> for mingw32.
11753         (remote_close, remote_open): Adjust for Winsock support.
11754         * configure, config.in: Regenerated.
11755
11756 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11757
11758         * server.c (decode_xfer_read, write_qxfer_response): New.
11759         (handle_query): Take a packet length argument.  Handle
11760         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
11761         the qSupported response.
11762         (main): Update call to handle_query.
11763
11764 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
11765
11766         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
11767         (putpkt_binary): Renamed from putpkt and adjusted for binary
11768         data.
11769         (putpkt): New wrapper for putpkt_binary.
11770         (readchar): Don't mask off the high bit.
11771         (decode_X_packet): New function.
11772         * server.c (main): Call putpkt_binary if a handler sets the packet
11773         length.  Save the length of the incoming packet.  Handle 'X'.
11774         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
11775
11776 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
11777
11778         * server.c (handle_query): Handle qSupported.
11779
11780 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
11781
11782         * remote-utils.c (all_symbols_looked_up): New variable.
11783         (look_up_one_symbol): Check it.
11784         * server.h (look_up_one_symbol): New declaration.
11785         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
11786
11787 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
11788
11789         * Makefile.in (linux-arm-low.o): Update dependencies.
11790         * linux-arm-low.c: Include "gdb_proc_service.h".
11791         (PTRACE_GET_THREAD_AREA): Define.
11792         (ps_get_thread_area): New function.
11793
11794 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
11795
11796         * configure.srv (m68k*-*-uclinux*): New target.
11797         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
11798         (linux_resume_one_process): Remove extraneous cast.
11799         (linux_read_offsets): New.
11800         (linux_target_op): Add linux_read_offsets on mmuless systems.
11801         * server.c (handle_query): Add qOffsets logic.
11802         * target.h (struct target_ops): Add read_offsets.
11803
11804 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
11805
11806         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
11807         (PTRACE_GET_THREAD_AREA): Define.
11808         (ps_get_thread_area): New function.
11809         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
11810         (linux-x86-64-low.o): Update.
11811
11812 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
11813
11814         * configure.ac: Remove checks for prfpregset_t.
11815         * gdb_proc_service.h: New file.
11816         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
11817         new "gdb_proc_service.h".
11818         * proc-service.c: Likewise.
11819         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
11820         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
11821         * Makefile.in (gdb_proc_service_h): Updated.
11822         * configure, config.in: Regenerated.
11823
11824 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
11825
11826         * remote-utils.c (prepare_resume_reply): Move declaration
11827         of gdb_id_from_wait to the top of the block.
11828
11829 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
11830
11831         * linux-low.c (regsets_store_inferior_registers): Read the regset
11832         from the target before filling it.
11833
11834 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11835
11836         * server.c (attach_inferior): Return SIGTRAP for a successful
11837         attach.
11838
11839 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
11840
11841         * Makefile.in (OBS): Add version.o.
11842         (STAGESTUFF): Delete.
11843         (version.o): Add dependencies.
11844         (version.c): Replace rule.
11845         (clean): Remove version.c.
11846         * server.c (gdbserver_version): New.
11847         (gdbserver_usage): Use printf.
11848         (main): Handle --version and --help.
11849         * server.h (version, host_name): Add declarations.
11850
11851 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
11852
11853         * linux-arm-low.c:
11854         * linux-arm-low.c:
11855         * inferiors.c:
11856         * i387-fp.h:
11857         * i387-fp.c:
11858         * gdbreplay.c:
11859         * regcache.c:
11860         * proc-service.c:
11861         * mem-break.h:
11862         * mem-break.c:
11863         * linux-x86-64-low.c:
11864         * linux-sh-low.c:
11865         * linux-s390-low.c:
11866         * linux-ppc64-low.c:
11867         * linux-ppc-low.c:
11868         * linux-mips-low.c:
11869         * linux-m68k-low.c:
11870         * linux-m32r-low.c:
11871         * linux-low.h:
11872         * linux-low.c:
11873         * linux-ia64-low.c:
11874         * linux-i386-low.c:
11875         * linux-crisv32-low.c:
11876         * thread-db.c:
11877         * terminal.h:
11878         * target.h:
11879         * target.c:
11880         * server.h:
11881         * server.c:
11882         * remote-utils.c:
11883         * regcache.h:
11884         * utils.c:
11885         * Makefile.in:
11886         * configure.ac:
11887         * gdbserver.1: Add (C) after Copyright.  Update the FSF
11888         address.
11889
11890 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
11891
11892         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
11893         (arm_breakpoint_at): Recognize both breakpoints.
11894         (the_low_target): Use the correct breakpoint instruction.
11895
11896 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
11897
11898         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
11899         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
11900         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
11901         (the_low_target): Update.
11902
11903 2005-10-25  Andreas Schwab  <schwab@suse.de>
11904
11905         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
11906
11907         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
11908         (ia64_num_regs): Reduce to 462.
11909
11910 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
11911
11912         * acinclude.m4: Correct quoting.
11913         * aclocal.m4: Regenerated.
11914
11915         Suggested by SZOKOVACS Robert <szo@ies.hu>:
11916         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
11917         (thread_db_init): Call thread_db_err_str.
11918         * configure.ac: Check for TD_VERSION.
11919         * config.in, configure: Regenerated.
11920
11921 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
11922
11923         * server.h (error, fatal, warning): Add ATTR_FORMAT.
11924
11925 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
11926
11927         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
11928         is not available.  Define HAVE_PTRACE_GETREGS if it is.
11929         * config.in, configure: Regenerated.
11930         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
11931         * linux-i386-low.c, linux-m68k-low.c: Update to use
11932         HAVE_PTRACE_GETREGS.
11933         * linux-low.c (regsets_fetch_inferior_registers)
11934         (regsets_store_inferior_registers): Only return 0 if we processed
11935         GENERAL_REGS.
11936         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
11937         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
11938
11939 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
11940
11941         * inferiors.c (struct thread_info): Add gdb_id.
11942         (add_thread): Add gdb_id argument.
11943         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
11944         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
11945         calls to add_thread.
11946         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
11947         * server.c (handle_query): Use thread_to_gdb_id.
11948         (handle_v_cont, main): Use gdb_id_to_thread_id.
11949         * server.h (add_thread): Update prototype.
11950         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
11951         prototypes.
11952
11953 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
11954
11955         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
11956         left-padded registers.
11957         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
11958         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
11959
11960 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
11961
11962         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
11963         * configure: Regenerate.
11964         * config.in: Regenerate.
11965         * server.h (NEED_DECLARATION_STRERROR):
11966         Replace with !HAVE_DECL_STRERROR.
11967
11968 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
11969
11970         * linux-low.c (linux_wait, linux_send_signal): Don't test
11971         an unsigned long variable for > 0 if it could be MAX_ULONG.
11972         * server.c (myresume): Likewise.
11973         * target.c (set_desired_inferior): Likewise.
11974
11975 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
11976
11977         * configure.ac: Simplify and improve check for socklen_t.
11978         * configure, config.in: Regenerate.
11979
11980 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
11981
11982         * acconfig.h: Remove.
11983         * configure.ac: Add a test for socklen_t.  Use three-argument
11984         AC_DEFINE throughout.
11985         * config.in: Regenerated using autoheader 2.59.
11986         * configure: Regenerated.
11987
11988         * gdbreplay.c (socklen_t): Provide a default.
11989         (remote_open): Use socklen_t.
11990         * remote-utils.c (socklen_t): Provide a default.
11991         (remote_open): Use socklen_t.
11992         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
11993         unsigned char.
11994
11995         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
11996         char for buffers.
11997         * linux-low.c (linux_read_memory, linux_write_memory)
11998         (linux_read_auxv): Likewise.
11999         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12000         (check_mem_write): Likewise.
12001         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12002         Likewise.
12003         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12004         (registers_from_string, register_data): Likewise.
12005         * server.c (handle_query, main): Likewise.
12006         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12007         (decode_M_packet): Likewise.
12008         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12009         * target.h (struct target_ops): Update read_memory, write_memory,
12010         and read_auxv.
12011         (read_inferior_memory, write_inferior_memory): Update.
12012         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12013         to unsigned char *.
12014         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12015         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12016         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12017         linux-s390-low.c, linux-sh-low.c: Update for changes in
12018         read_inferior_memory and the_low_target->breakpoint.
12019
12020 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12021
12022         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12023         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12024         * configure.srv: Add powerpc64-*-linux*.
12025         * linux-ppc64-low.c: New file.
12026
12027 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12028
12029         * linux-cris-low.c: New file with support for CRIS.
12030         * linux-crisv32-low.c: Ditto for CRISv32.
12031         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12032         (clean): Add reg-cris.c and reg-crisv32.c.
12033         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12034         reg-crisv32.o, and reg-crisv32.c to make rules.
12035         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12036         recognized targets.
12037
12038 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12039
12040         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12041         of sizeof (PTRACE_XFER_TYPE).
12042         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12043
12044 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12045
12046         * target.h (struct target_ops): Add insert_watchpoint,
12047         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12048         pointers for hardware watchpoint support.
12049         * linux-low.h (struct linux_target_ops): Ditto.
12050         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12051         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12052         to linux_target_ops.
12053         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12054         reply packet.
12055         * server.c (main): Recognize 'Z' and 'z' packets.
12056
12057 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12058
12059         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12060         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12061         (the_low_target): Add new members.
12062
12063 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12064
12065         * proc-service.c (ps_lgetregs): Search all_processes instead of
12066         all_threads.
12067
12068 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12069
12070         * server.c (start_inferior): Change return type to int.
12071         (attach_inferior): Change sigptr to int *.
12072         (handle_v_cont, handle_v_requests): Change signal to int *.
12073         (main): Change signal to int.
12074
12075 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12076
12077         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12078         * configure.srv: Add m32r*-*-linux*.
12079         * linux-m32r-low.c: New file.
12080
12081 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12082
12083         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12084
12085 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12086
12087         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12088         Take unsigned long arguments for PIDs.
12089         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12090         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12091         (wait_for_sigstop, linux_resume_one_process)
12092         (regsets_fetch_inferior_registers, linux_send_signal)
12093         (linux_read_auxv): Likewise.  Update the types of variables holding
12094         PIDs.  Update format string specifiers.
12095         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12096         * remote-utils.c (prepare_resume_reply): Likewise.
12097         * server.c (cont_thread, general_thread, step_thread)
12098         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12099         unsigned long.
12100         (handle_query): Update format specifiers.
12101         (handle_v_cont, main): Use strtoul for thread IDs.
12102         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12103         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12104         (general_thread, step_thread, thread_from_wait)
12105         (old_thread_from_wait): Update.
12106         * target.h (struct thread_resume): Use unsigned long for THREAD.
12107         (struct target_ops): Use unsigned long for arguments to attach and
12108         thread_alive.
12109
12110 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12111
12112         * acinclude.m4: Include bfd/bfd.m4 directly.
12113         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12114         <agriffis@toolchain.org>.
12115         * aclocal.m4, configure: Regenerated.
12116
12117 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12118
12119         * configure.ac: Rename configure.in, require autoconf 2.59.
12120         * configure: Re-generate.
12121
12122 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12123
12124         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12125         LIBS when finished.
12126         * aclocal.m4: Regenerated.
12127         * configure: Regenerated.
12128
12129 2004-11-21  Andreas Schwab  <schwab@suse.de>
12130
12131         * linux-m68k-low.c (m68k_num_gregs): Define.
12132         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12133         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12134         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12135         (m68k_breakpoint_at): New.  Add to the_low_target.
12136
12137         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12138         srv_linux_thread_db to yes.
12139
12140 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12141
12142         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12143         (ARCH_SET_FS): Likewise.
12144         (ARCH_GET_FS): Likewise.
12145         (ARCH_GET_GS): Likewise.
12146
12147 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12148
12149         * linux-i386-low.c (ps_get_thread_area): New.
12150         * linux-x86-64-low.c (ps_get_thread_area): New.
12151         * linux-low.c: Include <sys/syscall.h>.
12152         (linux_kill_one_process): Don't kill the first thread here.
12153         (linux_kill): Kill the first thread here.
12154         (kill_lwp): New function.
12155         (send_sigstop, linux_send_signal): Use it.
12156         * proc-service.c: Clean up #ifdefs.
12157         (fpregset_info): Delete.
12158         (ps_lgetregs): Update and enable implementation.
12159         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12160         implementations.
12161         * remote-utils.c (struct sym_cache, symbol_cache): New.
12162         (input_interrupt): Print a clearer message.
12163         (async_io_enabled): New variable.
12164         (enable_async_io, disable_async_io): Use it.  Update comments.
12165         (look_up_one_symbol): Use the symbol cache.
12166         * thread-db.c (thread_db_look_up_symbols): New function.
12167         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12168
12169 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12170
12171         * configure.in: Test for -rdynamic.
12172         * configure: Regenerated.
12173         * Makefile (INTERNAL_LDFLAGS): New.
12174         (gdbserver, gdbreplay): Use it.
12175
12176 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12177
12178         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12179
12180 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12181
12182         * linux-low.c (linux_wait): Clear all_processes list also.
12183
12184 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12185
12186         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12187         errno.
12188
12189 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12190
12191         * gdbreplay.c, server.h, utils.c: Update copyright years.
12192
12193 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12194
12195         * server.c (main): Print child status or termination signal from
12196         variable 'signal', not 'sig'.
12197
12198 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12199
12200         * linux-low.c (linux_read_memory): Change return type to
12201         int.  Check for and return error from ptrace().
12202         * target.c (read_inferior_memory): Change return type to int.  Pass
12203         back return status from the_target->read_memory().
12204         * target.h (struct target_ops): Adapt *read_memory() prototype.
12205         Update comment.
12206         (read_inferior_memory): Adapt prototype.
12207         * server.c (main): Return an error packet if
12208         read_inferior_memory() returns an error.
12209
12210 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12211
12212         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12213         Unify with other clean targets.
12214
12215 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12216
12217         * server.c (handle_v_cont): Call set_desired_inferior.
12218
12219 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12220
12221         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12222
12223 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12224
12225         * linux-low.c (linux_wait): Unblock async I/O.
12226         (linux_resume): Block and enable async I/O.
12227         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12228         * server.h (block_async_io, unblock_async_io): Add prototypes.
12229
12230 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12231
12232         * remote-utils.c (remote_open): Print a status notice after
12233         opening a TCP port.
12234         * server.c (attach_inferior): Print a status notice after
12235         attaching.
12236
12237 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12238
12239         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12240
12241 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12242
12243         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12244         error packet.
12245         * server.c, target.h: Update copyright years.
12246
12247 2004-02-25  Roland McGrath  <roland@redhat.com>
12248
12249         * target.h (struct target_ops): New member `read_auxv'.
12250         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12251         * linux-low.c (linux_read_auxv): New function.
12252         (linux_target_ops): Initialize `read_auxv' member to that.
12253
12254 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12255
12256         Committed by Jim Blandy  <jimb@redhat.com>.
12257
12258         * linux-s390-low.c (s390_num_regs): Update.
12259         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12260         instead of GPR_SIZE to distiguish s390 and s390x targets.
12261
12262 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12263
12264         * linux-low.c: Update copyright year.
12265         (check_removed_breakpoint): Clear pending_is_breakpoint.
12266         (linux_set_resume_request, linux_queue_one_thread)
12267         (resume_status_pending_p): New functions.
12268         (linux_continue_one_thread): Use process->resume.
12269         (linux_resume): Only resume threads if there are no pending events.
12270         * linux-low.h (struct process_info): Add resume request
12271         pointer.
12272
12273 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12274
12275         * regcache.c (new_register_cache): Clear the allocated register
12276         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12277
12278 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12279
12280         * linux-low.c (linux_resume): Take a struct thread_resume *
12281         argument.
12282         (linux_wait): Update call.
12283         (resume_ptr): New static variable.
12284         (linux_continue_one_thread): Renamed from
12285         linux_continue_one_process.  Use resume_ptr.
12286         (linux_resume): Use linux_continue_one_thread.
12287         * server.c (handle_v_cont, handle_v_requests): New functions.
12288         (myresume): New function.
12289         (main): Handle 'v' case.
12290         * target.h (struct thread_resume): New type.
12291         (struct target_ops): Change argument of "resume" to struct
12292         thread_resume *.
12293         (myresume): Delete macro.
12294
12295 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12296
12297         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12298         (uninstall): Support DESTDIR.
12299
12300 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12301
12302         * configure.srv: Add xscale*linux copy of arm*linux entry.
12303
12304 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12305
12306         * linux-arm-low.c (arm_reinsert_addr): New function.
12307         (the_low_target): Add arm_reinsert_addr.
12308
12309 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12310
12311         * mem-break.c: Remove whitespace at end of file.
12312
12313 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12314
12315         * configure.in: Check whether we need to prototype strerror.
12316         * server.h: Optionally prototype strerror.
12317         * gdbreplay.c (perror_with_name): Use strerror.
12318         * linux-low.c (linux_attach_lwp): Use strerror.
12319         * utils.c (perror_with_name): Use strerror.
12320         * config.in, configure: Regenerated.
12321
12322 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12323
12324         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12325         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12326
12327 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12328
12329         * Makefile.in (SFILES): Update.
12330         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12331         low-sun3.c: Remove files.
12332
12333 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12334
12335         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12336         (linux_detach_one_process, linux_detach): New functions.
12337         (linux_target_ops): Add linux_detach.
12338         * server.c (main): Handle 'D' packet.
12339         * target.h (struct target_ops): Add "detach" member.
12340         (detach_inferior): Define.
12341
12342 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12343
12344         From Kelley Cook  <kelleycook@wideopenwest.com>:
12345         * configure.srv: Accept i[34567]86 variants.
12346
12347 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12348
12349         * linux-low.c (linux_wait_for_event): Correct comment typos.
12350         (linux_resume_one_process): Call check_removed_breakpoint.
12351         (linux_send_signal): New function.
12352         (linux_target_ops): Add linux_send_signal.
12353         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12354         of kill.
12355         * target.h (struct target_ops): Add send_signal.
12356
12357 2003-05-29  Jim Blandy  <jimb@redhat.com>
12358
12359         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12360         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12361         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12362         away part of the register's value.
12363
12364 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12365
12366         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12367         (linux_wait_for_event, linux_init_signals): Likewise.
12368
12369 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12370
12371         * configure.in: Check for stdlib.h.
12372         * configure: Regenerated.
12373         * config.in: Regenerated.
12374
12375 2003-01-04  Andreas Schwab  <schwab@suse.de>
12376
12377         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12378
12379 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12380
12381         * Makefile.in: Remove obsolete code.
12382
12383 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12384
12385         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12386         defined(PT_FPR0_HI).
12387
12388 2002-11-17  Stuart Hughes  <seh@zee2.com>
12389
12390         * linux-arm-low.c (arm_num_regs): Increase.
12391         (arm_regmap): Include status register.
12392
12393 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
12394
12395         * linux-low.c (register_addr): Remove incorrect -1 check.
12396
12397 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
12398
12399         * linux-low.c (linux_create_inferior): Call setpgid.  Return
12400         the new PID.
12401         (unstopped_p, linux_signal_pid): Remove.
12402         (linux_target_ops): Remove linux_signal_pid.
12403         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
12404         global instead of target method.
12405         * target.h (struct target_ops): Remove signal_pid.  Update comment
12406         for create_inferior.
12407         * server.c (signal_pid): New variable.
12408         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
12409         gdbserver.  Set the child to be the foreground process group.
12410         (attach_inferior): Set signal_pid.
12411
12412 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
12413
12414         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
12415
12416 2002-08-20  Jim Blandy  <jimb@redhat.com>
12417
12418         * Makefile.in (LDFLAGS): Allow the configure script to establish a
12419         default for this.
12420
12421 2002-08-01  Andrew Cagney  <cagney@redhat.com>
12422
12423         * Makefile.in: Make chill references obsolete.
12424
12425 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
12426
12427         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
12428         * configure: Regenerate.
12429         * config.in: Regenerate.
12430
12431 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
12432
12433         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
12434         (perror_with_name, remote_close, remote_open, expect, play): Static.
12435
12436 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
12437
12438         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
12439         byte offsets instead of an array of indexes.
12440         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
12441
12442 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
12443
12444         * regcache.c: Add comment.
12445
12446 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
12447
12448         * thread-db.c: New file.
12449         * proc-service.c: New file.
12450         * acinclude.m4: New file.
12451         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
12452         proc-service.o, and thread-db.o.
12453         (linux-low.o): Add USE_THREAD_DB.
12454         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
12455         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
12456         * aclocal.m4: Regenerated.
12457         * config.in: Regenerated.
12458         * configure: Regenerated.
12459         * configure.in: Check for proc_service.h, sys/procfs.h,
12460         thread_db.h, and linux/elf.h headrs.
12461         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
12462         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
12463         Check for -lthread_db and thread support.
12464         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
12465         PowerPC, and SuperH.
12466         * i387-fp.c: Constify arguments.
12467         * i387-fp.h: Likewise.
12468         * inferiors.c: (struct thread_info): Renamed from
12469         `struct inferior_info'.  Remove PID member.  Use generic inferior
12470         list header.  All uses updated.
12471         (inferiors, signal_pid): Removed.
12472         (all_threads): New variable.
12473         (get_thread): Define.
12474         (add_inferior_to_list): New function.
12475         (for_each_inferior): New function.
12476         (change_inferior_id): New function.
12477         (add_inferior): Removed.
12478         (remove_inferior): New function.
12479         (add_thread): New function.
12480         (free_one_thread): New function.
12481         (remove_thread): New function.
12482         (clear_inferiors): Use for_each_inferior and free_one_thread.
12483         (find_inferior): New function.
12484         (find_inferior_id): New function.
12485         (inferior_target_data): Update argument type.
12486         (set_inferior_target_data): Likewise.
12487         (inferior_regcache_data): Likewise.
12488         (set_inferior_regcache_data): Likewise.
12489         * linux-low.c (linux_bp_reinsert): Remove.
12490         (all_processes, stopping_threads, using_thrads)
12491         (struct pending_signals, debug_threads, pid_of): New.
12492         (inferior_pid): Replace with macro.
12493         (struct inferior_linux_data): Remove.
12494         (get_stop_pc, add_process): New functions.
12495         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
12496         Use add_process and add_thread.
12497         (linux_attach_lwp): New function, based on old linux_attach.  Use
12498         add_process and add_thread.  Set stop_expected for new threads.
12499         (linux_attach): New function.
12500         (linux_kill_one_process): New function.
12501         (linux_kill): Kill all LWPs.
12502         (linux_thread_alive): Use find_inferior_id.
12503         (check_removed_breakpoints, status_pending_p): New functions.
12504         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
12505         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
12506         struct for the found process.
12507         (linux_wait_for_event): New function.
12508         (linux_wait): Use it.  Support LWPs.
12509         (send_sigstop, wait_for_sigstop, stop_all_processes)
12510         (linux_resume_one_process, linux_continue_one_process): New functions.
12511         (linux_resume): Support LWPs.
12512         (REGISTER_RAW_SIZE): Remove.
12513         (fetch_register): Use register_size instead.  Call supply_register.
12514         (usr_store_inferior_registers): Likewise.  Call collect_register.
12515         Fix recursive case.
12516         (regsets_fetch_inferior_registers): Improve error message.
12517         (regsets_store_inferior_registers): Add debugging.
12518         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
12519         (unstopped_p, linux_signal_pid): New functions.
12520         (linux_target_ops): Add linux_signal_pid.
12521         (linux_init_signals): New function.
12522         (initialize_low): Call it.  Initialize using_threads.
12523         * regcache.c (inferior_regcache_data): Add valid
12524         flag.
12525         (get_regcache): Fetch registers lazily.  Add fetch argument
12526         and update all callers.
12527         (regcache_invalidate_one, regcache_invalidate): New
12528         functions.
12529         (new_register_cache): Renamed from create_register_cache.
12530         Return the new regcache.
12531         (free_register_cache): Change argument to a void *.
12532         (registers_to_string, registers_from_string): Call get_regcache
12533         with fetch flag set.
12534         (register_data): Make static.  Pass fetch flag to get_regcache.
12535         (supply_register): Call get_regcache with fetch flag clear.
12536         (collect_register): Call get_regcache with fetch flag set.
12537         (collect_register_as_string): New function.
12538         * regcache.h: Update.
12539         * remote-utils.c (putpkt): Flush after debug output and use
12540         stderr.
12541         Handle input interrupts while waiting for an ACK.
12542         (input_interrupt): Use signal_pid method.
12543         (getpkt): Flush after debug output and use stderr.
12544         (outreg): Use collect_register_as_string.
12545         (new_thread_notify, dead_thread_notify): New functions.
12546         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
12547         and general_thread.
12548         (look_up_one_symbol): Flush after debug output.
12549         * server.c (step_thread, server_waiting): New variables.
12550         (start_inferior): Don't use signal_pid.  Update call to mywait.
12551         (attach_inferior): Update call to mywait.
12552         (handle_query): Handle qfThreadInfo and qsThreadInfo.
12553         (main): Don't fetch/store registers explicitly.  Use
12554         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
12555         calls to mywait.
12556         * server.h: Update.
12557         (struct inferior_list, struct_inferior_list_entry): New.
12558         * target.c (set_desired_inferior): New.
12559         (write_inferior_memory): Constify.
12560         (mywait): New function.
12561         * target.h: Update.
12562         (struct target_ops): New signal_pid method.
12563         (mywait): Removed macro, added prototype.
12564
12565         * linux-low.h (regset_func): Removed.
12566         (regset_fill_func, regset_store_func): New.
12567         (enum regset_type): New.
12568         (struct regset_info): Add type field.  Use new operation types.
12569         (struct linux_target_ops): stop_pc renamed to get_pc.
12570         Add decr_pc_after_break and breakpoint_at.
12571         (get_process, get_thread_proess, get_process_thread)
12572         (strut process_info, all_processes, linux_attach_lwp)
12573         (thread_db_init): New.
12574
12575         * linux-arm-low.c (arm_get_pc, arm_set_pc,
12576         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
12577         (the_low_target): Add new members.
12578         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
12579         (i386_store_fpxregset): Constify.
12580         (target_regsets): Add new kind identifier.
12581         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
12582         (i386_set_pc): Add debugging.
12583         (i386_breakpoint_at): New function.
12584         (the_low_target): Add new members.
12585         * linux-mips-low.c (mips_get_pc, mips_set_pc)
12586         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
12587         (mips_breakpoint_at): New.
12588         (the_low_target): Add new members.
12589         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
12590         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
12591         (the_low_target): Add new members.
12592         * linux-sh-low.c (sh_get_pc, sh_set_pc)
12593         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
12594         (the_low_target): Add new members.
12595         * linux-x86-64-low.c (target_regsets): Add new kind
12596         identifier.
12597
12598 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
12599
12600         From Martin Pool <mbp@samba.org>:
12601         * server.c (gdbserver_usage): New function.
12602         (main): Call it.
12603
12604 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
12605
12606         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
12607         stop_at -> stop_pc.
12608
12609 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
12610
12611         * Makefile.in: Remove obsolete code.
12612
12613 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
12614
12615         * linux-low.c (regsets_fetch_inferior_registers),
12616         (regsets_store_inferior_registers): Removed cast to int from
12617         ptrace() calls.
12618         * regcache.h: Added declaration of struct inferior_info.
12619
12620 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12621
12622         * inferiors.c (struct inferior_info): Add regcache_data.
12623         (add_inferior): Call create_register_cache.
12624         (clear_inferiors): Call free_register_cache.
12625         (inferior_regcache_data, set_inferior_regcache_data): New functions.
12626         * regcache.c (struct inferior_regcache_data): New.
12627         (registers): Remove.
12628         (get_regcache): New function.
12629         (create_register_cache, free_register_cache): New functions.
12630         (set_register_cache): Don't initialize the register cache here.
12631         (registers_to_string, registers_from_string, register_data): Call
12632         get_regcache.
12633         * regcache.h: Add prototypes.
12634         * server.h: Likewise.
12635
12636 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12637
12638         * mem-break.c: New file.
12639         * mem-break.h: New file.
12640         * Makefile.in: Add mem-break.o rule; update server.h
12641         dependencies.
12642         * inferiors.c (struct inferior_info): Add target_data
12643         member.
12644         (clear_inferiors): Free target_data member if set.
12645         (inferior_target_data, set_inferior_target_data): New functions.
12646         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
12647         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
12648         * linux-low.c (linux_bp_reinsert): New variable.
12649         (struct inferior_linux_data): New.
12650         (linux_create_inferior): Use set_inferior_target_data.
12651         (linux_attach): Likewise.  Call add_inferior.
12652         (linux_wait_for_one_inferior): New function.
12653         (linux_wait): Call it.
12654         (linux_write_memory): Add const.
12655         (initialize_low): Call set_breakpoint_data.
12656         * linux-low.h (struct linux_target_ops): Add breakpoint
12657         handling members.
12658         * server.c (attach_inferior): Remove extra add_inferior
12659         call.
12660         * server.h: Include mem-break.h.  Update inferior.c
12661         prototypes.
12662         * target.c (read_inferior_memory)
12663         (write_inferior_memory): New functions.
12664         * target.h (read_inferior_memory)
12665         (write_inferior_memory): Change macros to prototypes.
12666         (struct target_ops): Update comments.  Add const to write_memory
12667         definition.
12668
12669 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
12670
12671         * linux-low.c (usr_store_inferior_registers): Support
12672         registers which are allowed to fail to store.
12673         * linux-low.h (linux_target_ops): Likewise.
12674         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
12675         (ppc_cannot_store_register): FPSCR may not be storable.
12676
12677 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12678
12679         * server.h: Include <string.h> if HAVE_STRING_H.
12680         * ChangeLog: Correct paths in last ChangeLog entry.
12681
12682 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12683
12684         * linux-low.h: Remove obsolete prototypes.
12685         (struct linux_target_ops): New.
12686         (extern the_low_target): New.
12687         * linux-low.c (num_regs, regmap): Remove declarations.
12688         (register_addr): Use the_low_target explicitly.
12689         (fetch_register): Likewise.
12690         (usr_fetch_inferior_registers): Likewise.
12691         (usr_store_inferior_registers): Likewise.
12692         * linux-arm-low.c (num_regs): Remove.
12693         (arm_num_regs): Define.
12694         (arm_regmap): Renamed from regmap, made static.
12695         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
12696         made static.
12697         (arm_cannot_store_register): Renamed from cannot_store_register,
12698         made static.
12699         (the_low_target): New.
12700         * linux-i386-low.c (num_regs): Remove.
12701         (i386_num_regs): Define.
12702         (i386_regmap): Renamed from regmap, made static.
12703         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
12704         made static.
12705         (i386_cannot_store_register): Renamed from cannot_store_register,
12706         made static.
12707         (the_low_target): New.
12708         * linux-ia64-low.c (num_regs): Remove.
12709         (ia64_num_regs): Define.
12710         (ia64_regmap): Renamed from regmap, made static.
12711         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
12712         made static.
12713         (ia64_cannot_store_register): Renamed from cannot_store_register,
12714         made static.
12715         (the_low_target): New.
12716         * linux-m68k-low.c (num_regs): Remove.
12717         (m68k_num_regs): Define.
12718         (m68k_regmap): Renamed from regmap, made static.
12719         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
12720         made static.
12721         (m68k_cannot_store_register): Renamed from cannot_store_register,
12722         made static.
12723         (the_low_target): New.
12724         * linux-mips-low.c (num_regs): Remove.
12725         (mips_num_regs): Define.
12726         (mips_regmap): Renamed from regmap, made static.
12727         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
12728         made static.
12729         (mips_cannot_store_register): Renamed from cannot_store_register,
12730         made static.
12731         (the_low_target): New.
12732         * linux-ppc-low.c (num_regs): Remove.
12733         (ppc_num_regs): Define.
12734         (ppc_regmap): Renamed from regmap, made static.
12735         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
12736         made static.
12737         (ppc_cannot_store_register): Renamed from cannot_store_register,
12738         made static.
12739         (the_low_target): New.
12740         * linux-s390-low.c (num_regs): Remove.
12741         (s390_num_regs): Define.
12742         (s390_regmap): Renamed from regmap, made static.
12743         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
12744         made static.
12745         (s390_cannot_store_register): Renamed from cannot_store_register,
12746         made static.
12747         (the_low_target): New.
12748         * linux-sh-low.c (num_regs): Remove.
12749         (sh_num_regs): Define.
12750         (sh_regmap): Renamed from regmap, made static.
12751         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
12752         made static.
12753         (sh_cannot_store_register): Renamed from cannot_store_register,
12754         made static.
12755         (the_low_target): New.
12756         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
12757         (the_low_target): New.
12758
12759 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12760
12761         * Makefile.in: Add stamp-h target.
12762         * configure.in: Create stamp-h.
12763         * configure: Regenerated.
12764
12765 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12766
12767         * inferiors.c: New file.
12768         * target.c: New file.
12769         * target.h: New file.
12770         * Makefile.in:  Add target.o and inferiors.o.  Update
12771         dependencies.
12772         * linux-low.c (inferior_pid): New static variable,
12773         moved from server.c.
12774         (linux_create_inferior): Renamed from create_inferior.
12775         Call add_inferior.  Return 0 on success instead of a PID.
12776         (linux_attach): Renamed from myattach.
12777         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
12778         (linux_thread_alive): Renamed from mythread_alive.
12779         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
12780         child dies.
12781         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
12782         (regsets_store_inferior_registers): Correct error message.
12783         Add missing ``return 0''.
12784         (linux_fetch_registers): Renamed from fetch_inferior_registers.
12785         (linux_store_registers): Renamed from store_inferior_registers.
12786         (linux_read_memory): Renamed from read_inferior_memory.
12787         (linux_write_memory): Renamed from write_inferior_memory.
12788         (linux_target_ops): New structure.
12789         (initialize_low): Call set_target_ops ().
12790         * remote-utils.c (unhexify): New function.
12791         (hexify): New function.
12792         (input_interrupt): Send signals to ``signal_pid''.
12793         * server.c (inferior_pid): Remove.
12794         (start_inferior): Update create_inferior call.
12795         (attach_inferior): Call add_inferior.
12796         (handle_query): New function.
12797         (main): Call handle_query for `q' packets.
12798         * server.h: Include "target.h".  Remove obsolete prototypes.
12799         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
12800
12801 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12802
12803         * Makefile.in: Add WARN_CFLAGS.  Update configury
12804         dependencies.
12805         * configure.in: Check for <string.h>
12806         * configure: Regenerate.
12807         * config.in: Regenerate.
12808         * gdbreplay.c: Include needed system headers.
12809         (remote_open): Remove strchr prototype.
12810         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
12811         * regcache.c (supply_register): Change buf argument to const void *.
12812         (supply_register_by_name): Likewise.
12813         (collect_register): Change buf argument to void *.
12814         (collect_register_by_name): Likewise.
12815         * regcache.h: Add missing prototypes.
12816         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
12817         * server.c (handle_query): New function.
12818         (attached): New static variable, moved out of main.
12819         (main): Quiet longjmp clobber warnings.
12820         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
12821         * utils.c (error): Remove NORETURN.
12822         (fatal): Likewise.