Target remote mode fork and exec event support
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-12-11  Don Breazeal  <donb@codesourcery.com>
2
3         * server.c (process_serial_event): Don't exit from gdbserver
4         in remote mode if there are still active inferiors.
5
6 2015-12-11  Yao Qi  <yao.qi@linaro.org>
7
8         * linux-aarch64-low.c (aarch64_breakpoint_at): Call
9         arm_breakpoint_at if the process is 32-bit.
10
11 2015-12-11  Yao Qi  <yao.qi@linaro.org>
12
13         * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
14         arm breakpoint.
15
16 2015-12-07  Yao Qi  <yao.qi@linaro.org>
17
18         * configure.srv: Append arm.o to srv_tgtobj for
19         aarch64*-*-linux* target.
20         * linux-aarch32-low.c (arm_abi_breakpoint): New macro.  Moved
21         from linux-arm-low.c.
22         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
23         (arm_breakpoint_len, thumb_breakpoint): Likewise.
24         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
25         (thumb2_breakpoint_len): Likewise.
26         (arm_is_thumb_mode, arm_breakpoint_at): Likewise.
27         (arm_breakpoint_kinds): Likewise.
28         (arm_breakpoint_kind_from_pc): Likewise.
29         (arm_sw_breakpoint_from_kind): Likewise.
30         (arm_breakpoint_kind_from_current_state): Likewise.
31         * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
32         (arm_sw_breakpoint_from_kind): Declare.
33         (arm_breakpoint_kind_from_current_state): Declare.
34         (arm_breakpoint_at): Declare.
35         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
36         arm_sw_breakpoint_from_kind if process is 32-bit.
37         (aarch64_breakpoint_kind_from_pc): New function.
38         (aarch64_breakpoint_kind_from_current_state): New function.
39         (the_low_target): Initialize fields breakpoint_kind_from_pc
40         and breakpoint_kind_from_current_state.
41         * linux-arm-low.c (arm_breakpoint_kinds): Move to
42         linux-aarch32-low.c.
43         (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
44         (arm_breakpoint, arm_breakpoint_len): Likewise.
45         (thumb_breakpoint, thumb_breakpoint_len): Likewise.
46         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
47         (arm_is_thumb_mode): Likewise.
48         (arm_breakpoint_at): Likewise.
49         (arm_breakpoint_kind_from_pc): Likewise.
50         (arm_sw_breakpoint_from_kind): Likewise.
51         (arm_breakpoint_kind_from_current_state): Likewise.
52
53         Revert:
54         2015-08-04  Yao Qi  <yao.qi@linaro.org>
55
56         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
57         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
58         * server.c (extended_protocol): Remove "static".
59         * server.h (extended_protocol): Declare it.
60
61 2015-12-04  Josh Stone  <jistone@redhat.com>
62
63         * target.h (struct target_ops) <arch_setup>: Rename to ...
64         (struct target_ops) <post_create_inferior>: ... this.
65         (target_arch_setup): Rename to ...
66         (target_post_create_inferior): ... this, calling post_create_inferior.
67         * server.c (start_inferior): Update target_arch_setup calls to
68         target_post_create_inferior.
69         * linux-low.c (linux_low_ptrace_options): Forward declare.
70         (linux_arch_setup): Update its comment for general use.
71         (linux_post_create_inferior): New, run arch_setup and setup ptrace.
72         (struct linux_target_ops): Use linux_post_create_inferior.
73         * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
74         to post_create_inferior.
75         * nto-low.c (struct nto_target_ops): Likewise.
76         * spu-low.c (struct spu_target_ops): Likewise.
77         * win32-low.c (struct win32_target_ops): Likewise.
78
79 2015-12-03  Antoine Tremblay  <antoine.tremblay@ericsson.com>
80
81         * linux-arm-low.c: Remove duplicate arch/arm.h include.
82
83 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
84
85         * linux-arm-low.c (arm_reinsert_addr): Remove function.
86         (struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
87         * linux-cris-low.c (cris_reinsert_addr> Remove function.
88         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
89         * linux-crisv32-low.c (cris_reinsert_addr): Remove function.
90         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
91         * linux-mips-low.c (mips_reinsert_addr): Remove function.
92         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
93         * linux-nios2-low.c (nios2_reinsert_addr): Remove function.
94         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
95         * linux-sparc-low.c (sparc_reinsert_addr): Remove function.
96         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
97
98 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
99
100         * linux-low.c (linux_look_up_symbols): Don't call
101         linux_supports_traceclone.
102         * linux-low.h (thread_db_init): Remove use_events argument.
103         * thread-db.c (thread_db_use_event): Remove global variable.
104         (struct thread_db) <td_thr_event_enable_p>: Remove field.
105         (struct thread_db) <td_create_bp>: Remove field.
106         (thread_db_create_event): Remove function.
107         (thread_db_enable_reporting): Likewise.
108         (find_one_thread): Don't check for thread_db_use_events.
109         (attach_thread): Likewise.
110         (thread_db_load_search): Remove td_thr_event_enable_p initialization.
111         (try_thread_db_load_1): Don't check for thread_db_use_events.
112         (thread_db_init): Remove use_events argument and thread events
113         handling.
114         (remove_thread_event_breakpoints): Remove function.
115         (thread_db_detach): Remove call to remove_thred_event_breakpoints.
116
117 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
118
119         * linux-aarch64-low.c (aarch64_supports_hardware_single_step):
120         New function.
121         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
122         * linux-arm-low.c (arm_supports_hardware_single_step): New function.
123         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
124         * linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
125         (struct linux_target_ops) <bfin_supports_hardware_single_step>:
126         Initialize.
127         * linux-crisv32-low.c (cris_supports_hardware_single_step):
128         New function.
129         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
130         * linux-low.c (can_hardware_single_step): Use
131         supports_hardware_single_step.
132         (can_software_single_step): New function.
133         (start_step_over): Call can_software_single_step.
134         (linux_supports_hardware_single_step): New function.
135         (struct target_ops) <supports_software_single_step>: Initialize.
136         * linux-low.h (struct linux_target_ops)
137         <supports_hardware_single_step>: Initialize.
138         * linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
139         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
140         * linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
141         (struct linux_target_ops) <supports_hardware_single_step> Initialize.
142         * linux-s390-low.c (s390_supports_hardware_single_step): New function.
143         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
144         * linux-sh-low.c (sh_supports_hardware_single_step): New function.
145         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
146         * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
147         (struct linux_target_ops) <tic6x_supports_hardware_single_step>:
148         Initialize.
149         * linux-tile-low.c (tile_supports_hardware_single_step): New function.
150         (struct linux_target_ops) <tile_supports_hardware_single_step>:
151         Initialize.
152         * linux-x86-low.c (x86_supports_hardware_single_step) New function.
153         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
154         * linux-xtensa-low.c (xtensa_supports_hardware_single_step):
155         New function.
156         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
157         * target.h (struct target_ops): <supports_software_single_step>:
158         New field.
159         (target_supports_software_single_step): New macro.
160
161 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
162
163         * linux-low.c (linux_wait_1): Fix pc advance condition.
164         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
165         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
166
167 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
168
169         * linux-arm-low.c (arm_is_thumb_mode): New function.
170         (arm_breakpoint_at): Use arm_is_thumb_mode.
171         (arm_breakpoint_kind_from_current_state): New function.
172         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
173         Initialize.
174         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
175         (linux_breakpoint_kind_from_current_state): New function.
176         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
177         * linux-low.h (struct linux_target_ops)
178         <breakpoint_kind_from_current_state>: New field.
179         * target.h (struct target_ops): Likewise.
180         (target_breakpoint_kind_from_current_state): New macro.
181
182 2015-11-30  Pedro Alves  <palves@redhat.com>
183
184         * linux-low.c (linux_resume): Wake up the event loop before
185         returning.
186
187 2015-11-30  Pedro Alves  <palves@redhat.com>
188
189         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
190         check.
191         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
192         to -1.
193         * target.c (struct thread_search): New structure.
194         (thread_search_callback): New function.
195         (prev_general_thread): New global.
196         (prepare_to_access_memory, done_accessing_memory): New functions.
197         * target.h (prepare_to_access_memory, done_accessing_memory):
198         Replace macros with function declarations.
199
200 2015-11-30  Pedro Alves  <palves@redhat.com>
201
202         PR 14618
203         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
204         report TARGET_WAITKIND_NO_RESUMED.
205         * remote-utils.c (prepare_resume_reply): Handle
206         TARGET_WAITKIND_NO_RESUMED.
207         * server.c (report_no_resumed): New global.
208         (handle_query) <qSupported>: Handle "no-resumed+".  Report
209         "no-resumed+" support.
210         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
211         return error if the client doesn't support no-resumed events.
212         (push_stop_notification): New function.
213         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
214         events if the client supports them.
215
216 2015-11-30  Pedro Alves  <palves@redhat.com>
217
218         * linux-low.c (thread_still_has_status_pending_p): Don't check
219         vCont;t here.
220         (lwp_resumed): New function.
221         (status_pending_p_callback): Return early if the LWP is not
222         supposed to be resumed.
223
224 2015-11-30  Pedro Alves  <palves@redhat.com>
225
226         * linux-low.c (handle_extended_wait): Assert that the LWP's
227         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
228         thread create events, leave the new child's status pending.
229         (linux_low_filter_event): If GDB wants to hear about thread exit
230         events, leave the LWP marked dead and don't delete it.
231         (linux_wait_for_event_filtered): Don't check for thread exit.
232         (filter_exit_event): New function.
233         (linux_wait_1): Use it, when returning an exit event.
234         (linux_resume_one_lwp_throw): Assert that the LWP's
235         waitstatus is TARGET_WAITKIND_IGNORE.
236         * remote-utils.c (prepare_resume_reply): Handle
237         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
238         * server.c (report_thread_events): New global.
239         (handle_general_set): Handle QThreadEvents.
240         (handle_query) <qSupported>: Handle and report QThreadEvents+;
241         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
242         TARGET_WAITKIND_THREAD_EXITED.
243         * server.h (report_thread_events): Declare.
244
245 2015-11-30  Pedro Alves  <palves@redhat.com>
246
247         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
248         the thread's last_resume_kind was resume_stop.
249
250 2015-11-30  Pedro Alves  <palves@redhat.com>
251
252         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
253         before returning.
254
255 2015-11-30  Pedro Alves  <palves@redhat.com>
256
257         * server.c (handle_v_requests): Handle vCtrlC.
258
259 2015-11-30  Pedro Alves  <palves@redhat.com>
260
261         * gdbthread.h (find_any_thread_of_pid): Declare.
262         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
263         functions.
264         * server.c (handle_query): If current_thread is NULL, look for
265         another thread of the selected process.
266
267 2015-11-26  Daniel Colascione  <dancol@dancol.org>
268             Simon Marchi  <simon.marchi@ericsson.com>
269
270         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
271         * server.c (handle_qxfer_threads_worker): Refactor to include thread
272         name in reply.
273         * target.h (struct target_ops) <thread_name>: New field.
274         (target_thread_name): New macro.
275
276 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
277
278         * regcache.h (regcache_invalidate_pid): Add declaration.
279         * regcache.c (regcache_invalidate_pid): New function, extracted
280         from regcache_invalidate.
281         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
282         Add trivial documentation comment.
283         * lynx-low.c: Use regcache_invalidate_pid instead of
284         regcache_invalidate.
285
286 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
287
288         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
289         and Elf64_auxv_t if the target is Android.
290
291 2015-11-22  Doug Evans  <xdje42@gmail.com>
292
293         * target.h: #include <sys/types.h>.
294
295 2015-11-19  Pedro Alves  <palves@redhat.com>
296
297         * linux-low.c (linux_process_qsupported): Change prototype.
298         Adjust.
299         * linux-low.h (struct linux_target_ops) <process_qsupported>:
300         Change prototype.
301         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
302         and adjust to loop over all features.
303         * server.c (handle_query) <qSupported>: Adjust to call
304         target_process_qsupported once, passing it a vector of unprocessed
305         features.
306         * target.h (struct target_ops) <process_qsupported>: Change
307         prototype.
308         (target_process_qsupported): Adjust.
309
310 2015-11-19  Pedro Alves  <palves@redhat.com>
311
312         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
313         mode.
314         * configure: Regenerate.
315
316 2015-11-19  Pedro Alves  <palves@redhat.com>
317
318         * configure: Regenerate.
319
320 2015-11-19  Yao Qi  <yao.qi@linaro.org>
321
322         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
323         type to uint32_t.
324
325 2015-11-19  Yao Qi  <yao.qi@linaro.org>
326
327         * linux-aarch64-low.c (enum aarch64_operand_type): New.
328         (struct aarch64_operand): Move enum out.
329
330 2015-11-19  Yao Qi  <yao.qi@linaro.org>
331
332         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
333         struct user_fpsimd_state *.
334         (aarch64_store_fpregset): Likewise.
335
336 2015-11-19  Yao Qi  <yao.qi@linaro.org>
337
338         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
339         struct user_pt_regs *.
340         (aarch64_store_gregset): Likewise.
341
342 2015-11-18  Pedro Alves  <palves@redhat.com>
343
344         * Makefile.in (all_object_files): Add $IPA_OBJS.
345
346 2015-11-17  Pedro Alves  <palves@redhat.com>
347
348         * win32-low.c (win32_resume): Use gdb_signal_from_host,
349         GDB_SIGNAL_0 and gdb_signal_to_string.
350
351 2015-11-17  Pedro Alves  <palves@redhat.com>
352
353         * win32-low.c (handle_output_debug_string): Remove parameter.
354         (win32_kill): Remove our_status local and adjust call to
355         handle_output_debug_string.
356         (get_child_debug_event): Adjust call to
357         handle_output_debug_string.
358
359 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
360
361         * linux-mips-low.c (mips_fill_gregset): Add cast.
362         (mips_store_gregset): Likewise.
363         (mips_fill_fpregset): Likewise.
364         (mips_store_fpregset): Likewise.
365
366 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
367
368         * linux-mips-low.c (mips_add_watchpoint): Rename private to
369         priv.
370
371 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
372
373         * linux-mips-low.c (mips_linux_new_thread): Change type of
374         watch_type to enum target_hw_bp_type.
375
376 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
377
378                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
379                 Change return type to arm_hwbp_type.
380
381 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
382
383         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
384         (arm_store_gregset): Likewise.
385         * linux-arm-low.c (arm_get_hwcap): Likewise.
386         (arm_read_description): Likewise.
387
388 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
389
390         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
391
392 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
393
394         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
395         (ppc_fill_vsxregset): Likewise.
396         (ppc_store_vsxregset): Likewise.
397         (ppc_fill_vrregset): Likewise.
398         (ppc_store_vrregset): Likewise.
399         (ppc_fill_evrregset): Likewise.
400         (ppc_store_evrregset): Likewise.
401
402 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
403
404         * linux-ppc-low.c (ppc_usrregs_info): Remove
405         forward-declaration.
406         (ppc_arch_setup): Move lower in file.
407
408 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
409
410         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
411         (ps_pdwrite): Likewise.
412
413 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
414
415         * linux-arm-low.c (arm_new_thread): Move pointer dereference
416         to after assert checks.
417
418 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
419
420         * proc-service.c (ps_pdread): Add/adjust casts.
421         (ps_pdwrite): Add/adjust casts.
422
423 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
424
425         * server.c (handle_search_memory_1): Cast return value of
426         memmem.
427
428 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
429
430         * server.c (write_qxfer_response): Change type of data to
431         gdb_byte *.
432
433 2015-10-29  Pedro Alves  <palves@redhat.com>
434
435         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
436
437 2015-10-29  Pedro Alves  <palves@redhat.com>
438
439         * tracepoint.c (clear_installed_tracepoints): Add casts.
440
441 2015-10-29  Pedro Alves  <palves@redhat.com>
442
443         * server.c (handle_v_cont, process_serial_event): Add enum
444         gdb_signal casts to signal parsing code.
445
446 2015-10-29  Pedro Alves  <palves@redhat.com>
447
448         * linux-low.h (NULL_REGSET): Define.
449         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
450         * linux-arm-low.c (arm_regsets): Likewise.
451         * linux-crisv32-low.c (cris_regsets): Likewise.
452         * linux-m68k-low.c (m68k_regsets): Likewise.
453         * linux-mips-low.c (mips_regsets): Likewise.
454         * linux-nios2-low.c (nios2_regsets): Likewise.
455         * linux-ppc-low.c (ppc_regsets): Likewise.
456         * linux-s390-low.c (s390_regsets): Likewise.
457         * linux-sh-low.c (sh_regsets): Likewise.
458         * linux-sparc-low.c (sparc_regsets): Likewise.
459         * linux-tic6x-low.c (tic6x_regsets): Likewise.
460         * linux-tile-low.c (tile_regsets): Likewise.
461         * linux-x86-low.c (x86_regsets): Likewise.
462         * linux-xtensa-low.c (xtensa_regsets): Likewise.
463
464 2015-10-29  Pedro Alves  <palves@redhat.com>
465
466         * linux-low.h (NULL_REGSET): Define.
467         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
468         * linux-arm-low.c (arm_regsets): Likewise.
469         * linux-crisv32-low.c (cris_regsets): Likewise.
470         * linux-m68k-low.c (m68k_regsets): Likewise.
471         * linux-mips-low.c (mips_regsets): Likewise.
472         * linux-nios2-low.c (nios2_regsets): Likewise.
473         * linux-ppc-low.c (ppc_regsets): Likewise.
474         * linux-s390-low.c (s390_regsets): Likewise.
475         * linux-sh-low.c (sh_regsets): Likewise.
476         * linux-sparc-low.c (sparc_regsets): Likewise.
477         * linux-tic6x-low.c (tic6x_regsets): Likewise.
478         * linux-tile-low.c (tile_regsets): Likewise.
479         * linux-x86-low.c (x86_regsets): Likewise.
480         * linux-xtensa-low.c (xtensa_regsets): Likewise.
481
482 2015-10-26  Doug Evans  <dje@google.com>
483
484         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
485
486 2015-10-26  Doug Evans  <dje@google.com>
487
488         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
489
490 2015-10-26  Doug Evans  <dje@google.com>
491
492         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
493         for debug_printf.
494         (attach_thread, find_new_threads_callback): Ditto.
495
496 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
497
498         * mem-break.h (set_breakpoint_data): Remove.
499
500 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
501
502         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
503         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
504         (initialize_low): Remove set_breakpoint_data call.
505         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
506         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
507         (initialize_low): Remove set_breakpoint_data call.
508         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
509         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
510         (initialize_low): Remove set_breakpoint_data call.
511
512 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
513
514         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
515         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
516         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
517         * target.h (target_breakpoint_kind_from_pc): New macro.
518
519 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
520
521         * linux-low.c (default_breakpoint_kind_from_pc): New function.
522         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
523         the default breakpoint kind.
524
525 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
526
527         * linux-arm-low.c (arm_supports_z_point_type): Add software
528         breakpoint support.
529
530 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
531
532         * linux-arm-low.c: Refactor breakpoint definitions.
533         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
534         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
535
536 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
537
538         * Makefile.in: Add arm.c/o.
539         * configure.srv: Likewise.
540         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
541         (arm_breakpoint_kind_from_pc): New function.
542         (arm_sw_breakpoint_from_kind): Return proper kind.
543         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
544
545 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
546
547         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
548         removal.
549         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
550         (struct raw_breakpoint) <size>: Remove.
551         (struct raw_breakpoint) <kind>: Add.
552         (bp_size): New function.
553         (bp_opcode): Likewise.
554         (find_raw_breakpoint_at): Adjust for kind.
555         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
556         (remove_memory_breakpoint): Adjust for kind call bp_size.
557         (set_raw_breakpoint_at): Adjust for kind.
558         (set_breakpoint): Likewise.
559         (set_breakpoint_at): Call breakpoint_kind_from_pc.
560         (delete_raw_breakpoint): Adjust for kind.
561         (delete_breakpoint): Likewise.
562         (find_gdb_breakpoint): Likewise.
563         (set_gdb_breakpoint_1): Likewise.
564         (set_gdb_breakpoint): Likewise.
565         (delete_gdb_breakpoint_1): Likewise.
566         (delete_gdb_breakpoint): Likewise.
567         (uninsert_raw_breakpoint): Likewise.
568         (reinsert_raw_breakpoint): Likewise.
569         (set_breakpoint_data): Remove.
570         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
571         (check_mem_read): Adjust for kind call bp_size.
572         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
573         (clone_one_breakpoint): Adjust for kind.
574         * mem-break.h (set_gdb_breakpoint): Likewise.
575         (delete_gdb_breakpoint): Likewise.
576         * server.c (process_serial_event): Likewise.
577
578 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
579
580         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
581         (struct linux_target_ops) <breakpoint>: Remove.
582         (struct linux_target_ops) <breakpoint_len>: Remove.
583         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
584         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
585         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
586         (arm_sw_breakpoint_from_kind): New function.
587         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
588         (struct linux_target_ops) <breakpoint>: Remove.
589         (struct linux_target_ops) <breakpoint_len>: Remove.
590         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
591         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
592         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
593         (struct linux_target_ops) <breakpoint>: Remove.
594         (struct linux_target_ops) <breakpoint_len>: Remove.
595         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
596         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
597         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
598         (struct linux_target_ops) <breakpoint>: Remove.
599         (struct linux_target_ops) <breakpoint_len>: Remove.
600         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
601         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
602         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
603         and sw_breakpoint_from_kind to increment the pc.
604         (linux_breakpoint_kind_from_pc): New function.
605         (linux_sw_breakpoint_from_kind): New function.
606         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
607         (initialize_low): Call breakpoint_kind_from_pc and
608         sw_breakpoint_from_kind to replace breakpoint_data/len.
609         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
610         New field.
611         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
612         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
613         (struct linux_target_ops) <breakpoint>: Remove.
614         (struct linux_target_ops) <breakpoint_len>: Remove.
615         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
616         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
617         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
618         (struct linux_target_ops) <breakpoint>: Remove.
619         (struct linux_target_ops) <breakpoint_len>: Remove.
620         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
621         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
622         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
623         (struct linux_target_ops) <breakpoint>: Remove.
624         (struct linux_target_ops) <breakpoint_len>: Remove.
625         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
626         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
627         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
628         (struct linux_target_ops) <breakpoint>: Remove.
629         (struct linux_target_ops) <breakpoint_len>: Remove.
630         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
631         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
632         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
633         (struct linux_target_ops) <breakpoint>: Remove.
634         (struct linux_target_ops) <breakpoint_len>: Remove.
635         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
636         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
637         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
638         (struct linux_target_ops) <breakpoint>: Remove.
639         (struct linux_target_ops) <breakpoint_len>: Remove.
640         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
641         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
642         * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
643         (struct linux_target_ops) <breakpoint>: Remove.
644         (struct linux_target_ops) <breakpoint_len>: Remove.
645         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
646         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
647         * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
648         (struct linux_target_ops) <breakpoint>: Remove.
649         (struct linux_target_ops) <breakpoint_len>: Remove.
650         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
651         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
652         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
653         (struct linux_target_ops) <breakpoint>: Remove.
654         (struct linux_target_ops) <breakpoint_len>: Remove.
655         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
656         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
657         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
658         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
659         (struct linux_target_ops) <breakpoint>: Remove.
660         (struct linux_target_ops) <breakpoint_len>: Remove.
661         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
662         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
663         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
664         (struct linux_target_ops) <breakpoint>: Remove.
665         (struct linux_target_ops) <breakpoint_len>: Remove.
666         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
667         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
668
669 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
670
671         * linux-cris-low.c (cris_get_pc): Remove void arg.
672
673 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
674
675         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
676         variable name.
677
678 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
679
680         * inferiors.c (thread_pid_matches_callback): New function.
681         (find_thread_process): New function.
682         (remove_thread): Reset current_thread.
683         (remove_process): Assert threads have been removed first.
684
685 2015-10-15  Yao Qi  <yao.qi@linaro.org>
686
687         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
688         if it is 3.
689         (aarch64_remove_point): Likewise.
690         * regcache.c (regcache_register_size): New function.
691
692 2015-10-12  Yao Qi  <yao.qi@linaro.org>
693
694         * linux-aarch64-low.c: Update all callers as emit_load_store
695         is renamed to aarch64_emit_load_store.
696
697 2015-10-12  Yao Qi  <yao.qi@linaro.org>
698
699         * linux-aarch64-low.c: Update all callers of function renaming
700         from emit_insn to aarch64_emit_insn.
701
702 2015-10-12  Yao Qi  <yao.qi@linaro.org>
703
704         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
705         arch/aarch64-insn.h.
706         (struct aarch64_memory_operand): Likewise.
707         (ENCODE): Likewise.
708         (emit_insn): Move to arch/aarch64-insn.c.
709         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
710         (emit_load_store): Move to arch/aarch64-insn.c.
711         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
712         (can_encode_int32): Remove.
713
714 2015-10-12  Yao Qi  <yao.qi@linaro.org>
715
716         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
717         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
718         (aarch64_relocate_instruction): Likewise.
719         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
720         (struct aarch64_insn_visitor): Likewise.
721
722 2015-10-12  Yao Qi  <yao.qi@linaro.org>
723
724         * linux-aarch64-low.c (struct aarch64_insn_data): New.
725         (struct aarch64_insn_visitor): New.
726         (struct aarch64_insn_relocation_data): New.
727         (aarch64_ftrace_insn_reloc_b): New function.
728         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
729         (aarch64_ftrace_insn_reloc_cb): Likewise.
730         (aarch64_ftrace_insn_reloc_tb): Likewise.
731         (aarch64_ftrace_insn_reloc_adr): Likewise.
732         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
733         (aarch64_ftrace_insn_reloc_others): Likewise.
734         (visitor): New.
735         (aarch64_relocate_instruction): Use visitor.
736
737 2015-10-12  Yao Qi  <yao.qi@linaro.org>
738
739         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
740         int.  Add argument buf.
741         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
742         aarch64_relocate_instruction.
743
744 2015-10-12  Yao Qi  <yao.qi@linaro.org>
745
746         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
747         argument insn.  Remove local variable insn.  Don't call
748         target_read_uint32.
749         (aarch64_install_fast_tracepoint_jump_pad): Call
750         target_read_uint32.
751
752 2015-09-30  Yao Qi  <yao.qi@linaro.org>
753
754         * linux-aarch64-low.c (emit_movk): Shorten a long line.
755         (emit_load_store_pair): Likewise.
756
757 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
758
759         * dll.c (match_dll): Add cast(s).
760         (unloaded_dll): Likewise.
761         * linux-low.c (second_thread_of_pid_p): Likewise.
762         (delete_lwp_callback): Likewise.
763         (count_events_callback): Likewise.
764         (select_event_lwp_callback): Likewise.
765         (linux_set_resume_request): Likewise.
766         * server.c (accumulate_file_name_length): Likewise.
767         (emit_dll_description): Likewise.
768         (handle_qxfer_threads_worker): Likewise.
769         (visit_actioned_threads): Likewise.
770         * thread-db.c (any_thread_of): Likewise.
771         * tracepoint.c (same_process_p): Likewise.
772         (match_blocktype): Likewise.
773         (build_traceframe_info_xml): Likewise.
774
775 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
776
777         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
778         assignment.
779         (gdb_unparse_agent_expr): Likewise.
780         * hostio.c (require_data): Likewise.
781         (handle_pread): Likewise.
782         * linux-low.c (disable_regset): Likewise.
783         (fetch_register): Likewise.
784         (store_register): Likewise.
785         (get_dynamic): Likewise.
786         (linux_qxfer_libraries_svr4): Likewise.
787         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
788         (set_fast_tracepoint_jump): Likewise.
789         (uninsert_fast_tracepoint_jumps_at): Likewise.
790         (reinsert_fast_tracepoint_jumps_at): Likewise.
791         (validate_inserted_breakpoint): Likewise.
792         (clone_agent_expr): Likewise.
793         * regcache.c (init_register_cache): Likewise.
794         * remote-utils.c (putpkt_binary_1): Likewise.
795         (decode_M_packet): Likewise.
796         (decode_X_packet): Likewise.
797         (look_up_one_symbol): Likewise.
798         (relocate_instruction): Likewise.
799         (monitor_output): Likewise.
800         * server.c (handle_search_memory): Likewise.
801         (handle_qxfer_exec_file): Likewise.
802         (handle_qxfer_libraries): Likewise.
803         (handle_qxfer): Likewise.
804         (handle_query): Likewise.
805         (handle_v_cont): Likewise.
806         (handle_v_run): Likewise.
807         (captured_main): Likewise.
808         * target.c (write_inferior_memory): Likewise.
809         * thread-db.c (try_thread_db_load_from_dir): Likewise.
810         * tracepoint.c (init_trace_buffer): Likewise.
811         (add_tracepoint_action): Likewise.
812         (add_traceframe): Likewise.
813         (add_traceframe_block): Likewise.
814         (cmd_qtdpsrc): Likewise.
815         (cmd_qtdv): Likewise.
816         (cmd_qtstatus): Likewise.
817         (response_source): Likewise.
818         (response_tsv): Likewise.
819         (cmd_qtnotes): Likewise.
820         (gdb_collect): Likewise.
821         (initialize_tracepoint): Likewise.
822
823 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
824
825         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
826         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
827         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
828         <NOP>: New.
829         (enum aarch64_condition_codes): New enum.
830         (w0): New static global.
831         (fp): Likewise.
832         (lr): Likewise.
833         (struct aarch64_memory_operand) <type>: New
834         MEMORY_OPERAND_POSTINDEX type.
835         (postindex_memory_operand): New helper function.
836         (emit_ret): New function.
837         (emit_load_store_pair): New function, factored out of emit_stp
838         with support for MEMORY_OPERAND_POSTINDEX.
839         (emit_stp): Rewrite using emit_load_store_pair.
840         (emit_ldp): New function.
841         (emit_load_store): Likewise.
842         (emit_ldr): Mention post-index instruction in comment.
843         (emit_ldrh): New function.
844         (emit_ldrb): New function.
845         (emit_ldrsw): Mention post-index instruction in comment.
846         (emit_str): Likewise.
847         (emit_subs): New function.
848         (emit_cmp): Likewise.
849         (emit_and): Likewise.
850         (emit_orr): Likewise.
851         (emit_orn): Likewise.
852         (emit_eor): Likewise.
853         (emit_mvn): Likewise.
854         (emit_lslv): Likewise.
855         (emit_lsrv): Likewise.
856         (emit_asrv): Likewise.
857         (emit_mul): Likewise.
858         (emit_sbfm): Likewise.
859         (emit_sbfx): Likewise.
860         (emit_ubfm): Likewise.
861         (emit_ubfx): Likewise.
862         (emit_csinc): Likewise.
863         (emit_cset): Likewise.
864         (emit_nop): Likewise.
865         (emit_ops_insns): New helper function.
866         (emit_pop): Likewise.
867         (emit_push): Likewise.
868         (aarch64_emit_prologue): New function.
869         (aarch64_emit_epilogue): Likewise.
870         (aarch64_emit_add): Likewise.
871         (aarch64_emit_sub): Likewise.
872         (aarch64_emit_mul): Likewise.
873         (aarch64_emit_lsh): Likewise.
874         (aarch64_emit_rsh_signed): Likewise.
875         (aarch64_emit_rsh_unsigned): Likewise.
876         (aarch64_emit_ext): Likewise.
877         (aarch64_emit_log_not): Likewise.
878         (aarch64_emit_bit_and): Likewise.
879         (aarch64_emit_bit_or): Likewise.
880         (aarch64_emit_bit_xor): Likewise.
881         (aarch64_emit_bit_not): Likewise.
882         (aarch64_emit_equal): Likewise.
883         (aarch64_emit_less_signed): Likewise.
884         (aarch64_emit_less_unsigned): Likewise.
885         (aarch64_emit_ref): Likewise.
886         (aarch64_emit_if_goto): Likewise.
887         (aarch64_emit_goto): Likewise.
888         (aarch64_write_goto_address): Likewise.
889         (aarch64_emit_const): Likewise.
890         (aarch64_emit_call): Likewise.
891         (aarch64_emit_reg): Likewise.
892         (aarch64_emit_pop): Likewise.
893         (aarch64_emit_stack_flush): Likewise.
894         (aarch64_emit_zero_ext): Likewise.
895         (aarch64_emit_swap): Likewise.
896         (aarch64_emit_stack_adjust): Likewise.
897         (aarch64_emit_int_call_1): Likewise.
898         (aarch64_emit_void_call_2): Likewise.
899         (aarch64_emit_eq_goto): Likewise.
900         (aarch64_emit_ne_goto): Likewise.
901         (aarch64_emit_lt_goto): Likewise.
902         (aarch64_emit_le_goto): Likewise.
903         (aarch64_emit_gt_goto): Likewise.
904         (aarch64_emit_ge_got): Likewise.
905         (aarch64_emit_ops_impl): New static global variable.
906         (aarch64_emit_ops): New target function, return
907         &aarch64_emit_ops_impl.
908         (struct linux_target_ops): Install it.
909
910 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
911
912         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
913         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
914         aarch64-ipa.o.
915         * linux-aarch64-ipa.c: New file.
916         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
917         and endian.h.
918         (aarch64_get_thread_area): New target method.
919         (extract_signed_bitfield): New helper function.
920         (aarch64_decode_ldr_literal): New function.
921         (enum aarch64_opcodes): New enum.
922         (struct aarch64_register): New struct.
923         (struct aarch64_operand): New struct.
924         (x0): New static global.
925         (x1): Likewise.
926         (x2): Likewise.
927         (x3): Likewise.
928         (x4): Likewise.
929         (w2): Likewise.
930         (ip0): Likewise.
931         (sp): Likewise.
932         (xzr): Likewise.
933         (aarch64_register): New helper function.
934         (register_operand): Likewise.
935         (immediate_operand): Likewise.
936         (struct aarch64_memory_operand): New struct.
937         (offset_memory_operand): New helper function.
938         (preindex_memory_operand): Likewise.
939         (enum aarch64_system_control_registers): New enum.
940         (ENCODE): New macro.
941         (emit_insn): New helper function.
942         (emit_b): New function.
943         (emit_bcond): Likewise.
944         (emit_cb): Likewise.
945         (emit_tb): Likewise.
946         (emit_blr): Likewise.
947         (emit_stp): Likewise.
948         (emit_ldp_q_offset): Likewise.
949         (emit_stp_q_offset): Likewise.
950         (emit_load_store): Likewise.
951         (emit_ldr): Likewise.
952         (emit_ldrsw): Likewise.
953         (emit_str): Likewise.
954         (emit_ldaxr): Likewise.
955         (emit_stxr): Likewise.
956         (emit_stlr): Likewise.
957         (emit_data_processing_reg): Likewise.
958         (emit_data_processing): Likewise.
959         (emit_add): Likewise.
960         (emit_sub): Likewise.
961         (emit_mov): Likewise.
962         (emit_movk): Likewise.
963         (emit_mov_addr): Likewise.
964         (emit_mrs): Likewise.
965         (emit_msr): Likewise.
966         (emit_sevl): Likewise.
967         (emit_wfe): Likewise.
968         (append_insns): Likewise.
969         (can_encode_int32_in): New helper function.
970         (aarch64_relocate_instruction): New function.
971         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
972         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
973         (struct linux_target_ops): Install aarch64_get_thread_area,
974         aarch64_install_fast_tracepoint_jump_pad and
975         aarch64_get_min_fast_tracepoint_insn_len.
976
977 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
978
979         * Makefile.in (aarch64-insn.o): New rule.
980         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
981
982 2015-09-21  Yao Qi  <yao.qi@linaro.org>
983
984         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
985
986 2015-09-21  Yao Qi  <yao.qi@linaro.org>
987
988         * tracepoint.c (max_jump_pad_size): Remove.
989
990 2015-09-18  Yao Qi  <yao.qi@linaro.org>
991
992         * linux-aarch64-low.c: Don't include sys/uio.h.
993         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
994
995 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
996
997         * tracepoint.c (eval_result_type): Change prototype.
998         (condition_true_at_tracepoint): Fix argument to compiled_cond.
999
1000 2015-09-15  Pedro Alves  <palves@redhat.com>
1001
1002         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
1003         Check whether to report exec events instead of checking whether
1004         multiprocess is enabled.
1005
1006 2015-09-15  Pedro Alves  <palves@redhat.com>
1007
1008         PR remote/18965
1009         * remote-utils.c (prepare_resume_reply): Merge
1010         TARGET_WAITKIND_VFORK_DONE switch case with the
1011         TARGET_WAITKIND_FORKED case.
1012
1013 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1014
1015         * server.c (handle_query): Check string comparison using
1016         "else if" instead of "if".
1017
1018 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1019
1020         * server.c (vCont_supported): New global variable.
1021         (handle_query): Set vCont_supported to 1 if "vContSupported+"
1022         matches.  Append ";vContSupported+" to own_buf.
1023         (handle_v_requests): Append ";s;S" to own_buf if target supports
1024         hardware single step or vCont_supported is false.
1025         (capture_main): Set vCont_supported to zero.
1026
1027 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1028
1029         * linux-low.c (linux_supports_conditional_breakpoints): Rename
1030         it to ...
1031         (linux_supports_hardware_single_step): ... New function.
1032         (linux_target_ops): Update.
1033         * lynx-low.c (lynx_target_ops): Set field
1034         supports_hardware_single_step to target_can_do_hardware_single_step.
1035         * nto-low.c (nto_target_ops): Likewise.
1036         * spu-low.c (spu_target_ops): Likewise.
1037         * win32-low.c (win32_target_ops): Likewise.
1038         * target.c (target_can_do_hardware_single_step): New function.
1039         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1040         Remove.  <supports_hardware_single_step>: New field.
1041         (target_supports_conditional_breakpoints): Remove.
1042         (target_supports_hardware_single_step): New macro.
1043         (target_can_do_hardware_single_step): Declare.
1044         * server.c (handle_query): Use target_supports_hardware_single_step
1045         instead of target_supports_conditional_breakpoints.
1046
1047 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1048
1049         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
1050         function.
1051         (struct linux_target_ops the_low_target): Install
1052         aarch64_linux_siginfo_fixup.
1053
1054 2015-09-11  Don Breazeal  <donb@codesourcery.com>
1055             Luis Machado  <lgustavo@codesourcery.com>
1056
1057         * linux-low.c (linux_mourn): Static declaration.
1058         (linux_arch_setup): Move in front of
1059         handle_extended_wait.
1060         (linux_arch_setup_thread): New function.
1061         (handle_extended_wait): Handle exec events.  Call
1062         linux_arch_setup_thread.  Make event_lwp argument a
1063         pointer-to-a-pointer.
1064         (check_zombie_leaders): Do not check stopped threads.
1065         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
1066         (linux_low_filter_event): Add lwp and thread for exec'ing
1067         non-leader thread if leader thread has been deleted.
1068         Refactor code into linux_arch_setup_thread and call it.
1069         Pass child lwp pointer by reference to handle_extended_wait.
1070         (linux_wait_for_event_filtered): Update comment.
1071         (linux_wait_1): Prevent clobbering exec event status.
1072         (linux_supports_exec_events): New function.
1073         (linux_target_ops) <supports_exec_events>: Initialize new member.
1074         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
1075         new member.
1076         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
1077         * server.c (report_exec_events): New global variable.
1078         (handle_query): Handle qSupported query for exec-events feature.
1079         (captured_main): Initialize report_exec_events.
1080         * server.h (report_exec_events): Declare new global variable.
1081         * target.h (struct target_ops) <supports_exec_events>: New
1082         member.
1083         (target_supports_exec_events): New macro.
1084         * win32-low.c (win32_target_ops) <supports_exec_events>:
1085         Initialize new member.
1086
1087 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
1088
1089         * linux-low.c (linux_low_enable_btrace): Remove.
1090         (linux_target_ops): Replace linux_low_enable_btrace with
1091         linux_enable_btrace.
1092
1093 2015-09-03  Yao Qi  <yao.qi@linaro.org>
1094
1095         * linux-aarch64-low.c (aarch64_insert_point): Call
1096         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
1097         returns true.
1098
1099 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1100
1101         * linux-low.c (check_stopped_by_breakpoint): Use
1102         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
1103
1104 2015-08-27  Pedro Alves  <palves@redhat.com>
1105
1106         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
1107
1108 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
1109
1110         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
1111         the XNEW-family equivalent.
1112         (compile_bytecodes): Likewise.
1113         * dll.c (loaded_dll): Likewise.
1114         * event-loop.c (append_callback_event): Likewise.
1115         (create_file_handler): Likewise.
1116         (create_file_event): Likewise.
1117         * hostio.c (handle_open): Likewise.
1118         * inferiors.c (add_thread): Likewise.
1119         (add_process): Likewise.
1120         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
1121         * linux-arm-low.c (arm_new_process): Likewise.
1122         (arm_new_thread): Likewise.
1123         * linux-low.c (add_to_pid_list): Likewise.
1124         (linux_add_process): Likewise.
1125         (handle_extended_wait): Likewise.
1126         (add_lwp): Likewise.
1127         (enqueue_one_deferred_signal): Likewise.
1128         (enqueue_pending_signal): Likewise.
1129         (linux_resume_one_lwp_throw): Likewise.
1130         (linux_resume_one_thread): Likewise.
1131         (linux_read_memory): Likewise.
1132         (linux_write_memory): Likewise.
1133         * linux-mips-low.c (mips_linux_new_process): Likewise.
1134         (mips_linux_new_thread): Likewise.
1135         (mips_add_watchpoint): Likewise.
1136         * linux-x86-low.c (initialize_low_arch): Likewise.
1137         * lynx-low.c (lynx_add_process): Likewise.
1138         * mem-break.c (set_raw_breakpoint_at): Likewise.
1139         (set_breakpoint): Likewise.
1140         (add_condition_to_breakpoint): Likewise.
1141         (add_commands_to_breakpoint): Likewise.
1142         (clone_agent_expr): Likewise.
1143         (clone_one_breakpoint): Likewise.
1144         * regcache.c (new_register_cache): Likewise.
1145         * remote-utils.c (look_up_one_symbol): Likewise.
1146         * server.c (queue_stop_reply): Likewise.
1147         (start_inferior): Likewise.
1148         (queue_stop_reply_callback): Likewise.
1149         (handle_target_event): Likewise.
1150         * spu-low.c (fetch_ppc_memory): Likewise.
1151         (store_ppc_memory): Likewise.
1152         * target.c (set_target_ops): Likewise.
1153         * thread-db.c (thread_db_load_search): Likewise.
1154         (try_thread_db_load_1): Likewise.
1155         * tracepoint.c (add_tracepoint): Likewise.
1156         (add_tracepoint_action): Likewise.
1157         (create_trace_state_variable): Likewise.
1158         (cmd_qtdpsrc): Likewise.
1159         (cmd_qtro): Likewise.
1160         (add_while_stepping_state): Likewise.
1161         * win32-low.c (child_add_thread): Likewise.
1162         (get_image_name): Likewise.
1163
1164 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1165
1166         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1167
1168 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1169
1170         * Makefile.in (aarch64-linux.o): New rule.
1171         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1172         srv_tgtobj.
1173         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1174         (aarch64_init_debug_reg_state): Make it extern.
1175         (aarch64_linux_prepare_to_resume): Remove.
1176
1177 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1178
1179         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1180         lwp_arch_private_info and ptid_of_lwp.
1181
1182 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1183
1184         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1185         Find proc_info by find_process_pid.  All callers updated.
1186
1187 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1188
1189         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1190         Remove.
1191         (debug_reg_change_callback): Remove.
1192         (aarch64_notify_debug_reg_change): Remove.
1193
1194 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1195
1196         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1197         Call current_lwp_ptid.
1198
1199 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1200
1201         * linux-aarch64-low.c (debug_reg_change_callback): Use
1202         debug_printf.
1203
1204 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1205
1206         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1207
1208 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1209
1210         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1211
1212 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1213
1214         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1215         the code.
1216
1217 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1218
1219         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1220         Remove.
1221         (debug_reg_change_callback): Remove argument entry and add argument
1222         lwp.  Remove local variable thread.  Don't print thread id in the
1223         debugging output.  Don't check whether pid of thread equals to pid.
1224         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1225         iterate_over_lwps instead find_inferior.
1226
1227 2015-08-24  Pedro Alves  <palves@redhat.com>
1228
1229         * inferiors.c (get_first_process): New function.
1230         * inferiors.h (get_first_process): New declaration.
1231         * remote-utils.c (read_ptid): Default to the first process in the
1232         list, instead of to the current thread's process.
1233
1234 2015-08-24  Pedro Alves  <palves@redhat.com>
1235
1236         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1237         * event-loop.c: Likewise.
1238         * remote-utils.c: Likewise.
1239         * tracepoint.c: Likewise.
1240
1241 2015-08-24  Pedro Alves  <palves@redhat.com>
1242
1243         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1244         ptid_get_lwp.
1245
1246 2015-08-21  Pedro Alves  <palves@redhat.com>
1247
1248         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1249         instead of literal 1.
1250
1251 2015-08-21  Pedro Alves  <palves@redhat.com>
1252
1253         * tdesc.c (default_description): Explicitly zero-initialize.
1254
1255 2015-08-21  Pedro Alves  <palves@redhat.com>
1256
1257         PR gdb/18749
1258         * inferiors.c (remove_thread): Discard any pending stop reply for
1259         this thread.
1260         * server.c (remove_all_on_match_pid): Rename to ...
1261         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1262         instead of a pid.
1263         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1264         extern.
1265         (handle_v_kill, kill_inferior_callback, captured_main)
1266         (process_serial_event): Adjust.
1267         * server.h (discard_queued_stop_replies): Declare.
1268
1269 2015-08-21  Pedro Alves  <palves@redhat.com>
1270
1271         * linux-low.c (wait_for_sigstop): Always switch to no thread
1272         selected if the previously current thread dies.
1273         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1274         process instead of the current thread's.
1275         * remote-utils.c (input_interrupt): Don't check if there's no
1276         current thread.
1277         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1278         current thread to the general thread fails, error out.
1279         (handle_qxfer_auxv, handle_qxfer_libraries)
1280         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1281         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1282         (handle_query): Check if there's a thread selected instead of
1283         checking whether there's any thread in the thread list.
1284         (handle_qxfer_threads, handle_qxfer_btrace)
1285         (handle_qxfer_btrace_conf): Don't error out early if there's no
1286         thread in the thread list.
1287         (handle_v_cont, myresume): Don't set the current thread to the
1288         continue thread.
1289         (process_serial_event) <Hg handling>: Also set thread_id if the
1290         previous general thread is still alive.
1291         (process_serial_event) <g/G handling>: If setting the current
1292         thread to the general thread fails, error out.
1293         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1294         thread's lwp instead of the current thread's.
1295         * target.c (set_desired_thread): If the desired thread was not
1296         found, leave the current thread pointing to NULL.  Return an int
1297         (boolean) indicating success.
1298         * target.h (set_desired_thread): Change return type to int.
1299
1300 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1301
1302         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1303         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1304         #includes.
1305         (ps_get_thread_area): New function.
1306
1307 2015-08-19  Gary Benson  <gbenson@redhat.com>
1308
1309         * hostio.c (handle_pread): Do not attempt to read more data
1310         than hostio_reply_with_data can fit in a packet.
1311
1312 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1313
1314         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1315
1316 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1317
1318         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1319
1320 2015-08-06  Pedro Alves  <palves@redhat.com>
1321
1322         * tracepoint.c (expr_eval_result): Now an int.
1323
1324 2015-08-06  Pedro Alves  <palves@redhat.com>
1325
1326         * gdbthread.h (struct regcache): Forward declare.
1327         (struct thread_info) <regcache_data>: Now a struct regcache
1328         pointer.
1329         * inferiors.c (inferior_regcache_data)
1330         (set_inferior_regcache_data): Now work with struct regcache
1331         pointers.
1332         * inferiors.h (struct regcache): Forward declare.
1333         (inferior_regcache_data, set_inferior_regcache_data): Now work
1334         with struct regcache pointers.
1335         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1336         (free_register_cache_thread): Remove struct regcache pointer
1337         casts.
1338
1339 2015-08-06  Pedro Alves  <palves@redhat.com>
1340
1341         * server.c (captured_main): On error, print the exception message
1342         to stderr, and if run_once is set, throw a quit.
1343
1344 2015-08-06  Pedro Alves  <palves@redhat.com>
1345
1346         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1347         the current thread.
1348
1349 2015-08-06  Pedro Alves  <palves@redhat.com>
1350
1351         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1352         reading beyond the passed in buffer length.
1353
1354 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1355
1356         * tracepoint.c (symbol_list) <required>: Remove.
1357
1358 2015-08-06  Pedro Alves  <palves@redhat.com>
1359
1360         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1361         count if stopping and suspending threads.
1362         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1363         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1364         (linux_detach): Complete an ongoing step-over.
1365         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1366         throughout.
1367         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1368         (linux_wait_1): If passing a signal to the inferior after
1369         finishing a step-over, unsuspend and re-resume all lwps.  If we
1370         see a single-step event but the thread should be continuing, don't
1371         pass the trap to gdb.
1372         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1373         internal_error instead of gdb_assert.
1374         (enqueue_pending_signal): New function.
1375         (check_ptrace_stopped_lwp_gone): Add debug output.
1376         (start_step_over): Use internal_error instead of gdb_assert.
1377         (complete_ongoing_step_over): New function.
1378         (linux_resume_one_thread): Don't resume a suspended thread.
1379         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1380         it stepping.
1381
1382 2015-08-06  Pedro Alves  <palves@redhat.com>
1383
1384         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1385         (linux_thread_alive): Use lwp_is_marked_dead.
1386         (extended_event_reported): Delete.
1387         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1388         instead of extended_event_reported.
1389         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1390         as well.
1391         (lwp_is_marked_dead): New function.
1392         (lwp_running): Use lwp_is_marked_dead.
1393         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1394         comment.
1395
1396 2015-08-06  Pedro Alves  <palves@redhat.com>
1397
1398         * linux-low.c (linux_wait_1): Move fork event output out of the
1399         !report_to_gdb check.  Pass event_child->waitstatus to
1400         target_waitstatus_to_string instead of ourstatus.
1401
1402 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1403
1404         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1405         if current_thread is 32 bit.
1406
1407 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1408
1409         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1410         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1411         * server.c (extended_protocol): Remove "static".
1412         * server.h (extended_protocol): Declare it.
1413
1414 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1415
1416         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1417         both aarch64 and aarch32.
1418         (aarch64_set_pc): Likewise.
1419
1420 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1421
1422         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1423         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1424         arm-with-neon.xml to srv_xmlfiles.
1425         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1426         (is_64bit_tdesc): New function.
1427         (aarch64_linux_read_description): New function.
1428         (aarch64_arch_setup): Call aarch64_linux_read_description.
1429         (regs_info): Rename to regs_info_aarch64.
1430         (aarch64_regs_info): Return right regs_info.
1431         (initialize_low_arch): Call initialize_low_arch_aarch32.
1432
1433 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1434
1435         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1436         * linux-aarch32-low.c: New file.
1437         * linux-aarch32-low.h: New file.
1438         * linux-arm-low.c (arm_fill_gregset): Move it to
1439         linux-aarch32-low.c.
1440         (arm_store_gregset): Likewise.
1441         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1442         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1443         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1444         (regs_info): Rename to regs_info_arm.
1445         (arm_regs_info): Return regs_info_aarch32 if
1446         have_ptrace_getregset is 1 and target description is
1447         arm_with_neon or arm_with_vfpv3.
1448         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1449         Call initialize_low_arch_aarch32 instead.
1450
1451 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1452
1453         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1454         * linux-low.c: ... here.
1455         * linux-low.h (have_ptrace_getregset): Declare it.
1456
1457 2015-08-04  Pedro Alves  <palves@redhat.com>
1458
1459         * thread-db.c (struct thread_db): Use new typedefs.
1460         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1461         CHK calls.
1462         (disable_thread_event_reporting): Cast result of dlsym to
1463         destination function pointer type.
1464         (thread_db_mourn): Use td_ta_delete_ftype.
1465
1466 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1467
1468         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1469         arch variant.
1470         (CDX_BREAKPOINT): Define for R2.
1471         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1472         (the_low_target): Add comments.
1473
1474 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1475
1476         * linux-arm-low.c (arm_hwcap): Remove it.
1477         (arm_read_description): New local variable arm_hwcap.  Don't
1478         set arm_hwcap to zero.
1479
1480 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1481
1482         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1483         Use regcache->tdesc instead.
1484         (arm_store_wmmxregset): Likewise.
1485         (arm_fill_vfpregset): Likewise.
1486         (arm_store_vfpregset): Likewise.
1487
1488 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1489
1490         * linux-arm-low.c: Include arch/arm.h.
1491         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1492         (arm_store_gregset): Likewise.
1493
1494 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1495
1496         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1497         ptrace's 4th parameter.
1498
1499 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1500
1501         * configure.srv (case aarch64*-*-linux*): Don't set
1502         srv_linux_usrregs.
1503
1504 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1505
1506         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1507         sys/ptrace.h.
1508         * linux-arm-low.c: Likewise.
1509         * linux-cris-low.c: Likewise.
1510         * linux-crisv32-low.c: Likewise.
1511         * linux-low.c: Likewise.
1512         * linux-m68k-low.c: Likewise.
1513         * linux-mips-low.c: Likewise.
1514         * linux-nios2-low.c: Likewise.
1515         * linux-s390-low.c: Likewise.
1516         * linux-sparc-low.c: Likewise.
1517         * linux-tic6x-low.c: Likewise.
1518         * linux-tile-low.c: Likewise.
1519         * linux-x86-low.c: Likewise.
1520
1521 2015-07-24  Pedro Alves  <palves@redhat.com>
1522
1523         * config.in: Regenerate.
1524         * configure: Regenerate.
1525
1526 2015-07-24  Pedro Alves  <palves@redhat.com>
1527
1528         * acinclude.m4: Include ../ptrace.m4.
1529         * configure.ac: Call GDB_AC_PTRACE.
1530         * config.in, configure: Regenerate.
1531
1532 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1533
1534         * linux-low.c (linux_create_inferior): Remove setting to
1535         proc->priv->new_inferior.
1536         (linux_attach): Likewise.
1537         (linux_low_filter_event): Likewise.
1538         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1539
1540 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1541
1542         * linux-low.c (linux_arch_setup): New function.
1543         (linux_low_filter_event): If proc->tdesc is NULL and
1544         proc->attached is true, call the_low_target.arch_setup.
1545         Otherwise, keep status pending, and return.
1546         (linux_resume_one_lwp_throw): Don't call get_pc if
1547         thread->while_stepping isn't NULL.  Don't call
1548         get_thread_regcache if proc->tdesc is NULL.
1549         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1550         (linux_target_ops): Install arch_setup.
1551         * server.c (start_inferior): Call the_target->arch_setup.
1552         * target.h (struct target_ops) <arch_setup>: New field.
1553         (target_arch_setup): New marco.
1554         * lynx-low.c (lynx_target_ops): Update.
1555         * nto-low.c (nto_target_ops): Update.
1556         * spu-low.c (spu_target_ops): Update.
1557         * win32-low.c (win32_target_ops): Update.
1558
1559 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1560
1561         * linux-low.c (linux_add_process): Don't set
1562         proc->priv->new_inferior.
1563         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1564         (linux_attach): Likewise.
1565
1566 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1567
1568         * server.c (start_inferior): Code refactor.
1569
1570 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1571
1572         * server.c (process_serial_event): Set general_thread.
1573
1574 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1575
1576         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1577         aarch64_linux_get_debug_reg_capacity.
1578
1579 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1580
1581         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1582         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1583         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1584         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1585         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1586         (AARCH64_HWP_ALIGNMENT): Likewise.
1587         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1588         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1589         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1590         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1591         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1592         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1593         (struct aarch64_debug_reg_state): Likewise.
1594         (struct arch_lwp_info): Likewise.
1595         (aarch64_align_watchpoint): Likewise.
1596         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1597         (aarch64_watchpoint_length): Likewise.
1598         (aarch64_point_encode_ctrl_reg): Likewise
1599         (aarch64_point_is_aligned): Likewise.
1600         (aarch64_align_watchpoint): Likewise.
1601         (aarch64_linux_set_debug_regs):
1602         (aarch64_dr_state_insert_one_point): Likewise.
1603         (aarch64_dr_state_remove_one_point): Likewise.
1604         (aarch64_handle_breakpoint): Likewise.
1605         (aarch64_handle_aligned_watchpoint): Likewise.
1606         (aarch64_handle_unaligned_watchpoint): Likewise.
1607         (aarch64_handle_watchpoint): Likewise.
1608
1609 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1610
1611         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1612         and don't aarch64_get_debug_reg_state.  All callers update.
1613         (aarch64_handle_aligned_watchpoint): Likewise.
1614         (aarch64_handle_unaligned_watchpoint): Likewise.
1615         (aarch64_handle_watchpoint): Likewise.
1616         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1617         (aarch64_remove_point): Likewise.
1618
1619 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1620
1621         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1622         debug_printf.
1623         (aarch64_handle_unaligned_watchpoint): Likewise.
1624
1625 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1626
1627         Revert the previous 3 commits:
1628         Move gdb_regex* to common/
1629         Move linux_find_memory_regions_full & co.
1630         gdbserver build-id attribute generator
1631
1632 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1633             Jan Kratochvil  <jan.kratochvil@redhat.com>
1634
1635         gdbserver build-id attribute generator.
1636         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1637         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1638         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1639         (find_phdr): New.
1640         (get_dynamic): Use find_pdhr to traverse program headers.
1641         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1642         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1643         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
1644         (get_hex_build_id): New.
1645         (linux_qxfer_libraries_svr4): Add optional build-id attribute
1646         to reply XML document.
1647
1648 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1649             Jan Kratochvil  <jan.kratochvil@redhat.com>
1650
1651         * target.c: Include target/target-utils.h and fcntl.h.
1652         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
1653         (target_fileio_read_stralloc): New functions.
1654
1655 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1656
1657         * Makefile.in (OBS): Add gdb_regex.o.
1658         (gdb_regex.o): New.
1659         * config.in: Rebuilt.
1660         * configure: Rebuilt.
1661
1662 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1663             Jan Kratochvil  <jan.kratochvil@redhat.com>
1664
1665         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
1666         * Makefile.in (OBS): Add target-utils.o.
1667         (linux-maps.o, target-utils.o): New.
1668         * configure.srv (srv_linux_obj): Add linux-maps.o.
1669
1670 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
1671
1672         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
1673         function, return 1.
1674         (the_low_target): Install it.
1675
1676 2015-07-14  Pedro Alves  <palves@redhat.com>
1677
1678         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
1679         Instead, ignore ECHILD, and throw an error for other errnos.
1680
1681 2015-07-10  Pedro Alves  <palves@redhat.com>
1682
1683         * event-loop.c (struct callback_event) <data>: Change type to
1684         gdb_client_data instance instead of gdb_client_data pointer.
1685         (append_callback_event): Adjust.
1686
1687 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
1688
1689         * linux-aarch64-low.c: Add comments for each linux_target_ops
1690         method.  Remove comments already covered in target_ops and
1691         linux_target_ops definitions.
1692         (the_low_target): Add comments for each unimplemented method.
1693
1694 2015-07-09  Yao Qi  <yao.qi@linaro.org>
1695
1696         * linux-aarch64-low.c (aarch64_regmap): Remove.
1697         (aarch64_usrregs_info): Remove.
1698         (regs_info): Set field usrregs to NULL.
1699
1700 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
1701
1702         * linux-low.c: Include "rsp-low.h"
1703         (linux_low_encode_pt_config, linux_low_encode_raw): New.
1704         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
1705         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
1706         (handle_btrace_enable_pt): New.
1707         (handle_btrace_general_set): Support "pt".
1708         (handle_btrace_conf_general_set): Support "pt:size".
1709
1710 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1711
1712         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
1713         Z_PACKET_SW_BP.
1714
1715 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1716
1717         * linux-aarch64-low.c: Remove comment about endianness.
1718         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
1719         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
1720         memcmp.
1721
1722 2015-06-24  Gary Benson  <gbenson@redhat.com>
1723
1724         * linux-i386-ipa.c (stdint.h): Do not include.
1725         * lynx-i386-low.c (stdint.h): Likewise.
1726         * lynx-ppc-low.c (stdint.h): Likewise.
1727         * mem-break.c (stdint.h): Likewise.
1728         * thread-db.c (stdint.h): Likewise.
1729         * tracepoint.c (stdint.h): Likewise.
1730         * win32-low.c (stdint.h): Likewise.
1731
1732 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
1733
1734         * server.c (write_qxfer_response): Update call to
1735         remote_escape_output.
1736
1737 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
1738             Jan Kratochvil  <jan.kratochvil@redhat.com>
1739
1740         Merge multiple hex conversions.
1741         * gdbreplay.c (tohex): Rename to 'fromhex'.
1742         (logchar): Use fromhex.
1743
1744 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1745
1746         * server.c (handle_qxfer_libraries): Set `version' attribute for
1747         <library-list>.
1748
1749 2015-06-10  Gary Benson  <gbenson@redhat.com>
1750
1751         * target.h (struct target_ops) <multifs_open>: New field.
1752         <multifs_unlink>: Likewise.
1753         <multifs_readlink>: Likewise.
1754         * linux-low.c (nat/linux-namespaces.h): New include.
1755         (linux_target_ops): Initialize the_target->multifs_open,
1756         the_target->multifs_unlink and the_target->multifs_readlink.
1757         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
1758         * hostio.c (hostio_fs_pid): New static variable.
1759         (hostio_handle_new_gdb_connection): New function.
1760         (handle_setfs): Likewise.
1761         (handle_open): Use the_target->multifs_open as appropriate.
1762         (handle_unlink): Use the_target->multifs_unlink as appropriate.
1763         (handle_readlink): Use the_target->multifs_readlink as
1764         appropriate.
1765         (handle_vFile): Handle vFile:setfs packets.
1766         * server.c (handle_query): Call hostio_handle_new_gdb_connection
1767         after target_handle_new_gdb_connection.
1768
1769 2015-06-10  Gary Benson  <gbenson@redhat.com>
1770
1771         * configure.ac (AC_CHECK_FUNCS): Add setns.
1772         * config.in: Regenerate.
1773         * configure: Likewise.
1774         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
1775         (linux-namespaces.o): New rule.
1776         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
1777
1778 2015-06-09  Gary Benson <gbenson@redhat.com>
1779
1780         * hostio.c (handle_open): Process mode argument with
1781         fileio_to_host_mode.
1782
1783 2015-06-01  Yao Qi  <yao.qi@linaro.org>
1784
1785         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
1786         * linux-x86-low.c: Likewise.
1787
1788 2015-05-28  Don Breazeal  <donb@codesourcery.com>
1789
1790         * linux-low.c (handle_extended_wait): Initialize
1791         thread_info.last_resume_kind for new fork children.
1792
1793 2015-05-15  Pedro Alves  <palves@redhat.com>
1794
1795         * target.h (target_handle_new_gdb_connection): Rewrite using if
1796         wrapped in do/while.
1797
1798 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
1799
1800         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
1801         * configure, config.in: Regenerate.
1802         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
1803         Declare typedef.
1804
1805 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1806
1807         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
1808         PTRACE_EVENT_VFORK_DONE.
1809         (linux_low_ptrace_options, extended_event_reported): Add vfork
1810         events.
1811         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
1812         and "vforkdone" for RSP 'T' Stop Reply Packet.
1813         * server.h (report_vfork_events): Declare
1814         global variable.
1815
1816 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1817
1818         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
1819         (the_low_target) <new_fork>: Initialize new member.
1820         * linux-arm-low.c (arm_new_fork): New function.
1821         (the_low_target) <new_fork>: Initialize new member.
1822         * linux-low.c (handle_extended_wait): Call new target function
1823         new_fork.
1824         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
1825         * linux-mips-low.c (mips_add_watchpoint): New function
1826         extracted from mips_insert_point.
1827         (the_low_target) <new_fork>: Initialize new member.
1828         (mips_linux_new_fork): New function.
1829         (mips_insert_point): Call mips_add_watchpoint.
1830         * linux-x86-low.c (x86_linux_new_fork): New function.
1831         (the_low_target) <new_fork>: Initialize new member.
1832
1833 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1834
1835         * linux-low.c (handle_extended_wait): Implement return value,
1836         rename argument 'event_child' to 'event_lwp', handle
1837         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
1838         (linux_low_ptrace_options): New function.
1839         (linux_low_filter_event): Call linux_low_ptrace_options,
1840         use different argument fo linux_enable_event_reporting,
1841         use return value from handle_extended_wait.
1842         (extended_event_reported): New function.
1843         (linux_wait_1): Call extended_event_reported and set
1844         status to report fork events.
1845         (linux_write_memory): Add pid to debug message.
1846         (reset_lwp_ptrace_options_callback): New function.
1847         (linux_handle_new_gdb_connection): New function.
1848         (linux_target_ops): Initialize new structure member.
1849         * linux-low.h (struct lwp_info) <waitstatus>: New member.
1850         * lynx-low.c: Initialize new structure member.
1851         * remote-utils.c (prepare_resume_reply): Implement stop reason
1852         "fork" for "T" stop message.
1853         * server.c (handle_query): Call handle_new_gdb_connection.
1854         * server.h (report_fork_events): Declare global flag.
1855         * target.h (struct target_ops) <handle_new_gdb_connection>:
1856         New member.
1857         (target_handle_new_gdb_connection): New macro.
1858         * win32-low.c: Initialize new structure member.
1859
1860 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1861
1862         * mem-break.c (APPEND_TO_LIST): Define macro.
1863         (clone_agent_expr): New function.
1864         (clone_one_breakpoint): New function.
1865         (clone_all_breakpoints): New function.
1866         * mem-break.h: Declare new functions.
1867
1868 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1869
1870         * linux-low.c (linux_supports_fork_events): New function.
1871         (linux_supports_vfork_events): New function.
1872         (linux_target_ops): Initialize new structure members.
1873         (initialize_low): Call linux_check_ptrace_features.
1874         * lynx-low.c (lynx_target_ops): Initialize new structure
1875         members.
1876         * server.c (report_fork_events, report_vfork_events):
1877         New global flags.
1878         (handle_query): Add new features to qSupported packet and
1879         response.
1880         (captured_main): Initialize new global variables.
1881         * target.h (struct target_ops) <supports_fork_events>:
1882         New member.
1883         <supports_vfork_events>: New member.
1884         (target_supports_fork_events): New macro.
1885         (target_supports_vfork_events): New macro.
1886         * win32-low.c (win32_target_ops): Initialize new structure
1887         members.
1888
1889 2015-05-12  Gary Benson <gbenson@redhat.com>
1890
1891         * server.c (handle_qxfer_exec_file): Use current process
1892         if annex is empty.
1893
1894 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
1895
1896         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
1897         Remove HAVE_PTRACE_GETREGS conditionals.
1898         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
1899         instead of PTRACE_GETREGS and PTRACE_SETREGS.
1900
1901 2015-05-08  Yao Qi  <yao.qi@linaro.org>
1902
1903         * linux-low.c (linux_supports_conditional_breakpoints): New
1904         function.
1905         (linux_target_ops): Install new target method.
1906         * lynx-low.c (lynx_target_ops): Install NULL hook for
1907         supports_conditional_breakpoints.
1908         * nto-low.c (nto_target_ops): Likewise.
1909         * spu-low.c (spu_target_ops): Likewise.
1910         * win32-low.c (win32_target_ops): Likewise.
1911         * server.c (handle_query): Check
1912         target_supports_conditional_breakpoints.
1913         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1914         New field.
1915         (target_supports_conditional_breakpoints): New macro.
1916
1917 2015-05-06  Pedro Alves  <palves@redhat.com>
1918
1919         PR server/18081
1920         * server.c (start_inferior): If the process exits, mourn it.
1921
1922 2015-04-21  Gary Benson <gbenson@redhat.com>
1923
1924         * hostio.c (fileio_open_flags_to_host): Factored out to
1925         fileio_to_host_openflags in common/fileio.c.  Single use
1926         updated.
1927
1928 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1929
1930         * linux-xtensa-low.c (xtensa_fill_gregset)
1931         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
1932         XCHAL_HAVE_LOOP.
1933
1934 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1935
1936         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
1937         (regs_info): Replace usrregs pointer with NULL.
1938
1939 2015-04-17  Gary Benson  <gbenson@redhat.com>
1940
1941         * target.h (struct target_ops) <pid_to_exec_file>: New field.
1942         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
1943         * server.c (handle_qxfer_exec_file): New function.
1944         (qxfer_packets): Add exec-file entry.
1945         (handle_query): Report qXfer:exec-file:read as supported packet.
1946
1947 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
1948
1949         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
1950
1951 2015-04-09  Gary Benson <gbenson@redhat.com>
1952
1953         * hostio-errno.c (errno_to_fileio_error): Remove function.
1954         Update caller to use remote_fileio_to_fio_error.
1955
1956 2015-04-09  Yao Qi  <yao.qi@linaro.org>
1957
1958         * linux-low.c (linux_insert_point): Call
1959         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
1960         (linux_remove_point): Call remove_memory_breakpoint if type is
1961         raw_bkpt_type_sw.
1962         * linux-x86-low.c (x86_insert_point): Don't call
1963         insert_memory_breakpoint.
1964         (x86_remove_point): Don't call remove_memory_breakpoint.
1965
1966 2015-04-01  Pedro Alves  <palves@redhat.com>
1967             Cleber Rosa  <crosa@redhat.com>
1968
1969         * server.c (gdbserver_usage): Reorganize and extend the usage
1970         message.
1971
1972 2015-03-24  Pedro Alves  <palves@redhat.com>
1973
1974         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
1975         output.  Also dump TRAP_TRACE.
1976         (linux_low_filter_event): In debug output, distinguish a
1977         resume_stop SIGSTOP from a delayed SIGSTOP.
1978
1979 2015-03-24  Gary Benson  <gbenson@redhat.com>
1980
1981         * linux-x86-low.c (x86_linux_new_thread): Moved to
1982         nat/x86-linux.c.
1983         (x86_linux_prepare_to_resume): Likewise.
1984
1985 2015-03-24  Gary Benson  <gbenson@redhat.com>
1986
1987         * Makefile.in (x86-linux-dregs.o): New rule.
1988         * configure.srv: Add x86-linux-dregs.o to relevant targets.
1989         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
1990         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
1991         (x86_linux_dr_get): Likewise.
1992         (x86_linux_dr_set): Likewise.
1993         (update_debug_registers_callback): Likewise.
1994         (x86_linux_dr_set_addr): Likewise.
1995         (x86_linux_dr_get_addr): Likewise.
1996         (x86_linux_dr_set_control): Likewise.
1997         (x86_linux_dr_get_control): Likewise.
1998         (x86_linux_dr_get_status): Likewise.
1999         (x86_linux_update_debug_registers): Likewise.
2000
2001 2015-03-24  Gary Benson  <gbenson@redhat.com>
2002
2003         * linux-x86-low.c (x86_linux_update_debug_registers):
2004         New function, factored out from...
2005         (x86_linux_prepare_to_resume): ...this.
2006
2007 2015-03-24  Gary Benson  <gbenson@redhat.com>
2008
2009         * linux-x86-low.c (x86_linux_dr_get): Update comments.
2010         (x86_linux_dr_set): Likewise.
2011         (update_debug_registers_callback): Likewise.
2012         (x86_linux_dr_set_addr): Likewise.
2013         (x86_linux_dr_get_addr): Likewise.
2014         (x86_linux_dr_set_control): Likewise.
2015         (x86_linux_dr_get_control): Likewise.
2016         (x86_linux_dr_get_status): Likewise.
2017         (x86_linux_prepare_to_resume): Likewise.
2018
2019 2015-03-24  Gary Benson  <gbenson@redhat.com>
2020
2021         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
2022         Use perror_with_name.  Pass string through gettext.
2023         (x86_linux_dr_set): Likewise.
2024
2025 2015-03-24  Gary Benson  <gbenson@redhat.com>
2026
2027         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
2028         (x86_linux_dr_set_addr): ...this.
2029         (x86_dr_low_get_addr): Rename to...
2030         (x86_linux_dr_get_addr): ...this.
2031         (x86_dr_low_set_control): Rename to...
2032         (x86_linux_dr_set_control): ...this.
2033         (x86_dr_low_get_control): Rename to...
2034         (x86_linux_dr_get_control): ...this.
2035         (x86_dr_low_get_status): Rename to...
2036         (x86_linux_dr_get_status): ...this.
2037         (x86_dr_low): Update with new function names.
2038
2039 2015-03-24  Gary Benson  <gbenson@redhat.com>
2040
2041         * Makefile.in (x86-linux.o): New rule.
2042         * configure.srv: Add x86-linux.o to relevant targets.
2043         * linux-low.c (lwp_set_arch_private_info): New function.
2044         (lwp_arch_private_info): Likewise.
2045         * linux-x86-low.c: Include nat/x86-linux.h.
2046         (arch_lwp_info): Removed structure.
2047         (update_debug_registers_callback):
2048         Use lwp_set_debug_registers_changed.
2049         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
2050         and lwp_set_debug_registers_changed.
2051         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2052
2053 2015-03-24  Gary Benson  <gbenson@redhat.com>
2054
2055         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
2056         * linux-arm-low.c (arm_new_thread): Likewise.
2057         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
2058         * linux-mips-low.c (mips_linux_new_thread): Likewise.
2059         * linux-x86-low.c (x86_linux_new_thread): Likewise.
2060         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
2061
2062 2015-03-24  Gary Benson  <gbenson@redhat.com>
2063
2064         * linux-low.c (ptid_of_lwp): New function.
2065         (lwp_is_stopped): Likewise.
2066         (lwp_stop_reason): Likewise.
2067         * linux-x86-low.c (update_debug_registers_callback):
2068         Use lwp_is_stopped.
2069         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
2070         lwp_stop_reason.
2071
2072 2015-03-24  Gary Benson  <gbenson@redhat.com>
2073
2074         * linux-low.h (linux_stop_lwp): Remove declaration.
2075
2076 2015-03-24  Gary Benson  <gbenson@redhat.com>
2077
2078         * linux-low.h: Include nat/linux-nat.h.
2079         * linux-low.c (iterate_over_lwps_args): New structure.
2080         (iterate_over_lwps_filter): New function.
2081         (iterate_over_lwps): Likewise.
2082         * linux-x86-low.c (update_debug_registers_callback):
2083         Update signature to what iterate_over_lwps expects.
2084         Remove PID check that iterate_over_lwps now performs.
2085         (x86_dr_low_set_addr): Use iterate_over_lwps.
2086         (x86_dr_low_set_control): Likewise.
2087
2088 2015-03-24  Gary Benson  <gbenson@redhat.com>
2089
2090         * linux-x86-low.c (x86_debug_reg_state): New function.
2091         (x86_linux_prepare_to_resume): Use the above.
2092
2093 2015-03-24  Gary Benson  <gbenson@redhat.com>
2094
2095         * linux-low.c (current_lwp_ptid): New function.
2096         * linux-x86-low.c: Include nat/linux-nat.h.
2097         (x86_dr_low_get_addr): Use current_lwp_ptid.
2098         (x86_dr_low_get_control): Likewise.
2099         (x86_dr_low_get_status): Likewise.
2100
2101 2015-03-20  Pedro Alves  <palves@redhat.com>
2102
2103         * tracepoint.c (cmd_qtstatus): Make "str" const.
2104
2105 2015-03-20  Pedro Alves  <palves@redhat.com>
2106
2107         * server.c (handle_general_set): Make "req_str" const.
2108
2109 2015-03-19  Pedro Alves  <palves@redhat.com>
2110
2111         * linux-low.c (linux_resume_one_lwp): Rename to ...
2112         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
2113         instead call perror_with_name.
2114         (check_ptrace_stopped_lwp_gone): New function.
2115         (linux_resume_one_lwp): Reimplement as wrapper around
2116         linux_resume_one_lwp_throw that swallows errors if the LWP is
2117         gone.
2118
2119 2015-03-19  Pedro Alves  <palves@redhat.com>
2120
2121         * linux-low.c (count_events_callback, select_event_lwp_callback):
2122         No longer check whether the thread has resume_stop as last resume
2123         kind.
2124
2125 2015-03-19 Pedro Alves  <palves@redhat.com>
2126
2127         * linux-low.c (count_events_callback, select_event_lwp_callback):
2128         Use the lwp's status_pending_p field, not the thread's.
2129
2130 2015-03-19  Pedro Alves  <palves@redhat.com>
2131
2132         * linux-low.c (select_event_lwp_callback): Update comments to
2133         no longer mention SIGTRAP.
2134
2135 2015-03-18  Gary Benson  <gbenson@redhat.com>
2136
2137         * server.c (handle_query): Do not report vFile:fstat as supported.
2138
2139 2015-03-11  Gary Benson  <gbenson@redhat.com>
2140
2141         * hostio.c (sys/types.h): New include.
2142         (sys/stat.h): Likewise.
2143         (common-remote-fileio.h): Likewise.
2144         (handle_fstat): New function.
2145         (handle_vFile): Handle vFile:fstat packets.
2146
2147 2015-03-11  Gary Benson  <gbenson@redhat.com>
2148
2149         * configure.ac (AC_CHECK_MEMBERS): Add checks for
2150         struct stat.st_blocks and struct stat.st_blksize.
2151         * configure: Regenerate.
2152         * config.in: Likewise.
2153         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
2154         (OBS): Add common-remote-fileio.o.
2155         (common-remote-fileio.o): New rule.
2156
2157 2015-03-09  Pedro Alves  <palves@redhat.com>
2158
2159         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2160         'struct sockaddr' pointer in 'accept' call.
2161
2162 2015-03-09  Pedro Alves  <palves@redhat.com>
2163
2164         Revert:
2165         2015-03-07  Pedro Alves  <palves@redhat.com>
2166         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2167         or <winsock2.h> here.  Instead include "gdb_socket.h".
2168         (remote_open): Use union gdb_sockaddr_u.
2169         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2170         or <winsock2.h> here.  Instead include "gdb_socket.h".
2171         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2172         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2173         or <sys/un.h>.
2174         (init_named_socket, gdb_agent_helper_thread): Use union
2175         gdb_sockaddr_u.
2176
2177 2015-03-07  Pedro Alves  <palves@redhat.com>
2178
2179         * configure.ac (build_warnings): Move
2180         -Wdeclaration-after-statement to the C-specific set.
2181         * configure: Regenerate.
2182
2183 2015-03-07  Pedro Alves  <palves@redhat.com>
2184
2185         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2186         or <winsock2.h> here.  Instead include "gdb_socket.h".
2187         (remote_open): Use union gdb_sockaddr_u.
2188         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2189         or <winsock2.h> here.  Instead include "gdb_socket.h".
2190         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2191         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2192         or <sys/un.h>.
2193         (init_named_socket, gdb_agent_helper_thread): Use union
2194         gdb_sockaddr_u.
2195
2196 2015-03-07  Pedro Alves  <palves@redhat.com>
2197
2198         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2199         instead.
2200
2201 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2202
2203         * linux-aarch64-low.c (aarch64_insert_point): Use
2204         show_debug_regs as a boolean.
2205         (aarch64_remove_point): Likewise.
2206
2207 2015-03-05  Pedro Alves  <palves@redhat.com>
2208
2209         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2210         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2211         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2212         * nto-low.c (nto_target_ops): Likewise.
2213         * spu-low.c (spu_target_ops): Likewise.
2214         * win32-low.c (win32_target_ops): Likewise.
2215
2216 2015-03-04  Pedro Alves  <palves@redhat.com>
2217
2218         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2219         Decide whether a breakpoint triggered based on the SIGTRAP's
2220         siginfo.si_code.
2221         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2222         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2223         (linux_low_filter_event): Check for breakpoints before checking
2224         watchpoints.
2225         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2226         siginfo.si_code.
2227         (linux_stopped_by_sw_breakpoint)
2228         (linux_supports_stopped_by_sw_breakpoint)
2229         (linux_stopped_by_hw_breakpoint)
2230         (linux_supports_stopped_by_hw_breakpoint): New functions.
2231         (linux_target_ops): Install new target methods.
2232
2233 2015-03-04  Pedro Alves  <palves@redhat.com>
2234
2235         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2236         * server.c (swbreak_feature, hwbreak_feature): New globals.
2237         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2238         (captured_main): Clear swbreak_feature and hwbreak_feature.
2239         * server.h (swbreak_feature, hwbreak_feature): Declare.
2240         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2241         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2242         supports_stopped_by_hw_breakpoint>: New fields.
2243         (target_supports_stopped_by_sw_breakpoint)
2244         (target_stopped_by_sw_breakpoint)
2245         (target_supports_stopped_by_hw_breakpoint)
2246         (target_stopped_by_hw_breakpoint): Declare.
2247
2248 2015-03-04  Pedro Alves  <palves@redhat.com>
2249
2250         enum lwp_stop_reason -> enum target_stop_reason
2251         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2252         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2253         (linux_wait_1, stuck_in_jump_pad_callback)
2254         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2255         (linux_stopped_by_watchpoint):
2256         * linux-low.h (enum lwp_stop_reason): Delete.
2257         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2258         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2259
2260 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2261
2262         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2263
2264 2015-03-03  Gary Benson  <gbenson@redhat.com>
2265
2266         * hostio.c (handle_vFile): Fix prefix lengths.
2267
2268 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2269
2270         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2271         ptr_bits.
2272
2273 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2274
2275         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2276         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2277         (clean): Add "rm -f" for above C files.
2278         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2279         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2280         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2281         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2282         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2283         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2284         (init_registers_s390x_vx_linux64)
2285         (init_registers_s390x_tevx_linux64)
2286         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2287         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2288         declarations.
2289         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2290         (s390_store_vxrs_high): New functions.
2291         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2292         NT_S390_VXRS_HIGH.
2293         (s390_arch_setup): Add logic for selecting one of the new target
2294         descriptions.  Activate the new vector regsets if applicable.
2295         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2296         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2297         and init_registers_s390x_tevx_linux64.
2298
2299 2015-03-01  Pedro Alves  <palves@redhat.com>
2300
2301         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2302         parameter.
2303
2304 2015-02-27  Pedro Alves  <palves@redhat.com>
2305
2306         * linux-x86-low.c (u_debugreg_offset): New function.
2307         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2308
2309 2015-02-27  Pedro Alves  <palves@redhat.com>
2310
2311         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2312         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2313         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2314         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2315         (ps_lsetfpregs, ps_getpid)
2316         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2317         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2318         (ps_lsetxregs, ps_plog): Declare.
2319
2320 2015-02-27  Pedro Alves  <palves@redhat.com>
2321
2322         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2323         IP_AGENT_EXPORT_FUNC.
2324         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2325         IP_AGENT_EXPORT_FUNC.
2326         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2327         (IP_AGENT_EXPORT): Delete.
2328         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2329         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2330         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2331         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2332         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2333         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2334         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2335         (traceframe_read_count, traceframe_write_count)
2336         (traceframes_created, trace_state_variables, get_raw_reg)
2337         (get_trace_state_variable_value, set_trace_state_variable_value)
2338         (ust_loaded, helper_thread_id, cmd_buf): Use
2339         IPA_SYM_EXPORTED_NAME.
2340         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2341         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2342         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2343         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2344         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2345         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2346         EXTERN_C_PUSH/EXTERN_C_POP.
2347         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2348         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2349         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2350         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2351         (traceframe_write_count, traceframe_read_count)
2352         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2353         (about_to_request_buffer_space, get_trace_state_variable_value)
2354         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2355         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2356         EXTERN_C_PUSH/EXTERN_C_POP.
2357         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2358         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2359         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2360         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2361         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2362         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2363         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2364         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2365         Define.
2366         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2367         (IP_AGENT_EXPORT_VAR_DECL): Define.
2368         (tracing): Declare.
2369         (gdb_agent_get_raw_reg): Declare.
2370
2371 2015-02-27  Tom Tromey  <tromey@redhat.com>
2372             Pedro Alves  <palves@redhat.com>
2373
2374         Rename symbols whose names are reserved C++ keywords throughout.
2375
2376 2015-02-27  Pedro Alves  <palves@redhat.com>
2377
2378         * Makefile.in (COMPILER): New, get it from autoconf.
2379         (CXX): Get from autoconf instead.
2380         (COMPILE.pre): Use COMPILER.
2381         (CC-LD): Rename to ...
2382         (CC_LD): ... this.  Use COMPILER.
2383         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2384         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2385         * acinclude.m4: Include build-with-cxx.m4.
2386         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2387         Disable -Werror by default if building in C++ mode.
2388         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2389         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2390         the C++ compiler.  Save/restore CXXFLAGS too.
2391         * configure: Regenerate.
2392
2393 2015-02-27  Pedro Alves  <palves@redhat.com>
2394
2395         * acinclude.m4: Include libiberty.m4.
2396         * configure.ac: Call libiberty_INIT.
2397         * config.in, configure: Regenerate.
2398
2399 2015-02-26  Pedro Alves  <palves@redhat.com>
2400
2401         * linux-low.c (linux_wait_1): When incrementing the PC past a
2402         program breakpoint always use the_low_target.breakpoint_len as
2403         increment, rather than the maximum between that and
2404         the_low_target.decr_pc_after_break.
2405
2406 2015-02-23  Pedro Alves  <palves@redhat.com>
2407
2408         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2409         thread was doing a step-over; always adjust the PC if
2410         we stepped over a permanent breakpoint.
2411         (linux_wait_1): If we stepped over breakpoint that was on top of a
2412         permanent breakpoint, manually advance the PC past it.
2413
2414 2015-02-23  Pedro Alves  <palves@redhat.com>
2415
2416         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2417         modes.
2418         (x86_fill_gregset, x86_store_gregset): Use it when handling
2419         $orig_eax.
2420
2421 2015-02-20  Pedro Alves  <palves@redhat.com>
2422
2423         * thread-db.c: Include "nat/linux-procfs.h".
2424         (thread_db_init): Skip listing new threads if the kernel supports
2425         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2426
2427 2015-02-20  Pedro Alves  <palves@redhat.com>
2428
2429         * linux-low.c (status_pending_p_callback): Use ptid_match.
2430
2431 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2432
2433         PR breakpoints/16812
2434         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2435         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2436         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2437
2438 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2439
2440         PR breakpoints/15956
2441         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2442
2443 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2444
2445         * linux-low.c (linux_low_btrace_conf): Print size.
2446         * server.c (handle_btrace_conf_general_set): New.
2447         (hanle_general_set): Call handle_btrace_conf_general_set.
2448         (handle_query): Report Qbtrace-conf:bts:size as supported.
2449
2450 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2451
2452         * linux-low.c (linux_low_enable_btrace): Update parameters.
2453         (linux_low_btrace_conf): New.
2454         (linux_target_ops)<to_btrace_conf>: Initialize.
2455         * server.c (current_btrace_conf): New.
2456         (handle_btrace_enable): Rename to ...
2457         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2458         to target_enable_btrace.  Update comment.  Update users.
2459         (handle_qxfer_btrace_conf): New.
2460         (qxfer_packets): Add btrace-conf entry.
2461         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2462         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2463         (target_ops)<read_btrace_conf>: New.
2464         (target_enable_btrace): Update parameters.
2465         (target_read_btrace_conf): New.
2466
2467 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2468
2469         * server.c (handle_btrace_general_set): Remove call to
2470         target_supports_btrace.
2471         (supported_btrace_packets): New.
2472         (handle_query): Call supported_btrace_packets.
2473         * target.h: include btrace-common.h.
2474         (btrace_target_info): Removed.
2475         (supports_btrace, target_supports_btrace): Update parameters.
2476
2477 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2478
2479         * Makefile.in (SFILES): Add common/btrace-common.c.
2480         (OBS): Add common/btrace-common.o.
2481         (btrace-common.o): Add build rules.
2482         * linux-low: Include btrace-common.h.
2483         (linux_low_read_btrace): Use struct btrace_data.  Call
2484         btrace_data_init and btrace_data_fini.
2485
2486 2015-02-06  Pedro Alves  <palves@redhat.com>
2487
2488         * thread-db.c (find_new_threads_callback): Add debug output.
2489
2490 2015-02-04  Pedro Alves  <palves@redhat.com>
2491
2492         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2493         (resume_stopped_resumed_lwps): New function.
2494         (linux_wait_for_event_filtered): Use it.
2495
2496 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2497
2498         * Makefile.in (SFILES): Add linux-personality.c.
2499         (linux-personality.o): New rule.
2500         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2501         list of objects to be built.
2502         * linux-low.c: Include nat/linux-personality.h.
2503         (linux_create_inferior): Remove code to disable address space
2504         randomization (moved to ../nat/linux-personality.c).  Create
2505         cleanup to disable address space randomization.
2506
2507 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2508
2509         * Makefile.in (posix-strerror.o): New rule.
2510         (mingw-strerror.o): Likewise.
2511         * configure: Regenerated.
2512         * configure.ac: Source file ../common/common.host.  Initialize new
2513         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2514
2515 2015-01-14  Yao Qi  <yao@codesourcery.com>
2516
2517         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2518         (ppc-linux.o): New rule.
2519         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2520         * configure.ac: AC_CHECK_FUNCS(getauxval).
2521         * config.in: Re-generated.
2522         * configure: Re-generated.
2523         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2524         ppc64_64bit_inferior_p
2525
2526 2015-01-14  Yao Qi  <yao@codesourcery.com>
2527
2528         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2529          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2530         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2531         (PT_ORIG_R3, PT_TRAP): Likewise.
2532         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2533         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2534         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2535
2536 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2537
2538         * i387-fp.c (i387_cache_to_xsave): In look over
2539         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2540         zmmh_low_space field by use of zmmh_high_space.
2541
2542 2015-01-09  Pedro Alves  <palves@redhat.com>
2543
2544         * linux-low.c (step_over_bkpt): Move higher up in the file.
2545         (handle_extended_wait): Don't store the stop_pc here.
2546         (get_stop_pc): Adjust comments and rename to ...
2547         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2548         stopped for a software breakpoint or hardware breakpoint.
2549         (thread_still_has_status_pending_p): New function.
2550         (status_pending_p_callback): Use
2551         thread_still_has_status_pending_p.  If the event is no longer
2552         interesting, resume the LWP.
2553         (handle_tracepoints): Add assert.
2554         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2555         (wstatus_maybe_breakpoint): New function.
2556         (cancel_breakpoint): Delete function.
2557         (check_stopped_by_watchpoint): New function, factored out from
2558         linux_low_filter_event.
2559         (lp_status_maybe_breakpoint): Delete function.
2560         (linux_low_filter_event): Remove filter_ptid argument.
2561         Leave thread group exits pending here.  Store the LWP's stop PC.
2562         Always leave events pending.
2563         (linux_wait_for_event_filtered): Pull all events out of the
2564         kernel, and leave them all pending.
2565         (count_events_callback, select_event_lwp_callback): Consider all
2566         events.
2567         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2568         (select_event_lwp): Only give preference to the stepping LWP in
2569         all-stop mode.  Adjust comments.
2570         (ignore_event): New function.
2571         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2572         references to cancel_breakpoints.  Adjust to renames.  Also give
2573         equal priority to all LWPs that have had events in non-stop mode.
2574         If reporting a software breakpoint event, unadjust the LWP's PC.
2575         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2576         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2577         Adjust.
2578         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2579         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2580         (linux_stopped_by_watchpoint): Adjust.
2581         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2582         * linux-low.h (enum lwp_stop_reason): New.
2583         (struct lwp_info) <stop_pc>: Adjust comment.
2584         <stopped_by_watchpoint>: Delete field.
2585         <stop_reason>: New field.
2586         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2587         * mem-break.c (software_breakpoint_inserted_here)
2588         (hardware_breakpoint_inserted_here): New function.
2589         * mem-break.h (software_breakpoint_inserted_here)
2590         (hardware_breakpoint_inserted_here): Declare.
2591         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2592         (cancel_breakpoints): Delete.
2593         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2594         (upload_fast_traceframes): Remove references to
2595         cancel_breakpoints.
2596
2597 2015-01-09  Pedro Alves  <palves@redhat.com>
2598
2599         * thread-db.c (find_new_threads_callback): Ignore thread if the
2600         kernel thread ID is -1.
2601
2602 2015-01-09  Pedro Alves  <palves@redhat.com>
2603
2604         * linux-low.c (linux_attach_fail_reason_string): Move to
2605         nat/linux-ptrace.c, and rename.
2606         (linux_attach_lwp): Update comment.
2607         (attach_proc_task_lwp_callback): New function.
2608         (linux_attach): Adjust to rename and use
2609         linux_proc_attach_tgid_threads.
2610         (linux_attach_fail_reason_string): Delete declaration.
2611
2612 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2613
2614         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2615         * server.c (gdbserver_version): Likewise.
2616
2617 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2618
2619         * remote-utils.c: Include ctype.h.
2620         (input_interrupt): Explicitly handle the case when the char
2621         received is the NUL byte.  Improve the printing of non-ASCII
2622         characters.
2623
2624 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2625
2626         * linux-low.c (linux_low_filter_event): Update call to
2627         linux_enable_event_reporting following the addition of
2628         a new parameter to that function.
2629
2630 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2631
2632         PR server/17457
2633         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2634         (AARCH64_FPCR_REGNO): Likewise.
2635         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2636         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2637         (aarch64_store_fpregset): Likewise.
2638
2639 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2640
2641         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2642         Remove FIXME comment about assumption about N.
2643
2644 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
2645
2646         * configure.ac: If large-file support is disabled in GDBserver,
2647         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
2648         * configure: Regenerate.
2649
2650 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2651
2652         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
2653         warning upon ENODATA from ptrace.
2654         * linux-s390-low.c (s390_store_tdb): New.
2655         (s390_regsets): Add regset for NT_S390_TDB.
2656
2657 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2658
2659         * linux-low.c (regsets_store_inferior_registers): Skip regsets
2660         without a fill_function.
2661         * linux-s390-low.c (s390_fill_last_break): Remove.
2662         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
2663         (s390_arch_setup): Use regset's size instead of fill_function for
2664         loop end condition.
2665
2666 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2667
2668         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
2669         the regset's store function when ptrace returned an error.
2670         * regcache.c (get_thread_regcache): Invalidate register cache
2671         before fetching inferior's registers.
2672
2673 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2674
2675         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
2676         while-loop as for-loop.
2677         (regsets_store_inferior_registers): Likewise.
2678
2679 2014-11-28  Yao Qi  <yao@codesourcery.com>
2680
2681         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
2682         * config.in, configure: Re-generate.
2683         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
2684         is defined.
2685
2686 2014-11-21  Yao Qi  <yao@codesourcery.com>
2687
2688         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
2689         (AC_CHECK_HEADERS): Remove malloc.h.
2690         * configure: Re-generated.
2691         * config.in: Re-generated.
2692         * server.h: Don't include alloca.h and malloc.h.
2693         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
2694         Don't include malloc.h.
2695
2696 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
2697
2698         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
2699         corresponding ERRNO check in same block.
2700
2701 2014-11-12  Pedro Alves  <palves@redhat.com>
2702
2703         * server.c (cont_thread): Update comment.
2704         (start_inferior, attach_inferior): No longer clear cont_thread.
2705         (handle_v_cont): No longer set cont_thread.
2706         (captured_main): Clear cont_thread each time a GDB connects.
2707
2708 2014-11-12  Pedro Alves  <palves@redhat.com>
2709
2710         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
2711         thread, and don't resume all threads if the Hc thread has exited.
2712
2713 2014-11-12  Pedro Alves  <palves@redhat.com>
2714
2715         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
2716         the process group instead of to a specific LWP.
2717
2718 2014-10-15  Pedro Alves  <palves@redhat.com>
2719
2720         PR server/17487
2721         * win32-arm-low.c (arm_set_thread_context): Remove current_event
2722         parameter.
2723         (arm_set_thread_context): Delete.
2724         (the_low_target): Adjust.
2725         * win32-i386-low.c (debug_registers_changed)
2726         (debug_registers_used): Delete.
2727         (update_debug_registers_callback): New function.
2728         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
2729         needing to update their debug registers.
2730         (win32_get_current_dr): New function.
2731         (x86_dr_low_get_addr, x86_dr_low_get_control)
2732         (x86_dr_low_get_status): Fetch the debug register from the thread
2733         record's context.
2734         (i386_initial_stuff): Adjust.
2735         (i386_get_thread_context): Remove current_event parameter.  Don't
2736         clear debug_registers_changed nor copy DR values to
2737         debug_reg_state.
2738         (i386_set_thread_context): Delete.
2739         (i386_prepare_to_resume): New function.
2740         (i386_thread_added): Mark the thread as needing to update irs
2741         debug registers.
2742         (the_low_target): Remove i386_set_thread_context and install
2743         i386_prepare_to_resume.
2744         * win32-low.c (win32_get_thread_context): Adjust.
2745         (win32_set_thread_context): Use SetThreadContext
2746         directly.
2747         (win32_prepare_to_resume): New function.
2748         (win32_require_context): New function, factored out from ...
2749         (thread_rec): ... this.
2750         (continue_one_thread): Call win32_prepare_to_resume on each thread
2751         we're about to continue.
2752         (win32_resume): Call win32_prepare_to_resume on the event thread.
2753         * win32-low.h (struct win32_thread_info)
2754         <debug_registers_changed>: New field.
2755         (struct win32_target_ops): Change prototype of set_thread_context,
2756         delete set_thread_context and add prepare_to_resume.
2757         (win32_require_context): New declaration.
2758
2759 2014-10-08  Gary Benson  <gbenson@redhat.com>
2760
2761         * server.h: Do not include common-exceptions.h.
2762
2763 2014-10-08  Gary Benson  <gbenson@redhat.com>
2764
2765         * server.h: Do not include cleanups.h.
2766
2767 2014-09-30  James Hogan  <james.hogan@imgtec.com>
2768
2769         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
2770         mips64-dsp-linux.c.
2771
2772 2014-09-23  Yao Qi  <yao@codesourcery.com>
2773
2774         * linux-low.c (lp_status_maybe_breakpoint): New function.
2775         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
2776         (count_events_callback): Likewise.
2777         (select_event_lwp_callback): Likewise.
2778         (cancel_breakpoints_callback): Likewise.
2779
2780 2014-09-19  Don Breazeal  <donb@codesourcery.com>
2781
2782         * linux-low.c (handle_extended_wait): Call
2783         linux_ptrace_get_extended_event.
2784         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
2785         linux_is_extended_waitstatus.
2786
2787 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
2788
2789         * Makefile.in (CPPFLAGS): Define.
2790         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
2791         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
2792
2793 2014-09-16  Gary Benson  <gbenson@redhat.com>
2794
2795         * inferiors.h (current_inferior): Renamed as...
2796         (current_thread): New variable.  All uses updated.
2797         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
2798         (maybe_move_out_of_jump_pad): Likewise.
2799         (cancel_breakpoint): Likewise.
2800         (linux_low_filter_event): Likewise.
2801         (wait_for_sigstop): Likewise.
2802         (linux_resume_one_lwp): Likewise.
2803         (need_step_over_p): Likewise.
2804         (start_step_over): Likewise.
2805         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
2806         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
2807         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
2808         and save_inferior as saved_thread.
2809         * regcache.c (get_thread_regcache): Renamed saved_inferior as
2810         saved_thread.
2811         (regcache_invalidate_thread): Likewise.
2812         * remote-utils.c (prepare_resume_reply): Likewise.
2813         * thread-db.c (thread_db_get_tls_address): Likewise.
2814         (disable_thread_event_reporting): Likewise.
2815         (remove_thread_event_breakpoints): Likewise.
2816         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
2817         as saved_thread.
2818         * target.h (set_desired_inferior): Renamed as...
2819         (set_desired_thread): New declaration.  All uses updated.
2820         * server.c (myresume): Updated comment to reference thread instead
2821         of inferior.
2822         (handle_serial_event): Likewise.
2823         (handle_target_event): Likewise.
2824
2825 2014-09-12  Tom Tromey  <tromey@redhat.com>
2826             Gary Benson  <gbenson@redhat.com>
2827
2828         * regcache.h: Include common-regcache.h.
2829         (regcache_read_pc): Don't declare.
2830         * regcache.c (get_thread_regcache_for_ptid): New function.
2831
2832 2014-09-11  Tom Tromey  <tromey@redhat.com>
2833             Gary Benson  <gbenson@redhat.com>
2834
2835         * symbol.c: New file.
2836         * Makefile.in (SFILES): Add symbol.c.
2837         (OBS): Add symbol.o.
2838
2839 2014-09-11  Gary Benson  <gbenson@redhat.com>
2840
2841         * target.c (target_stop_ptid, target_continue_ptid): New
2842         functions.
2843
2844 2014-09-11  Tom Tromey  <tromey@redhat.com>
2845             Gary Benson  <gbenson@redhat.com>
2846
2847         * target.h: Include target/target.h.
2848         * target.c (target_read_memory, target_read_uint32)
2849         (target_write_memory): New functions.
2850
2851 2014-09-11  Gary Benson  <gbenson@redhat.com>
2852
2853         * server.h (debug_hw_points): Don't declare.
2854         * server.c (debug_hw_points): Don't define.  Replace all uses
2855         with show_debug_regs.
2856         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
2857         all uses with show_debug_regs.
2858
2859 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
2860
2861         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
2862         endianness into account.
2863         (ppc_supply_ptrace_register): Likewise.
2864
2865 2014-09-03  James Hogan  <james.hogan@imgtec.com>
2866
2867         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
2868         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2869
2870 2014-09-03  Gary Benson  <gbenson@redhat.com>
2871
2872         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
2873         ALL_DEBUG_ADDRESS_REGISTERS.
2874
2875 2014-09-02  Gary Benson  <gbenson@redhat.com>
2876
2877         * i386-low.h: Renamed as...
2878         * x86-low.h: New file.  All type, function and variable name
2879         prefixes changed from "i386_" to "x86_".  All references updated.
2880         * i386-low.c: Renamed as...
2881         * x86-low.c: New file.  All type, function and variable name
2882         prefixes changed from "i386_" to "x86_".  All references updated.
2883
2884 2014-09-02  Gary Benson  <gbenson@redhat.com>
2885
2886         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
2887         (x86_linux_new_thread): Likewise.
2888
2889 2014-08-29  Gary Benson  <gbenson@redhat.com>
2890
2891         * server.h (setjmp.h): Do not include.
2892         (toplevel): Do not declare.
2893         (common-exceptions.h): Include.
2894         (cleanups.h): Likewise.
2895         * server.c (toplevel): Do not define.
2896         (exit_code): New static global.
2897         (detach_or_kill_for_exit_cleanup): New function.
2898         (main): New function.  Original main renamed to...
2899         (captured_main): New function.
2900         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
2901
2902 2014-08-29  Gary Benson  <gbenson@redhat.com>
2903
2904         * Makefile.in (SFILES): Add common/common-exceptions.c.
2905         (OBS): Add common-exceptions.o.
2906         (common-exceptions.o): New rule.
2907         * utils.c (prepare_to_throw_exception): New function.
2908
2909 2014-08-29  Gary Benson  <gbenson@redhat.com>
2910
2911         * config.in: Regenerate.
2912         * configure: Likewise.
2913
2914 2014-08-29  Gary Benson  <gbenson@redhat.com>
2915
2916         * Makefile.in (SFILES): Add common/cleanups.c.
2917         (OBS): cleanups.o.
2918         (cleanups.o): New rule.
2919
2920 2014-08-29  Gary Benson  <gbenson@redhat.com>
2921
2922         * utils.c (internal_vwarning): New function.
2923
2924 2014-08-28  Gary Benson  <gbenson@redhat.com>
2925
2926         * utils.h (fatal): Remove declaration.
2927         * utils.c (fatal): Remove function.
2928
2929 2014-08-28  Gary Benson  <gbenson@redhat.com>
2930
2931         * tracepoint.c (gdb_agent_init): Replace fatal with
2932         perror_with_name.
2933         (initialize_tracepoint): Likewise.
2934
2935 2014-08-28  Gary Benson  <gbenson@redhat.com>
2936
2937         * remote-utils.c (remote_prepare): Replace fatal with error.
2938
2939 2014-08-28  Gary Benson  <gbenson@redhat.com>
2940
2941         * linux-low.c (linux_async): Replace fatal with warning.
2942         Tidy up and return.
2943         (linux_start_non_stop): Return -1 if linux_async failed.
2944
2945 2014-08-28  Gary Benson  <gbenson@redhat.com>
2946
2947         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
2948         gdb_assert.
2949         (i386_dr_low_get_addr): Remove vague comment.
2950         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
2951         gdb_assert.
2952
2953 2014-08-28  Gary Benson  <gbenson@redhat.com>
2954
2955         * inferiors.c (get_thread_process): Replace check with gdb_assert.
2956         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
2957         internal_error.
2958         (linux_resume_one_lwp): Likewise.
2959         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
2960         gdb_assert.
2961         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
2962         with internal_error.
2963         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
2964         (init_register_cache): Replace fatal with gdb_assert_not_reached.
2965         (find_register_by_name): Replace fatal with internal_error.
2966         (find_regno): Likewise.
2967         * tdesc.c (init_target_desc): Replace check with gdb_assert.
2968         * thread-db.c (thread_db_create_event): Likewise.
2969         (thread_db_load_search): Likewise.
2970         (try_thread_db_load_1): Likewise.
2971         * tracepoint.c (get_jump_space_head): Replace fatal with
2972         internal_error.
2973         (claim_trampoline_space): Likewise.
2974         (have_fast_tracepoint_trampoline_buffer): Likewise.
2975         (cmd_qtstart): Likewise.
2976         (stop_tracing): Likewise.
2977         (fast_tracepoint_collecting): Likewise.
2978         (target_malloc): Likewise.
2979         (download_tracepoint): Likewise.
2980         (download_trace_state_variables): Replace check with gdb_assert.
2981         (upload_fast_traceframes): Replace fatal with internal_error.
2982
2983 2014-08-19  Tom Tromey  <tromey@redhat.com>
2984             Gary Benson  <gbenson@redhat.com>
2985
2986         * Makefile.in (SFILES): Add common/common-debug.c.
2987         (OBS): Add common-debug.o.
2988         (common-debug.o): New rule.
2989         * debug.h (debug_printf): Don't declare.
2990         * debug.c (debug_printf): Renamed and rewritten as...
2991         (debug_vprintf): New function.
2992
2993 2014-08-19  Gary Benson  <gbenson@redhat.com>
2994
2995         * utils.h: Do not include print-utils.h.
2996
2997 2014-08-19  Tom Tromey  <tromey@redhat.com>
2998             Gary Benson  <gbenson@redhat.com>
2999
3000         * server.h: Add static assertion.
3001         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
3002
3003 2014-08-19  Tom Tromey  <tromey@redhat.com>
3004             Gary Benson  <gbenson@redhat.com>
3005
3006         * Makefile.in (SFILES): Add common/errors.c.
3007         (OBS): Add errors.o.
3008         (IPA_OBS): Add errors-ipa.o.
3009         (errors.o): New rule.
3010         (errors-ipa.o): Likewise.
3011         * utils.h (perror_with_name, error, warning): Don't declare.
3012         * utils.c (warning): Renamed and rewritten as...
3013         (vwarning): New function.
3014         (error): Renamed and rewritten as...
3015         (verror): New function.
3016         (internal_error): Renamed and rewritten as...
3017         (internal_verror): New function.
3018
3019 2014-08-07  Gary Benson  <gbenson@redhat.com>
3020
3021         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
3022         * configure: Regenerate.
3023         * config.in: Likewise.
3024         * server.h: Do not include errno.h.
3025         * event-loop.c: Likewise.
3026         * hostio-errno.c: Likewise.
3027         * linux-low.c: Likewise.
3028         * remote-utils.c: Likewise.
3029         * spu-low.c: Likewise.
3030         * utils.c: Likewise.
3031         * gdbreplay.c: Unconditionally include errno.h.
3032
3033 2014-08-07  Gary Benson  <gbenson@redhat.com>
3034
3035         * server.h: Do not include string.h.
3036         * event-loop.c: Likewise.
3037         * linux-low.c: Likewise.
3038         * regcache.c: Likewise.
3039         * remote-utils.c: Likewise.
3040         * spu-low.c: Likewise.
3041         * utils.c: Likewise.
3042
3043 2014-08-07  Gary Benson  <gbenson@redhat.com>
3044
3045         * server.h: Do not include gdb_assert.h.
3046
3047 2014-08-07  Gary Benson  <gbenson@redhat.com>
3048
3049         * server.h: Do not include common-utils.h.
3050
3051 2014-08-07  Gary Benson  <gbenson@redhat.com>
3052
3053         * server.h: Do not include ptid.h.
3054         * notif.h: Likewise.
3055
3056 2014-08-07  Gary Benson  <gbenson@redhat.com>
3057
3058         * server.h: Do not include gdb_locale.h.
3059
3060 2014-08-07  Gary Benson  <gbenson@redhat.com>
3061
3062         * server.h: Do not include gdb/signals.h.
3063         * win32-low.c: Likewise.
3064
3065 2014-08-07  Gary Benson  <gbenson@redhat.com>
3066
3067         * server.h: Do not include pathmax.h.
3068
3069 2014-08-07  Gary Benson  <gbenson@redhat.com>
3070
3071         * server.h: Do not include libiberty.h.
3072         * linux-bfin-low.c: Likewise.
3073
3074 2014-08-07  Gary Benson  <gbenson@redhat.com>
3075
3076         * server.h: Do not include ansidecl.h.
3077
3078 2014-08-07  Gary Benson  <gbenson@redhat.com>
3079
3080         * linux-x86-low.c: Do not include stddef.h.
3081         * lynx-ppc-low.c: Likewise.
3082         * tracepoint.c: Likewise.
3083
3084 2014-08-07  Gary Benson  <gbenson@redhat.com>
3085
3086         * server.h: Do not include stdarg.h.
3087         * nto-low.c: Likewise.
3088
3089 2014-08-07  Gary Benson  <gbenson@redhat.com>
3090
3091         * server.h: Do not include stdlib.h.
3092         * inferiors.c: Likewise.
3093         * linux-low.c: Likewise.
3094         * regcache.c: Likewise.
3095         * spu-low.c: Likewise.
3096         * tracepoint.c: Likewise.
3097         * utils.c: Likewise.
3098
3099 2014-08-07  Gary Benson  <gbenson@redhat.com>
3100
3101         * server.h: Do not include stdio.h.
3102         * linux-low.c: Likewise.
3103         * remote-utils.c: Likewise.
3104         * spu-low.c: Likewise.
3105         * utils.c: Likewise.
3106         * wincecompat.c: Likewise.
3107
3108 2014-08-06  Gary Benson  <gbenson@redhat.com>
3109
3110         * regcache.c (init_register_cache): Move conditionals inside if.
3111
3112 2014-08-06  Gary Benson  <gbenson@redhat.com>
3113
3114         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
3115
3116 2014-07-31  Gary Benson  <gbenson@redhat.com>
3117
3118         * ax.h: Do not include server.h.
3119         * gdbthread.h: Likewise.
3120         * lynx-low.h: Likewise.
3121         * notif.h: Likewise.
3122
3123 2014-07-30  Gary Benson  <gbenson@redhat.com>
3124
3125         * server.h: Include common-defs.h.
3126         Do not include config.h or build-gnulib-gdbserver/config.h.
3127
3128 2014-07-30  Gary Benson  <gbenson@redhat.com>
3129
3130         * hostio-errno.c: Move server.h to top of includes list.
3131         * inferiors.c: Likewise.
3132         * linux-x86-low.c: Likewise.
3133         * notif.c: Include server.h.
3134
3135 2014-07-24  Tom Tromey  <tromey@redhat.com>
3136             Gary Benson  <gbenson@redhat.com>
3137
3138         * server.h (CORE_ADDR): Now unsigned.
3139
3140 2014-07-16  Pedro Alves  <palves@redhat.com>
3141
3142         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
3143
3144 2014-07-15  Pedro Alves  <palves@redhat.com>
3145
3146         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
3147         copy.
3148
3149 2014-07-11  Pedro Alves  <palves@redhat.com>
3150
3151         * linux-low.c (kill_wait_lwp): New function, based on
3152         kill_one_lwp_callback, but use my_waitpid directly.
3153         (kill_one_lwp_callback, linux_kill): Use it.
3154
3155 2014-06-23  Pedro Alves  <palves@redhat.com>
3156
3157         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
3158         before setting DR0..DR3.
3159
3160 2014-06-20  Gary Benson  <gbenson@redhat.com>
3161
3162         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3163         * configure: Regenerated.
3164         * config.in: Likewise.
3165
3166 2014-06-20  Gary Benson  <gbenson@redhat.com>
3167
3168         * Makefile.in (SFILES): Update locations for files moved
3169         from common to nat.
3170         (object file files): Reordered.
3171
3172 2014-06-20  Gary Benson  <gbenson@redhat.com>
3173
3174         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3175         (i386_dr_low_set_addr): Likewise.
3176         (i386_dr_low_get_addr): Likewise.
3177         (i386_dr_low_can_set_control): Likewise.
3178         (i386_dr_low_set_control): Likewise.
3179         (i386_dr_low_get_control): Likewise.
3180         (i386_dr_low_get_status): Likewise.
3181         (i386_get_debug_register_length): Likewise.
3182         * linux-x86-low.c (i386_dr_low_set_addr):
3183         Changed signature.  Made static.
3184         (i386_dr_low_get_addr): Likewise.
3185         (i386_dr_low_set_control): Likewise.
3186         (i386_dr_low_get_control): Likewise.
3187         (i386_dr_low_get_status): Likewise.
3188         (i386_dr_low): New global variable.
3189         * win32-i386-low.c (i386_dr_low_set_addr):
3190         Changed signature.  Made static.
3191         (i386_dr_low_get_addr): Likewise.
3192         (i386_dr_low_set_control): Likewise.
3193         (i386_dr_low_get_control): Likewise.
3194         (i386_dr_low_get_status): Likewise.
3195         (i386_dr_low): New global variable.
3196
3197 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3198
3199         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3200         * Makefile.in (AR, AR_FLAGS): Define.
3201         * configure: Regenerate.
3202
3203 2014-06-19  Gary Benson  <gbenson@redhat.com>
3204
3205         * Makefile.in (i386-dregs.o): New rule.
3206         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3207         * i386-low.c (target.h): Remove include.
3208         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3209         (DR_CONTROL_SHIFT): Likewise.
3210         (DR_CONTROL_SIZE): Likewise.
3211         (DR_RW_EXECUTE): Likewise.
3212         (DR_RW_WRITE): Likewise.
3213         (DR_RW_READ): Likewise.
3214         (DR_RW_IORW): Likewise.
3215         (DR_LEN_1): Likewise.
3216         (DR_LEN_2): Likewise.
3217         (DR_LEN_4): Likewise.
3218         (DR_LEN_8): Likewise.
3219         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3220         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3221         (DR_ENABLE_SIZE): Likewise.
3222         (DR_LOCAL_SLOWDOWN): Likewise.
3223         (DR_GLOBAL_SLOWDOWN): Likewise.
3224         (DR_CONTROL_RESERVED): Likewise.
3225         (I386_DR_CONTROL_MASK): Likewise.
3226         (I386_DR_VACANT): Likewise.
3227         (I386_DR_LOCAL_ENABLE): Likewise.
3228         (I386_DR_GLOBAL_ENABLE): Likewise.
3229         (I386_DR_DISABLE): Likewise.
3230         (I386_DR_SET_RW_LEN): Likewise.
3231         (I386_DR_GET_RW_LEN): Likewise.
3232         (I386_DR_WATCH_HIT): Likewise.
3233         (i386_wp_op_t): Likewise.
3234         (i386_show_dr): Likewise.
3235         (i386_length_and_rw_bits): Likewise.
3236         (i386_insert_aligned_watchpoint): Likewise.
3237         (i386_remove_aligned_watchpoint): Likewise.
3238         (i386_handle_nonaligned_watchpoint): Likewise.
3239         i386_update_inferior_debug_regs(): Likewise.
3240         (i386_dr_insert_watchpoint): Likewise.
3241         (i386_dr_remove_watchpoint): Likewise.
3242         (i386_dr_region_ok_for_watchpoint): Likewise.
3243         (i386_dr_stopped_data_address): Likewise.
3244         (i386_dr_stopped_by_watchpoint): Likewise.
3245
3246 2014-06-19  Gary Benson  <gbenson@redhat.com>
3247
3248         * i386-low.c (i386_dr_show): Renamed to
3249         i386_show_dr and made static.  All uses updated.
3250         (i386_dr_length_and_rw_bits): Renamed to
3251         i386_length_and_rw_bits and made static.
3252         All uses updated.
3253         (i386_dr_insert_aligned_watchpoint): Renamed to
3254         i386_insert_aligned_watchpoint and made static.
3255         All uses updated.
3256         (i386_dr_remove_aligned_watchpoint): Renamed to
3257         i386_remove_aligned_watchpoint and made static.
3258         All uses updated.
3259         (i386_dr_update_inferior_debug_regs): Renamed to
3260         i386_update_inferior_debug_regs and made static.
3261         All uses updated.
3262
3263 2014-06-18  Gary Benson  <gbenson@redhat.com>
3264
3265         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3266         (i386_dr_low_can_set_control): Likewise.
3267         (i386_get_debug_register_length): Likewise.
3268         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3269         (i386_dr_low_can_set_control): Likewise.
3270         (i386_get_debug_register_length): Likewise.
3271
3272 2014-06-17  Gary Benson  <gbenson@redhat.com>
3273
3274         * i386-low.h (i386-dregs.h): New include.
3275         (DR_FIRSTADDR): Now in i386-dregs.h.
3276         (DR_LASTADDR): Likewise.
3277         (DR_NADDR): Likewise.
3278         (DR_STATUS): Likewise.
3279         (DR_CONTROL): Likewise.
3280         (i386_debug_reg_state): Likewise.
3281         (i386_dr_insert_watchpoint): Likewise.
3282         (i386_dr_remove_watchpoint): Likewise.
3283         (i386_dr_region_ok_for_watchpoint): Likewise.
3284         (i386_dr_stopped_data_address): Likewise.
3285         (i386_dr_stopped_by_watchpoint): Likewise.
3286         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3287
3288 2014-06-18  Gary Benson  <gbenson@redhat.com>
3289
3290         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3291         i386_dr_insert_watchpoint.
3292         (i386_low_remove_watchpoint): Renamed to
3293         i386_dr_remove_watchpoint.
3294         (i386_low_region_ok_for_watchpoint): Renamed to
3295         i386_dr_region_ok_for_watchpoint.
3296         (i386_low_stopped_data_address): Renamed to
3297         i386_dr_stopped_data_address.
3298         (i386_low_stopped_by_watchpoint): Renamed to
3299         i386_dr_stopped_by_watchpoint.
3300         * i386-low.c (i386_show_dr): Renamed to
3301         i386_dr_show and made nonstatic.  All uses updated.
3302         (i386_length_and_rw_bits): Renamed to
3303         i386_dr_length_and_rw_bits and made nonstatic.
3304         All uses updated.
3305         (i386_insert_aligned_watchpoint): Renamed to
3306         i386_dr_insert_aligned_watchpoint and made nonstatic.
3307         All uses updated.
3308         (i386_remove_aligned_watchpoint): Renamed to
3309         i386_dr_remove_aligned_watchpoint and made nonstatic.
3310         All uses updated.
3311         (i386_update_inferior_debug_regs): Renamed to
3312         i386_dr_update_inferior_debug_regs and made nonstatic.
3313         All uses updated.
3314         (i386_low_insert_watchpoint): Renamed to
3315         i386_dr_insert_watchpoint.  All uses updated.
3316         (i386_low_remove_watchpoint): Renamed to
3317         i386_dr_remove_watchpoint.  All uses updated.
3318         (i386_low_region_ok_for_watchpoint): Renamed to
3319         i386_dr_region_ok_for_watchpoint.  All uses updated.
3320         (i386_low_stopped_data_address): Renamed to
3321         i386_dr_stopped_data_address.  All uses updated.
3322         (i386_low_stopped_by_watchpoint): Renamed to
3323         i386_dr_stopped_by_watchpoint.  All uses updated.
3324
3325 2014-06-18  Gary Benson  <gbenson@redhat.com>
3326
3327         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3328         (i386_dr_low_can_set_control): Likewise.
3329         (i386_insert_aligned_watchpoint): New check.
3330
3331 2014-06-18  Gary Benson  <gbenson@redhat.com>
3332
3333         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3334         Renamed to state.
3335
3336 2014-06-18  Gary Benson  <gbenson@redhat.com>
3337
3338         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3339         instead of fatal and error.
3340         (i386_handle_nonaligned_watchpoint): Likewise.
3341
3342 2014-06-18  Gary Benson  <gbenson@redhat.com>
3343
3344         * i386-low.c (i386_get_debug_register_length): New macro.
3345         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3346         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3347         phex to format values.
3348
3349 2014-06-18  Gary Benson  <gbenson@redhat.com>
3350
3351         * i386-low.h: Comment changes.
3352         * i386-low.c: Likewise.
3353
3354 2014-06-18  Gary Benson  <gbenson@redhat.com>
3355
3356         * i386-low.c: Whitespace changes.
3357
3358 2014-06-12  Tom Tromey  <tromey@redhat.com>
3359
3360         * utils.c (freeargv): Remove.
3361
3362 2014-06-12  Tom Tromey  <tromey@redhat.com>
3363
3364         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3365         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3366         (parse_debug_format_options): Likewise.
3367         (gdbserver_usage): Likewise.
3368         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3369         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3370         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3371         against libiberty.
3372         ($(LIBGNU)): Depend on libiberty.
3373         (all-lib): Recurse into all subdirs.
3374         (install-only): Invoke "install" target in subdirs.
3375         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3376         targets.
3377         * configure: Rebuild.
3378         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3379         for vasprintf, vsnprintf, or gettimeofday.
3380         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3381         srv_tgtobj.
3382
3383 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3384
3385         * development.sh: Delete.
3386         * Makefile.in (config.status): Adjust dependency on development.sh.
3387         * configure.ac: Adjust development.sh source call.
3388         * configure: Regenerate.
3389
3390 2014-06-02  Pedro Alves  <palves@redhat.com>
3391
3392         * ax.c (gdb_free_agent_expr): New function.
3393         * ax.h (gdb_free_agent_expr): New declaration.
3394         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3395         list.
3396         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3397         static.
3398         (clear_breakpoint_conditions_and_commands): New function.
3399         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3400         (clear_breakpoint_conditions_and_commands): New declaration.
3401
3402 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3403
3404         * linux-aarch64-low.c (asm/ptrace.h): Include.
3405
3406 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3407
3408         Fix TLS access for -static -pthread.
3409         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3410         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3411         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3412
3413 2014-05-20  Pedro Alves  <palves@redhat.com>
3414
3415         * linux-aarch64-low.c (aarch64_insert_point)
3416         (aarch64_remove_point): No longer check whether the type is
3417         supported here.  Adjust to new interface.
3418         (the_low_target): Install aarch64_supports_z_point_type as
3419         supports_z_point_type method.
3420         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3421         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3422         instead of a Z packet char.  Adjust.
3423         (arm_supports_z_point_type): New function.
3424         (arm_insert_point, arm_remove_point): Adjust to new interface.
3425         (the_low_target): Install arm_supports_z_point_type.
3426         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3427         (cris_insert_point, cris_remove_point): Adjust to new interface.
3428         Don't check whether the type is supported here.
3429         (the_low_target): Install cris_supports_z_point_type.
3430         * linux-low.c (linux_supports_z_point_type): New function.
3431         (linux_insert_point, linux_remove_point): Adjust to new interface.
3432         * linux-low.h (struct linux_target_ops) <insert_point,
3433         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3434         raw_breakpoint pointer parameter.
3435         <supports_z_point_type>: New method.
3436         * linux-mips-low.c (mips_supports_z_point_type): New function.
3437         (mips_insert_point, mips_remove_point): Adjust to new interface.
3438         Use mips_supports_z_point_type.
3439         (the_low_target): Install mips_supports_z_point_type.
3440         * linux-ppc-low.c (the_low_target): Install NULL as
3441         supports_z_point_type method.
3442         * linux-s390-low.c (the_low_target): Install NULL as
3443         supports_z_point_type method.
3444         * linux-sparc-low.c (the_low_target): Install NULL as
3445         supports_z_point_type method.
3446         * linux-x86-low.c (x86_supports_z_point_type): New function.
3447         (x86_insert_point): Adjust to new insert_point interface.  Use
3448         insert_memory_breakpoint.  Adjust to new
3449         i386_low_insert_watchpoint interface.
3450         (x86_remove_point): Adjust to remove_point interface.  Use
3451         remove_memory_breakpoint.  Adjust to new
3452         i386_low_remove_watchpoint interface.
3453         (the_low_target): Install x86_supports_z_point_type.
3454         * lynx-low.c (lynx_target_ops): Install NULL as
3455         supports_z_point_type callback.
3456         * nto-low.c (nto_supports_z_point_type): New.
3457         (nto_insert_point, nto_remove_point): Adjust to new interface.
3458         (nto_target_ops): Install nto_supports_z_point_type.
3459         * mem-break.c: Adjust intro comment.
3460         (struct raw_breakpoint) <raw_type, size>: New fields.
3461         <inserted>: Update comment.
3462         <shlib_disabled>: Delete field.
3463         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3464         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3465         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3466         (raw_bkpt_type_to_target_hw_bp_type): New function.
3467         (find_enabled_raw_code_breakpoint_at): New function.
3468         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3469         (insert_memory_breakpoint): New function, based off
3470         set_raw_breakpoint_at.
3471         (remove_memory_breakpoint): New function.
3472         (set_raw_breakpoint_at): Reimplement.
3473         (set_breakpoint): New, based on set_breakpoint_at.
3474         (set_breakpoint_at): Reimplement.
3475         (delete_raw_breakpoint): Go through the_target->remove_point
3476         instead of assuming memory breakpoints.
3477         (find_gdb_breakpoint_at): Delete.
3478         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3479         (find_gdb_breakpoint): New function.
3480         (set_gdb_breakpoint_at): Delete.
3481         (z_type_supported): New function.
3482         (set_gdb_breakpoint_1): New function, loosely based off
3483         set_gdb_breakpoint_at.
3484         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3485         (delete_gdb_breakpoint_at): Delete.
3486         (delete_gdb_breakpoint_1): New function, loosely based off
3487         delete_gdb_breakpoint_at.
3488         (delete_gdb_breakpoint): New function.
3489         (clear_gdb_breakpoint_conditions): Rename to ...
3490         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3491         breakpoint.
3492         (add_condition_to_breakpoint): Make static.
3493         (add_breakpoint_condition): Take a struct breakpoint pointer
3494         instead of an address.  Adjust.
3495         (gdb_condition_true_at_breakpoint): Rename to ...
3496         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3497         z_type parameter.
3498         (gdb_condition_true_at_breakpoint): Reimplement.
3499         (add_breakpoint_commands): Take a struct breakpoint pointer
3500         instead of an address.  Adjust.
3501         (gdb_no_commands_at_breakpoint): Rename to ...
3502         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3503         parameter.  Return true if no breakpoint was found.  Change debug
3504         output.
3505         (gdb_no_commands_at_breakpoint): Reimplement.
3506         (run_breakpoint_commands): Rename to ...
3507         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3508         and change return type to boolean.
3509         (run_breakpoint_commands): New function.
3510         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3511         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3512         breakpoint.  Go through the_target->remove_point instead of
3513         assuming memory breakpoint.
3514         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3515         software and hardware breakpoints.
3516         (reinsert_raw_breakpoint): Go through the_target->insert_point
3517         instead of assuming memory breakpoint.
3518         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3519         software and hardware breakpoints.
3520         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3521         Check both software and hardware breakpoints.
3522         (validate_inserted_breakpoint): Assert the breakpoint is a
3523         software breakpoint.  Set the inserted flag to -1 instead of
3524         setting shlib_disabled.
3525         (delete_disabled_breakpoints): Adjust.
3526         (validate_breakpoints): Only validate software breakpoints.
3527         Adjust to inserted flag change.
3528         (check_mem_read, check_mem_write): Skip breakpoint types other
3529         than software breakpoints.  Adjust to inserted flag change.
3530         * mem-break.h (enum raw_bkpt_type): New enum.
3531         (raw_breakpoint, struct process_info): Forward declare.
3532         (Z_packet_to_target_hw_bp_type): Delete declaration.
3533         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3534         (set_gdb_breakpoint, delete_gdb_breakpoint)
3535         (clear_breakpoint_conditions): New declarations.
3536         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3537         (breakpoint_inserted_here): Update comment.
3538         (add_breakpoint_condition, add_breakpoint_commands): Replace
3539         address parameter with a breakpoint pointer parameter.
3540         (gdb_breakpoint_here): Update comment.
3541         (delete_gdb_breakpoint_at): Delete.
3542         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3543         * server.c (process_point_options): Take a struct breakpoint
3544         pointer instead of an address.  Adjust.
3545         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3546         delete_gdb_breakpoint.
3547         * spu-low.c (spu_target_ops): Install NULL as
3548         supports_z_point_type method.
3549         * target.h: Include mem-break.h.
3550         (struct target_ops) <prepare_to_access_memory>: Update comment.
3551         <supports_z_point_type>: New field.
3552         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3553         instead of a char.  Also take a raw breakpoint pointer.
3554         * win32-arm-low.c (the_low_target): Install NULL as
3555         supports_z_point_type.
3556         * win32-i386-low.c (i386_supports_z_point_type): New function.
3557         (i386_insert_point, i386_remove_point): Adjust to new interface.
3558         (the_low_target): Install i386_supports_z_point_type.
3559         * win32-low.c (win32_supports_z_point_type): New function.
3560         (win32_insert_point, win32_remove_point): Adjust to new interface.
3561         (win32_target_ops): Install win32_supports_z_point_type.
3562         * win32-low.h (struct win32_target_ops):
3563         <supports_z_point_type>: New method.
3564         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3565         instead of a char.  Also take a raw breakpoint pointer.
3566
3567 2014-05-20  Pedro Alves  <palves@redhat.com>
3568
3569         * mem-break.h: Include break-common.h.
3570         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3571         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3572         (Z_packet_to_target_hw_bp_type): New declaration.
3573         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3574         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3575         (Z_PACKET_ACCESS_WP): Delete macros.
3576         (Z_packet_to_hw_type): Delete function.
3577         * i386-low.h: Don't include break-common.h here.
3578         (Z_packet_to_hw_type): Delete declaration.
3579         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3580         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3581         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3582         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3583         * linux-aarch64-low.c: Don't include break-common.h here.
3584         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3585         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3586         (Z_packet_to_target_hw_bp_type): Delete function.
3587         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3588         function.
3589         (mips_insert_point, mips_remove_point): Use
3590         Z_packet_to_target_hw_bp_type.
3591
3592 2014-05-20  Pedro Alves  <palves@redhat.com>
3593
3594         * linux-aarch64-low.c: Include break-common.h.
3595         (enum target_point_type): Delete.
3596         (Z_packet_to_point_type): Rename to ...
3597         (Z_packet_to_target_hw_bp_type): ... this, and return a
3598         target_hw_bp_type instead.
3599         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3600         instead of an enum target_point_type.
3601         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3602         breakpoint type.
3603         (aarch64_dr_state_insert_one_point)
3604         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3605         (aarch64_handle_aligned_watchpoint)
3606         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3607         Take an enum target_hw_bp_type instead of an enum
3608         target_point_type.
3609         (aarch64_supports_z_point_type): New function.
3610         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3611         use Z_packet_to_target_hw_bp_type.
3612
3613 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3614
3615         * configure.ac: Only use -Werror by default when DEVELOPMENT
3616         is true.
3617         * configure: Regenerate.
3618
3619 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3620
3621         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3622         * linux-x86-low.c (X86_64_USER_REGS): New.
3623         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3624
3625 2014-04-28  Yao Qi  <yao@codesourcery.com>
3626
3627         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3628         name.
3629
3630 2014-04-25  Pedro Alves  <palves@redhat.com>
3631
3632         PR server/16255
3633         * linux-low.c (linux_attach_fail_reason_string): New function.
3634         (linux_attach_lwp): Delete.
3635         (linux_attach_lwp_1): Rename to ...
3636         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3637         argument.  Remove "initial" parameter.  Return int instead of
3638         void.  Don't error or warn here.
3639         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3640         failure to attach to the tgid.  Call warning when failing to
3641         attach to an lwp.
3642         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3643         argument.  Remove "initial" parameter.  Return int instead of
3644         void.  Don't error or warn here.
3645         (linux_attach_fail_reason_string): New declaration.
3646         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
3647         interface change.  Use linux_attach_fail_reason_string.
3648
3649 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
3650             Walfred Tedeschi  <walfred.tedeschi@intel.com>
3651
3652         * Makefile.in: Added rules to handle new files
3653         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
3654         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
3655         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
3656         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
3657         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
3658         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
3659         x32-avx512-linux.o.
3660         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
3661         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
3662         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
3663         i386/x32-avx512.xml.
3664         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
3665         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
3666         i386/x32-avx512-linux.xml.
3667         * i387-fp.c (num_avx512_k_registers): New constant for number
3668         of K registers.
3669         (num_avx512_zmmh_low_registers): New constant for number of
3670         lower ZMM registers (0-15).
3671         (num_avx512_zmmh_high_registers): New constant for number of
3672         higher ZMM registers (16-31).
3673         (num_avx512_ymmh_registers): New contant for number of higher
3674         YMM registers (ymm16-31 added by avx521 on x86_64).
3675         (num_avx512_xmm_registers): New constant for number of higher
3676         XMM registers (xmm16-31 added by AVX512 on x86_64).
3677         (struct i387_xsave): Add space for AVX512 registers.
3678         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
3679         Add code to handle AVX512 registers.
3680         (i387_xsave_to_cache): Add code to handle AVX512 registers.
3681         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
3682         prototypei from generated file.
3683         (tdesc_amd64_avx512_linux): Likewise.
3684         (init_registers_x32_avx512_linux): Likewise.
3685         (tdesc_x32_avx512_linux): Likewise.
3686         (init_registers_i386_avx512_linux): Likewise.
3687         (tdesc_i386_avx512_linux): Likewise.
3688         (x86_64_regmap): Add AVX512 registers.
3689         (x86_linux_read_description): Add code to handle AVX512 XSTATE
3690         mask.
3691         (initialize_low_arch): Add code to initialize AVX512 registers.
3692
3693 2014-04-23  Pedro Alves  <palves@redhat.com>
3694
3695         * mem-break.c (find_gdb_breakpoint_at): Make static.
3696         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
3697
3698 2014-04-23  Pedro Alves  <palves@redhat.com>
3699
3700         * i386-low.c: Don't include break-common.h here.
3701         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3702         prototype to take target_hw_bp_type as argument instead of a Z
3703         packet char.
3704         * i386-low.h: Include break-common.h here.
3705         (Z_packet_to_hw_type): Declare.
3706         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3707         prototypes.
3708         * linux-x86-low.c (x86_insert_point): Convert the packet number to
3709         a target_hw_bp_type before calling i386_low_insert_watchpoint.
3710         (x86_remove_point): Convert the packet number to a
3711         target_hw_bp_type before calling i386_low_remove_watchpoint.
3712         * win32-i386-low.c (i386_insert_point): Convert the packet number
3713         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
3714         (i386_remove_point): Convert the packet number to a
3715         target_hw_bp_type before calling i386_low_remove_watchpoint.
3716
3717 2014-04-23  Pedro Alves  <palves@redhat.com>
3718
3719         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
3720
3721 2014-04-10  Pedro Alves  <palves@redhat.com>
3722
3723         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
3724         Check if the condition or command is NULL before checking if the
3725         breakpoint is known.  On success, return true.
3726         * mem-break.h (add_breakpoint_condition): Document return.
3727         (add_breakpoint_commands): Add describing comment.
3728         * server.c (skip_to_semicolon): New function.
3729         (process_point_options): Use it.
3730
3731 2014-04-09  Pedro Alves  <palves@redhat.com>
3732
3733         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
3734         to lwpid_of.
3735
3736 2014-02-27  Pedro Alves  <palves@redhat.com>
3737
3738         PR 12702
3739         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
3740         macros.
3741         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
3742         output.
3743         (last_thread_of_process_p): Take a PID argument instead of a
3744         thread pointer.
3745         (linux_wait_for_lwp): Delete.
3746         (num_lwps, check_zombie_leaders, not_stopped_callback): New
3747         functions.
3748         (linux_low_filter_event): New function, party factored out from
3749         linux_wait_for_event.
3750         (linux_wait_for_event): Rename to ...
3751         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
3752         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
3753         sigsuspend.  Check for zombie leaders.
3754         (linux_wait_for_event): Reimplement as wrapper around
3755         linux_wait_for_event_filtered.
3756         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
3757         a normal or signal exit is seen, it's the whole process exiting.
3758         (wait_for_sigstop): No longer a for_each_inferior callback.
3759         Rewrite on top of linux_wait_for_event_filtered.
3760         (stop_all_lwps): Call wait_for_sigstop directly.
3761         * server.c (resume, handle_target_event): Handle
3762         TARGET_WAITKIND_NO_RESUMED.
3763
3764 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3765
3766         * win32-low.c (psapi_get_dll_name,
3767         * win32_CreateToolhelp32Snapshot): Delete.
3768         (win32_CreateToolhelp32Snapshot, win32_Module32First)
3769         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
3770         Delete.
3771         (handle_load_dll): Add function description.
3772         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
3773
3774 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3775
3776         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
3777         Add comment.
3778         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
3779         base address when calling win32_add_one_solib.
3780         (handle_load_dll): Delete local variable load_addr.
3781         Remove 0x1000 offset applied to DLL base address when calling
3782         win32_add_one_solib.
3783         (handle_unload_dll): Add comment.
3784
3785 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3786
3787         * win32-low.c (win32_add_all_dlls): Renames
3788         win32_ensure_ntdll_loaded.  Rewrite function documentation.
3789         Adjust implementation to always load all DLLs.
3790         Add 0x1000 offset to DLL base address when calling
3791         win32_add_one_solib.
3792         (child_initialization_done): New static global.
3793         (do_initial_child_stuff): Set child_initialization_done to
3794         zero during child initialization, and 1 after.  Replace call
3795         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
3796         Add comment.
3797         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
3798         (handle_unload_dll): Add function documentation.
3799         (get_child_debug_event): Ignore load and unload DLL events
3800         during child initialization.
3801
3802 2014-02-20  Doug Evans  <dje@google.com>
3803
3804         Remove global all_lwps.
3805         * inferiors.h (ptid_of): Move here from linux-low.h.
3806         (pid_of, lwpid_of): Ditto.
3807         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
3808         parameter is a struct thread_info * now.
3809         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
3810         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
3811         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
3812         directly.
3813         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
3814         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
3815         * linux-arm-low.c (update_registers_callback): Update, "entry"
3816         parameter is a struct thread_info * now.
3817         Fetch lwpid from current_inferior directly.
3818         (arm_insert_point): Pass &all_threads to find_inferior instead of
3819         &all_lwps.
3820         (arm_remove_point): Ditto.
3821         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
3822         (arm_prepare_to_resume): Fetch pid from thread.
3823         (arm_read_description): Fetch lwpid from current_inferior directly.
3824         * linux-low.c (all_lwps): Delete.
3825         (delete_lwp): Delete call to remove_inferior.
3826         (handle_extended_wait): Fetch lwpid from thread.
3827         (add_lwp): Don't set lwp->entry.id.  Remove call to
3828         add_inferior_to_list.
3829         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
3830         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
3831         (kill_one_lwp_callback): Ditto.
3832         (linux_kill): Don't dereference NULL pointer.
3833         Fetch ptid,lwpid from thread.
3834         (get_detach_signal): Fetch ptid from thread.
3835         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
3836         Simplify call to regcache_invalidate_thread.
3837         (delete_lwp_callback): Update, "entry" parameter is a
3838         struct thread_info * now.  Fetch pid from thread.
3839         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
3840         (status_pending_p_callback): Update, "entry" parameter is a
3841         struct thread_info * now.  Fetch ptid from thread.
3842         (find_lwp_pid): Update, "entry" parameter is a
3843         struct thread_info * now.
3844         (linux_wait_for_lwp): Fetch pid from thread.
3845         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
3846         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
3847         (enqueue_one_deferred_signal): Fetch lwpid from thread.
3848         (dequeue_one_deferred_signal): Ditto.
3849         (cancel_breakpoint): Fetch ptid from current_inferior.
3850         (linux_wait_for_event): Pass &all_threads to find_inferior,
3851         not &all_lwps.  Fetch ptid, lwpid from thread.
3852         (count_events_callback): Update, "entry" parameter is a
3853         struct thread_info * now.
3854         (select_singlestep_lwp_callback): Ditto.
3855         (select_event_lwp_callback): Ditto.
3856         (cancel_breakpoints_callback): Ditto.
3857         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
3858         not &all_lwps.
3859         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
3860         (unsuspend_one_lwp): Update, "entry" parameter is a
3861         struct thread_info * now.
3862         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
3863         not &all_lwps.
3864         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
3865         Fetch lwpid from thread, not lwp.
3866         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
3867         Pass &all_threads to find_inferior, not &all_lwps.
3868         (send_sigstop): Fetch lwpid from thread, not lwp.
3869         (send_sigstop_callback): Update, "entry" parameter is a
3870         struct thread_info * now.
3871         (suspend_and_send_sigstop_callback): Ditto.
3872         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
3873         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
3874         struct thread_info * now.
3875         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
3876         from thread, lwp.
3877         (lwp_running): Update, "entry" parameter is a
3878         struct thread_info * now.
3879         (stop_all_lwps): Fetch ptid from thread.
3880         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
3881         (linux_resume_one_lwp): Fetch lwpid from thread.
3882         (linux_set_resume_request): Update, "entry" parameter is a
3883         struct thread_info * now.  Fetch pid, lwpid from thread.
3884         (resume_status_pending_p): Update, "entry" parameter is a
3885         struct thread_info * now.
3886         (need_step_over_p): Ditto.  Fetch lwpid from thread.
3887         (start_step_over): Fetch lwpid from thread.
3888         (linux_resume_one_thread): Update, "entry" parameter is a
3889         struct thread_info * now.  Fetch lwpid from thread.
3890         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
3891         (proceed_one_lwp): Update, "entry" parameter is a
3892         struct thread_info * now.  Fetch lwpid from thread.
3893         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
3894         struct thread_info * now.
3895         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
3896         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
3897         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
3898         directly.
3899         (regsets_store_inferior_registers): Ditto.
3900         (fetch_register, store_register): Ditto.
3901         (linux_read_memory, linux_write_memory): Ditto.
3902         (linux_request_interrupt): Ditto.
3903         (linux_read_auxv): Ditto.
3904         (linux_xfer_siginfo): Ditto.
3905         (linux_qxfer_spu): Ditto.
3906         (linux_qxfer_libraries_svr4): Ditto.
3907         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
3908         moved to inferiors.h.
3909         (get_lwp): Delete.
3910         (get_thread_lwp): Update.
3911         (struct lwp_info): Delete member "entry".  Simplify comment for
3912         member "thread".
3913         (all_lwps): Delete.
3914         * linux-mips-low.c (mips_read_description): Fetch lwpid from
3915         current_inferior directly.
3916         (update_watch_registers_callback): Update, "entry" parameter is a
3917         struct thread_info * now.  Fetch pid from thread.
3918         (mips_linux_prepare_to_resume): Fetch ptid from thread.
3919         (mips_insert_point): Fetch lwpid from current_inferior.
3920         Pass &all_threads to find_inferior, not &all_lwps.
3921         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
3922         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
3923         directly.
3924         (mips_stopped_data_address): Ditto.
3925         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
3926         directly.
3927         * linux-tile-low.c (tile_arch_setup): Ditto.
3928         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
3929         (update_debug_registers_callback): Update, "entry" parameter is a
3930         struct thread_info * now.  Fetch pid from thread.
3931         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
3932         Pass &all_threads to find_inferior, not &all_lwps.
3933         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
3934         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
3935         Pass &all_threads to find_inferior, not &all_lwps.
3936         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
3937         (i386_dr_low_get_status): Ditto.
3938         (x86_linux_prepare_to_resume): Fetch ptid from thread.
3939         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
3940         (x86_linux_read_description): Ditto.
3941         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
3942
3943 2014-02-20  Doug Evans  <dje@google.com>
3944
3945         * inferiors.c (get_first_inferior): Fix buglet.
3946
3947 2014-02-19  Doug Evans  <dje@google.com>
3948
3949         * gdbthread.h (add_thread): Change result type to struct thread_info *.
3950         * inferiors.c (add_thread): Change result type to struct thread_info *.
3951         All callers updated.
3952         (add_lwp): Call add_thread here instead of in callers.
3953         All callers updated.
3954         * linux-low.h (get_lwp_thread): Rewrite.
3955         (struct lwp_info): New member "thread".
3956
3957 2014-02-19  Doug Evans  <dje@google.com>
3958
3959         * linux-low.c (add_lwp): Change result to struct lwp_info *.
3960         All callers updated.
3961
3962 2014-02-19  Doug Evans  <dje@google.com>
3963
3964         * inferiors.c (add_thread): Fix whitespace.
3965
3966 2014-02-19  Doug Evans  <dje@google.com>
3967
3968         * dll.c (clear_dlls): Replace accessing list implemention details
3969         with API function.
3970         * gdbthread.h (get_first_thread): Declare.
3971         * inferiors.c (for_each_inferior_with_data): New function.
3972         (get_first_thread): New function.
3973         (find_thread_ptid): Simplify.
3974         (get_first_inferior): New function.
3975         (clear_list): Delete.
3976         (one_inferior_p): New function.
3977         (clear_inferior_list): New function.
3978         (clear_inferiors): Update.
3979         * inferiors.h (for_each_inferior_with_data): Declare.
3980         (clear_inferior_list): Declare.
3981         (one_inferior_p): Declare.
3982         (get_first_inferior): Declare.
3983         * linux-low.c (linux_wait_for_event): Replace accessing list
3984         implemention details with API function.
3985         * server.c (target_running): Ditto.
3986         (accumulate_file_name_length): New function.
3987         (emit_dll_description): New function.
3988         (handle_qxfer_libraries): Replace accessing list implemention
3989         details with API function.
3990         (handle_qxfer_threads_worker): New function.
3991         (handle_qxfer_threads_proper): Replace accessing list implemention
3992         details with API function.
3993         (handle_query): Ditto.
3994         (visit_actioned_threads_callback_ftype): New typedef.
3995         (visit_actioned_threads_data): New struct.
3996         (visit_actioned_threads): Rewrite to be find_inferior callback.
3997         (resume): Call find_inferior.
3998         (handle_status): Replace accessing list implemention
3999         details with API function.
4000         (process_serial_event): Replace accessing list implemention details
4001         with API function.
4002         * target.c (set_desired_inferior): Replace accessing list implemention
4003         details with API function.
4004         * tracepoint.c (same_process_p): New function.
4005         (gdb_agent_about_to_close): Replace accessing list implemention
4006         details with API function.
4007         * win32-low.c (child_delete_thread): Replace accessing list
4008         implemention details with API function.
4009         (match_dll_by_basename): New function.
4010         (dll_is_loaded_by_basename): New function.
4011         (win32_ensure_ntdll_loaded): Replace accessing list implemention
4012         details call to dll_is_loaded_by_basename.
4013
4014 2014-02-19  Doug Evans  <dje@google.com>
4015
4016         * dll.h (struct dll_info): Add comment.
4017         * gdbthread.h (struct thread_info): Add comment.
4018         (current_ptid): Simplify.
4019         * inferiors.c (add_process): Update.
4020         (remove_process): Update.
4021         * inferiors.h (struct process_info): Rename member "head" to "entry".
4022         * linux-low.c (delete_lwp): Update.
4023         (add_lwp): Update.
4024         (last_thread_of_process_p): Update.
4025         (kill_one_lwp_callback, linux_kill): Update.
4026         (status_pending_p_callback): Update.
4027         (wait_for_sigstop): Update.  Simplify read of ptid.
4028         (start_step_over): Update.
4029         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
4030         (get_lwp_thread): Update.
4031         (struct lwp_info): Rename member "head" to "entry".
4032         * regcache.h (inferior_list_entry): Delete.
4033         * server.c (kill_inferior_callback): Update.
4034         (detach_or_kill_inferior_callback): Update.
4035         (print_started_pid): Update.
4036         (print_attached_pid): Update.
4037         (process_serial_event): Simplify read of ptid.
4038         * thread-db.c (thread_db_create_event): Update.
4039         (thread_db_get_tls_address): Update.
4040         * win32-low.c (current_inferior_ptid): Simplify.
4041
4042 2014-02-19  Tom Tromey  <tromey@redhat.com>
4043
4044         * target.h (struct target_ops) <supports_btrace>: Add target_ops
4045         argument.
4046         (target_supports_btrace): Update.
4047
4048 2014-02-14  Yao Qi  <yao@codesourcery.com>
4049
4050         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
4051         (rsp-low-ipa.o): New target.
4052
4053 2014-02-12  Tom Tromey  <tromey@redhat.com>
4054
4055         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
4056         convert_ascii_to_int.
4057         * regcache.c (registers_to_string): Likewise.
4058         * remote-utils.c (decode_M_packet): Likewise.
4059         * server.c (process_serial_event): Likewise.
4060
4061 2014-02-12  Tom Tromey  <tromey@redhat.com>
4062
4063         * server.c (handle_query, handle_v_run): Use hex2bin, not
4064         unhexify.
4065         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
4066
4067 2014-02-12  Tom Tromey  <tromey@redhat.com>
4068
4069         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
4070         convert_int_to_ascii.
4071         * regcache.c (registers_to_string, collect_register_as_string):
4072         Likewise.
4073         * remote-utils.c (look_up_one_symbol, relocate_instruction):
4074         Likewise.
4075         * server.c (process_serial_event): Likewise.
4076         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
4077         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
4078
4079 2014-02-12  Tom Tromey  <tromey@redhat.com>
4080
4081         * remote-utils.c (look_up_one_symbol, monitor_output): Use
4082         bin2hex, not hexify.
4083         * tracepoint.c (cmd_qtstatus): Likewise.
4084
4085 2014-02-12  Tom Tromey  <tromey@redhat.com>
4086
4087         * remote-utils.c (monitor_output): Pass explicit length to
4088         hexify.
4089
4090 2014-02-12  Tom Tromey  <tromey@redhat.com>
4091
4092         * tracepoint.c: Include rsp-low.h.
4093         * server.c: Include rsp-low.h.
4094         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
4095         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
4096         declare.
4097         * remote-utils.c: Include rsp-low.h.
4098         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
4099         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
4100         (convert_int_to_ascii, convert_ascii_to_int): Move to
4101         common/rsp-low.c.
4102         * regcache.c: Include rsp-low.h.
4103         * ax.c: Include rsp-low.h.
4104         * Makefile.in (SFILES): Add common/rsp-low.c.
4105         (OBS): Add rsp-low.o.
4106         (rsp-low.o): New target.
4107
4108 2014-02-12  Tom Tromey  <tromey@redhat.com>
4109
4110         * utils.h (pulongest, plongest, phex_nz): Don't declare.
4111         Include print-utils.h.
4112         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
4113         (plongest, thirty_two, phex_nz): Remove.
4114         * Makefile.in (SFILES): Add common/print-utils.c.
4115         (OBS): Add print-utils.o.
4116         (print-utils-ipa.o): New target.
4117         (print-utils.o): New target.
4118         (IPA_OBJS): Add print-utils-ipa.o.
4119
4120 2014-02-06  Tom Tromey  <tromey@redhat.com>
4121
4122         * Makefile.in (SFILES): Fix indentation.
4123
4124 2014-02-05  Doug Evans  <dje@google.com>
4125
4126         * linux-low.c (linux_wait_for_event): Improve comment.
4127         (linux_wait_1): Keep current_inferior in sync with event_child.
4128
4129 2014-01-22  Doug Evans  <dje@google.com>
4130
4131         * gdbthread.h (gdb_id_to_thread): Delete, unused.
4132
4133 2014-01-22  Doug Evans  <dje@google.com>
4134
4135         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
4136         * configure: Regenerate.
4137         * config.in: Regenerate.
4138         * Makefile.in (SFILES): Add debug.c.
4139         (OBS): Add debug.o.
4140         * debug.c: New file.
4141         * debug.h: New file.
4142         * linux-aarch64-low.c (*): Update all debugging printfs to use
4143         debug_printf instead of fprintf.
4144         * linux-arm-low.c (*): Ditto.
4145         * linux-cris-low.c (*): Ditto.
4146         * linux-crisv32-low.c (*): Ditto.
4147         * linux-m32r-low.c (*): Ditto.
4148         * linux-sparc-low.c (*): Ditto.
4149         * linux-x86.c (*): Ditto.
4150         * linux-low.c (*): Ditto.
4151         (linux_wait_1): Add calls to debug_enter, debug_exit.
4152         (linux_wait): Remove redundant debugging printf.
4153         (stop_all_lwps): Add calls to debug_enter, debug_exit.
4154         (linux_resume, unstop_all_lwps): Ditto.
4155         * mem-break.c (*): Update all debugging printfs to use
4156         debug_printf instead of fprintf.
4157         * remote-utils.c (*): Ditto.
4158         * thread-db.c (*): Ditto.
4159         * server.c #include <ctype.h>, "gdb_vecs.h".
4160         (debug_threads): Moved to debug.c.
4161         (*): Update all debugging printfs to use debug_printf instead of
4162         fprintf.
4163         (start_inferior): Replace call to fflush with call to debug_flush.
4164         (monitor_show_help): Mention set debug-format.
4165         (parse_debug_format_options): New function.
4166         (handle_monitor_command): Handle "monitor set debug-format".
4167         (gdbserver_usage): Mention --debug-format.
4168         (main): Parse --debug-format.
4169         * server.h (debug_threads): Declaration moved to debug.h.
4170         #include "debug.h".
4171         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4172         trace_debug_1 that uses debug_printf.
4173         (tracepoint_look_up_symbols): Update all debugging printfs to use
4174         debug_printf instead of fprintf.
4175
4176 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4177
4178         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4179         sys/ptrace.h.
4180
4181 2014-01-17  Pedro Alves  <palves@redhat.com>
4182
4183         PR build/16445
4184         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4185         defined after including gdb_proc_service.h.
4186
4187 2014-01-16  Doug Evans  <dje@google.com>
4188
4189         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4190         (match_dll): Use it.
4191
4192 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4193
4194         * target.h (target_ops) <read_btrace>: Change parameters and
4195         return type to allow error reporting.
4196         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4197         trace reading errors on.
4198         * linux-low.c (linux_low_read_btrace): Pass trace reading
4199         errors on.
4200         (linux_low_disable_btrace): New.
4201
4202 2014-01-15  Doug Evans  <dje@google.com>
4203
4204         * inferiors.c (thread_id_to_gdb_id): Delete.
4205         * inferiors.h (thread_id_to_gdb_id): Delete.
4206
4207 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4208
4209         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4210         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4211         versions.
4212
4213 2014-01-08  Pedro Alves  <palves@redhat.com>
4214
4215         * server.c (handle_status): Don't discard previous queued stop
4216         replies or thread's pending status here.
4217         (main) <disconnection>: Do it here instead.
4218
4219 2014-01-08  Pedro Alves  <palves@redhat.com>
4220
4221         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4222         * server.c (visit_actioned_threads, handle_pending_status): New
4223         function.
4224         (handle_v_cont): Factor out parts to ...
4225         (resume): ... this new function.  If in all-stop, and a thread
4226         being resumed has a pending status, report it without actually
4227         resuming.
4228         (myresume): Adjust to use the new 'resume' function.
4229         (clear_pending_status_callback, set_pending_status_callback)
4230         (find_status_pending_thread_callback): New functions.
4231         (handle_status): Handle the case of multiple threads having
4232         interesting statuses to report.  Report threads' real last signal
4233         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4234         with an interesting thread to report the status for, instead of
4235         always reporting the status of the first thread.
4236
4237 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4238
4239         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4240         * gdbreplay.c (gdbreplay_version): Likewise.
4241
4242 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4243
4244         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4245         iov.iov_len with the real length in use.
4246
4247 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4248
4249         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4250         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4251         for all targets that use win32-low.c.
4252         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4253         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4254
4255 2013-12-13  Pedro Alves  <palves@redhat.com>
4256
4257         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4258         if equal to TARGET_WAITKIND_LOADED.
4259         * win32-low.c (cached_status): New static global.
4260         (win32_wait): Add declaration.
4261         (do_initial_child_stuff): Flush all initial pending debug events
4262         up to the initial breakpoint.
4263         (win32_wait): If CACHED_STATUS was set, return that instead
4264         of doing a real wait.  Remove the code resuming the execution
4265         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4266         during the initial phase.  Also remove the code changing
4267         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4268         TARGET_WAITKIND_STOPPED.
4269
4270 2013-12-11  Yao Qi  <yao@codesourcery.com>
4271
4272         * notif.c (handle_notif_ack): Return 0 if no notification
4273         matches.
4274
4275 2013-11-20  Doug Evans  <dje@google.com>
4276
4277         * linux-low.c (linux_set_resume_request): Fix comment.
4278
4279 2013-11-20  Doug Evans  <dje@google.com>
4280
4281         * linux-low.c (resume_status_pending_p): Tweak comment.
4282
4283 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4284
4285         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4286         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4287         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4288         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4289         (srv_amd64_regobj): Add amd64-mpx.o.
4290         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4291         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4292         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4293         * i387-fp.c (num_pl_bnd_register) Added constant.
4294         (num_pl_bnd_cfg_registers) Added constant.
4295         (struct i387_xsave) Added reserved area and MPX fields.
4296         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4297         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4298         function.
4299         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4300         (init_registers_amd64_mpx_linux): Declare new function.
4301         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4302         (x86_64_regmap): Add MPX registers.
4303         (x86_linux_read_description): Add MPX case.
4304         (initialize_low_arch): Initialize MPX targets.
4305
4306 2013-11-18  Tom Tromey  <tromey@redhat.com>
4307
4308         * configure: Rebuild.
4309         * configure.ac: Don't check for stdlib.h.
4310         * gdbreplay.c: Unconditionally include stdlib.h.
4311
4312 2013-11-18  Tom Tromey  <tromey@redhat.com>
4313
4314         * config.in: Rebuild.
4315         * configure: Rebuild.
4316         * configure.ac: Don't use AC_HEADER_DIRENT.
4317
4318 2013-11-18  Tom Tromey  <tromey@redhat.com>
4319
4320         * server.h: Don't check HAVE_STRING_H.
4321         * gdbreplay.c: Don't check HAVE_STRING_H.
4322         * configure: Rebuild.
4323
4324 2013-11-18  Tom Tromey  <tromey@redhat.com>
4325
4326         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4327         LIBGNU.
4328
4329 2013-11-08  Tom Tromey  <tromey@redhat.com>
4330
4331         * configure, config.in: Rebuild.
4332         * configure.ac: Remove unused configury.
4333
4334 2013-11-08  Tom Tromey  <tromey@redhat.com>
4335
4336         * acinclude.m4: Include common.m4, codeset.m4.
4337         * configure, config.in: Rebuild.
4338         * configure.ac: Use GDB_AC_COMMON.
4339
4340 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4341
4342         * linux-s390-low.c (HWCAP_S390_TE): New define.
4343         (s390_arch_setup): Consider the TE field in the HWCAP for
4344         determining 'have_regset_tdb'.
4345
4346 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4347
4348         PR gdb/16014
4349         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4350         call to sizeof.
4351
4352 2013-10-02  Pedro Alves  <palves@redhat.com>
4353
4354         * server.c (process_serial_event): Don't output "GDBserver
4355         exiting" if GDB is connected through stdio.
4356         * target.c (mywait): Likewise, be silent if GDB is connected
4357         through stdio.
4358
4359 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4360
4361         * lynx-low.c (lynx_add_threads_after_attach): New function.
4362         (lynx_attach): Remove call to add_thread.  Add call to
4363         lynx_add_threads_after_attach instead.
4364
4365 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4366
4367         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4368         * config.in, configure: Regenerated.
4369
4370 2013-09-18  Yao Qi  <yao@codesourcery.com>
4371
4372         PR server/15959
4373         * server.c (start_inferior): Clear 'resume_info'.
4374
4375 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4376
4377         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4378         for each register.
4379
4380 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4381
4382         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4383         linux-tile-low.o to srv_tgtobj.
4384
4385 2013-09-16  Will Newton  <will.newton@linaro.org>
4386
4387         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4388         out regs.
4389
4390 2013-09-06  Pedro Alves  <palves@redhat.com>
4391
4392         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4393         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4394         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4395         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4396         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4397         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4398
4399 2013-09-06  Pedro Alves  <palves@redhat.com>
4400
4401         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4402         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4403
4404 2013-09-06  Pedro Alves  <palves@redhat.com>
4405
4406         * linux-amd64-ipa.c: Include tracepoint.h.
4407         * linux-i386-ipa.c: Include tracepoint.h.
4408
4409 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4410
4411         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4412         (ps_get_thread_area): New function.
4413
4414 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4415
4416         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4417         (initialize_low_arch): Call init_registers_crisv32 rather than
4418         init_register_crisv32.
4419
4420 2013-09-05  Pedro Alves  <palves@redhat.com>
4421
4422         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4423         to ...
4424         * hostio.h: ... this new file.
4425         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4426         win32-low.c: Include hostio.h.
4427
4428 2013-09-05  Pedro Alves  <palves@redhat.com>
4429
4430         * server.h (gdb_client_data, handler_func, callback_handler_func)
4431         (delete_file_handler, add_file_handler, append_callback_event)
4432         (delete_callback_event, start_event_loop, initialize_event_loop):
4433         Move to event-loop.h and include it.
4434         * event-loop.h: New file.
4435
4436 2013-09-05  Pedro Alves  <palves@redhat.com>
4437
4438         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4439         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4440         (loaded_dll, unloaded_dll): Move to ...
4441         * dll.h: ... this new file.
4442         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4443
4444 2013-09-05  Pedro Alves  <palves@redhat.com>
4445
4446         * server.h (current_process, get_thread_process, all_processes)
4447         (add_inferior_to_list, for_each_inferior, current_inferior)
4448         (remove_inferior, add_process, remove_process, find_process_pid)
4449         (have_started_inferiors_p, have_attached_inferiors_p)
4450         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4451         (clear_inferiors, find_inferior, find_inferior_id)
4452         (inferior_target_data, set_inferior_target_data)
4453         (inferior_regcache_data, set_inferior_regcache_data): Move to
4454         inferiors.h, and include it.
4455         * inferiors.h: New file.
4456
4457 2013-09-05  Pedro Alves  <palves@redhat.com>
4458
4459         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4460         Move ...
4461         * ax.h: ... here.
4462
4463 2013-09-05  Pedro Alves  <palves@redhat.com>
4464
4465         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4466         tracepoint.h.
4467         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4468         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4469         (handle_tracepoint_general_set, handle_tracepoint_query)
4470         (tracepoint_finished_step, tracepoint_was_hit)
4471         (release_while_stepping_state_list, current_traceframe)
4472         (in_readonly_region, traceframe_read_mem)
4473         (fetch_traceframe_registers, traceframe_read_sdata)
4474         (traceframe_read_info, struct fast_tpoint_collect_status)
4475         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4476         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4477         (supply_fast_tracepoint_registers)
4478         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4479         (ipa_tdesc, claim_trampoline_space)
4480         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4481         (agent_mem_read, agent_get_trace_state_variable_value)
4482         (agent_set_trace_state_variable_value, agent_tsv_read)
4483         (agent_mem_read_string, get_raw_reg_func_addr)
4484         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4485         * tracepoint.h: ... this new file.
4486
4487 2013-09-05  Pedro Alves  <palves@redhat.com>
4488
4489         * server.h (perror_with_name, error, fatal, warning, paddress)
4490         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4491         include it.
4492         * utils.h: New file.
4493
4494 2013-09-05  Pedro Alves  <palves@redhat.com>
4495
4496         * server.h (remote_debug, noack_mode, transport_is_reliable)
4497         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4498         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4499         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4500         (write_enn, initialize_async_io, enable_async_io)
4501         (disable_async_io, check_remote_input_interrupt_request)
4502         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4503         (dead_thread_notify, prepare_resume_reply)
4504         (decode_address_to_semicolon, decode_address, decode_m_packet)
4505         (decode_M_packet, decode_X_packet, decode_xfer_write)
4506         (decode_search_memory_packet, unhexify, hexify)
4507         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4508         (look_up_one_symbol, relocate_instruction)
4509         (monitor_output): Move to remote-utils.h, and include it.
4510         * remote-utils.h: New file.
4511
4512 2013-09-05  Pedro Alves  <palves@redhat.com>
4513
4514         * server.h (_): Delete.
4515
4516 2013-09-02  Pedro Alves  <palves@redhat.com>
4517
4518         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4519         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4520         allocated.
4521         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4522
4523 2013-09-02  Pierre Muller  <muller@sourceware.org>
4524
4525         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4526         or WriteProcessMemory complete successfully and handle
4527         ERROR_PARTIAL_COPY error.
4528
4529 2013-09-02  Pedro Alves  <palves@redhat.com>
4530
4531         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4532         error instead of EIO.
4533
4534 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4535
4536         PR server/15604
4537         * linux-low.c: Include filestuff.h.
4538         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4539         * lynx-low.c: Include filestuff.h.
4540         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4541         * server.c: Include filestuff.h.
4542         (main): Call notice_open_fds.
4543         * spu-low.c: Include filestuff.h.
4544         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4545
4546 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4547
4548         * Makefile.in: Explain why ../target and ../nat are not
4549         listed as include file search paths.
4550         (linux-waitpid.o): New object file rule.
4551         * configure.srv (srv_native_linux_obj): New variable.
4552         Replace all occurrences of linux native object files with
4553         $srv_native_linux_obj.
4554         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4555         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4556         (linux_enable_event_reporting): Remove declaration.
4557         (my_waitpid): Moved to common/linux-waitpid.c.
4558         (linux_wait_for_event): Pass ptid when calling
4559         linux_enable_event_reporting.
4560         (linux_supports_tracefork_flag): Remove.
4561         (linux_enable_event_reporting): Likewise.
4562         (linux_tracefork_grandchild): Remove.
4563         (STACK_SIZE): Moved to common/linux-ptrace.c.
4564         (linux_tracefork_child): Remove.
4565         (linux_test_for_tracefork): Remove.
4566         (linux_look_up_symbols): Call linux_supports_traceclone.
4567         (initialize_low): Remove call to linux_test_for_tracefork.
4568         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4569         common/linux-ptrace.h.
4570         (PTRACE_TYPE_ARG4): Likewise.
4571         Include linux-ptrace.h.
4572
4573 2013-08-21  Pedro Alves  <palves@redhat.com>
4574
4575         * config.in: Renegerate.
4576
4577 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4578
4579         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4580         (SFILES): Remove $(srcdir)/common/target-common.c and
4581         add $(srcdir)/target/waitstatus.c.
4582         (OBS): Remove target-common.o and add waitstatus.o.
4583         (server_h): Remove $(srcdir)/../common/target-common.h and
4584         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4585         and $(srcdir)/../target/waitstatus.h.
4586         (target-common.o): Remove.
4587         (waitstatus.o): New target object file.
4588         * target.h: Do not include target-common.h and
4589         include target/resume.h, target/wait.h and
4590         target/waitstatus.h.
4591
4592 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4593
4594         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4595         to PTRACE_TYPE_ARG3.
4596         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4597         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4598         PTRACE_TYPE_ARG4.
4599         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4600         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4601
4602 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4603             Daniel Jacobowitz  <dan@codesourcery.com>
4604             Yao Qi  <yao@codesourcery.com>
4605
4606         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4607         (mips-linux-watch.o): New rule.
4608         (mips_linux_watch_h): New variable.
4609         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4610         srv_tgtobj.
4611         * linux-mips-low.c: Include mips-linux-watch.h.
4612         (struct arch_process_info, struct arch_lwp_info): New.
4613         (update_watch_registers_callback): New function.
4614         (mips_linux_new_process, mips_linux_new_thread) New functions.
4615         (mips_linux_prepare_to_resume, mips_insert_point): New
4616         functions.
4617         (mips_remove_point, mips_stopped_by_watchpoint): New
4618         functions.
4619         (rsp_bp_type_to_target_hw_bp_type): New function.
4620         (mips_stopped_data_address): New function.
4621         (the_low_target): Add watchpoint support functions.
4622
4623 2013-07-27  Yao Qi  <yao@codesourcery.com>
4624
4625         * i386-low.c: Include break-common.h.
4626         (enum target_hw_bp_type): Remove.
4627
4628 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4629
4630         * Makefile.in (SFILES): /common/target-common.c.
4631         (OBS): Add target-common.o.
4632         (server_h): Add $(srcdir)/../common/target-common.h.
4633         (target-common.o): New target.
4634         * server.c (queue_stop_reply_callback): Free
4635         status string after use.
4636         * target.c (target_waitstatus_to_string): Remove.
4637         * target.h: Include target-common.h.
4638         (resume_kind): Likewise.
4639         (target_waitkind): Likewise.
4640         (target_waitstatus): Likewise.
4641         (TARGET_WNOHANG): Likewise.
4642
4643 2013-07-04  Yao Qi  <yao@codesourcery.com>
4644
4645         * Makefile.in (host_alias): Use @host_noncanonical@.
4646         (target_alias): Use @target_noncanonical@.
4647         * configure.ac: Use ACX_NONCANONICAL_TARGET and
4648         ACX_NONCANONICAL_HOST.
4649         * configure: Regenerated.
4650
4651         Revert:
4652         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4653
4654         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4655         * configure: Rebuild.
4656         * Makefile.in (version_host, version_target): Get from configure.
4657         (version.c): Use $(version_host) and $(version_target).
4658
4659 2013-07-03  Pedro Alves  <palves@redhat.com>
4660
4661         * Makefile.in (config.status): Depend on development.sh.
4662         * acinclude.m4: Include libmcheck.m4.
4663         * configure: Regenerate.
4664
4665 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4666
4667         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
4668         attribute inside the parentheses.
4669         (winapi_DebugSetProcessKillOnExit): Ditto.
4670         (winapi_DebugBreakProcess): Ditto.
4671         (winapi_GenerateConsoleCtrlEvent): Ditto.
4672
4673 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4674
4675         * notif.h (notif_event): Add a dummy member to avoid compiler
4676         errors.
4677
4678 2013-07-01  Pedro Alves  <palves@redhat.com>
4679
4680         * hostio.c (HOSTIO_PATH_MAX): Define.
4681         (require_filename, handle_open, handle_unlink, handle_readlink):
4682         Use it.
4683
4684 2013-07-01  Pedro Alves  <palves@redhat.com>
4685
4686         * server.h: Include "pathmax.h".
4687         * linux-low.c: Don't include sys/param.h.
4688         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
4689         MAXPATHLEN.
4690         * win32-low.c: Don't include sys/param.h.
4691         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
4692
4693 2013-07-01  Pedro Alves  <palves@redhat.com>
4694
4695         * event-loop.c: Don't check HAVE_UNISTD_H before including
4696         <unistd.h>.
4697         * gdbreplay.c: Likewise.
4698         * remote-utils.c: Likewise.
4699         * server.c: Likewise.
4700         * configure.ac: Don't check for unistd.h.
4701         * configure: Regenerate.
4702
4703 2013-06-28  Tom Tromey  <tromey@redhat.com>
4704
4705         * Makefile.in (version.c): Use version.in, not
4706         common/version.in.
4707
4708 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4709
4710         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4711         * configure: Rebuild.
4712         * Makefile.in (version_host, version_target): Get from configure.
4713         (version.c): Use $(version_host) and $(version_target).
4714
4715 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4716
4717         Fix trace-status to output user name without trailing colon.
4718         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
4719
4720 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4721
4722         Fix trace-status to output proper start-time and stop-time.
4723         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
4724         output start time and stop time in hex as gdb expects.
4725
4726 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
4727
4728         * tracepoint.c (build_traceframe_info_xml): Output trace state
4729         variables present in the trace buffer.
4730
4731 2013-06-24  Tom Tromey  <tromey@redhat.com>
4732
4733         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
4734         create-version.sh.
4735         (version.o): Remove.
4736         * gdbreplay.c: Include version.h.
4737         (version, host_name): Don't declare.
4738         * server.h: Include version.h.
4739         (version, host_name): Don't declare.
4740
4741 2013-06-12  Pedro Alves  <palves@redhat.com>
4742
4743         * linux-x86-low.c (linux_is_elf64): Delete global.
4744         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
4745         with local linux_pid_exe_is_elf_64_file use.
4746
4747 2013-06-11  Pedro Alves  <palves@redhat.com>
4748
4749         * linux-low.c (regset_disabled, disable_regset): New functions.
4750         (regsets_fetch_inferior_registers)
4751         (regsets_store_inferior_registers): Use them.
4752         (initialize_regsets_info); Don't allocate the disabled_regsets
4753         array here.
4754         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
4755         comment.
4756
4757 2013-06-11  Pedro Alves  <palves@redhat.com>
4758
4759         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
4760         xmalloc.
4761
4762 2013-06-11  Pedro Alves  <palves@redhat.com>
4763
4764         * linux-x86-low.c (initialize_low_arch): Call
4765         init_registers_x32_avx_linux.
4766
4767 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
4768
4769         Fix compatibility with Android Bionic.
4770         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
4771         it is not empty.
4772
4773 2013-06-07  Pedro Alves  <palves@redhat.com>
4774
4775         PR server/14823
4776         * Makefile.in (OBS): Add tdesc.o.
4777         (IPA_OBJS): Add tdesc-ipa.o.
4778         (tdesc-ipa.o): New rule.
4779         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
4780         interface.
4781         * linux-low.c (new_inferior): Delete.
4782         (disabled_regsets, num_regsets): Delete.
4783         (linux_add_process): Adjust to set the new per-process
4784         new_inferior flag.
4785         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
4786         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
4787         was a stop.  When calling arch_setup, switch the current inferior
4788         to the thread that got an event.
4789         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
4790         (regsets_fetch_inferior_registers)
4791         (regsets_store_inferior_registers): New regsets_info parameter.
4792         Adjust to use it.
4793         (linux_register_in_regsets): New regs_info parameter.  Adjust to
4794         use it.
4795         (register_addr, fetch_register, store_register): New usrregs_info
4796         parameter.  Adjust to use it.
4797         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
4798         parameter regs_info.  Adjust to use it.
4799         (linux_fetch_registers): Get the current inferior's regs_info, and
4800         adjust to use it.
4801         (linux_store_registers): Ditto.
4802         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
4803         (initialize_low): Don't initialize the target_regsets here.  Call
4804         initialize_low_arch.
4805         * linux-low.h (target_regsets): Delete declaration.
4806         (struct regsets_info): New.
4807         (struct usrregs_info): New.
4808         (struct regs_info): New.
4809         (struct process_info_private) <new_inferior>: New field.
4810         (struct linux_target_ops): Delete the num_regs, regmap, and
4811         regset_bitmap fields.  New field regs_info.
4812         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
4813         * i387-fp.c (num_xmm_registers): Delete.
4814         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
4815         calls to new interface.
4816         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
4817         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
4818         Infer the number of xmm registers from the regcache's target
4819         description.
4820         * i387-fp.h (num_xmm_registers): Delete.
4821         * inferiors.c (add_thread): Don't install the thread's regcache
4822         here.
4823         * proc-service.c (gregset_info): Fetch the current inferior's
4824         regs_info.  Adjust to use it.
4825         * regcache.c: Include tdesc.h.
4826         (register_bytes, reg_defs, num_registers)
4827         (gdbserver_expedite_regs): Delete.
4828         (get_thread_regcache): If the thread doesn't have a regcache yet,
4829         create one, instead of aborting gdbserver.
4830         (regcache_invalidate_one): Rename to ...
4831         (regcache_invalidate_thread): ... this.
4832         (regcache_invalidate_one): New.
4833         (regcache_invalidate): Only invalidate registers of the current
4834         process.
4835         (init_register_cache): Add target_desc parameter, and use it.
4836         (new_register_cache): Ditto.  Assert the target description has a
4837         non zero registers_size.
4838         (regcache_cpy): Add assertions.  Adjust.
4839         (realloc_register_cache, set_register_cache): Delete.
4840         (registers_to_string, registers_from_string): Adjust.
4841         (find_register_by_name, find_regno, find_register_by_number)
4842         (register_cache_size): Add target_desc parameter, and use it.
4843         (free_register_cache_thread, free_register_cache_thread_one)
4844         (regcache_release, register_cache_size): New.
4845         (register_size): Add target_desc parameter, and use it.
4846         (register_data, supply_register, supply_register_zeroed)
4847         (supply_regblock, supply_register_by_name, collect_register)
4848         (collect_register_as_string, collect_register_by_name): Adjust.
4849         * regcache.h (struct target_desc): Forward declare.
4850         (struct regcache) <tdesc>: New field.
4851         (init_register_cache, new_register_cache): Add target_desc
4852         parameter.
4853         (regcache_invalidate_thread): Declare.
4854         (regcache_invalidate_one): Delete declaration.
4855         (regcache_release): Declare.
4856         (find_register_by_number, register_cache_size, register_size)
4857         (find_regno): Add target_desc parameter.
4858         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
4859         declarations.
4860         * remote-utils.c: Include tdesc.h.
4861         (outreg, prepare_resume_reply): Adjust.
4862         * server.c: Include tdesc.h.
4863         (gdbserver_xmltarget): Delete declaration.
4864         (get_features_xml, process_serial_event): Adjust.
4865         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
4866         declare.
4867         (struct process_info) <tdesc>: New field.
4868         (ipa_tdesc): Declare.
4869         * tdesc.c: New file.
4870         * tdesc.h: New file.
4871         * tracepoint.c: Include tdesc.h.
4872         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
4873         (get_context_regcache): Adjust to pass ipa_tdesc down.
4874         (do_action_at_tracepoint): Adjust to get the register cache size
4875         from the context regcache's description.
4876         (traceframe_walk_blocks): Adjust to get the register cache size
4877         from the current trace frame's description.
4878         (traceframe_get_pc): Adjust to get current trace frame's
4879         description and pass it down.
4880         (gdb_collect): Adjust to get the register cache size from the
4881         IPA's description.
4882         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
4883         (gdbserver_xmltarget): Delete.
4884         (initialize_low_tracepoint): Set the ipa's target description.
4885         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
4886         (initialize_low_tracepoint): Set the ipa's target description.
4887         * linux-x86-low.c: Include tdesc.h.
4888         [__x86_64__] (is_64bit_tdesc): New.
4889         (ps_get_thread_area, x86_get_thread_area): Use it.
4890         (i386_cannot_store_register): Rename to ...
4891         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
4892         (i386_cannot_fetch_register): Rename to ...
4893         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
4894         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
4895         to new interface.
4896         (target_regsets): Rename to ...
4897         (x86_regsets): ... this.
4898         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
4899         interface.
4900         (x86_siginfo_fixup): Use is_64bit_tdesc.
4901         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
4902         (tdesc_x32_avx_linux, tdesc_x32_linux)
4903         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
4904         Declare.
4905         (x86_linux_update_xmltarget): Delete.
4906         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
4907         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
4908         (AMD64_LINUX_USER64_CS): New.
4909         (x86_linux_read_description): New, based on
4910         x86_linux_update_xmltarget.
4911         (same_process_callback): New.
4912         (x86_arch_setup_process_callback): New.
4913         (x86_linux_update_xmltarget): New.
4914         (x86_regsets_info): New.
4915         (amd64_linux_regs_info): New.
4916         (i386_linux_usrregs_info): New.
4917         (i386_linux_regs_info): New.
4918         (x86_linux_regs_info): New.
4919         (x86_arch_setup): Reimplement.
4920         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
4921         (x86_emit_ops): Ditto.
4922         (the_low_target): Adjust.  Install x86_linux_regs_info,
4923         x86_cannot_fetch_register, and x86_cannot_store_register.
4924         (initialize_low_arch): New.
4925         * linux-ia64-low.c (tdesc_ia64): Declare.
4926         (ia64_fetch_register): Adjust.
4927         (ia64_usrregs_info, regs_info): New globals.
4928         (ia64_regs_info): New function.
4929         (the_low_target): Adjust.
4930         (initialize_low_arch): New function.
4931         * linux-sparc-low.c (tdesc_sparc64): Declare.
4932         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
4933         Adjust.
4934         (sparc_arch_setup): New function.
4935         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
4936         (the_low_target): Adjust.
4937         (initialize_low_arch): New function.
4938         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
4939         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
4940         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
4941         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
4942         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
4943         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
4944         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
4945         (tdesc_powerpc_isa205_vsx64l): Declare.
4946         (ppc_cannot_store_register, ppc_collect_ptrace_register)
4947         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
4948         (ppc_set_pc, ppc_get_hwcap): Adjust.
4949         (ppc_usrregs_info): Forward declare.
4950         (!__powerpc64__) ppc_regmap_adjusted: New global.
4951         (ppc_arch_setup): Adjust to the current process'es target
4952         description.
4953         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
4954         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
4955         (ppc_store_evrregset): Adjust.
4956         (target_regsets): Rename to ...
4957         (ppc_regsets): ... this, and make static.
4958         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
4959         (ppc_regs_info): New function.
4960         (the_low_target): Adjust.
4961         (initialize_low_arch): New function.
4962         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
4963         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
4964         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
4965         (tdesc_s390x_linux64v2): Declare.
4966         (s390_collect_ptrace_register, s390_supply_ptrace_register)
4967         (s390_fill_gregset, s390_store_last_break): Adjust.
4968         (target_regsets): Rename to ...
4969         (s390_regsets): ... this, and make static.
4970         (s390_get_pc, s390_set_pc): Adjust.
4971         (s390_get_hwcap): New target_desc parameter, and use it.
4972         [__s390x__] (have_hwcap_s390_high_gprs): New global.
4973         (s390_arch_setup): Adjust to set the current process'es target
4974         description.  Don't adjust the regmap.
4975         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
4976         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
4977         (regs_info_3264): New globals.
4978         (s390_regs_info): New function.
4979         (the_low_target): Adjust.
4980         (initialize_low_arch): New function.
4981         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
4982         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
4983         [__mips64] (init_registers_mips_linux)
4984         (init_registers_mips_dsp_linux): Delete defines.
4985         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
4986         (have_dsp): New global.
4987         (mips_read_description): New, based on mips_arch_setup.
4988         (mips_arch_setup): Reimplement.
4989         (get_usrregs_info): New function.
4990         (mips_cannot_fetch_register, mips_cannot_store_register)
4991         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
4992         (mips_fill_fpregset, mips_store_fpregset): Adjust.
4993         (target_regsets): Rename to ...
4994         (mips_regsets): ... this, and make static.
4995         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
4996         (dsp_regs_info, regs_info): New globals.
4997         (mips_regs_info): New function.
4998         (the_low_target): Adjust.
4999         (initialize_low_arch): New function.
5000         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
5001         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
5002         Declare.
5003         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
5004         (arm_read_description): New, with bits factored from
5005         arm_arch_setup.
5006         (arm_arch_setup): Reimplement.
5007         (target_regsets): Rename to ...
5008         (arm_regsets): ... this, and make static.
5009         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
5010         (arm_regs_info): New function.
5011         (the_low_target): Adjust.
5012         (initialize_low_arch): New function.
5013         * linux-m68k-low.c (tdesc_m68k): Declare.
5014         (target_regsets): Rename to ...
5015         (m68k_regsets): ... this, and make static.
5016         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
5017         (m68k_regs_info): New function.
5018         (m68k_arch_setup): New function.
5019         (the_low_target): Adjust.
5020         (initialize_low_arch): New function.
5021         * linux-sh-low.c (tdesc_sharch): Declare.
5022         (target_regsets): Rename to ...
5023         (sh_regsets): ... this, and make static.
5024         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
5025         (sh_regs_info, sh_arch_setup): New functions.
5026         (the_low_target): Adjust.
5027         (initialize_low_arch): New function.
5028         * linux-bfin-low.c (tdesc_bfin): Declare.
5029         (bfin_arch_setup): New function.
5030         (bfin_usrregs_info, regs_info): New globals.
5031         (bfin_regs_info): New function.
5032         (the_low_target): Adjust.
5033         (initialize_low_arch): New function.
5034         * linux-cris-low.c (tdesc_cris): Declare.
5035         (cris_arch_setup): New function.
5036         (cris_usrregs_info, regs_info): New globals.
5037         (cris_regs_info): New function.
5038         (the_low_target): Adjust.
5039         (initialize_low_arch): New function.
5040         * linux-cris-low.c (tdesc_crisv32): Declare.
5041         (cris_arch_setup): New function.
5042         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
5043         (cris_regs_info): New function.
5044         (the_low_target): Adjust.
5045         (initialize_low_arch): New function.
5046         * linux-m32r-low.c (tdesc_m32r): Declare.
5047         (m32r_arch_setup): New function.
5048         (m32r_usrregs_info, regs_info): New globals.
5049         (m32r_regs_info): Adjust.
5050         (initialize_low_arch): New function.
5051         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
5052         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
5053         (tic6x_usrregs_info): Forward declare.
5054         (tic6x_read_description): New function, based on ...
5055         (tic6x_arch_setup): ... this.  Reimplement.
5056         (target_regsets): Rename to ...
5057         (tic6x_regsets): ... this, and make static.
5058         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
5059         (tic6x_regs_info): New function.
5060         (the_low_target): Adjust.
5061         (initialize_low_arch): New function.
5062         * linux-xtensa-low.c (tdesc_xtensa): Declare.
5063         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
5064         (target_regsets): Rename to ...
5065         (xtensa_regsets): ... this, and make static.
5066         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
5067         globals.
5068         (xtensa_arch_setup, xtensa_regs_info): New functions.
5069         (the_low_target): Adjust.
5070         (initialize_low_arch): New function.
5071         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
5072         (nios2_arch_setup): Set the current process'es tdesc.
5073         (target_regsets): Rename to ...
5074         (nios2_regsets): ... this.
5075         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
5076         (nios2_regs_info): New function.
5077         (the_low_target): Adjust.
5078         (initialize_low_arch): New function.
5079         * linux-aarch64-low.c (tdesc_aarch64): Declare.
5080         (aarch64_arch_setup): Set the current process'es tdesc.
5081         (target_regsets): Rename to ...
5082         (aarch64_regsets): ... this.
5083         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
5084         (aarch64_regs_info): New function.
5085         (the_low_target): Adjust.
5086         (initialize_low_arch): New function.
5087         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
5088         globals.
5089         (target_regsets): Rename to ...
5090         (tile_regsets): ... this.
5091         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
5092         (tile_regs_info): New function.
5093         (tile_arch_setup): Set the current process'es tdesc.
5094         (the_low_target): Adjust.
5095         (initialize_low_arch): New function.
5096         * spu-low.c (tdesc_spu): Declare.
5097         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
5098         * win32-arm-low.c (tdesc_arm): Declare.
5099         (arm_arch_setup): New function.
5100         (the_low_target): Install arm_arch_setup instead of
5101         init_registers_arm.
5102         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
5103         (init_windows_x86): Rename to ...
5104         (i386_arch_setup): ... this.  Set `win32_tdesc'.
5105         (the_low_target): Adjust.
5106         * win32-low.c (win32_tdesc): New global.
5107         (child_add_thread): Don't create the thread cache here.
5108         (do_initial_child_stuff): Set the new process'es tdesc.
5109         * win32-low.h (struct target_desc): Forward declare.
5110         (win32_tdesc): Declare.
5111         * lynx-i386-low.c (tdesc_i386): Declare global.
5112         (lynx_i386_arch_setup): Set `lynx_tdesc'.
5113         * lynx-low.c (lynx_tdesc): New global.
5114         (lynx_add_process): Set the new process'es tdesc.
5115         * lynx-low.h (struct target_desc): Forward declare.
5116         (lynx_tdesc): Declare global.
5117         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
5118         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
5119         * nto-low.c (nto_tdesc): New global.
5120         (do_attach): Set the new process'es tdesc.
5121         * nto-low.h (struct target_desc): Forward declare.
5122         (nto_tdesc): Declare.
5123         * nto-x86-low.c (tdesc_i386): Declare.
5124         (nto_x86_arch_setup): Set `nto_tdesc'.
5125
5126 2013-06-04  Gary Benson  <gbenson@redhat.com>
5127
5128         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
5129         to qSupported response when appropriate.
5130         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
5131         with nonzero-length annex.
5132         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
5133         arguments supplied in annex.
5134
5135 2013-05-31  Doug Evans  <dje@google.com>
5136
5137         PR server/15594
5138         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
5139         64 bits in 64-cross-32 environment.
5140
5141 2013-05-28  Pedro Alves  <palves@redhat.com>
5142
5143         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
5144         (aarch64-without-fpu.c): Delete rule.
5145         * configure.srv (aarch64*-*-linux*): Remove references to
5146         aarch64-without-fpu.o and aarch64-without-fpu.xml.
5147         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
5148         declaration.
5149
5150 2013-05-24  Pedro Alves  <palves@redhat.com>
5151
5152         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
5153         instead of strchr/decode_address.  Error if the range isn't split
5154         with a ','.  Don't assume there's be a ':' in the action.
5155
5156 2013-05-23  Yao Qi  <yao@codesourcery.com>
5157             Pedro Alves  <palves@redhat.com>
5158
5159         * linux-low.c (lwp_in_step_range): New function.
5160         (linux_wait_1): If the thread was range stepping and stopped
5161         outside the stepping range, report the stop to GDB.  Otherwise,
5162         continue stepping.  Add range stepping debug output.
5163         (linux_set_resume_request): Copy the step range from the resume
5164         request to the lwp.
5165         (linux_supports_range_stepping): New.
5166         (linux_target_ops) <supports_range_stepping>: Set to
5167         linux_supports_range_stepping.
5168         * linux-low.h (struct linux_target_ops)
5169         <supports_range_stepping>: New field.
5170         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5171         * linux-x86-low.c (x86_supports_range_stepping): New.
5172         (the_low_target) <supports_range_stepping>: Set to
5173         x86_supports_range_stepping.
5174         * server.c (handle_v_cont): Handle 'r' action.
5175         (handle_v_requests): Append ";r" if the target supports range
5176         stepping.
5177         * target.h (struct thread_resume) <step_range_start,
5178         step_range_end>: New fields.
5179         (struct target_ops) <supports_range_stepping>:
5180         New field.
5181         (target_supports_range_stepping): New macro.
5182
5183 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5184
5185         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5186         confusion in comment.
5187
5188 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5189
5190         * lynx-low.c (struct process_info_private): New type.
5191         (lynx_add_process): New function.
5192         (lynx_create_inferior, lynx_attach): Replace calls to
5193         add_process by calls to lynx_add_process.
5194         (lynx_resume): If PTID is null, then try using
5195         current_process()->private->last_wait_event_ptid.
5196         Add comments.
5197         (lynx_clear_inferiors): Delete.  The contents of that function
5198         has been inlined in lynx_mourn;
5199         (lynx_wait_1): Save the ptid in the process's private data.
5200         (lynx_mourn): Free the process' private data.  Replace call
5201         to lynx_clear_inferiors by call to clear_inferiors.
5202
5203 2013-05-17  Yao Qi  <yao@codesourcery.com>
5204
5205         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5206         the right place.
5207
5208 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5209
5210         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5211         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5212         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5213         PT_TEXT_END_ADDR guards.  Update comments.
5214         (linux_target_op) <read_offsets>: Conditionally define to
5215         linux_read_offsets if the target is UCLIBC and if it defines
5216         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5217
5218 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5219             Andrew Jenner  <andrew@codesourcery.com>
5220
5221         * Makefile.in (SFILES): Add linux-nios2-low.c.
5222         (clean): Add action to delete nios2-linux.c.
5223         (nios2-linux.c): New rule.
5224         * configure.srv: Add nios2*-*-linux*.
5225         * linux-nios2-low.c: New.
5226
5227 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5228
5229         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5230
5231 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5232
5233         PR gdb/15186
5234         * ax.c (ax_printf): Add fflush.
5235
5236 2013-04-22  Tom Tromey  <tromey@redhat.com>
5237
5238         * Makefile.in (SFILES): Add filestuff.c.
5239         (OBS): Add filestuff.o.
5240         (filestuff.o): New target.
5241         * config.in, configure: Rebuild.
5242         * configure.ac: Check for fdwalk, pipe2.
5243
5244 2013-04-17  Pedro Alves  <palves@redhat.com>
5245
5246         * configure.ac (USE_THREAD_DB): Delete variable.
5247         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5248         Don't AC_SUBST USE_THREAD_DB.
5249         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5250         * config.in, configure: Regenerate.
5251
5252 2013-04-16  Pedro Alves  <palves@redhat.com>
5253
5254         * linux-low.h (struct lwp_info) <thread_known>: Move under
5255         the USE_THREAD_DB #ifdef.
5256
5257 2013-04-16  Pedro Alves  <palves@redhat.com>
5258
5259         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5260         (linux-low.o): Delete rule.
5261         * linux-low.h: Always include "gdb_thread_db.h" instead of
5262         conditionally including thread_db.h.
5263         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5264         HAVE_THREAD_DB_H.
5265
5266 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5267
5268         * Makefile.in (install-only): Fix make install regression.
5269
5270 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5271
5272         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5273         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5274         installation.
5275         * gdbserver.1: Remove.
5276
5277 2013-03-22  Pedro Alves  <palves@redhat.com>
5278
5279         * linux-low.c (handle_extended_wait): Don't call
5280         linux_enable_event_reporting.
5281
5282 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5283
5284         PR build/9098:
5285         * Makefile.in (SHELL): Use @SHELL@.
5286
5287 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5288
5289         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5290         compiler warning.
5291
5292 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5293
5294         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5295         Remove extraneous NULL element.
5296
5297 2013-03-13  Yao Qi  <yao@codesourcery.com>
5298
5299         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5300         'V' block in trace frame.
5301
5302 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5303
5304         * target.h (struct target_ops): Add btrace ops.
5305         (target_supports_btrace): New macro.
5306         (target_enable_btrace): New macro.
5307         (target_disable_btrace): New macro.
5308         (target_read_btrace): New macro.
5309         * gdbthread.h (struct thread_info): Add btrace field.
5310         * server.c: Include btrace-common.h.
5311         (handle_btrace_general_set): New function.
5312         (handle_btrace_enable): New function.
5313         (handle_btrace_disable): New function.
5314         (handle_general_set): Call handle_btrace_general_set.
5315         (handle_qxfer_btrace): New function.
5316         (struct qxfer qxfer_packets[]): Add btrace entry.
5317         * inferiors.c (remove_thread): Disable btrace.
5318         * linux-low: Include linux-btrace.h.
5319         (linux_low_enable_btrace): New function.
5320         (linux_low_read_btrace): New function.
5321         (linux_target_ops): Add btrace ops.
5322         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5323         Add srv_linux_btrace=yes.
5324         (x86_64-*-linux*): Add linux-btrace.o.
5325         Add srv_linux_btrace=yes.
5326         * configure.ac: Define HAVE_LINUX_BTRACE.
5327         * config.in: Regenerated.
5328         * configure: Regenerated.
5329
5330 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5331
5332         * server.c (handle_qxfer): Preserve error message if -3 is
5333         returned.
5334         (qxfer): Document the -3 return value.
5335
5336 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5337
5338         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5339         (linux_btrace_h): New variable.
5340         (linux-btrace.o): New rule.
5341
5342 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5343             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5344
5345         * tracepoint.c (trace_buffer_size): New global.
5346         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5347         (init_trace_buffer): Change to one-argument function. Allocate
5348         trace buffer memory.
5349         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5350         handle QTBuffer:size packet.
5351         (cmd_bigqtbuffer_size): New function.
5352         (initialize_tracepoint): Call init_trace_buffer with
5353         DEFAULT_TRACE_BUFFER_SIZE.
5354         * server.c (handle_query): Add QTBuffer:size in the
5355         supported packets.
5356
5357 2013-03-07  Yao Qi  <yao@codesourcery.com>
5358
5359         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5360         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5361         of -1.
5362         (cmd_qtsp): Adjust condition.  Do post increment.
5363         Set cur_action and cur_step_action back to 0.
5364
5365 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5366
5367         PR server/15236
5368         * linux-low.c (linux_write_memory): Return early success if LEN is
5369         zero.
5370
5371 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5372
5373         * configure.srv: Add x86_64-*-cygwin* as target.
5374
5375 2013-02-28  Tom Tromey  <tromey@redhat.com>
5376
5377         * configure.ac: Invoke AC_SYS_LARGEFILE.
5378         * configure, config.in: Rebuild.
5379
5380 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5381
5382         * win32-low.c: Throughout, fix format strings and casts of
5383         printf-like functions to avoid type related warnings on all
5384         platforms.
5385         (get_child_debug_event): Print dwDebugEventCode as hex since
5386         that's how it's usually documented.
5387
5388 2013-02-28  Yao Qi  <yao@codesourcery.com>
5389
5390         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5391         pulongest.
5392
5393 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5394
5395         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5396         (reg-tilegx32.c): New rule.
5397         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5398         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5399         different register info initializer according to elf class.
5400         (init_registers_tilgx32): New function.  The tilegx32 register info
5401         initializer.
5402         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5403         (tile_store_gregset): Likewise.
5404
5405 2013-02-27  Yao Qi  <yao@codesourcery.com>
5406
5407         * server.c (process_point_options): Print debug message when
5408         debug_threads is true.
5409
5410 2013-02-26  Yao Qi  <yao@codesourcery.com>
5411
5412         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5413
5414 2013-02-19  Pedro Alves  <palves@redhat.com>
5415             Kai Tietz <ktietz@redhat.com>
5416
5417         PR gdb/15161
5418
5419         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5420         instead of strtoul to extract address from packet.
5421         (process_serial_event) <'z'>: Likewise.
5422
5423 2013-02-18  Yao Qi  <yao@codesourcery.com>
5424
5425         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5426
5427 2013-02-14  Pedro Alves  <palves@redhat.com>
5428
5429         Plug memory leak.
5430
5431         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5432         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5433
5434 2013-02-14  Pedro Alves  <palves@redhat.com>
5435
5436         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5437
5438 2013-02-14  Pedro Alves  <palves@redhat.com>
5439
5440         * tracepoint.c (save_string): Delete.
5441         (add_tracepoint_action): Use savestring instead of save_string.
5442
5443 2013-02-12  Pedro Alves  <palves@redhat.com>
5444
5445         * linux-xtensa-low.c: Ditto.
5446         * xtensa-xtregs.c: Ditto.
5447
5448 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5449
5450         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5451         thread_db.
5452
5453 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5454
5455         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5456         aarch64_num_wp_regs and aarch64_num_bp_regs to
5457         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5458
5459 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5460
5461         * linux-aarch64-low.c (ps_get_thread_area): Replace
5462         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5463
5464 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5465             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5466             Nigel Stephens  <nigel.stephens@arm.com>
5467             Yufeng Zhang  <yufeng.zhang@arm.com>
5468
5469         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5470         (aarch64.c, aarch64-without-fpu.c): New targets.
5471         * configure.srv (aarch64*-*-linux*): New.
5472         * linux-aarch64-low.c: New file.
5473
5474 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5475
5476         * linux-low.c (handle_extended_wait, linux_create_inferior)
5477         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5478         (dequeue_one_deferred_signal, linux_resume_one_thread)
5479         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5480         (linux_tracefork_grandchild, linux_test_for_tracefork)
5481         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5482         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5483         where the argument is 0.
5484
5485 2013-01-25  Yao Qi  <yao@codesourcery.com>
5486
5487         * event-loop.c: Include "queue.h".
5488         (gdb_event_p): New typedef.
5489         (struct gdb_event) <next_event>: Remove.
5490         (event_queue): Change to QUEUE(gdb_event_p).
5491         (async_queue_event): Remove.
5492         (gdb_event_xfree): New.
5493         (initialize_event_loop): New.
5494         (process_event): Use API from QUEUE.
5495         (wait_for_event): Likewise.
5496         * server.c (main): Call initialize_event_loop.
5497         * server.h (initialize_event_loop): Declare.
5498
5499 2013-01-18  Yao Qi  <yao@codesourcery.com>
5500
5501         * ax.h (struct eval_agent_expr_context): New.
5502         (gdb_eval_agent_expr): Update declaration.
5503         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5504         TFRAME.  Add new argument CTX.
5505         * server.h (struct eval_agent_expr_context): Declare.
5506         (agent_mem_read, agent_tsv_read): Update declaration.
5507         (agent_mem_read_string): Likewise.
5508         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5509         (add_traceframe_block): Add new argument TPOINT.
5510         Increase TPOINT->traceframe_usage.
5511         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5512         eval_tracepoint_agent_expr.
5513         (condition_true_at_tracepoint): Likewise.
5514         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5515         (agent_mem_read_string, agent_tsv_read): Likewise.
5516
5517 2013-01-16  Yao Qi  <yao@codesourcery.com>
5518
5519         * linux-low.c (linux_resume_one_lwp): Don't check
5520         'lwp->bp_reinsert != 0'.
5521
5522 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5523             Pedro Alves  <palves@redhat.com>
5524
5525         * lynx-low.c (ptrace_request_to_str): Define a temporary
5526         macro and use it to simplify this function's implementation.
5527
5528 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5529
5530         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5531         sets errno.
5532
5533 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5534
5535         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5536
5537 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5538
5539         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5540
5541 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5542
5543         * lynx-low.c (lynx_resume): Use the resume_info parameter
5544         to determine the ptid for the lynx_ptrace call, unless
5545         it is equal to minus_one_ptid, in which case we use the
5546         ptid of the current_inferior.
5547         (lynx_wait_1): After having received a thread create/exit
5548         event, resume the inferior's execution using the signaling
5549         thread's ptid, rather than the old ptid.
5550
5551 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5552
5553         * lynx-low.c (lynx_resume): Delete variable ret.
5554
5555 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5556
5557         * gdbreplay.c (gdbreplay_version): Update copyright year.
5558         * server.c (gdbserver_version): Likewise.
5559
5560 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5561
5562         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5563         new thread.
5564
5565 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5566
5567         * lynx-low.c (ptrace_request_to_str): Add handling for
5568         PTRACE_GETTRACESIG.
5569
5570 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5571
5572         * lynx-low.c (lynx_attach): Delete variable new_process.
5573
5574 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5575
5576         * lynx-low.c (lynx_create_inferior): Delete variable
5577         new_process.
5578
5579 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5580
5581         * lynx-low.c (ptrace_request_to_str): Do not handle
5582         PTRACE_GETTHREADLIST if this macro does not exist.
5583
5584 2012-12-15  Yao Qi  <yao@codesourcery.com>
5585
5586         * Makefile.in (OBS): Add notif.o.
5587         * notif.c, notif.h: New.
5588         * server.c: Include "notif.h".
5589         (struct vstop_notif) <next>: Remove.
5590         <base>: New field.
5591         (queue_stop_reply): Update.
5592         (push_event, send_next_stop_reply): Remove.
5593         (discard_queued_stop_replies): Update.
5594         (notif_stop): New variable.
5595         (handle_v_stopped): Remove.
5596         (handle_v_requests): Don't call handle_v_stopped.  Call
5597         handle_ack_notif instead.
5598         (queue_stop_reply_callback): Call notif_event_enque instead
5599         of queue_stop_reply.
5600         (handle_status): Don't call send_next_stop_reply, call
5601         notif_write_event instead.
5602         (kill_inferior_callback): Likewise.
5603         (detach_or_kill_inferior_callback): Likewise.
5604         (main): Call initialize_notif.
5605         (process_serial_event): Call QUEUE_is_empty.
5606         (handle_target_event): Call notif_push instead of push event.
5607         * server.h (push_event): Remove declaration.
5608
5609 2012-12-10  Tom Tromey  <tromey@redhat.com>
5610
5611         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5612         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5613         macros.
5614         (.c.o): Rewrite.
5615         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5616         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5617         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5618         (amd64-linux-ipa.o, ax.o): Rewrite.
5619         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5620         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5621         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5622         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5623         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5624         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5625         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5626         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5627         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5628         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5629         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5630         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5631         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5632         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5633         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5634         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5635         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5636         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5637         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5638         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5639         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5640         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5641         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5642         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5643         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
5644         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
5645         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
5646         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
5647         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
5648         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
5649         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
5650         (reg-tilegx.o): Remove.
5651         (all_object_files): New macro.
5652         Include .deps files.
5653         * aclocal.m4, configure: Rebuild.
5654         * acinclude.m4: Include depstand.m4, lead-dot.m4.
5655         * configure.ac: Invoke ZW_CREATE_DEPDIR,
5656         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
5657
5658 2012-12-05  Tom Tromey  <tromey@redhat.com>
5659
5660         PR gdb/14917:
5661         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
5662
5663 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
5664
5665         * configure.ac: Check for linux/perf_event.h.
5666         * config.in: Regenerated.
5667         * configure: Regenerated.
5668
5669 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
5670
5671         * hostio.c (handle_readlink): Decrease buffer size
5672         parameter passed to readlink by one byte.
5673
5674 2012-11-26  Yao Qi  <yao@codesourcery.com>
5675
5676         * configure.ac (build_warnings): Append '-Wempty-body'.
5677         * configure: Regenerated.
5678         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
5679         body.
5680
5681 2012-11-15  Pierre Muller  <muller@sourceware.org>
5682
5683         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
5684         * config.in: Regenerate.
5685         * configure: Regenerate.
5686         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
5687         Use "gdb_wait.h" header instead of <sys/wait.h> header.
5688         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5689         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
5690         header.
5691         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
5692         instead of <sys/wait.h> header.
5693         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5694
5695 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
5696
5697         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
5698         (various make rules): Remove -DGDBSERVER
5699
5700 2012-11-09  Yao Qi  <yao@codesourcery.com>
5701
5702         * spu-low.c (current_ptid): Move it to ..
5703         * gdbthread.h: ... here.  New.
5704         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
5705         * server.c (myresume, process_serial_event): Likewise.
5706         * thread-db.c (thread_db_find_new_threads): Likewise.
5707         * tracepoint.c (run_inferior_command): Likewise.
5708
5709 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
5710
5711         * server.c (handle_search_memory_1): Include access length in
5712         warning message.
5713
5714 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
5715
5716         * linux-crisv32-low.c: Fix compile errors.
5717
5718 2012-09-04  Yao Qi  <yao@codesourcery.com>
5719
5720         * tracepoint.c (cmd_qtsv): Adjust debug message.
5721         Don't check CUR_TPOINT.
5722
5723 2012-08-28  Yao Qi  <yao@codesourcery.com>
5724
5725         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
5726         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
5727         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
5728         Remove declarations of xmalloc, xreallloc, xstrdup and
5729         freeargv.
5730         * Makefile.in (libiberty_h): New.
5731         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
5732         (linux-bfin-low.o): Append dependency 'libiberty.h'.
5733
5734 2012-08-23  Yao Qi  <yao@codesourcery.com>
5735
5736         * server.h: Remove declaration of 'xsnprintf'.
5737
5738 2012-08-22  Keith Seitz  <keiths@redhat.com>
5739
5740         * server.h: Include build-gnulib-gbserver/config.h.
5741         * gdbreplay.c: Likewise.
5742
5743 2012-08-08  Doug Evans  <dje@google.com>
5744
5745         * Makefile.in (SFILES): Add gdb_vecs.c.
5746         (OBS): Add gdb_vecs.o.
5747         (gdb_vecs_h, host_defs_h): New variables.
5748         (thread-db.o): Add $(gdb_vecs_h) dependency.
5749         (gdb_vecs.o): New rule.
5750         * thread-db.c: #include "gdb_vecs.h".
5751         (thread_db_load_search): Use a vector to iterate over path elements.
5752         Handle text appearing after "$pdir".
5753
5754         * configure.ac: Add check for strstr.
5755         * config.in: Regenerate.
5756         * configure: Regenerate.
5757
5758 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
5759
5760         * hostio.c (handle_pread): If pread fails, fall back to attempting
5761         lseek/read.
5762         (handle_pwrite): Likewise for pwrite.
5763
5764 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
5765
5766         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
5767         between unsupported TYPE and unimplementable ADDR/LEN combination.
5768         (arm_insert_point): Act on new return value.
5769
5770 2012-07-31  Pedro Alves  <palves@redhat.com>
5771
5772         * server.c (process_point_options): Only skip tokens if we find
5773         one that is unrecognized.  Don't treat 'X' specially while
5774         skipping unrecognized tokens.
5775
5776 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
5777
5778         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
5779         to 4-byte-align HW breakpoint addresses for Thumb.
5780
5781 2012-07-27  Yao Qi  <yao@codesourcery.com>
5782
5783         PR remote/14161.
5784
5785         * server.h: Declare gdb_agent_about_to_close.
5786         * target.c (kill_inferior): Include "agent.h".
5787         New.  Send command 'kill'.
5788         * target.h (kill_inferior): Removed macro.
5789         * tracepoint.c (gdb_agent_about_to_close): New.
5790         (gdb_agent_helper_thread): Handle command 'close'.
5791         Wait endlessly until the inferior stops.
5792         Install gdb_agent_remove_socket to atexit hook.
5793         (agent_socket_name): New static variable.
5794         (gdb_agent_socket_init): Replace local variable 'name' with
5795         'agent_socket_name'.
5796         (gdb_agent_remove_socket): New.
5797
5798 2012-07-27  Yao Qi  <yao@codesourcery.com>
5799
5800         * server.c (process_point_options): Stop at 'X' when parsing.
5801
5802 2012-07-19  Michael Eager  <eager@eagercon.com>
5803
5804         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
5805         to hw_execute.
5806         * linux-x86-low.c (x86_insert_point, x86_remove_point):
5807         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
5808         hardware breakpoint.
5809
5810 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5811
5812         * gdbserver/linux-low.c (initialize_low): Call
5813         linux_ptrace_init_warnings.
5814
5815 2012-07-02  Doug Evans  <dje@google.com>
5816
5817         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
5818         pointer to int.
5819
5820 2012-07-02  Stan Shebs  <stan@codesourcery.com>
5821
5822         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
5823         (ax.o): Add it to build rule.
5824         (ax-ipa.o): Ditto.
5825         (OBS): Add format.o.
5826         (IPA_OBS): Add format.o.
5827         * server.c (handle_query): Claim support for breakpoint commands.
5828         (process_point_options): Add command case.
5829         (process_serial_event): Leave running if there are printfs in
5830         effect.
5831         * mem-break.h (any_persistent_commands): Declare.
5832         (add_breakpoint_commands): Declare.
5833         (gdb_no_commands_at_breakpoint): Declare.
5834         (run_breakpoint_commands): Declare.
5835         * mem-break.c (struct point_command_list): New struct.
5836         (struct breakpoint): New field command_list.
5837         (any_persistent_commands): New function.
5838         (add_commands_to_breakpoint): New function.
5839         (add_breakpoint_commands): New function.
5840         (gdb_no_commands_at_breakpoint): New function.
5841         (run_breakpoint_commands): New function.
5842         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
5843         locally.
5844         * ax.c: Include format.h.
5845         (ax_printf): New function.
5846         (gdb_eval_agent_expr): Add printf opcode.
5847
5848 2012-06-13  Yao Qi  <yao@codesourcery.com>
5849
5850         * server.c (start_inferior): Remove duplicated writes to fields
5851         'last_resume_kind' and 'last_status' of 'current_inferior'.
5852
5853 2012-06-12  Yao Qi  <yao@codesourcery.com>
5854             Pedro Alves  <palves@redhat.com>
5855
5856         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
5857         comment.
5858         * server.c (handle_v_cont): Extend comment.
5859
5860 2012-06-11  Yao Qi  <yao@codesourcery.com>
5861
5862         * linux-low.c (linux_attach): Add 'static'.
5863
5864 2012-06-06  Yao Qi  <yao@codesourcery.com>
5865
5866         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
5867
5868 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
5869
5870         Fix gcc -flto compilation warning.
5871         * server.c (main): Make variable multi_mode and attach volatile.
5872
5873 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5874
5875         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
5876         if the platform doesn't know about it.
5877
5878 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
5879
5880         * Makefile.in (SFILES): Add linux-tile-low.c.
5881         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
5882         * configure.srv: Handle tilegx-*-linux*.
5883         * linux-tile-low.c: New file.
5884
5885 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5886
5887         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
5888
5889 2012-05-24  Pedro Alves  <palves@redhat.com>
5890
5891         PR gdb/7205
5892
5893         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
5894
5895 2012-05-24  Pedro Alves  <palves@redhat.com>
5896
5897         PR gdb/7205
5898
5899         Replace target_signal with gdb_signal throughout.
5900
5901 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
5902
5903         * linux-low.c (linux_store_registers): Avoid the copying sequence
5904         when no data has been retrieved by ptrace.
5905
5906 2012-05-22  Will Deacon  <will.deacon@arm.com>
5907
5908         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
5909         Include asm/ptrace.h.
5910         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
5911         already defined.
5912
5913 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
5914
5915         * linux-low.c (linux_store_registers): Don't re-retrieve data
5916         with ptrace that has already been obtained from /proc.  Always
5917         copy any data retrieved with ptrace to the buffer supplied.
5918
5919 2012-05-11  Yao Qi  <yao@codesourcery.com>
5920             Pedro Alves  <palves@redhat.com>
5921
5922         * linux-low.c (enum stopping_threads_kind): New.
5923         (stopping_threads): Change type to `enum stopping_threads_kind'.
5924         (handle_extended_wait): If stopping and suspending threads, leave
5925         the new_lwp suspended too.
5926         (linux_wait_for_event): Adjust.
5927         (stop_all_lwps): Set `stopping_threads' to
5928         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
5929         whether we're suspending threads or just stopping them.  Assert no
5930         recursion happens.
5931
5932 2012-04-29  Yao Qi  <yao@codesourcery.com>
5933
5934         * server.h: Move some code to ...
5935         * gdbthread.h: ... here.  New.
5936         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
5937         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
5938         (nto-low.o, win32-low.o): Likewise.
5939         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
5940         * regcache.c, remote-utils.c, server.c: Likewise.
5941         * target.c, tracepoint.c, win32-low.c: Likewise.
5942
5943 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5944
5945         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
5946         (PTRACE_ARG4_TYPE): Likewise.
5947         (PTRACE_XFER_TYPE): Likewise.
5948         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
5949         ptrace to PTRACE_ARG3_TYPE.
5950         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
5951         (PTRACE_ARG4_TYPE): Likewise.
5952         (PTRACE_XFER_TYPE): Likewise.
5953         (linux_detach_one_lwp): Cast fourth argument of
5954         ptrace to long then PTRACE_ARG4_TYPE.
5955         (regsets_fetch_inferior_registers): Cast third argument of
5956         ptrace to long then PTRACE_ARG3_TYPE.
5957         (regsets_store_inferior_registers): Likewise.
5958
5959 2012-04-20  Pedro Alves  <palves@redhat.com>
5960
5961         * configure: Regenerate.
5962
5963 2012-04-19  Pedro Alves  <palves@redhat.com>
5964
5965         * Makefile.in (GNULIB_BUILDDIR): New.
5966         (LIBGNU, INCGNU, GNULIB_H): Adjust.
5967         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
5968         (all, install-only, uninstall, clean-info, all-lib, clean): No
5969         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
5970         (maintainer-clean realclean distclean): Use subdir_do.
5971         (subdir_do): New.
5972         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
5973         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
5974         * acinclude.m4: Include acx_configure_dir.m4.
5975         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
5976         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
5977         ACX_CONFIGURE_DIR.
5978         (GNULIB): New.
5979         (GNULIB_STDINT_H): Adjust.
5980         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
5981         * gdbreplay.c: Include build-gnulib/config.h.
5982         * server.h: Likewise.
5983         * aclocal.m4: Regenerate.
5984         * config.in: Regenerate.
5985         * configure: Regenerate.
5986
5987 2012-04-19  Pedro Alves  <palves@redhat.com>
5988
5989         * Makefile.in (LIBGNU, INCGNU): Adjust.
5990         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
5991         (all, install-only, uninstall, clean-info, all-lib, clean)
5992         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
5993         * configure.ac: Adjust AC_OUTPUT output.
5994         * aclocal.m4: Regenerate.
5995         * configure: Regenerate.
5996
5997 2012-04-19  Pedro Alves  <palves@redhat.com>
5998
5999         * Makefile.in (generated_files): New.
6000         (server_h): Remove the explicit dependency on config.h, and depend
6001         on $generated_files.
6002
6003 2012-04-19  Pedro Alves  <palves@redhat.com>
6004
6005         * Makefile.in (INCGNU): Add -Ignulib.
6006
6007 2012-04-19  Pedro Alves  <palves@redhat.com>
6008
6009         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
6010         (INCGNU): ... this, and spell out -I here.
6011         (GNULIB_LIB): Rename to ...
6012         (LIBGNU): ... this.
6013         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
6014
6015 2012-04-19  Pedro Alves  <palves@redhat.com>
6016
6017         * config.in: Regenerate.
6018
6019 2012-04-19  Pedro Alves  <palves@redhat.com>
6020
6021         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
6022         * server.h (memmem): Remove declaration.
6023         * config.in: Regenerate.
6024         * configure: Regenerate.
6025
6026 2012-04-19  Yao Qi  <yao@codesourcery.com>
6027
6028         * Makefile.in (SFILES): Add common/vec.c.
6029         (OBS): Add vec.o.
6030         (vec.o): New rule.
6031
6032 2012-04-19  Yao Qi  <yao@codesourcery.com>
6033
6034         * remote-utils.c (prepare_resume_reply): Replace with macro
6035         target_core_of_thread.
6036         * server.c (handle_qxfer_threads_proper): Likewise.
6037         * target.h (traget_core_of_thread): New macro.
6038
6039 2012-04-18  Pedro Alves  <palves@redhat.com>
6040
6041         * aclocal.m4: Regenerate.
6042         * configure: Regenerate.
6043
6044 2012-04-16  Yao Qi  <yao@codesourcery.com>
6045
6046         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
6047         duplicated on address.
6048
6049 2012-04-16  Yao Qi  <yao@codesourcery.com>
6050
6051         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
6052         (struct tracepoint_action_ops) <send>: New field.
6053         (m_tracepoint_action_send, r_tracepoint_action_send): New.
6054         (agent_expr_send, x_tracepoint_action_send): New.
6055         (l_tracepoint_action_send): New.
6056         (cmd_qtdp): Download and install tracepoint
6057         according to `use_agent'.
6058         (run_inferior_command): Add one more parameter `len'.
6059         Update callers.
6060         (tracepoint_send_agent): New.
6061         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
6062
6063 2012-04-16  Yao Qi  <yao@codesourcery.com>
6064
6065         * tracepoint.c (download_tracepoints): Moved to ...
6066         (cmd_qtstart): ... here.
6067
6068 2012-04-14  Yao Qi  <yao@codesourcery.com>
6069
6070         * tracepoint.c: Include inttypes.h.
6071         (struct collect_memory_action): Use sized types.
6072         (struct tracepoint): Likewise.
6073         (cmd_qtdp, stop_tracing): Update print specifiers.
6074         (cmd_qtp, response_tracepoint): Likewise.
6075         (collect_data_at_tracepoint): Likewise.
6076         (collect_data_at_step): Likewise.
6077
6078 2012-04-14  Yao Qi  <yao@codesourcery.com>
6079
6080         Import gnulib module inttypes.
6081         * aclocal.m4, config.in, configure: Regenerated.
6082
6083 2012-04-14  Yao Qi  <yao@codesourcery.com>
6084
6085         * Makefile.in (maintainer-clean, realclean, distclean): Remove
6086         Makefile and config.status at last.
6087
6088 2012-04-13  Yao Qi  <yao@codesourcery.com>
6089
6090         * tracepoint.c: Include stdint.h unconditionally.
6091
6092 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6093
6094         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
6095         on BFD_HAVE_SYS_PROCFS_TYPE.
6096         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
6097         * configure: Regenerate.
6098         * config.in: Likewise.
6099
6100 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
6101
6102         * Makefile.in (clean): Also remove x32.c x32-linux.c
6103         x32-avx.c x32-avx-linux.c.
6104         (x32.o): New target.
6105         (x32.c): Likewise.
6106         (x32-linux.o): Likewise.
6107         (x32-linux.c): Likewise.
6108         (x32-avx.o): Likewise.
6109         (x32-avx.c): Likewise.
6110         (x32-avx-linux.o): Likewise.
6111         (x32-avx-linux.c): Likewise.
6112
6113         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
6114         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
6115         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
6116         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
6117         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
6118         i386/x32-avx-linux.xml.
6119
6120         * linux-x86-low.c (init_registers_x32_linux): New prototype.
6121         (init_registers_x32_avx_linux): Likwise.
6122         (x86_linux_update_xmltarget): Call init_registers_x32_linux
6123         or init_registers_x32_avx_linux if linux_is_elf64 is false.
6124
6125 2012-04-13  Pedro Alves  <palves@redhat.com>
6126
6127         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
6128         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
6129         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
6130         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
6131         the sub-make.
6132
6133 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6134
6135         * linux-x86-low.c (compat_x32_clock_t): New.
6136         (compat_x32_siginfo_t): Likewise.
6137         (compat_x32_siginfo_from_siginfo): Likewise.
6138         (siginfo_from_compat_x32_siginfo): Likewise.
6139         (linux_is_elf64): Likewise.
6140         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
6141         and siginfo_from_compat_x32_siginfo for x32.
6142         (x86_arch_setup): Set linux_is_elf64.
6143
6144 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6145
6146         PR gdb/13969
6147         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
6148         e_machine field.
6149         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
6150         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
6151         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
6152         compatible with process.
6153
6154 2012-04-12  Yao Qi  <yao@codesourcery.com>
6155
6156         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
6157         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
6158         (install-only, install-info, clean): Handle sub dir gnulib.
6159         (all-lib, am--refresh): New targets.
6160         (memmem.o): Remove target.
6161         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6162         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6163         (AC_REPLACE_FUNCS): Remove memmem.
6164         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6165         (AC_OUTPUT): Generate Makefile in gnulib/.
6166         * aclocal.m4, config.in, configure: Regenerated.
6167
6168 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6169
6170         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6171
6172 2012-04-05  Pedro Alves  <palves@redhat.com>
6173
6174         -Werror=strict-aliasing
6175
6176         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6177         pointer.
6178
6179 2012-04-04  Pedro Alves  <palves@redhat.com>
6180
6181         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6182         (sparc_store_gregset_from_stack, sparc_store_gregset)
6183         (sparc_breakpoint_at): Fix formatting.
6184
6185 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6186
6187         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6188         are available.
6189         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6190         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6191         * config.in: Regenerate.
6192         * configure: Likewise.
6193
6194 2012-03-29  Pedro Alves  <palves@redhat.com>
6195
6196         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6197         Correct ptrace arguments.
6198
6199 2012-03-28  Pedro Alves  <palves@redhat.com>
6200
6201         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6202         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6203         (IA64_FR1_REGNUM): New defines.
6204         (ia64_fetch_register): New.
6205         (the_low_target): Install it.
6206         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6207         field.
6208         * linux-low.c (linux_fetch_registers): Try the
6209         the_low_target.fetch_register hook first.
6210
6211         * linux-arm-low.c (the_low_target): Adjust.
6212         * linux-bfin-low.c (the_low_target): Adjust.
6213         * linux-cris-low.c (the_low_target): Adjust.
6214         * linux-crisv32-low.c (the_low_target): Adjust.
6215         * linux-m32r-low.c (the_low_target): Adjust.
6216         * linux-m68k-low.c (the_low_target): Adjust.
6217         * linux-mips-low.c (the_low_target): Adjust.
6218         * linux-ppc-low.c (the_low_target): Adjust.
6219         * linux-s390-low.c (the_low_target): Adjust.
6220         * linux-sh-low.c (the_low_target): Adjust.
6221         * linux-sparc-low.c (the_low_target): Adjust.
6222         * linux-tic6x-low.c (the_low_target): Adjust.
6223         * linux-x86-low.c (the_low_target): Adjust.
6224         * linux-xtensa-low.c (the_low_target): Adjust.
6225
6226 2012-03-26  Pedro Alves  <palves@redhat.com>
6227
6228         * server.c (handle_qxfer_libraries): Don't bail early if
6229         the_target->qxfer_libraries_svr4 is not NULL.
6230
6231 2012-03-26  Pedro Alves  <palves@redhat.com>
6232
6233         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6234
6235 2012-03-23  Pedro Alves  <palves@redhat.com>
6236
6237         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6238         "library-list-svr4" element's start tag when the the DSO list is
6239         empty.
6240
6241 2012-03-23  Pedro Alves  <palves@redhat.com>
6242
6243         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6244         a variable whose type size is the same as the inferior's pointer
6245         size.
6246
6247 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6248
6249         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6250         struct siginfo.
6251         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6252         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6253         * linux-low.h: Include <signal.h>.
6254         (struct siginfo): Remove forward declaration.
6255         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6256         struct siginfo.
6257
6258 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6259
6260         * .gitignore: Ignore more files.
6261
6262 2012-03-19  Pedro Alves  <palves@redhat.com>
6263             Jan Kratochvil  <jan.kratochvil@redhat.com>
6264
6265         * server.c (cont_thread, general_thread): Add describing comments.
6266         (start_inferior): Clear `cont_thread'.
6267         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6268         of a process.
6269
6270 2012-03-15  Yao Qi  <yao@codesourcery.com>
6271
6272         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6273         handling to ...
6274         (cmd_qtdp): ... here.
6275
6276 2012-03-15  Yao Qi  <yao@codesourcery.com>
6277
6278         * tracepoint.c (struct tracepoint_action_ops): New.
6279         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6280         (m_tracepoint_action_download): New.
6281         (r_tracepoint_action_download): New.
6282         (x_tracepoint_action_download): New.
6283         (l_tracepoint_action_download): New.
6284         (add_tracepoint_action): Install `action->ops' according type.
6285         (download_tracepoint_1): Move code `download' function pointer
6286         of various tracepoint_action_ops.
6287
6288 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6289
6290         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6291         linux_ptrace_attach_warnings.
6292
6293 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6294
6295         * Makefile.in (linux-ptrace.o): New.
6296         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6297         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6298         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6299         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6300         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6301         of these targets.
6302         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6303
6304 2012-03-08  Yao Qi  <yao@codesourcery.com>
6305             Pedro Alves  <palves@redhat.com>
6306
6307         Fix PR server/13392.
6308         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6309         offset of JMP insn.
6310         * tracepoint.c (remove_tracepoint): New.
6311         (cmd_qtdp): Call remove_tracepoint when failed to install.
6312
6313 2012-03-07  Pedro Alves  <palves@redhat.com>
6314
6315         * linux-low.c (get_detach_signal): New.
6316         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6317         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6318         ptrace call.
6319         * server.c (program_signals, program_signals_p): New.
6320         (handle_general_set): Handle QProgramSignals.
6321         * server.h (program_signals, program_signals_p): Declare.
6322
6323 2012-03-05  Pedro Alves  <palves@redhat.com>
6324             Jan Kratochvil  <jan.kratochvil@redhat.com>
6325
6326         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6327         New comment why.
6328
6329 2012-03-03  Yao Qi  <yao@codesourcery.com>
6330
6331         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6332         agent_look_up_symbols.
6333
6334 2012-03-03  Yao Qi  <yao@codesourcery.com>
6335
6336         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6337         (linux-x86-low.o): Likewise.
6338         * server.h: Remove in_process_agent_loaded.
6339         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6340         common/agent.c.
6341         Update callers.
6342
6343 2012-03-03  Yao Qi  <yao@codesourcery.com>
6344
6345         * tracepoint.c (gdb_agent_capability): New global.
6346         (in_process_agent_loaded_ust): Renamed to
6347         `in_process_agent_supports_ust'.
6348         Update callers.
6349         (in_process_agent_supports_ust): Call agent_capability_check.
6350         (clear_installed_tracepoints): Assert that agent supports
6351         agent.
6352
6353 2012-03-03  Yao Qi  <yao@codesourcery.com>
6354
6355         * linux-low.c (linux_supports_agent): New.
6356         (linux_target_ops): Initialize field `supports_agent' with
6357         linux_supports_agent.
6358         * target.h (struct target_ops) <supports_agent>: New.
6359         (target_supports_agent): New macro.
6360         * server.c (handle_general_set): Handle packet 'QAgent'.
6361         (handle_query): Send `QAgent+'.
6362         * Makefile.in (server.o): Depends on agent.h.
6363
6364 2012-03-03  Yao Qi  <yao@codesourcery.com>
6365
6366         * Makefile.in (OBS): Add agent.o.
6367         Add new rule for agent.o.
6368         Track dependence of tracepoint.c on agent.h.
6369         * tracepoint.c (run_inferior_command_1):
6370         (run_inferior_command): Call agent_run_command.
6371         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6372         common/agent.c.
6373         (resume_thread, stop_thread): Likewise.
6374         (gdb_ust_socket_init): Renamed to ...
6375         (gdb_agent_socket_init): ... New.
6376         (gdb_ust_thread): Renamed to ...
6377         (gdb_agent_helper_thread): ... New.
6378         (gdb_ust_init): Move some code to ...
6379         (gdb_agent_init): ... here.  New.
6380         [HAVE_UST]: Call gdb_ust_init.
6381         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6382         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6383         * config.in, configure: Regenerated.
6384
6385 2012-03-02  Pedro Alves  <palves@redhat.com>
6386
6387         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6388         * linux-low.c (struct simple_pid_list): New.
6389         (stopped_pids): New a struct simple_pid_list pointer.
6390         (add_to_pid_list, pull_pid_from_list): New.
6391         (handle_extended_wait): Don't assume the first signal new children
6392         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6393         (linux_wait_for_lwp): Adjust.
6394
6395 2012-03-02  Yao Qi  <yao@codesourcery.com>
6396
6397         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6398         debug log.
6399
6400 2012-03-02  Yao Qi  <yao@codesourcery.com>
6401
6402         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6403         `stop_pc' and `tpoint'.  Update caller.
6404
6405 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6406
6407         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6408         * linux-low.c (use_linux_regsets): New macro.
6409         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6410         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6411         (linux_register_in_regsets): New function.
6412         (usr_fetch_inferior_registers): Skip registers covered by
6413         regsets.
6414         (usr_store_inferior_registers): Likewise.
6415         (usr_fetch_inferior_registers): New macro.
6416         (usr_store_inferior_registers): Likewise.
6417         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6418         (linux_store_registers): Likewise.
6419         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6420         prototype.
6421         (init_registers_mips64_dsp_linux): Likewise.
6422         (init_registers_mips_linux): New macro.
6423         (init_registers_mips_dsp_linux): Likewise.
6424         (mips_dsp_num_regs): Likewise.
6425         (DSP_BASE, DSP_CONTROL): New fallback macros.
6426         (mips_base_regs): New macro.
6427         (mips_regmap): Use it.  Fix the size.
6428         (mips_dsp_regmap): New variable.
6429         (mips_dsp_regset_bitmap): Likewise.
6430         (mips_arch_setup): New function.
6431         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6432         than mips_regmap.
6433         (mips_cannot_store_register): Likewise.
6434         (the_low_target): Update .arch_setup, .num_regs and .regmap
6435         initializers.  Add .regset_bitmap initializer.
6436         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6437         initializer.
6438         * linux-bfin-low.c (the_low_target): Likewise.
6439         * linux-cris-low.c (the_low_target): Likewise.
6440         * linux-crisv32-low.c (the_low_target): Likewise.
6441         * linux-ia64-low.c (the_low_target): Likewise.
6442         * linux-m32r-low.c (the_low_target): Likewise.
6443         * linux-m68k-low.c (the_low_target): Likewise.
6444         * linux-ppc-low.c (the_low_target): Likewise.
6445         * linux-s390-low.c (the_low_target): Likewise.
6446         * linux-sh-low.c (the_low_target): Likewise.
6447         * linux-sparc-low.c (the_low_target): Likewise.
6448         * linux-tic6x-low.c (the_low_target): Likewise.
6449         * linux-x86-low.c (the_low_target): Likewise.
6450         * linux-xtensa-low.c (the_low_target): Likewise.
6451         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6452         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6453         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6454         srv_xmlfiles.
6455         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6456         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6457
6458 2012-02-29  Yao Qi  <yao@codesourcery.com>
6459             Pedro Alves  <palves@redhat.com>
6460
6461         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6462         `step_over_finished' is true.
6463
6464 2012-02-27  Pedro Alves  <palves@redhat.com>
6465
6466         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6467         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6468
6469 2012-02-27  Pedro Alves  <palves@redhat.com>
6470
6471         PR server/9684
6472         * linux-low.c (pid_is_stopped): New.
6473         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6474
6475 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6476
6477         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6478         of conditions.
6479
6480 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6481
6482         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6483
6484 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6485
6486         * server.c (handle_query): Advertise support for target-side
6487         breakpoint condition evaluation.
6488         (process_point_options): New function.
6489         (process_serial_event): When inserting a breakpoint, check for
6490         a target-side condition that should be evaluated.
6491
6492         * mem-break.c: Include regcache.h and ax.h.
6493         (point_cond_list_t): New data structure.
6494         (breakpoint) <cond_list>: New field.
6495         (find_gdb_breakpoint_at): Make non-static.
6496         (delete_gdb_breakpoint_at): Clear any target-side
6497         conditions.
6498         (clear_gdb_breakpoint_conditions): New function.
6499         (add_condition_to_breakpoint): Likewise.
6500         (add_breakpoint_condition): Likewise.
6501         (gdb_condition_true_at_breakpoint): Likewise.
6502         (gdb_breakpoint_here): Return result directly instead
6503         of going through a local variable.
6504
6505         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6506         (clear_gdb_breakpoint_conditions): Likewise.
6507         (add_breakpoint_condition): Likewise.
6508         (gdb_condition_true_at_breakpoint): Likewise.
6509
6510         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6511         (need_step_over_p): Take target-side breakpoint condition into
6512         consideration.
6513
6514 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6515
6516         * server.h: Include tracepoint.h.
6517         (agent_mem_read, agent_get_trace_state_variable_value,
6518         agent_set_trace_state_variable_value,
6519         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6520         get_set_tsv_func_addr): New prototypes.
6521
6522         * ax.h: New include file.
6523         * ax.c: New source file.
6524
6525         * tracepoint.c: Include ax.h.
6526         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6527         agent_expr, eval_result_type): Move to ax.h.
6528         (parse_agent_expr): Rename to ...
6529         (gdb_parse_agent_expr): ... this, make it non-static and move
6530         to ax.h.
6531         (unparse_agent_expr) Rename to ...
6532         (gdb_unparse_agent_expr): ... this, make it non-static and move
6533         to ax.h.
6534         (eval_agent_expr): Rename to ...
6535         (eval_tracepoint_agent_expr): ... this.
6536         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6537         forward declarations.
6538         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6539         (agent_get_trace_state_variable_value): New function.
6540         (agent_set_trace_state_variable_value): New function.
6541         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6542         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6543         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6544         (condition_true_at_tracepoint): Likewise.
6545         (parse_agent_expr): Rename to ...
6546         (gdb_parse_agent_expr): ... this and move to ax.c.
6547         (unparse_agent_expr): Rename to ...
6548         (gdb_unparse_agent_expr): ... this and move to ax.c.
6549         (gdb_agent_op_name): Move to ax.c.
6550         (eval_agent_expr): Rename to ...
6551         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6552         and move to ax.c.
6553         (eval_tracepoint_agent_expr): New function.
6554         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6555         non-static.
6556         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6557         ax.c.
6558         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6559         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6560         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6561         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6562         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6563         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6564         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6565         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6566         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6567         (compile_bytecodes): Remove forward declaration.
6568         (is_goto_target): Move to ax.c.
6569         (compile_bytecodes): Move to ax.c and call
6570         agent_get_trace_state_variable_value (...) and
6571         agent_set_trace_state_variable_value (...).
6572
6573         * Makefile.in: Update ax.c and IPA dependencies.
6574
6575 2012-02-24  Pedro Alves  <palves@redhat.com>
6576
6577         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6578         (cmd_bigqtbuffer_circular): ... this.  Only handle
6579         'QTBuffer:circular:'.
6580         (handle_tracepoint_general_set): Adjust.
6581
6582 2012-02-16  Yao Qi  <yao@codesourcery.com>
6583
6584         * inferiors.c: Move code to ...
6585         * dll.c: .... here.  New.
6586         * server.h: Declare clear_dlls.
6587         * Makefile.in (SFILES): Add dll.c.
6588         (OBS): Add dll.o
6589         (dll.o): New rule.
6590
6591 2012-02-11  Yao Qi  <yao@codesourcery.com>
6592
6593         * server.c: (handle_monitor_command): Add a new parameter
6594         `own_buf'.
6595         (handle_query): Update caller.
6596
6597 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6598
6599         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6600         * configure, config.in: Regenerate.
6601         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6602         is not defined.
6603
6604 2012-02-02  Pedro Alves  <palves@redhat.com>
6605
6606         Try SIGKILL first, then PTRACE_KILL.
6607         * linux-low.c (linux_kill_one_lwp): New.
6608         (linux_kill_one_lwp): Rename to ...
6609         (kill_one_lwp_callback): ... this.  Use the new
6610         linux_kill_one_lwp.
6611
6612 2012-02-02  Pedro Alves  <palves@redhat.com>
6613
6614         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6615         inferior.
6616
6617 2012-01-27  Pedro Alves  <palves@redhat.com>
6618
6619         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6620         (elf_64_file_p): Make static.
6621         (linux_pid_exe_is_elf_64_file): New.
6622         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6623         Delete declarations.
6624         (linux_pid_exe_is_elf_64_file): Declare.
6625         * linux-x86-low.c (x86_arch_setup): Use
6626         linux_pid_exe_is_elf_64_file.
6627
6628 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6629
6630         * linux-low.c (linux_wait_for_event_1): Rename to ...
6631         (linux_wait_for_event): ... here and merge it with former
6632         linux_wait_for_event - new variable wait_ptid, use it.
6633         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6634
6635 2012-01-23  Pedro Alves  <palves@redhat.com>
6636
6637         * server.c (main): Avoid yet another case of infinite loop while
6638         detaching/killing after a longjmp.
6639
6640 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6641
6642         Code cleanup.
6643         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
6644
6645 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
6646
6647         * hostio.c (handle_readlink): New function.
6648         (handle_vFile): Call it to handle "vFile:readlink" packets.
6649
6650 2012-01-20  Pedro Alves  <palves@redhat.com>
6651             Ulrich Weigand  <ulrich.weigand@linaro.org>
6652
6653         * server.c (handle_v_requests): Only support vAttach and vRun to
6654         start multiple processes when in extended protocol mode.
6655
6656 2012-01-17  Pedro Alves  <palves@redhat.com>
6657
6658         * tracepoint.c (initialize_tracepoint): Use mmap instead of
6659         memalign plus mprotect to allocate the scratch buffer.
6660
6661 2012-01-13  Pedro Alves  <palves@redhat.com>
6662
6663         * server.c (attach_inferior): Clear `cont_thread'.
6664
6665 2012-01-13  Pedro Alves  <palves@redhat.com>
6666
6667         * server.c (main): Avoid infinite loop while detaching/killing
6668         after a longjmp.
6669
6670 2012-01-09  Doug Evans  <dje@google.com>
6671
6672         * server.c (start_inferior): Set last_ptid in --wrapper case.
6673
6674 2012-01-06  Yao Qi  <yao@codesourcery.com>
6675
6676         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
6677         defined.
6678         [IN_PROCESS_AGENT] (debug_agent): New global variable.
6679
6680 2012-01-04  Yao Qi  <yao@codesourcery.com>
6681
6682         * tracepoint.c (cmd_qtdp): Print debug message
6683         for static tracepoint.
6684
6685 2012-01-04  Yao Qi  <yao@codesourcery.com>
6686
6687         * tracepoint.c (trace_vdebug): Differentiate debug message
6688         between gdbserver and IPA.
6689
6690 2012-01-03  Yao Qi  <yao@codesourcery.com>
6691
6692         * tracepoint.c (tracepoint_was_hit): Don't collect for
6693         static tracepoint.
6694
6695 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6696
6697         * terminal.h: Reformat copyright header.
6698
6699 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6700
6701         * server.c (gdbserver_version): Update copyright year.
6702         * gdbreplay.c (gdbreplay_version): Likewise.
6703
6704 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
6705
6706         * linux-low.c (linux_create_inferior): Put empty if clause for write.
6707
6708         Revert:
6709         2011-12-18  Hui Zhu  <teawater@gmail.com>
6710         * linux-low.c (linux_create_inferior): Save return value to ret.
6711
6712 2011-12-18  Hui Zhu  <teawater@gmail.com>
6713
6714         * linux-low.c (linux_create_inferior): Save return value to ret.
6715
6716 2011-12-16  Doug Evans  <dje@google.com>
6717
6718         * linux-low.c (linux_create_inferior): If stdio connection,
6719         redirect stdin from /dev/null, stdout to stderr.
6720         * remote-utils.c (remote_is_stdio): New static global.
6721         (remote_connection_is_stdio): New function.
6722         (remote_prepare): Handle stdio connection.
6723         (remote_open): Ditto.
6724         (remote_close): Don't close stdin for stdio connections.
6725         (read_prim,write_prim): New functions.  Replace all calls to
6726         read/write to these.
6727         * server.c (main): Watch for "-" argument.  Move call to
6728         remote_prepare before start_inferior.
6729         * server.h (STDIO_CONNECTION_NAME): New macro.
6730         (remote_connection_is_stdio): Declare.
6731
6732         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
6733         in debugging output.
6734
6735 2011-12-15  Yao Qi  <yao@codesourcery.com>
6736
6737         * tracepoint.c: Include sys/syscall.h.
6738         (gdb_ust_thread): Remove preprocessor conditional.
6739
6740 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
6741
6742         * linux-low.c (linux_detach_one_lwp): Call
6743         the_low_target.prepare_to_resume before detaching.
6744
6745 2011-12-14  Yao Qi  <yao@codesourcery.com>
6746
6747         * tracepoint.c (gdb_ust_thread): Don't ignore return value
6748         of write.
6749
6750 2011-12-14  Yao Qi  <yao@codesourcery.com>
6751
6752         * i386-low.c (i386_low_stopped_data_address): Initialize local
6753         variable `control'.
6754
6755 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
6756
6757         PR remote/13492
6758
6759         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
6760         DR_CONTROL unless necessary.  Extend comments.
6761         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
6762         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
6763
6764 2011-12-13  Yao Qi  <yao@codesourcery.com>
6765
6766         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
6767         macros.
6768         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
6769
6770 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
6771
6772         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
6773         Print new debug message for such case.
6774
6775 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6776
6777         Fix overlapping memcpy.
6778         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
6779         the read_inferior_memory transfer.
6780         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
6781         write_inferior_memory transfer.
6782         (set_fast_tracepoint_jump): New variable buf.  Use it for the
6783         read_inferior_memory and write_inferior_memory transfers.
6784         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
6785         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
6786         Use it for the write_inferior_memory transfer.
6787         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
6788         buffers.
6789
6790 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6791
6792         * linux-low.c (fetch_register, store_register): Make code
6793         consistent, fix formatting.
6794
6795 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6796
6797         * linux-low.c (usr_store_inferior_registers): Factor out code
6798         to handle individual registers into...
6799         (store_register): ... this new function.
6800
6801 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
6802
6803         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
6804         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
6805         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
6806         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
6807         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
6808         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
6809         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
6810         (srv_xmlfiles): Add new XML files.
6811
6812         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
6813         and <sys/uio.h>.
6814         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
6815         (init_registers_s390_linux32v1): Add prototype.
6816         (init_registers_s390_linux32v2): Likewise.
6817         (init_registers_s390_linux64v1): Likewise.
6818         (init_registers_s390_linux64v2): Likewise.
6819         (init_registers_s390x_linux64v1): Likewise.
6820         (init_registers_s390x_linux64v2): Likewise.
6821         (s390_num_regs): Increment to 52.
6822         (s390_regmap): Add orig_r2 register.
6823         (s390_num_regs_3264): Increment to 68.
6824         (s390_regmap_3264): Add orig_r2 register.
6825         (s390_collect_ptrace_register): Handle orig_r2 register.
6826         (s390_supply_ptrace_register): Likewise.
6827         (s390_fill_last_break): New function.
6828         (s390_store_last_break): Likewise.
6829         (s390_fill_system_call): New function.
6830         (s390_store_system_call): Likewise.
6831         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
6832         register sets.
6833         (s390_check_regset): New function.
6834         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
6835         NT_S390_SYSTEM_CALL regsets and use appropriate description.
6836         Update target_regsets for available register sets.
6837
6838 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
6839             Jan Kratochvil  <jan.kratochvil@redhat.com>
6840
6841         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
6842         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
6843         New.
6844         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
6845         * linux-low.h (struct process_info_private): New member r_debug.
6846         * server.c (handle_qxfer_libraries): Call
6847         the_target->qxfer_libraries_svr4.
6848         (handle_qxfer_libraries_svr4): New function.
6849         (qxfer_packets): New entry "libraries-svr4".
6850         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
6851         * target.h (struct target_ops): New member qxfer_libraries_svr4.
6852         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
6853         PACKET_qXfer_libraries_svr4.
6854
6855 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
6856
6857         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
6858         PSW address/mask between 8-byte and 16-byte formats.
6859         (s390_supply_ptrace_register): Likewise.
6860         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
6861         basic addressing mode bit.
6862
6863 2011-11-24  Stan Shebs  <stan@codesourcery.com>
6864
6865         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
6866
6867 2011-11-17  Stan Shebs  <stan@codesourcery.com>
6868
6869         * tracepoint.c (struct tracepoint): New field traceframe_usage.
6870         (tracing_start_time): New global.
6871         (tracing_stop_time): New global.
6872         (tracing_user_name): New global.
6873         (tracing_notes): New global.
6874         (tracing_stop_note): New global.
6875         (cmd_qtstart): Set traceframe_usage, start_time.
6876         (stop_tracing): Set stop_time.
6877         (cmd_qtstatus): Report additional status.
6878         (cmd_qtp): New function.
6879         (handle_tracepoint_query): Call it.
6880         (cmd_qtnotes): New function.
6881         (handle_tracepoint_general_set): Call it.
6882         (get_timestamp): Rename from tsv_get_timestamp.
6883
6884 2011-11-14  Stan Shebs  <stan@codesourcery.com>
6885             Kwok Cheung Yeung  <kcy@codesourcery.com>
6886
6887         * linux-x86-low.c (small_jump_insn): New.
6888         (i386_install_fast_tracepoint_jump_pad): Add arguments for
6889         trampoline and error message, build a trampoline and issue a small
6890         jump instruction to it.
6891         (x86_install_fast_tracepoint_jump_pad): Add arguments for
6892         trampoline and error message.
6893         (x86_get_min_fast_tracepoint_insn_len): New.
6894         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
6895         * linux-low.h (struct linux_target_ops): Add arguments to
6896         install_fast_tracepoint_jump_pad operation, add new operation.
6897         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
6898         arguments.
6899         (linux_get_min_fast_tracepoint_insn_len): New function.
6900         (linux_target_op): Add new operation.
6901         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
6902         (gdb_trampoline_buffer_end): Ditto.
6903         (gdb_trampoline_buffer_error): Ditto.
6904         (struct ipa_sym_addresses): Add fields for new IPA variables.
6905         (symbol_list): Add entries for new IPA variables.
6906         (struct tracepoint): Add fields to hold the address range of the
6907         trampoline used by the tracepoint.
6908         (trampoline_buffer_head): New static variable.
6909         (trampoline_buffer_tail): Ditto.
6910         (claim_trampoline_space): New function.
6911         (have_fast_tracepoint_trampoline_buffer): New function.
6912         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
6913         structure.
6914         (install_fast_tracepoint): Ditto, also add error buffer argument.
6915         (cmd_qtminftpilen): New function.
6916         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
6917         (fast_tracepoint_from_trampoline_address): New function.
6918         (fast_tracepoint_collecting): Handle trampoline as part of jump
6919         pad space.
6920         (set_trampoline_buffer_space): New function.
6921         (initialize_tracepoint): Initialize new IPA variables.
6922         * target.h (struct target_ops): Add arguments to
6923         install_fast_tracepoint_jump_pad operation, add new
6924         get_min_fast_tracepoint_insn_len operation.
6925         (target_get_min_fast_tracepoint_insn_len): New.
6926         (install_fast_tracepoint_jump_pad): Add arguments.
6927         * server.h (IPA_BUFSIZ): Define.
6928         * linux-i386-ipa.c: Include extra header files.
6929         (initialize_fast_tracepoint_trampoline_buffer): New function.
6930         (initialize_low_tracepoint): Call it.
6931         * server.h (set_trampoline_buffer_space): Declare.
6932         (claim_trampoline_space): Ditto.
6933         (have_fast_tracepoint_trampoline_buffer): Ditto.
6934
6935 2011-11-14  Yao Qi  <yao@codesourcery.com>
6936
6937         * server.c (handle_query): Handle InstallInTrace for qSupported.
6938         * tracepoint.c (add_tracepoint): Sort list.
6939         (install_tracepoint, download_tracepoint): New.
6940         (cmd_qtdp): Call them to install and download tracepoints.
6941         (sort_tracepoints): Removed.
6942         (cmd_qtstart): Update.
6943
6944 2011-11-14  Yao Qi  <yao@codesourcery.com>
6945
6946         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
6947         * mem-break.h: Declare.
6948         * tracepoint.c (cmd_qtstart): Move some code to ...
6949         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
6950         New.
6951         (download_tracepoints): Move some code to ...
6952         (download_tracepoint_1): ... here.  New.
6953
6954 2011-11-08  Yao Qi  <yao@codesourcery.com>
6955
6956         * remote-utils.c (relocate_instruction): A comment fix.
6957
6958 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
6959
6960         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
6961         (i386_dr_low_get_control, i386_dr_low_get_status): Use
6962         dr_status_mirror and dr_control_mirror from debug_reg_state.
6963         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
6964         (i386_initial_stuff): Remove use of deleted globals.
6965         (i386_get_thread_context, i386_set_thread_context,
6966         i386_thread_added): Use dr_status_mirror and dr_control_mirror
6967         from debug_reg_state.
6968
6969 2011-11-05  Yao Qi  <yao@codesourcery.com>
6970
6971         * tracepoint.c (gdb_collect): Loop over tracepoints of same
6972         address as TPOINT's.
6973
6974 2011-11-02  Stan Shebs  <stan@codesourcery.com>
6975
6976         * tracepoint.c (agent_mem_read_string): New function.
6977         (eval_agent_expr): Call it for tracenz.
6978         * server.c (handle_query): Report support for tracenz.
6979
6980 2011-11-02  Yao Qi  <yao@codesourcery.com>
6981
6982         * tracepoint.c (cmd_qtstart): Remove unused local variables.
6983
6984 2011-11-02  Yao Qi  <yao@codesourcery.com>
6985
6986         * target.h: Fix a typo in comment.
6987
6988 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
6989
6990         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
6991         clobber the breakpoints' shadows with fast tracepoint jumps.
6992         * mem-break.h (check_mem_write): Add `myaddr' parameter.
6993         * target.c (write_inferior_memory): Also pass MYADDR down to
6994         check_mem_write.
6995
6996 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
6997
6998         * configure.ac: Check support for personality routine.
6999         * configure: Regenerate.
7000         * config.in: Likewise.
7001         * linux-low.c: Include <sys/personality.h>.
7002         Define ADDR_NO_RANDOMIZE if necessary.
7003         (linux_create_inferior): Disable address space randomization when
7004         forking inferior, if requested.
7005         (linux_supports_disable_randomization): New function.
7006         (linux_target_ops): Install it.
7007         * server.h (disable_randomization): Declare.
7008         * server.c (disable_randomization): New global variable.
7009         (handle_general_set): Handle QDisableRandomization.
7010         (handle_query): Likewise for qSupported.
7011         (main): Support --disable-randomization and --no-disable-randomization
7012         command line arguments.
7013         * target.h (struct target_ops): Add supports_disable_randomization.
7014         (target_supports_disable_randomization): New macro.
7015
7016 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
7017
7018         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
7019         ifdef check.
7020         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
7021         [!PT_GETDSBT] (target_loadmap): New definition.
7022         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
7023         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
7024         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
7025         and PT_GETDSBT to LINUX_LOADMAP.
7026         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
7027         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
7028
7029 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7030
7031         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
7032         (arm_linux_hwbp_cap): New static variable.
7033         (arm_linux_get_hwbp_cap): Replace by ...
7034         (arm_linux_init_hwbp_cap): ... this new function.
7035         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
7036         (arm_linux_get_hw_watchpoint_count): Likewise.
7037         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7038         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
7039         (arm_prepare_to_resume): Use perror_with_name instead of error.
7040
7041 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7042
7043         * linux-arm-low.c: Include <signal.h>.
7044         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
7045         (struct arm_linux_hwbp_cap): New data type.
7046         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
7047         (struct arm_linux_hw_breakpoint): New data type.
7048         (MAX_BPTS, MAX_WPTS): Define.
7049         (struct arch_process_info, struct arch_lwp_info): New data types.
7050         (arm_linux_get_hwbp_cap): New function.
7051         (arm_linux_get_hw_breakpoint_count): Likewise.
7052         (arm_linux_get_hw_watchpoint_count): Likewise.
7053         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7054         (arm_hwbp_control_initialize): Likewise.
7055         (arm_hwbp_control_is_enabled): Likewise.
7056         (arm_hwbp_control_is_initialized): Likewise.
7057         (arm_hwbp_control_disable): Likewise.
7058         (arm_linux_hw_breakpoint_equal): Likewise.
7059         (arm_linux_hw_point_initialize): Likewise.
7060         (struct update_registers_data): New data structure.
7061         (update_registers_callback: New function.
7062         (arm_insert_point): Likewise.
7063         (arm_remove_point): Likewise.
7064         (arm_stopped_by_watchpoint): Likewise.
7065         (arm_stopped_data_address): Likewise.
7066         (arm_new_process): Likewise.
7067         (arm_new_thread): Likewise.
7068         (arm_prepare_to_resume): Likewise.
7069         (the_low_target): Register arm_insert_point, arm_remove_point,
7070         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
7071         arm_new_thread, and arm_prepare_to_resume.
7072
7073 2011-09-15  Stan Shebs  <stan@codesourcery.com>
7074
7075         * server.h (struct emit_ops): Add compare-goto fields.
7076         * tracepoint.c (gdb_agent_op_sizes): New table.
7077         (emit_eq_goto): New function.
7078         (emit_ne_goto): New function.
7079         (emit_lt_goto): New function.
7080         (emit_le_goto): New function.
7081         (emit_gt_goto): New function.
7082         (emit_ge_goto): New function.
7083         (is_goto_target): New function.
7084         (compile_bytecodes): Recognize special cases of compare-goto
7085         combinations and call specialized emitters for them.
7086         * linux-x86-low.c (amd64_emit_eq_goto): New function.
7087         (amd64_emit_ne_goto): New function.
7088         (amd64_emit_lt_goto): New function.
7089         (amd64_emit_le_goto): New function.
7090         (amd64_emit_gt_goto): New function.
7091         (amd64_emit_ge_goto): New function.
7092         (amd64_emit_ops): Add the new functions.
7093         (i386_emit_eq_goto): New function.
7094         (i386_emit_ne_goto): New function.
7095         (i386_emit_lt_goto): New function.
7096         (i386_emit_le_goto): New function.
7097         (i386_emit_gt_goto): New function.
7098         (i386_emit_ge_goto): New function.
7099         (i386_emit_ops): Add the new functions.
7100
7101 2011-09-08  Stan Shebs  <stan@codesourcery.com>
7102
7103         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
7104         (i386_emit_epilogue): Restore %ebx.
7105
7106 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
7107
7108         * server.c (step_thread): Remove definition.
7109         (process_serial_event): Don't handle Hs.
7110         * server.h (step_thread): Remove declaration.
7111         * target.c (set_desired_inferior): Remove use of step_thread.
7112
7113 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7114
7115         * linux-low.c: Include linux-procfs.h.
7116         (linux_attach_lwp_1): Update comments.
7117         (linux_attach): Scan for existing threads when attaching to a
7118         process that is the tgid.
7119         * Makefile.in: Update dependencies.
7120
7121 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7122
7123         * configure.srv: Add linux-procfs.o dependencies.
7124
7125 2011-08-14  Yao Qi  <yao@codesourcery.com>
7126
7127         * target.h (struct target_ops): Fix indent.
7128         * win32-low.c (win32_target_ops): Fix comment.
7129
7130 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
7131             Yao Qi  <yao@codesourcery.com>
7132
7133         * Makefile.in (clean): Remove tic6x-*.c files.
7134         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
7135         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
7136         (tic6x-c64xp-linux.c): Likewise.
7137         * configure.srv: Add support for tic6x-*-uclinux.
7138         * linux-tic6x-low.c: New.
7139         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
7140
7141 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
7142             Yao Qi  <yao@codesourcery.com>
7143
7144         * target.h (struct target_ops): Add read_loadmap.
7145         * linux-low.c (struct target_loadseg): New type.
7146         (struct target_loadmap): New type.
7147         (linux_read_loadmap): New function.
7148         (linux_target_ops): Add linux_read_loadmap.
7149         * server.c (handle_query): Support qXfer:fdpic:read packet.
7150         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
7151         to NULL.
7152
7153 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7154
7155         * win32-low.c: Include <stdint.h>.
7156
7157 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
7158
7159         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7160         to the inferior here.
7161         (i386_remove_aligned_watchpoint): Ditto.
7162         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7163         fit part of the watchpoint in the debug registers.
7164         (i386_update_inferior_debug_regs): New.
7165         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7166         registers, and only update the inferior on success.
7167         (i386_low_remove_watchpoint): Ditto.
7168
7169 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7170
7171         * linux-low.c (compare_ints, unique, list_threads, show_process,
7172         linux_core_of_thread): Delete.
7173         (linux_target_ops): Change linux_core_of_thread to
7174         linux_common_core_of_thread.
7175         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7176         * utils.c (malloc_failure): Change type of argument.
7177         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7178         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7179         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7180         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7181         (IPA_OBJS): Add common-utils-ipa.o.
7182         (ptid_h, linux_osdata_h): New macros.
7183         (server_h): Add common/common-utils.h, common/xml-utils.h,
7184         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7185         common/ptid.h.
7186         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7187         ptid.o, buffer.o): New rules.
7188         (linux-low.o): Add common/linux-osdata.h as a dependency.
7189         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7190         * configure.ac: Add AC_HEADER_DIRENT check.
7191         * config.in: Regenerate.
7192         * configure: Regenerate.
7193         * remote-utils.c (xml_escape_text): Delete.
7194         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7195         buffer_xml_printf): Move to common/buffer.c.
7196         * server.c (main): Remove call to initialize_inferiors.
7197         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7198         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7199         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7200         internal_error, gdb_assert, gdb_assert_fail): Delete.
7201         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7202         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7203         common/buffer.h.
7204         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7205         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7206         initialize_inferiors): Delete.
7207
7208 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7209
7210         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7211         symbol error.
7212
7213 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7214
7215         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7216         assertion.
7217         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7218
7219 2011-05-26  Yao Qi  <yao@codesourcery.com>
7220
7221         * Makefile.in (thread-db.o): Track dependence to
7222         common/gdb_thread_db.h.
7223         * thread-db.c: include gdb_thread_db.h from right place.
7224
7225 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7226
7227         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7228         __FILE__ and __LINE__ to internal_error.
7229
7230 2011-05-13  Doug Evans  <dje@google.com>
7231
7232         * thread-db.c (try_thread_db_load_from_sdir): New function.
7233         (try_thread_db_load_from_dir): New function.
7234         (thread_db_load_search): Handle $sdir, ignore $pdir.
7235         Remove trying of system directories if search of
7236         libthread-db-search-path fails, that is now done via $sdir.
7237
7238 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7239
7240         * server.c (handle_query): Add EnableDisableTracepoints to the list
7241         of supported features.
7242         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7243         tracepoints.
7244         (cmd_qtenable_disable): New.
7245         (cmd_qtstart): Install tracepoints even if disabled.
7246         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7247         receiving a QTEnable or QTDisable packet.
7248         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7249         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7250         tracepoints.
7251         (gdb_probe): Skip data collection if static tracepoint is disabled.
7252
7253 2011-05-10  Doug Evans  <dje@google.com>
7254
7255         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7256
7257 2011-05-04  Doug Evans  <dje@google.com>
7258
7259         * linux-low.c (linux_join): Skip process lookup.
7260         * spu-low.c (spu_join): Ditto.
7261         * server.c (join_inferiors_callback): Delete.
7262         (process_serial_event): For 'D' packet (detach) call join_inferior
7263         directly.
7264
7265 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7266
7267         * README: Don't mention xscale*-*-linux*.
7268         * configure.srv (xscale*-*-linux*): Don't handle target.
7269
7270 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7271
7272         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7273         casting pointers.
7274         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7275         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7276         (i386_emit_void_call_2): Likewise.
7277
7278 2011-04-26  Yao Qi  <yao@codesourcery.com>
7279
7280         * linux-low.c: Move common macros to linux-ptrace.h.
7281         Include linux-ptrace.h.
7282         * Makefile.in (linux_ptrace_h): New.
7283         (linux-low.o): Depends on linux-ptrace.h.
7284
7285 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7286
7287         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7288         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7289         (remote_prepare): New function with most of the TCP code from ...
7290         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7291         setting transport_is_reliable.
7292         * server.c (run_once): New variable.
7293         (gdbserver_usage): Document it.
7294         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7295         the first run if RUN_ONCE.
7296         * server.h (run_once, remote_prepare): New declarations.
7297
7298 2011-04-19  Tom Tromey  <tromey@redhat.com>
7299
7300         * win32-low.c (handle_load_dll): Remove duplicate "the".
7301
7302 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7303
7304         Remove support for old Cygwin 1.5 versions.
7305         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7306         function to avoid warning.
7307         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7308         warning.
7309
7310 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7311
7312         * gdbserver/server.h (Macro _): Define it if not available.
7313
7314 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7315
7316         * hostio.c (handle_close): Remove unnecessary null test.
7317
7318 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7319
7320         * Makefile.in (maintainer-clean realclean distclean): Remove
7321         "make ...  subdir_do" command.
7322
7323 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7324
7325         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7326
7327         * server.c (handle_v_run): Free alloced buffer on early return.
7328
7329 2011-03-09  Yao Qi  <yao@codesourcery.com>
7330
7331         Revert:
7332         2011-03-04  Yao Qi  <yao@codesourcery.com>
7333
7334         * Makefile.in: Remove GNU make feature --directory.
7335
7336         2011-03-05  Yao Qi  <yao@codesourcery.com>
7337
7338         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7339         (subdir_do): New make target.  Copied from gdb/Makefile.
7340         (maintainer-clean, realclean, distclean, clean): Call corresponding
7341         make targets in common/Makefile.
7342
7343         2011-02-11  Yao Qi  <yao@codesourcery.com>
7344
7345         * configure.ac: Call AC_PROG_RANLIB.
7346         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7347         * configure: Regenerate.
7348
7349 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7350
7351         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7352
7353 2011-03-06  Yao Qi  <yao@codesourcery.com>
7354
7355         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7356
7357 2011-03-05  Yao Qi  <yao@codesourcery.com>
7358
7359         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7360         (subdir_do): New make target.  Copied from gdb/Makefile.
7361         (maintainer-clean, realclean, distclean, clean): Call corresponding
7362         make targets in common/Makefile.
7363
7364 2011-03-04  Yao Qi  <yao@codesourcery.com>
7365
7366         * Makefile.in: Remove GNU make feature --directory.
7367
7368 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7369
7370         * server.c (queue_stop_reply): Call xmalloc not malloc.
7371
7372 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7373
7374         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7375
7376 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7377
7378         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7379         (cmd_qtframe): Ditto.
7380         (cmd_qtbuffer): Ditto.
7381         (cmd_bigqtbuffer): Ditto.
7382
7383         * utils.c (decimal2str): Initialize 'width' to nine, then
7384         don't mess with it.
7385
7386 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7387
7388         * hostio.c (require_data): Free *data, not data.
7389
7390 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7391
7392         * hostio.c (require_data): Use free, not xfree.
7393
7394 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7395
7396         * server.c (handle_query): Discard unused value.
7397
7398         * hostio.c (require_data): Free malloc memory before returning
7399         error.
7400
7401 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7402
7403         * linux-low.c (list_threads): Call closedir for dirent.
7404
7405 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7406
7407         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7408         a case statement falls through.
7409
7410         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7411
7412         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7413         in comparison.
7414
7415 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7416
7417         * utils.c (decimal2str): Eliminate dead code and dead param.
7418         (pulongest): Drop dead param from call to decimal2str.
7419         (plongest): Ditto.
7420
7421 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7422
7423         Revert the following patch (not approved yet):
7424         2011-02-21  Hui Zhu  <teawater@gmail.com>
7425         * tracepoint.c (tp_printf): New function.
7426         (eval_agent_expr): Handle gdb_agent_op_printf.
7427
7428 2011-02-21  Hui Zhu  <teawater@gmail.com>
7429
7430         * tracepoint.c (tp_printf): New function.
7431         (eval_agent_expr): Handle gdb_agent_op_printf.
7432
7433 2011-02-18  Tom Tromey  <tromey@redhat.com>
7434
7435         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7436         (tracepoint.o): Likewise.
7437         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7438         (gdb_agent_op_names): Likewise.
7439
7440 2011-02-18  Tom Tromey  <tromey@redhat.com>
7441
7442         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7443         gdb_agent_op_rot>: New constants.
7444         (gdb_agent_op_names): Add pick and roll.
7445         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7446         cases.
7447
7448 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7449
7450         * aclocal.m4: Regenerated with aclocal-1.11.1.
7451
7452 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7453
7454         * server.c (handle_qxfer_traceframe_info): New.
7455         (qxfer_packets): Register "traceframe-info".
7456         (handle_query): Report support for qXfer:traceframe-info:read+.
7457         * tracepoint.c (match_blocktype): New.
7458         (traceframe_find_block_type): Rename to ...
7459         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7460         and use it.
7461         (traceframe_find_block_type): New, reimplemented on top of
7462         traceframe_walk_blocks.
7463         (build_traceframe_info_xml): New.
7464         (traceframe_read_info): New.
7465         * server.h (traceframe_read_info): Declare.
7466
7467 2011-02-11  Yao Qi  <yao@codesourcery.com>
7468
7469         * configure.ac: Call AC_PROG_RANLIB.
7470         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7471         * configure: Regenerate.
7472
7473 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7474
7475         * server.c (gdb_read_memory): Change return semantics to allow
7476         partial transfers.
7477         (handle_search_memory_1): Adjust.
7478         (process_serial_event) <'m' packet>: Handle partial transfers.
7479         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7480
7481 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7482
7483         * regcache.c (init_register_cache): Initialize
7484         regcache->register_status.
7485         (free_register_cache): Release regcache->register_status.
7486         (regcache_cpy): Copy register_status.
7487         (registers_to_string): Print 'x's for unavailable registers.
7488         (supply_register): Mark the register's status valid or
7489         unavailable, depending on whether a buffer was passed in or not.
7490         (supply_register_zeroed): New.
7491         (supply_regblock): Mark the registers' status valid or
7492         unavailable, depending on whether a buffer was passed in or not.
7493         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7494         (struct regcache): New `register_status' field.
7495         (supply_register_zeroed): Declare.
7496         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7497         supply_register_zeroed, rather than passing a NULL buffer to
7498         supply_register.
7499         * tracepoint.c (fetch_traceframe_registers): Update comment.
7500
7501 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7502
7503         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7504         buffer explicit.
7505
7506 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7507
7508         * server.h (decode_xfer_write): Change prototype.
7509         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7510         and don't extract the annex here.
7511         * server.c (decode_xfer_read): Remove `annex' parameter,
7512         and don't extract the annex here.
7513         (decode_xfer): New.
7514         (struct qxfer): New.
7515         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7516         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7517         (handle_qxfer_statictrace): New functions, abstracted out from
7518         handle_query, and made to use the struct qxfer interface.
7519         (handle_threads_qxfer_proper): Rename to ...
7520         (handle_qxfer_threads_proper): ... this.
7521         (handle_threads_qxfer): Rename to ...
7522         (handle_qxfer_threads): ... this.  Adjust.
7523         (qxfer_packets): New array.
7524         (handle_qxfer): New function.
7525         (handle_query): Use handle_qxfer.
7526
7527 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7528
7529         * gdbreplay.c: Shorten lines of >= 80 columns.
7530         * linux-low.c: Ditto.
7531         * linux-ppc-low.c: Ditto.
7532         * linux-s390-low.c: Ditto.
7533         * linux-sparc-low.c: Ditto.
7534         * linux-x86-low.c: Ditto.
7535         * linux-xtensa-low.c: Ditto.
7536         * mem-break.c: Ditto.
7537         * nto-low.c: Ditto.
7538         * regcache.h: Ditto.
7539         * remote-utils.c: Ditto.
7540         * server.c: Ditto.
7541         * server.h: Ditto.
7542         * thread-db.c: Ditto.
7543         * tracepoint.c: Ditto.
7544         * utils.c: Ditto.
7545         * win32-low.h: Ditto.
7546
7547 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7548
7549         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7550         update.
7551
7552 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7553
7554         * server.c (gdbserver_version): Update copyright year in version
7555         output.
7556         * gdbreplay.c (gdbreplay_version): Ditto.
7557
7558 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7559
7560         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7561         * linux-bfin-low.c: New file.
7562         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7563         PT_DATA_ADDR for BFIN targets.
7564         * Makefile.in (SFILES): Add linux-bfin-low.c.
7565         (clean): Remove reg-bfin.c.
7566         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7567         * README: Mention supported Blackfin targets.
7568
7569 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7570
7571         * .gitignore: New file.
7572
7573 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7574
7575         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7576
7577 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7578
7579         * Makefile.in: Add FLAGS_TO_PASS variable.
7580         (install): Remove dependency of install-only and recursively
7581         invoke make for install-only.
7582
7583 2010-10-04  Doug Evans  <dje@google.com>
7584
7585         * Makefile.in (uninstall): Use $(DESTDIR).
7586
7587 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7588
7589         PR gdb/11842
7590
7591         * linux-x86-low.c (compat_siginfo_from_siginfo)
7592         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7593         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7594         si_code < 0.
7595
7596 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7597
7598         * lynx-i386-low.c: New file.
7599         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7600
7601 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7602
7603         * lynx-low.c (ptrace_request_to_str): Remove handling for
7604         request values that have been removed in LynxOS 5.x.
7605
7606 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7607
7608         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7609         <ptrace.h>
7610
7611 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7612
7613         * configure.ac: Add --enable-inprocess-agent option.
7614         * configure: Rebuilt.
7615
7616 2010-09-06  Yao Qi  <yao@codesourcery.com>
7617
7618         * linux-low.c (linux_kill): Remove unused variable.
7619         (linux_stabilize_threads): Likewise.
7620         * server.c (start_inferior): Likewise.
7621         (queue_stop_reply_callback): Likewise.
7622         * tracepoint.c (do_action_at_tracepoint): Likewise.
7623
7624 2010-09-06  Yao Qi  <yao@codesourcery.com>
7625
7626         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7627         on return.
7628
7629 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7630
7631         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7632
7633 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7634
7635         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7636         "$(IPA_DEPFILES)".
7637
7638 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7639
7640         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7641         gdbserver/lynx-ppc-low.c: New files.
7642         * Makefile.in (lynx_low_h): New variable.
7643         (lynx-low.o, lynx-ppc-low.o): New rules.
7644         * configure.ac: On LynxOS, link with -lnetinet.
7645         * configure.srv: Add handling of powerpc-*-lynxos* targets.
7646         * configure: regenerate.
7647
7648 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7649
7650         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
7651         * configure.ac: Add check for vasprintf and vsnprintf.
7652         * configure, config.in: Regenerate.
7653         * server.h (vasprintf, vsnprintf): Add conditional declarations.
7654
7655 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7656
7657         * gdbreplay.c: Move include of alloca.h up, next to include of
7658         malloc.h.
7659         * server.h: Add include of malloc.h.
7660         * mem-break.c: Remove include of malloc.h.
7661         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
7662
7663 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7664
7665         * Makefile.in (memmem.o): Build with -Wno-error.
7666
7667 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7668
7669         * utils.c (xsnprintf): Make non-static.
7670         * server.h: Add xsnprintf declaration.
7671         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
7672         replace calls to snprintf by calls to xsnprintf throughout.
7673
7674 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7675
7676         * configure.ac: Add configure check for alloca.
7677         * configure, config.in: Regenerate.
7678         * server.h: Include alloca.h if it exists.
7679         * gdbreplay.c: Include alloca.h if it exists.
7680
7681 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7682
7683         * linux-low.c (__SIGRTMIN): Define if not already defined.
7684         (linux_create_inferior): Check for __ANDROID__ rather than
7685         __SIGRTMIN.
7686         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
7687         are already deferred.
7688         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
7689         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
7690         stopped and already has a pending signal to report.
7691         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
7692         a pending signal to report or is moving out of a jump pad.
7693         (linux_init_signals): Check for __ANDROID__ rather than
7694         __SIGRTMIN.
7695
7696 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7697
7698         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
7699         debug_threads check.  Avoid a linear search when not doing debug
7700         output.
7701
7702 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7703
7704         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
7705         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
7706         (struct file_handler) <fd>: Change type to gdb_fildes_t.
7707         (process_event): Change local fd's type to gdb_fildes_t.
7708         (create_file_handler): Adjust prototype.
7709         (delete_file_handler): Adjust prototype.
7710         (handle_file_event): Adjust prototype.  Use pfildes.
7711         (create_file_event): Adjsut prototype.
7712         * remote-utils.c (remote_desc, listen_desc): Change type to
7713         gdb_fildes_t.
7714         * server.h: New gdb_fildes_t typedef.
7715         [USE_WIN32API]: Include winsock2.h.
7716         (delete_file_handler, add_file_handler): Adjust prototypes.
7717         (pfildes): Declare.
7718         * utils.c (pfildes): New.
7719
7720 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7721
7722         * configure.ac (build_warnings): Add -Wno-char-subscripts.
7723         * configure: Regenerate.
7724
7725 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7726
7727         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
7728         (linux_done_accessing_memory): ... this.
7729         (linux_target_ops): Adjust.
7730         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
7731         * nto-low.c (nto_target_ops): Adjust comment.
7732         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
7733         * spu-low.c (spu_target_ops): Adjust comment.
7734         * target.h (target_ops): Rename unprepare_to_access_memory field
7735         to done_accessing_memory.
7736         (unprepare_to_access_memory): Rename to ...
7737         (done_accessing_memory): ... this.
7738
7739 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7740
7741         * linux-low.c (linux_prepare_to_access_memory): New.
7742         (linux_unprepare_to_access_memory): New.
7743         (linux_target_ops): Install them.
7744         * server.c (read_memory): Rename to ...
7745         (gdb_read_memory): ... this.  Use
7746         prepare_to_access_memory/prepare_to_access_memory.
7747         (write_memory): Rename to ...
7748         (gdb_write_memory): ... this.  Use
7749         prepare_to_access_memory/prepare_to_access_memory.
7750         (handle_search_memory_1): Adjust.
7751         (process_serial_event): Adjust.
7752         * target.h (struct target_ops): New fields
7753         prepare_to_access_memory and unprepare_to_access_memory.
7754         (prepare_to_access_memory, unprepare_to_access_memory): New.
7755         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
7756         prepare_to_access_memory/prepare_to_access_memory.
7757         * nto-low.c (nto_target_ops): Adjust.
7758         * spu-low.c (spu_target_ops): Adjust.
7759         * win32-low.c (win32_target_ops): Adjust.
7760
7761 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7762
7763         * Makefile.in (WARN_CFLAGS): Get it from configure.
7764         (WERROR_CFLAGS): New.
7765         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
7766         * configure.ac: Introduce --enable-werror, which adds -Werror to
7767         the compiler command line.  Enabled by default.  Disable with
7768         --disable-werror.  Add -Wdeclaration-after-statement
7769         Wpointer-arith and -Wformat-nonliteral to warning flags.
7770         * configure: Regenerate.
7771
7772 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7773
7774         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
7775
7776 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7777
7778         * gdbreplay.c (remote_error): New.
7779         (gdbchar): New.
7780         (expect): Use gdbchar.  Check for error reading from GDB.
7781         Clarify sync error output.
7782         (play): Check for errors writing to GDB.
7783         * linux-low.c (sigchld_handler): Really ignore `write' errors.
7784         * remote-utils.c (getpkt): Check for errors writing to the remote
7785         descriptor.
7786
7787 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7788
7789         * linux-low.c (linux_wait_1): Move non-debugging code out of
7790         `debug_threads' control.
7791
7792 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7793
7794         * linux-low.c (linux_wait_1): Don't set last_status here.
7795         * server.c (push_event, queue_stop_reply_callback): Assert we're
7796         not pushing a TARGET_WAITKIND_IGNORE event.
7797         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
7798         (myresume, handle_target_event): Set the thread's last_resume_kind
7799         and last_status from the target returned status.
7800
7801 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7802
7803         PR threads/10729
7804
7805         * linux-x86-low.c (update_debug_registers_callback): New.
7806         (i386_dr_low_set_addr): Use it.
7807         (i386_dr_low_get_addr): New.
7808         (i386_dr_low_set_control): Use update_debug_registers_callback.
7809         (i386_dr_low_get_control): New.
7810         (i386_dr_low_get_status): Adjust.
7811         * linux-low.c (linux_stop_lwp): New.
7812         * linux-low.h (linux_stop_lwp): Declare.
7813
7814         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
7815         argument instead of a i386_debug_reg_state.
7816         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
7817         a i386_debug_reg_state.
7818         (i386_insert_aligned_watchpoint): Adjust.
7819         (i386_remove_aligned_watchpoint): Adjust.
7820         (i386_low_stopped_data_address): Read the debug registers from the
7821         inferior instead of from the mirrors.
7822         * i386-low.h (struct i386_debug_reg_state): Extend comment.
7823         (i386_dr_low_get_addr): Declare.
7824         (i386_dr_low_get_control): Declare.
7825         (i386_dr_low_get_status): Change prototype.
7826
7827         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
7828         (i386_dr_low_get_addr): New.
7829         (i386_dr_low_get_control): New.
7830         (i386_dr_low_get_status): Adjust prototype.  Return
7831         dr_status_mirror.
7832         (i386_initial_stuff): Clear dr_status_mirror and
7833         dr_control_mirror.
7834         (i386_get_thread_context): Adjust.
7835         (i386_set_thread_context): Adjust.
7836         (i386_thread_added): Adjust.
7837
7838 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
7839
7840         * linux-low.h (linux_thread_area): Delete declaration.
7841
7842 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
7843
7844         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
7845         after its termination.
7846
7847 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
7848
7849         * linux-low.c (gdb_wants_lwp_stopped): Delete.
7850         (gdb_wants_all_stopped): Delete.
7851         (linux_wait_1): Don't call them.
7852         * server.c (handle_v_cont): Tag all threads as want-stopped.
7853         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
7854         stopped as "client-wants-stopped".
7855
7856 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
7857
7858         * Makefile.in (signals_h): New.
7859         (server_h): Depend on it.
7860         (server.o): Don't depend on $(signals_def).
7861         (signals.o): Depend on $(signals_def).
7862
7863 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
7864
7865         * Makefile.in (signals_def): New.
7866         (server_h): Append include/gdb/signals.h and signals_def.
7867         (server.o): Append signals_def.
7868
7869 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7870
7871         * server.c (handle_target_event): Use target_signal_to_host for
7872         resume_info.sig initialization.
7873         * target.h (struct thread_resume) <sig>: New comment.
7874
7875 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
7876
7877         * server.c (handle_query): strcpy() the returned string from paddress()
7878         instead of sprintf().
7879         * utils.c (paddress): Return phex_nz().
7880
7881 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
7882
7883         * server.c (handle_v_cont): Call mourn_inferior if process
7884         just exited.
7885         (myresume): Likewise.
7886
7887 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
7888
7889         Static tracepoints, and integration with UST.
7890
7891         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
7892         * mem-break.c (uninsert_all_breakpoints)
7893         (reinsert_all_breakpoints): New.
7894         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
7895         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
7896         (gdb_agent_ust_loaded, helper_thread_id)
7897         (gdb_agent_helper_thread_id): New macros.
7898         (struct ipa_sym_addresses): Add addr_ust_loaded,
7899         addr_helper_thread_id, addr_cmd_buf.
7900         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
7901         (in_process_agent_loaded_ust): New.
7902         (write_e_ust_not_loaded): New.
7903         (maybe_write_ipa_ust_not_loaded): New.
7904         (struct collect_static_trace_data_action): New.
7905         (enum tracepoint_type) <static_tracepoint>: New.
7906         (struct tracepoint) <handle>: Mention static tracepoints.
7907         (struct static_tracepoint_ctx): New.
7908         (CMD_BUF_SIZE): New.
7909         (add_tracepoint_action): Handle static tracepoint actions.
7910         (unprobe_marker_at): New.
7911         (clear_installed_tracepoints): Handle static tracepoints.
7912         (cmd_qtdp): Handle static tracepoints.
7913         (probe_marker_at): New.
7914         (cmd_qtstart): Handle static tracepoints.
7915         (response_tracepoint): Handle static tracepoints.
7916         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
7917         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
7918         (get_context_regcache): Handle static tracepoints.
7919         (do_action_at_tracepoint): Handle static tracepoint actions.
7920         (traceframe_find_block_type): Handle static trace data blocks.
7921         (traceframe_read_sdata): New.
7922         (download_tracepoints): Download static tracepoint actions.
7923         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
7924         (GDB_PROBE_NAME): New.
7925         (ust_ops): New.
7926         (GET_UST_SYM): New.
7927         (USTF): New.
7928         (dlsym_ust): New.
7929         (ust_marker_to_static_tracepoint): New.
7930         (gdb_probe): New.
7931         (collect_ust_data_at_tracepoint): New.
7932         (gdb_ust_probe): New.
7933         (UNIX_PATH_MAX, SOCK_DIR): New.
7934         (gdb_ust_connect_sync_socket): New.
7935         (resume_thread, stop_thread): New.
7936         (run_inferior_command): New.
7937         (init_named_socket): New.
7938         (gdb_ust_socket_init): New.
7939         (cstr_to_hexstr): New.
7940         (next_st): New.
7941         (first_marker, next_marker): New.
7942         (response_ust_marker): New.
7943         (cmd_qtfstm, cmd_qtsstm): New.
7944         (unprobe_marker_at, probe_marker_at): New.
7945         (cmd_qtstmat, gdb_ust_thread): New.
7946         (gdb_ust_init): New.
7947         (initialize_tracepoint_ftlib): Call gdb_ust_init.
7948         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
7949         (ST_REGENTRY): New.
7950         (x86_64_st_collect_regmap): New.
7951         (X86_64_NUM_ST_COLLECT_GREGS): New.
7952         (AMD64_RIP_REGNUM): New.
7953         (supply_static_tracepoint_registers): New.
7954         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
7955         (ST_REGENTRY): New.
7956         (i386_st_collect_regmap): New.
7957         (i386_NUM_ST_COLLECT_GREGS): New.
7958         (supply_static_tracepoint_registers): New.
7959         * server.c (handle_query): Handle qXfer:statictrace:read.
7960         <qSupported>: Report support for StaticTracepoints, and
7961         qXfer:statictrace:read features.
7962         * server.h (traceframe_read_sdata)
7963         (supply_static_tracepoint_registers): Declare.
7964         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
7965         (unpack_varlen_hex): Include in IPA build.
7966         * Makefile.in (ustlibs, ustinc): New.
7967         (IPA_OBJS): Add remote-utils-ipa.o.
7968         ($(IPA_LIB)): Link -ldl and -lpthread.
7969         (UST_CFLAGS): New.
7970         (IPAGENT_CFLAGS): Add UST_CFLAGS.
7971         * config.in, configure: Regenerate.
7972
7973 2010-06-20  Ian Lance Taylor  <iant@google.com>
7974             Pedro Alves  <pedro@codesourcery.com>
7975
7976         * linux-x86-low.c (always_true): Delete.
7977         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
7978         trying to fool the compiler with always_true.
7979
7980 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
7981
7982         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
7983         conditions in gdbserver.
7984
7985 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
7986
7987         * spu-low.c (spu_read_memory): Wrap around local store limit.
7988         (spu_write_memory): Likewise.
7989
7990 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
7991
7992         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
7993         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
7994         LONGEST uses.
7995         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
7996         uses.
7997         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
7998         uses with LONGEST uses.
7999
8000 2010-06-14  Stan Shebs  <stan@codesourcery.com>
8001             Pedro Alves  <pedro@codesourcery.com>
8002
8003         Bytecode compiler.
8004
8005         * linux-x86-low.c: Include limits.h.
8006         (add_insns): New.
8007         (always_true): New.
8008         (EMIT_ASM): New.
8009         (EMIT_ASM32): New.
8010         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
8011         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
8012         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
8013         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
8014         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
8015         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
8016         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
8017         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
8018         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
8019         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
8020         (amd64_emit_void_call_2): New.
8021         (amd64_emit_ops): New.
8022         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
8023         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
8024         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
8025         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
8026         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
8027         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
8028         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
8029         (i386_emit_call, i386_emit_reg, i386_emit_pop)
8030         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
8031         (i386_emit_stack_adjust, i386_emit_int_call_1)
8032         (i386_emit_void_call_2): New.
8033         (i386_emit_ops): New.
8034         (x86_emit_ops): New.
8035         (the_low_target): Install x86_emit_ops.
8036         * server.h (struct emit_ops): New.
8037         (get_raw_reg_func_addr): Declare.
8038         (current_insn_ptr, emit_error): Declare.
8039         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
8040         (set_trace_state_variable_value): New defines.
8041         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
8042         addr_get_trace_state_variable_value and
8043         addr_set_trace_state_variable_value.
8044         (symbol_list): New fields for get_raw_reg,
8045         get_trace_state_variable_value and set_trace_state_variable_value.
8046         (condfn): New typedef.
8047         (struct tracepoint): New field `compiled_cond'.
8048         (do_action_at_tracepoint): Clear compiled_cond.
8049         (get_trace_state_variable_value, set_trace_state_variable_value):
8050         Export in the IPA.
8051         (condition_true_at_tracepoint): If there's a compiled condition,
8052         run that.
8053         (current_insn_ptr, emit_error): New globals.
8054         (struct bytecode_address): New.
8055         (get_raw_reg_func_addr): New.
8056         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
8057         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
8058         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
8059         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
8060         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
8061         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
8062         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
8063         (compile_tracepoint_condition, compile_bytecodes): New.
8064         * target.h (emit_ops): Forward declare.
8065         (struct target_ops): New field emit_ops.
8066         (target_emit_ops): New.
8067         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
8068         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
8069         * linux-low.c (linux_emit_ops): New.
8070         (linux_target_ops): Install it.
8071         * linux-low.h (struct linux_target_ops): New field emit_ops.
8072
8073 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
8074
8075         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
8076         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
8077
8078 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8079             Stan Shebs  <stan@codesourcery.com>
8080
8081         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
8082         (all): Depend on $(extra_libraries).
8083         (install-only): Install the IPA.
8084         (IPA_OBJS, IPA_LIB): New.
8085         (clean): Remove the IPA lib.
8086         (IPAGENT_CFLAGS): New.
8087         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
8088         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
8089         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
8090         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
8091         * configure.ac: Check for atomic builtins support in the compiler.
8092         (IPA_DEPFILES, extra_libraries): Define.
8093         * configure.srv (ipa_obj): Add description.
8094         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
8095         (i[34567]86-*-linux*): Set ipa_obj.
8096         (x86_64-*-linux*): Set ipa_obj.
8097         * linux-low.c (stabilizing_threads): New.
8098         (supports_fast_tracepoints): New.
8099         (linux_detach): Stabilize threads before detaching.
8100         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
8101         the lwp is either not stabilizing, or is moving out of a jump pad.
8102         (linux_fast_tracepoint_collecting): New.
8103         (maybe_move_out_of_jump_pad): New.
8104         (enqueue_one_deferred_signal): New.
8105         (dequeue_one_deferred_signal): New.
8106         (linux_wait_for_event_1): If moving out of a jump pad, defer
8107         pending signals to later.
8108         (linux_stabilize_threads): New.
8109         (linux_wait_1): Check if threads need moving out of jump pads, and
8110         do it if so.
8111         (stuck_in_jump_pad_callback): New.
8112         (move_out_of_jump_pad_callback): New.
8113         (lwp_running): New.
8114         (linux_resume_one_lwp): Handle moving out of jump pads.
8115         (linux_set_resume_request): Dequeue deferred signals.
8116         (need_step_over_p): Also step over fast tracepoint jumps.
8117         (start_step_over): Also uninsert fast tracepoint jumps.
8118         (finish_step_over): Also reinsert fast tracepoint jumps.
8119         (linux_install_fast_tracepoint_jump): New.
8120         (linux_target_ops): Install linux_stabilize_threads and
8121         linux_install_fast_tracepoint_jump_pad.
8122         * linux-low.h (linux_target_ops) <get_thread_area,
8123         install_fast_tracepoint_jump_pad>: New fields.
8124         (struct lwp_info) <collecting_fast_tracepoint,
8125         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
8126         (linux_get_thread_area): Declare.
8127         * linux-x86-low.c (jump_insn): New.
8128         (x86_get_thread_area): New.
8129         (append_insns): New.
8130         (push_opcode): New.
8131         (amd64_install_fast_tracepoint_jump_pad): New.
8132         (i386_install_fast_tracepoint_jump_pad): New.
8133         (x86_install_fast_tracepoint_jump_pad): New.
8134         (the_low_target): Install x86_get_thread_area and
8135         x86_install_fast_tracepoint_jump_pad.
8136         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
8137         (struct fast_tracepoint_jump): New.
8138         (fast_tracepoint_jump_insn): New.
8139         (fast_tracepoint_jump_shadow): New.
8140         (find_fast_tracepoint_jump_at): New.
8141         (fast_tracepoint_jump_here): New.
8142         (delete_fast_tracepoint_jump): New.
8143         (set_fast_tracepoint_jump): New.
8144         (uninsert_fast_tracepoint_jumps_at): New.
8145         (reinsert_fast_tracepoint_jumps_at): New.
8146         (set_breakpoint_at): Use write_inferior_memory.
8147         (uninsert_raw_breakpoint): Use write_inferior_memory.
8148         (check_mem_read): Mask out fast tracepoint jumps.
8149         (check_mem_write): Mask out fast tracepoint jumps.
8150         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
8151         (set_fast_tracepoint_jump): Declare.
8152         (delete_fast_tracepoint_jump)
8153         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
8154         (reinsert_fast_tracepoint_jumps_at): Declare.
8155         * regcache.c: Don't compile many functions when building the
8156         in-process agent library.
8157         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
8158         the register buffer in the heap.
8159         (free_register_cache): If the register buffer isn't owned by the
8160         regcache, don't free it.
8161         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8162         pre-existing register caches.
8163         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8164         type.
8165         (convert_ascii_to_int): : Constify `from' parameter type.
8166         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8167         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8168         the needed buffer in-place.
8169         (relocate_instruction): New.
8170         * server.c (handle_query) <qSymbols>: If the target supports
8171         tracepoints, give it a chance of looking up symbols.  Report
8172         support for fast tracepoints.
8173         (handle_status): Stabilize threads.
8174         (process_serial_event): Adjust.
8175         * server.h (struct fast_tracepoint_jump): Forward declare.
8176         (struct process_info) <fast_tracepoint_jumps>: New field.
8177         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8178         (decode_X_packet, decode_M_packet): Adjust.
8179         (relocate_instruction): Declare.
8180         (in_process_agent_loaded): Declare.
8181         (tracepoint_look_up_symbols): Declare.
8182         (struct fast_tpoint_collect_status): Declare.
8183         (fast_tracepoint_collecting): Declare.
8184         (force_unlock_trace_buffer): Declare.
8185         (handle_tracepoint_bkpts): Declare.
8186         (initialize_low_tracepoint)
8187         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8188         * target.h (struct target_ops) <stabilize_threads,
8189         install_fast_tracepoint_jump_pad>: New fields.
8190         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8191         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8192         [HAVE_STDINT_H]: Include stdint.h.
8193         (trace_debug_1): Rename to ...
8194         (trace_vdebug): ... this.
8195         (trace_debug): Rename to ...
8196         (trace_debug_1): ... this.  Add `level' parameter.
8197         (trace_debug): New.
8198         (ATTR_USED, ATTR_NOINLINE): New.
8199         (IP_AGENT_EXPORT): New.
8200         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8201         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8202         (about_to_request_buffer_space, trace_buffer_is_full)
8203         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8204         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8205         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8206         (traceframe_write_count, traceframes_created)
8207         (trace_state_variables)
8208         New renaming defines.
8209         (struct ipa_sym_addresses): New.
8210         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8211         (symbol_list): New.
8212         (ipa_sym_addrs): New.
8213         (all_tracepoint_symbols_looked_up): New.
8214         (in_process_agent_loaded): New.
8215         (write_e_ipa_not_loaded): New.
8216         (maybe_write_ipa_not_loaded): New.
8217         (tracepoint_look_up_symbols): New.
8218         (debug_threads) [IN_PROCESS_AGENT]: New.
8219         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8220         (UNKNOWN_SIDE_EFFECTS): New.
8221         (stop_tracing): New.
8222         (flush_trace_buffer): New.
8223         (stop_tracing_bkpt): New.
8224         (flush_trace_buffer_bkpt): New.
8225         (read_inferior_integer): New.
8226         (read_inferior_uinteger): New.
8227         (read_inferior_data_pointer): New.
8228         (write_inferior_data_pointer): New.
8229         (write_inferior_integer): New.
8230         (write_inferior_uinteger): New.
8231         (struct collect_static_trace_data_action): Delete.
8232         (enum tracepoint_type): New.
8233         (struct tracepoint) <type>: New field `type'.
8234         <actions_str, step_actions, step_actions_str>: Only include in
8235         GDBserver.
8236         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8237         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8238         (tracepoints): Use IP_AGENT_EXPORT.
8239         (last_tracepoint): Don't include in the IPA.
8240         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8241         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8242         (alloced_trace_state_variables): New.
8243         (trace_state_variables): Use IP_AGENT_EXPORT.
8244         (traceframe_t): Delete unused variable.
8245         (circular_trace_buffer): Don't include in the IPA.
8246         (trace_buffer_start): Delete.
8247         (struct trace_buffer_control): New.
8248         (trace_buffer_free): Delete.
8249         (struct ipa_trace_buffer_control): New.
8250         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8251         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8252         New.
8253         (trace_buffer_ctrl): New.
8254         (TRACE_BUFFER_CTRL_CURR): New.
8255         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8256         Reimplement as macros.
8257         (trace_buffer_wrap): Delete.
8258         (traceframe_write_count, traceframe_read_count)
8259         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8260         (struct tracepoint_hit_ctx) <type>: New field.
8261         (struct fast_tracepoint_ctx): New.
8262         (memory_barrier): New.
8263         (cmpxchg): New.
8264         (record_tracepoint_error): Update atomically in the IPA.
8265         (clear_inferior_trace_buffer): New.
8266         (about_to_request_buffer_space): New.
8267         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8268         updating the same buffer.
8269         (add_tracepoint): Default the tracepoint's type to trap
8270         tracepoint, and orig_size to -1.
8271         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8272         internal variables.
8273         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8274         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8275         (cmd_qtdp): Handle fast tracepoints.
8276         (cmd_qtdv): Adjust.
8277         (max_jump_pad_size): New.
8278         (gdb_jump_pad_head): New.
8279         (get_jump_space_head): New.
8280         (claim_jump_space): New.
8281         (sort_tracepoints): New.
8282         (MAX_JUMP_SIZE): New.
8283         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8284         IPA.
8285         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8286         support.  Upload fast traceframes, and delete internal IPA
8287         breakpoints.
8288         (stop_tracing_handler): New.
8289         (flush_trace_buffer_handler): New.
8290         (cmd_qtstop): Upload fast tracepoints.
8291         (response_tracepoint): Handle fast tracepoints.
8292         (tracepoint_finished_step): Upload fast traceframes.  Set the
8293         tracepoint hit context's tracepoint type.
8294         (handle_tracepoint_bkpts): New.
8295         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8296         type.  Add comment about fast tracepoints.
8297         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8298         non-existing action_str field.
8299         (get_context_regcache): Handle fast tracepoints.
8300         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8301         to the regcache.
8302         (fast_tracepoint_from_jump_pad_address): New.
8303         (fast_tracepoint_from_ipa_tpoint_address): New.
8304         (collecting_t): New.
8305         (force_unlock_trace_buffer): New.
8306         (fast_tracepoint_collecting): New.
8307         (collecting): New.
8308         (gdb_collect): New.
8309         (write_inferior_data_ptr): New.
8310         (target_tp_heap): New.
8311         (target_malloc): New.
8312         (download_agent_expr): New.
8313         (UALIGN): New.
8314         (download_tracepoints): New.
8315         (download_trace_state_variables): New.
8316         (upload_fast_traceframes): New.
8317         (IPA_FIRST_TRACEFRAME): New.
8318         (IPA_NEXT_TRACEFRAME_1): New.
8319         (IPA_NEXT_TRACEFRAME): New.
8320         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8321         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8322         (gdb_jump_pad_buffer_end): New.
8323         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8324         (initialize_tracepoint): Adjust.
8325         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8326         buffer.  Initialize the low module.
8327         * utils.c (PREFIX, TOOLNAME): New.
8328         (malloc_failure): Use PREFIX.
8329         (error): In the IPA, an error causes an exit.
8330         (fatal, warning): Use PREFIX.
8331         (internal_error): Use TOOLNAME.
8332         (NUMCELLS): Increase to 10.
8333         * configure, config.in: Regenerate.
8334
8335 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8336
8337         * server.c (handle_query) <qSupported>: Do two passes over the
8338         qSupported string to avoid nesting strtok.
8339
8340 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8341
8342         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8343         (CDEPS): New.
8344         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8345         -Wl,--dynamic-list.
8346         * configure: Regenerate.
8347         * proc-service.list: New.
8348
8349 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8350
8351         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8352         New comment.
8353
8354 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8355
8356         * gdbreplay.c (remote_open): Check error return from socket() call by
8357         its equality to -1 not by it being negative.
8358         * remote-utils.c (remote_open): Likewise.
8359
8360 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8361
8362         * config.h: Regenerate.
8363
8364 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8365
8366         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8367         doesn't provide PTRACE_GET_THREAD_AREA.
8368
8369 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8370
8371         * linux-m68k-low.c: Include <asm/ptrace.h>
8372         (ps_get_thread_area): Implement.
8373
8374 2010-05-03  Doug Evans  <dje@google.com>
8375
8376         * event-loop.c (struct callback_event): New struct.
8377         (callback_list): New global.
8378         (append_callback_event, delete_callback_event): New functions.
8379         (process_callback): New function.
8380         (start_event_loop): Call it.
8381         * remote-utils.c (NOT_SCHEDULED): Define.
8382         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8383         moved out of readchar.
8384         (readchar): Rewrite.  Call reschedule before returning.
8385         (reset_readchar): New function.
8386         (remote_close): Call it.
8387         (process_remaining, reschedule): New functions.
8388         * server.h (callback_handler_func): New typedef.
8389         (append_callback_event, delete_callback_event): Declare.
8390
8391 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8392
8393         * proc-service.c (ps_pglobal_lookup): Use
8394         thread_db_look_up_one_symbol.
8395         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8396         parameter.  Use it instead of all_symbols_looked_up.
8397         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8398         field.
8399         (all_symbols_looked_up): Don't declare.
8400         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8401         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8402         field.
8403         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8404         Set all_symbols_looked_up here.
8405         (thread_db_look_up_one_symbol): New.
8406         (thread_db_get_tls_address): Adjust.
8407         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8408         thread_db object on the heap, and tentatively set it in the
8409         process structure.
8410         (thread_db_init): Don't set all_symbols_looked_up here.
8411         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8412
8413 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8414
8415         * linux-low.c (linux_kill, linux_detach): Adjust.
8416         (status_pending_p_callback): Remove redundant statement.  Check
8417         for !TARGET_WAITIKIND_IGNORE, instead of
8418         TARGET_WAITKIND_STOPPED.
8419         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8420         (linux_wait_for_event_1): Adjust.
8421         (linux_cancel_breakpoints): New.
8422         (unsuspend_one_lwp): New.
8423         (unsuspend_all_lwps): New.
8424         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8425         (send_sigstop_callback): Change return type to int, add new
8426         `except' parameter and handle it.
8427         (suspend_and_send_sigstop_callback): New.
8428         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8429         pass them down.  If SUSPEND, also increment the lwp's suspend
8430         count.
8431         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8432         (need_step_over_p): Don't consider suspended LWPs.
8433         (start_step_over): Adjust.
8434         (proceed_one_lwp): Change return type to int, add new `except'
8435         parameter and handle it.
8436         (unsuspend_and_proceed_one_lwp): New.
8437         (proceed_all_lwps): Use find_inferior instead of
8438         for_each_inferior.
8439         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8440         also decrement the suspend count of LWPs.  Pass `except' down,
8441         instead of hacking its suspend count.
8442         (linux_pause_all): Add `freeze' parameter.  Adjust.
8443         (linux_unpause_all): New.
8444         (linux_target_ops): Install linux_unpause_all.
8445         * server.c (handle_status): Adjust.
8446         * target.h (struct target_ops): New fields `unpause_all' and
8447         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8448         (pause_all): Add new `freeze' parameter.
8449         (unpause_all): New.
8450         (cancel_breakpoints): New.
8451         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8452         cancel breakpoints.
8453         (cmd_qtstart): Pause threads.
8454         (stop_tracing): Pause threads, and cancel breakpoints.
8455         * win32-low.c (win32_target_ops): Adjust.
8456
8457 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8458
8459         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8460         the inferior right away from here...
8461         (linux_wait_1): ... to here, and adjust to check the thread's
8462         last_resume_kind instead of the lwp's step or stop_expected flags.
8463
8464 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8465
8466         * README: Use consistent `GDB' and `GDBserver' spellings.
8467
8468 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8469
8470         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8471         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8472         (linux_detach_one_lwp): Assume the lwp is stopped.
8473         (any_thread_of): Delete.
8474         (linux_detach): Stop all lwps here.  Don't blindly delete all
8475         breakpoints.
8476         (delete_lwp_callback): New.
8477         (linux_mourn): Delete all lwps of the process that is gone.
8478         (linux_wait_1): Don't delete the last lwp of the process here.
8479         * mem-break.h (mark_breakpoints_out): Declare.
8480         * mem-break.c (mark_breakpoints_out): New.
8481         (free_all_breakpoints): Use it.
8482         * server.c (handle_target_event): If the process is gone, mark
8483         breakpoints out.
8484         * thread-db.c (struct thread_db) <create_bp>: New field.
8485         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8486         breakpoint reference in the thread_db struct.
8487         (thread_db_load_search): Clear the thread_db object.
8488         (try_thread_db_load_1): Ditto.
8489         (switch_to_process): New.
8490         (disable_thread_event_reporting): Use it.
8491         (remove_thread_event_breakpoints): New.
8492         (thread_db_detach, thread_db_mourn): Use it.
8493
8494 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8495
8496         * linux-low.c (linux_enable_event_reporting): New.
8497         (linux_wait_for_event_1, handle_extended_wait): Use it.
8498
8499 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8500
8501         * linux-low.c (linux_kill_one_lwp, linux_kill)
8502         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8503         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8504         SIGSTOP even if the LWP is stopped.
8505         (send_sigstop_callback): New.
8506         (stop_all_lwps): Use send_sigstop_callback instead.
8507         (linux_resume_one_thread): Adjust.
8508         (proceed_one_lwp): Still proceed an LWP that the client has
8509         requested to stop, if we haven't reported it as stopped yet.  Make
8510         sure that LWPs the client want stopped, have a pending SIGSTOP.
8511
8512 2010-04-26  Doug Evans  <dje@google.com>
8513
8514         * server.c (handle_general_set): Make static.
8515
8516         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8517         Print received char after testing for error/eof instead of before.
8518         (input_interrupt): Tweak comment.
8519
8520 2010-04-23  Doug Evans  <dje@google.com>
8521
8522         * server.c (start_inferior): Print inferior argv if --debug.
8523
8524 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8525
8526         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8527         * nto-x86-low.c: Include server.h
8528
8529 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8530
8531         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8532         be consistent with other sources of this directory.
8533         (init_registers_amd64): Correct name of source file of this function
8534         in the comment.
8535
8536 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8537
8538         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8539         64-bit executables.
8540
8541 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8542
8543         * win32-i386-low.c: Add 64-bit support.
8544         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8545         (init_registers_amd64): Declare.
8546         (mappings): Add 64-bit version of array.
8547         (init_windows_x86): New function.
8548         (the_low_target): Change init_arch field to init_windows_x86.
8549
8550 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8551
8552         * win32-low.c: Adapt to support also 64-bit architecture.
8553         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8554         (get_image_name): Use SIZE_T type for local variable `done'.
8555         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8556         (toolhelp_get_dll_name): Idem.
8557         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8558         Use uintptr_t typecast to avoid warning.
8559         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8560         (handle_exception): Use phex_nz to avoid warning.
8561         (win32_wait): Remove unused local variable `process'.
8562
8563 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8564
8565         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8566         `amd64-avx.o'.
8567
8568 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8569
8570         * configure.ac: Use `ws2_32' library for srv_mingw.
8571         * configure: Regenerate.
8572         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8573         * remote-utils.c: Likewise.
8574
8575 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8576
8577         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8578         if __x86_64__ is defined.
8579
8580 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8581
8582         * configure: Regenerate.
8583
8584 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8585
8586         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8587         * target.h (target_ops): New get_tib_address field.
8588         * win32-low.h (win32_thread_info): Add thread_local_base field.
8589         * win32-low.c (child_add_thread): Add tlb argument.
8590         Set thread_local_base field to TLB.
8591         (get_child_debug_event): Adapt to child_add_thread change.
8592         (win32_get_tib_address): New function.
8593         (win32_target_ops): Set get_tib_address field to
8594         win32_get_tib_address.
8595         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8596
8597 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8598
8599         * linux-low.c (linux_mourn): Also remove the process.
8600         * server.c (handle_target_event): Don't remove the process here.
8601         * nto-low.c (nto_mourn): New.
8602         (nto_target_ops): Install it.
8603         * spu-low.c (spu_mourn): New.
8604         (spu_target_ops): Install it.
8605         * win32-low.c (win32_mourn): New.
8606         (win32_target_ops): Install it.
8607
8608 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8609
8610         * server.h (buffer_xml_printf): Remove redundant `;'.
8611
8612 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8613
8614         * regcache.c (set_register_cache): Invalidate regcaches before
8615         changing the register cache layout.
8616         (regcache_invalidate_one): Allow a NULL regcache.
8617         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8618         regcaches before changing the register cache layout or the target
8619         regsets.
8620
8621 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8622
8623         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8624         variable warning on Linux/x86-64.
8625
8626 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8627
8628         GDBserver disconnected tracing support.
8629
8630         * linux-low.c (linux_remove_process): Delete.
8631         (add_lwp): Don't set last_resume_kind here.
8632         (linux_kill): Use `mourn'.
8633         (linux_detach): Use `thread_db_detach', and `mourn'.
8634         (linux_mourn): New.
8635         (linux_attach_lwp_1): Adjust comment.
8636         (linux_attach): last_resume_kind moved the thread_info; adjust.
8637         (status_pending_p_callback): Adjust.
8638         (linux_wait_for_event_1): Adjust.
8639         (count_events_callback, select_singlestep_lwp_callback)
8640         (select_event_lwp_callback, cancel_breakpoints_callback)
8641         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8642         (proceed_one_lwp): Adjust.
8643         (linux_async): Add debug output.
8644         (linux_thread_stopped): New.
8645         (linux_pause_all): New.
8646         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
8647         linux_pause_all.
8648         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
8649         (thread_db_free): Delete declaration.
8650         (thread_db_detach, thread_db_mourn): Declare.
8651         * thread-db.c (thread_db_init): Use thread_db_mourn.
8652         (thread_db_free): Delete, split in two.
8653         (disable_thread_event_reporting): New.
8654         (thread_db_detach): New.
8655         (thread_db_mourn): New.
8656
8657         * server.h (struct thread_info) <last_resume_kind>: New field.
8658         <attached>: Add comment.
8659         <gdb_detached>: New field.
8660         (handler_func): Change return type to int.
8661         (handle_serial_event, handle_target_event): Ditto.
8662         (gdb_connected): Declare.
8663         (tracing): Delete.
8664         (disconnected_tracing): Declare.
8665         (stop_tracing): Declare.
8666
8667         * server.c (handle_query) <qSupported>: Report support for
8668         disconnected tracing.
8669         (queue_stop_reply_callback): Account for running threads.
8670         (gdb_wants_thread_stopped): New.
8671         (gdb_wants_all_threads_stopped): New.
8672         (gdb_reattached_process): New.
8673         (handle_status): Clear the `gdb_detached' flag of all processes.
8674         In all-stop, stop all threads.
8675         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
8676         (process_serial_event): If the remote connection breaks, or if an
8677         exit was forced with "monitor exit", force an event loop exit.
8678         Handle disconnected tracing on detach.
8679         (handle_serial_event): Adjust.
8680         (handle_target_event): If GDB isn't connected, forward events back
8681         to the inferior, unless the last process exited, in which case,
8682         exit gdbserver.  Adjust interface.
8683
8684         * remote-utils.c (remote_open): Don't block in accept.  Instead
8685         register an event loop source on the listen socket file
8686         descriptor.  Refactor bits into ...
8687         (listen_desc): ... this new global.
8688         (gdb_connected): ... this new function.
8689         (enable_async_notification): ... this new function.
8690         (handle_accept_event): ... this new function.
8691         (remote_close): Clear remote_desc.
8692
8693         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
8694
8695         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
8696         New fields.
8697         (mourn_inferior): Define.
8698         (target_process_qsupported): Avoid the dangling else problem.
8699         (thread_stopped): Define.
8700         (pause_all): Define.
8701         (target_waitstatus_to_string): Declare.
8702         * target.c (target_waitstatus_to_string): New.
8703
8704         * tracepoint.c (tracing): Make extern.
8705         (disconnected_tracing): New.
8706         (stop_tracing): Make extern.  Handle tracing stops due to GDB
8707         disconnecting.
8708         (cmd_qtdisconnected): New.
8709         (cmd_qtstatus): Report disconnected tracing status in trace reply.
8710         (handle_tracepoint_general_set): Handle QTDisconnected.
8711
8712         * event-loop.c (event_handler_func): Change return type to int.
8713         (process_event): Bail out if the event handler wants the event
8714         loop to stop.
8715         (handle_file_event): Ditto.
8716         (start_event_loop): Bail out if the event handler wants the event
8717         loop to stop.
8718
8719         * nto-low.c (nto_target_ops): Adjust.
8720         * spu-low.c (spu_wait): Don't remove the process here.
8721         (spu_target_ops): Adjust.
8722         * win32-low.c (win32_wait): Don't remove the process here.
8723         (win32_target_ops): Adjust.
8724
8725 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8726
8727         * regcache.c (realloc_register_cache): Invalidate inferior's
8728         regcache before recreating it.
8729
8730 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
8731
8732         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
8733
8734 2010-04-09  Stan Shebs  <stan@codesourcery.com>
8735             Pedro Alves  <pedro@codesourcery.com>
8736
8737         * server.h (LONGEST): New.
8738         (struct thread_info) <while_stepping>: New field.
8739         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
8740         Declare.
8741         (initialize_tracepoint, handle_tracepoint_general_set)
8742         (handle_tracepoint_query, tracepoint_finished_step)
8743         (tracepoint_was_hit, release_while_stepping_state_list):
8744         (current_traceframe): Declare.
8745         * server.c (handle_general_set): Handle tracepoint packets.
8746         (read_memory): New.
8747         (write_memory): New.
8748         (handle_search_memory_1): Use read_memory.
8749         (handle_query): Report support for conditional tracepoints, trace
8750         state variables, and tracepoint sources.  Handle tracepoint
8751         queries.
8752         (main): Initialize the tracepoints module.
8753         (process_serial_event): Handle traceframe reads/writes.
8754
8755         * linux-low.c (handle_tracepoints): New.
8756         (linux_wait_1): Call it.
8757         (linux_resume_one_lwp): Handle while-stepping.
8758         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
8759         (linux_target_ops): Install them.
8760         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
8761         New field.
8762         * linux-x86-low.c (x86_supports_tracepoints): New.
8763         (the_low_target). Install it.
8764
8765         * mem-break.h (delete_breakpoint): Declare.
8766         * mem-break.c (delete_breakpoint): Make external.
8767
8768         * target.h (struct target_ops): Add `supports_tracepoints',
8769         `read_pc', and `write_pc' fields.
8770         (target_supports_tracepoints): Define.
8771         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
8772         (phex_nz): New.
8773
8774         * regcache.h (struct regcache) <registers_owned>: New field.
8775         (init_register_cache, regcache_cpy): Declare.
8776         (regcache_read_pc, regcache_write_pc): Declare.
8777         (register_cache_size): Declare.
8778         (supply_regblock): Declare.
8779         * regcache.c (init_register_cache): New.
8780         (new_register_cache): Use it.
8781         (regcache_cpy): New.
8782         (register_cache_size): New.
8783         (supply_regblock): New.
8784         (regcache_read_pc, regcache_write_pc): New.
8785
8786         * tracepoint.c: New.
8787
8788         * Makefile.in (OBS): Add tracepoint.o.
8789         (tracepoint.o): New rule.
8790
8791 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
8792
8793         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
8794         (i386-mmx.o): New.
8795         (i386-mmx.c): Likewise.
8796         (i386-mmx-linux.o): Likewise.
8797         (i386-mmx-linux.c): Likewise.
8798
8799         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
8800         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
8801         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
8802         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
8803
8804         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
8805         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
8806         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
8807
8808 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
8809
8810         * Makefile.in (clean): Updated.
8811         (i386-avx.o): New.
8812         (i386-avx.c): Likewise.
8813         (i386-avx-linux.o): Likewise.
8814         (i386-avx-linux.c): Likewise.
8815         (amd64-avx.o): Likewise.
8816         (amd64-avx.c): Likewise.
8817         (amd64-avx-linux.o): Likewise.
8818         (amd64-avx-linux.c): Likewise.
8819
8820         * configure.srv (srv_i386_regobj): Add i386-avx.o.
8821         (srv_i386_linux_regobj): Add i386-avx-linux.o.
8822         (srv_amd64_regobj): Add amd64-avx.o.
8823         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
8824         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
8825         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
8826         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
8827         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
8828         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
8829         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
8830
8831         * i387-fp.c: Include "i386-xstate.h".
8832         (i387_xsave): New.
8833         (i387_cache_to_xsave): Likewise.
8834         (i387_xsave_to_cache): Likewise.
8835         (x86_xcr0): Likewise.
8836
8837         * i387-fp.h (i387_cache_to_xsave): Likewise.
8838         (i387_xsave_to_cache): Likewise.
8839         (x86_xcr0): Likewise.
8840
8841         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
8842         * linux-crisv32-low.c (target_regsets): Likewise.
8843         * linux-m68k-low.c (target_regsets): Likewise.
8844         * linux-mips-low.c (target_regsets): Likewise.
8845         * linux-ppc-low.c (target_regsets): Likewise.
8846         * linux-s390-low.c (target_regsets): Likewise.
8847         * linux-sh-low.c (target_regsets): Likewise.
8848         * linux-sparc-low.c (target_regsets): Likewise.
8849         * linux-xtensa-low.c (target_regsets): Likewise.
8850
8851         * linux-low.c: Include <sys/uio.h>.
8852         (regsets_fetch_inferior_registers): Support nt_type.
8853         (regsets_store_inferior_registers): Likewise.
8854         (linux_process_qsupported): New.
8855         (linux_target_ops): Add linux_process_qsupported.
8856
8857         * linux-low.h (regset_info): Add nt_type.
8858         (linux_target_ops): Add process_qsupported.
8859
8860         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
8861         and <sys/uio.h>.
8862         (init_registers_i386_avx_linux): New.
8863         (init_registers_amd64_avx_linux): Likewise.
8864         (xmltarget_i386_linux_no_xml): Likewise.
8865         (xmltarget_amd64_linux_no_xml): Likewise.
8866         (PTRACE_GETREGSET): Likewise.
8867         (PTRACE_SETREGSET): Likewise.
8868         (x86_fill_xstateregset): Likewise.
8869         (x86_store_xstateregset): Likewise.
8870         (use_xml): Likewise.
8871         (x86_linux_update_xmltarget): Likewise.
8872         (x86_linux_process_qsupported): Likewise.
8873         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
8874         (x86_arch_setup): Don't call init_registers_amd64_linux nor
8875         init_registers_i386_linux here.  Call
8876         x86_linux_update_xmltarget.
8877         (the_low_target): Add x86_linux_process_qsupported.
8878
8879         * server.c (handle_query): Call target_process_qsupported.
8880
8881         * target.h (target_ops): Add process_qsupported.
8882         (target_process_qsupported): New.
8883
8884 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
8885
8886         * inferiors.c (add_thread): Set last_status kind to
8887         TARGET_WAITKIND_IGNORE.
8888         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
8889         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
8890         (linux_wait_1): Move `thread' local definition to block that uses
8891         it.  Don't NULL initialize `event_child'.
8892         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
8893         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
8894         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
8895
8896 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8897
8898         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
8899         an extended waitstatus, or by a watchpoint.
8900         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
8901         thread was stepping or has been stopped by a watchpoint.
8902
8903 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8904
8905         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
8906         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
8907         of another, then delete the previous, and validate all
8908         breakpoints.
8909         (validate_inserted_breakpoint): New.
8910         (delete_disabled_breakpoints): New.
8911         (validate_breakpoints): New.
8912         (check_mem_read): Validate breakpoints before trusting their
8913         shadow.  Delete disabled breakpoints.
8914         (check_mem_write): Validate breakpoints before trusting they
8915         should be inserted.  Delete disabled breakpoints.
8916         * mem-break.h (validate_breakpoints):
8917         * server.c (handle_query): Validate breakpoints when we see a
8918         qSymbol query.
8919
8920 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8921
8922         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
8923         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
8924         if we could tell there's a GDB breakpoint at stop_pc.
8925         (need_step_over_p): Don't do a step over if we find a GDB
8926         breakpoint at the resume PC.
8927
8928         * mem-break.c (struct raw_breakpoint): New.
8929         (enum bkpt_type): New type `gdb_breakpoint'.
8930         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
8931         fields.  New field `raw'.
8932         (find_raw_breakpoint_at): New.
8933         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
8934         breakpoint instead.
8935         (set_breakpoint_at): Adjust.
8936         (delete_raw_breakpoint): New.
8937         (release_breakpoint): New.
8938         (delete_breakpoint): Rename to...
8939         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
8940         release_breakpoint.  Return ENOENT.
8941         (delete_breakpoint): Reimplement.
8942         (find_breakpoint_at): Delete.
8943         (find_gdb_breakpoint_at): New.
8944         (delete_breakpoint_at): Delete.
8945         (set_gdb_breakpoint_at): New.
8946         (delete_gdb_breakpoint_at): New.
8947         (gdb_breakpoint_here): New.
8948         (set_reinsert_breakpoint): Use release_breakpoint.
8949         (uninsert_breakpoint): Rename to ...
8950         (uninsert_raw_breakpoint): ... this.
8951         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
8952         (reinsert_raw_breakpoint): Change parameter type to
8953         raw_breakpoint.
8954         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
8955         instead.
8956         (check_breakpoints): Adjust.  Use release_breakpoint.
8957         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
8958         (breakpoint_inserted_here): Ditto.
8959         (check_mem_read): Adjust to iterate over raw breakpoints instead.
8960         Don't trust the breakpoint's shadow if it is not inserted.
8961         (check_mem_write): Adjust to iterate over raw breakpoints instead.
8962         (delete_all_breakpoints): Adjust.
8963         (free_all_breakpoints): Mark all breakpoints as uninserted, and
8964         use delete_breakpoint_1.
8965
8966         * mem-break.h (breakpoints_supported): Delete declaration.
8967         (set_gdb_breakpoint_at): Declare.
8968         (gdb_breakpoint_here): Declare.
8969         (delete_breakpoint_at): Delete.
8970         (delete_gdb_breakpoint_at): Declare.
8971
8972         * server.h (struct raw_breakpoint): Forward declare.
8973         (struct process_info): New field `raw_breakpoints'.
8974
8975         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
8976         breakpoints.
8977
8978 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8979
8980         * linux-low.c (status_pending_p_callback): Fix comment.
8981         (linux_wait_for_event_1): Move most of the internal breakpoint
8982         handling from here...
8983         (linux_wait_1): ... to here.
8984         (count_events_callback): New.
8985         (select_singlestep_lwp_callback): New.
8986         (select_event_lwp_callback): New.
8987         (cancel_breakpoints_callback): New.
8988         (select_event_lwp): New.
8989         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
8990         priority to all LWPs that have had events that should be reported
8991         to the client.  Cancel breakpoints when about to reporting the
8992         event to the client, not while stopping lwps.  No longer cancel
8993         finished single-steps here.
8994         (cancel_finished_single_step): Delete.
8995         (cancel_finished_single_steps): Delete.
8996
8997 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8998
8999         * mem-break.c (enum bkpt_type): New.
9000         (struct breakpoint): New field `type'.
9001         (set_breakpoint_at): Change return type to struct breakpoint
9002         pointer.  Set type to `other_breakpoint' by default.
9003         (delete_breakpoint): Rewrite, supporting more than one breakpoint
9004         in the breakpoint list.
9005         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
9006         (reinsert_breakpoint): Rename to ...
9007         (reinsert_raw_breakpoint): ... this.
9008         (reinsert_breakpoints_at): Adjust.
9009         * mem-break.h (struct breakpoint): Declare.
9010         (set_breakpoint_at): Change return type to struct breakpoint
9011         pointer.
9012
9013 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9014
9015         * server.c (handle_query): Assign, not compare.
9016
9017 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9018
9019         Teach linux gdbserver to step-over-breakpoints.
9020
9021         * linux-low.c (can_hardware_single_step): New.
9022         (supports_breakpoints): New.
9023         (handle_extended_wait): If stopping threads, read the stop pc of
9024         the new cloned LWP.
9025         (get_pc): New.
9026         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
9027         low target doesn't support retrieving the PC.
9028         (add_lwp): Set last_resume_kind to resume_continue.
9029         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
9030         (linux_attach): Don't clear stop_expected.  Set the lwp's
9031         last_resume_kind to resume_stop.
9032         (linux_detach_one_lwp): Don't check for removed breakpoints.
9033         (check_removed_breakpoint): Delete.
9034         (status_pending_p): Rename to ...
9035         (status_pending_p_callback): ... this.  Don't check for removed
9036         breakpoints.  Don't consider threads that are stopped from GDB's
9037         perspective.
9038         (linux_wait_for_lwp): Always read the stop_pc here.
9039         (cancel_breakpoint): New.
9040         (step_over_bkpt): New global.
9041         (linux_wait_for_event_1): Implement stepping over breakpoints.
9042         (gdb_wants_lwp_stopped): New.
9043         (gdb_wants_all_stopped): New.
9044         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
9045         single-step traps here.  Store the thread's last reported target
9046         wait status.
9047         (send_sigstop): Don't clear stop_expected.  Always set it,
9048         instead.
9049         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
9050         (cancel_finished_single_step): New.
9051         (cancel_finished_single_steps): New.
9052         (wait_for_sigstop): Don't cancel finished single-step traps here.
9053         (linux_resume_one_lwp): Don't check for removed breakpoints.
9054         Don't set `step' on non-hardware step archs.
9055         (linux_set_resume_request): Ignore resume_stop requests if already
9056         stopping or stopped.  Set the lwp's last_resume_kind.
9057         (resume_status_pending_p): Don't check for removed breakpoints.
9058         (need_step_over_p): New.
9059         (start_step_over): New.
9060         (finish_step_over): New.
9061         (linux_resume_one_thread): Always queue a sigstop for resume_stop
9062         requests.  Clear the thread's last reported target waitstatus.
9063         Don't use the `suspended' flag.  Don't consider pending breakpoints.
9064         (linux_resume): Start a step-over if necessary.
9065         (proceed_one_lwp): New.
9066         (proceed_all_lwps): New.
9067         (unstop_all_lwps): New.
9068         * linux-low.h (struct lwp_info): Rewrite comment for the
9069         `suspended' flag.  Add the `stop_pc' field.  Delete the
9070         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
9071         Add `'last_resume_kind' and `need_step_over' fields.
9072         * inferiors.c (struct thread_info): Delete, moved elsewhere.
9073         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
9074         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
9075         (set_raw_breakpoint_at): New.
9076         (set_breakpoint_at): Rewrite to use it.
9077         (reinsert_breakpoint_handler): Delete.
9078         (set_reinsert_breakpoint): New.
9079         (reinsert_breakpoint_by_bp): Delete.
9080         (delete_reinsert_breakpoints): New.
9081         (uninsert_breakpoint): Rewrite.
9082         (uninsert_breakpoints_at): New.
9083         (reinsert_breakpoint): Rewrite.
9084         (reinsert_breakpoints_at): New.
9085         (check_breakpoints): Rewrite.
9086         (breakpoint_here): New.
9087         (breakpoint_inserted_here): New.
9088         (check_mem_read): Adjust.
9089         * mem-break.h (breakpoints_supported, breakpoint_here)
9090         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
9091         (reinsert_breakpoint_by_bp): Delete declaration.
9092         (delete_reinsert_breakpoints): Declare.
9093         (reinsert_breakpoint): Delete declaration.
9094         (reinsert_breakpoints_at): Declare.
9095         (uninsert_breakpoint): Delete declaration.
9096         (uninsert_breakpoints_at): Declare.
9097         (check_breakpoints): Adjust prototype.
9098         * server.h: Adjust include order.
9099         (struct thread_info): Declare here.  Add a `last_status' field.
9100
9101 2010-03-23  Michael Snyder  <msnyder@vmware.com>
9102
9103         * server.c (crc32): New function.
9104         (handle_query): Add handling for 'qCRC:' request.
9105
9106 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
9107
9108         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
9109         lwp had been stopped by a watchpoint.
9110
9111 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
9112
9113         * server.h (internal_error): Declare.
9114         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
9115         * utils.c (internal_error): New function.
9116
9117 2010-03-15  Andreas Schwab  <schwab@redhat.com>
9118
9119         * configure.srv: Fix typo setting srv_regobj.
9120
9121 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
9122
9123         * linux-low.c (fetch_register): Avoid passing a non string literal
9124         format to `error'.
9125         (usr_store_inferior_registers): Ditto.
9126
9127 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9128
9129         * linux-low.c (linux_write_memory): Bail out early if peeking
9130         memory failed.
9131
9132 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9133
9134         * linux-low.h (struct lwp_info): New fields
9135         `stopped_by_watchpoint' and `stopped_data_address'.
9136         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
9137         here, and cache them in the lwp object.
9138         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
9139         directly.
9140         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
9141         field.
9142         (linux_stopped_by_watchpoint): Rewrite.
9143         (linux_stopped_data_address): Rewrite.
9144
9145 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
9146
9147         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
9148         switching the current inferior, not before.
9149
9150 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
9151
9152         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
9153         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
9154         i386-linux.c and amd64-linux.c.
9155         (reg-i386.o): Removed.
9156         (reg-i386.c): Likewise.
9157         (reg-i386-linux.o): Likewise.
9158         (reg-i386-linux.c): Likewise.
9159         (reg-x86-64.o): Likewise.
9160         (reg-x86-64.c): Likewise.
9161         (reg-x86-64-linux.o): Likewise.
9162         (reg-x86-64-linux.c): Likewise.
9163         (i386.o): New.
9164         (i386.c): Likewise.
9165         (i386-linux.o): Likewise.
9166         (i386-linux.c): Likewise.
9167         (amd64.o): Likewise.
9168         (amd64.c): Likewise.
9169         (amd64-linux.o): Likewise.
9170         (amd64-linux.c): Likewise.
9171
9172         * configure.srv (srv_i386_regobj): New.
9173         (srv_i386_linux_regobj): Likewise.
9174         (srv_amd64_regobj): Likewise.
9175         (srv_amd64_linux_regobj): Likewise.
9176         (srv_i386_32bit_xmlfiles): Likewise.
9177         (srv_i386_64bit_xmlfiles): Likewise.
9178         (srv_i386_xmlfiles): Likewise.
9179         (srv_amd64_xmlfiles): Likewise.
9180         (srv_i386_linux_xmlfiles): Likewise.
9181         (srv_amd64_linux_xmlfiles): Likewise.
9182         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9183         srv_xmlfiles to $srv_i386_xmlfiles.
9184         (i[34567]86-*-mingw32ce*): Likewise.
9185         (i[34567]86-*-mingw*): Likewise.
9186         (i[34567]86-*-nto*): Likewise.
9187         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9188         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9189         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9190         (x86_64-*-linux*): Likewise.
9191
9192         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9193         (init_registers_amd64_linux): New.
9194         (x86_arch_setup): Replace init_registers_x86_64_linux with
9195         init_registers_amd64_linux.
9196
9197 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9198
9199         * configure.ac: Check for libdl.  If it is not available link against
9200         static libthread_db.
9201         * configure: Regenerate.
9202
9203 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9204
9205         PR9605
9206
9207         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9208         handing a read watchpoint.
9209         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9210
9211 2010-02-12  Doug Evans  <dje@google.com>
9212
9213         * linux-low.c (linux_supports_tracefork_flag): Document.
9214         (linux_look_up_symbols): Add comment.
9215
9216 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9217
9218         * regcache.c (supply_register): Clear regcache if buf is NULL.
9219
9220 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9221             Joel Brobecker  <brobecker@adacore.com>
9222
9223         * inferiors.c (find_inferior): Add function documentation.
9224         (unloaded_dll): Handle the case where the unloaded dll has not
9225         been previously registered in the dll list.
9226
9227 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9228
9229         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9230         (thumb2_breakpoint): New.
9231         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9232
9233 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9234
9235         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9236         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9237         breakpoints.
9238
9239 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9240
9241         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9242
9243 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9244
9245         * linux-s390-low.c (s390_collect_ptrace_register)
9246         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9247
9248 2010-01-21  Doug Evans  <dje@google.com>
9249
9250         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9251         (PTRACE_ARG4_TYPE): New macro.
9252         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9253         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9254         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9255         (usr_store_inferior_registers): Ditto.
9256         (linux_read_memory, linux_write_memory): Ditto.
9257         (linux_test_for_tracefork): Ditto.
9258
9259         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9260         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9261
9262 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9263
9264         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9265         target.
9266
9267 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9268
9269         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9270         prototype to take a regcache.  Adjust.
9271
9272 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9273
9274         * regcache.h (struct thread_info): Forward declare.
9275         (struct regcache): New.
9276         (new_register_cache): Adjust prototype.
9277         (get_thread_regcache): Declare.
9278         (free_register_cache): Adjust prototype.
9279         (registers_to_string, registers_from_string): Ditto.
9280         (supply_register, supply_register_by_name, collect_register)
9281         (collect_register_as_string, collect_register_by_name): Ditto.
9282         * regcache.c (struct inferior_regcache_data): Delete.
9283         (get_regcache): Rename to ...
9284         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9285         fetching registers.
9286         (regcache_invalidate_one): Adjust.
9287         (regcache_invalidate): Fix prototype.
9288         (new_register_cache): Return the new register cache.
9289         (free_register_cache): Change prototype.
9290         (realloc_register_cache): Adjust.
9291         (registers_to_string): Change prototype to take a regcache.  Adjust.
9292         (registers_from_string): Ditto.
9293         (register_data): Ditto.
9294         (supply_register): Ditto.
9295         (supply_register_by_name): Ditto.
9296         (collect_register): Ditto.
9297         (collect_register_as_string): Ditto.
9298         (collect_register_by_name): Ditto.
9299         * server.c (process_serial_event): Adjust.
9300         * linux-low.h (regset_fill_func, regset_store_func): Change
9301         prototype.
9302         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9303         Change prototype.
9304         * linux-low.c (get_stop_pc): Adjust.
9305         (check_removed_breakpoint): Adjust.
9306         (linux_wait_for_event): Adjust.
9307         (linux_resume_one_lwp): Adjust.
9308         (fetch_register): Add regcache parameter.  Adjust.
9309         (usr_store_inferior_registers): Ditto.
9310         (regsets_fetch_inferior_registers): Ditto.
9311         (regsets_store_inferior_registers): Ditto.
9312         (linux_fetch_registers, linux_store_registers): Ditto.
9313         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9314         regcache.  Adjust.
9315         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9316         Ditto.
9317         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9318         prototype to take a regcache.
9319         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9320         * remote-utils.c (convert_ascii_to_int, outreg)
9321         (prepare_resume_reply): Change prototype to take a regcache.
9322         Adjust.
9323         * target.h (struct target_ops) <fetch_registers, store_registers>:
9324         Change prototype to take a regcache.
9325         (fetch_inferior_registers, store_inferior_registers): Change
9326         prototype to take a regcache.  Adjust.
9327         * proc-service.c (ps_lgetregs): Adjust.
9328         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9329         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9330         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9331         take a regcache.  Adjust.
9332         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9333         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9334         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9335         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9336         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9337         (cris_cannot_fetch_register):
9338         (cris_breakpoint_at): Change prototype to take a regcache.
9339         Adjust.
9340         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9341         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9342         to take a regcache.  Adjust.
9343         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9344         Adjust.
9345         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9346         take a regcache.  Adjust.
9347         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9348         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9349         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9350         * linux-mips-low.c (mips_get_pc):
9351         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9352         (mips_reinsert_addr): Adjust.
9353         (mips_collect_register): Change prototype to take a regcache.
9354         Adjust.
9355         (mips_supply_register):
9356         (mips_collect_register_32bit, mips_supply_register_32bit)
9357         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9358         (mips_store_fpregset): Ditto.
9359         * linux-ppc-low.c (ppc_supply_ptrace_register)
9360         (ppc_supply_ptrace_register): Ditto.
9361         (parse_spufs_run): Adjust.
9362         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9363         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9364         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9365         take a regcache.  Adjust.
9366         * linux-s390-low.c (s390_collect_ptrace_register)
9367         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9368         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9369         (s390_arch_setup): Adjust.
9370         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9371         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9372         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9373         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9374         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9375         regcache.  Adjust.
9376         (sparc_breakpoint_at): Adjust.
9377         * linux-xtensa-low.c (xtensa_fill_gregset):
9378         (xtensa_store_gregset):
9379         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9380         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9381         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9382         prototype to take a regcache.  Adjust.
9383         * win32-arm-low.c (arm_fetch_inferior_register)
9384         (arm_store_inferior_register): Change prototype to take a
9385         regcache.  Adjust.
9386         * win32-i386-low.c (i386_fetch_inferior_register)
9387         (i386_store_inferior_register): Change prototype to take a
9388         regcache.  Adjust.
9389         * win32-low.c (child_fetch_inferior_registers)
9390         (child_store_inferior_registers): Change prototype to take a
9391         regcache.  Adjust.
9392         (win32_wait): Adjust.
9393         (win32_fetch_inferior_registers): Change prototype to take a
9394         regcache.  Adjust.
9395         (win32_store_inferior_registers): Adjust.
9396         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9397         store_inferior_register>: Change prototype to take a regcache.
9398
9399 2010-01-20  Doug Evans  <dje@google.com>
9400
9401         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9402         #ifdef.
9403         (linux_wait_for_event1, linux_init_signals): Ditto.
9404         (W_STOPCODE): Provide definition if missing.
9405
9406 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9407
9408         * linux-low.c (linux_core_of_thread): New.
9409         (compare_ints, show_process, list_threads): New.
9410         (linux_qxfer_osdata): Report threads and cores.
9411         (linux_target_op): Register linux_core_of_thread.
9412         * remote-utils.c (prepare_resume_reply): Report the core.
9413         (buffer_xml_printf): Support %d specifier.
9414         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9415         New.
9416         (handle_query): Handle qXfer:threads.  Announce availability
9417         thereof.
9418         * target.h (struct target_ops): New field core_of_thread.
9419
9420 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9421
9422         * Makefile.in (clean): Remove new generated files.
9423         (reg-s390.o, reg-s390.c): Remove rules.
9424         (reg-s390x.o, reg-s390x.c): Likewise.
9425         (s390-linux32.o, s390-linux32.c): Add rules.
9426         (s390-linux64.o, s390-linux64.c): Likewise.
9427         (s390x-linux64.o, s390x-linux64.c): Likewise.
9428         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9429         * linux-s390-low.c: Include <elf.h>.
9430         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9431         (init_registers_s390): Remove prototype.
9432         (init_registers_s390x): Likewise.
9433         (init_registers_s390_linux32): Add prototype.
9434         (init_registers_s390_linux64): Likewise.
9435         (init_registers_s390x_linux64): Likewise.
9436         (s390_num_regs_3264): New define.
9437         (s390_regmap_3264): New global variable.
9438         (s390_cannot_fetch_register): Remove obsolete check.
9439         (s390_cannot_store_register): Likewise.
9440         (s390_collect_ptrace_register): Handle upper/lower register halves.
9441         (s390_supply_ptrace_register): Likewise.
9442         (s390_fill_gregset): Update to register number changes.
9443         (s390_get_hwcap): New routine.
9444         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9445         Install appropriate regmap and register set.
9446
9447 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9448
9449         * server.c (gdbserver_version): Update copyright year to 2010.
9450         * gdbreplay.c (gdbreplay_version): Likewise.
9451
9452 2009-12-28  Doug Evans  <dje@google.com>
9453
9454         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9455         elf/external.h.  Include <elf.h> instead but only if necessary.
9456
9457 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9458
9459         * linux-low.c (linux_remove_process): Remove `detaching'
9460         parameter.  Don't release/detach from thread_db here.
9461         (linux_kill): Release/detach from thread_db here, ...
9462         (linux_detach): ... and here, before actually detaching.
9463         (linux_wait_1): ... and here, when a process exits.
9464         * thread-db.c (any_thread_of): New.
9465         (thread_db_free): Switch the current inferior to a thread of the
9466         passed in process.
9467
9468 2009-12-21  Doug Evans  <dje@google.com>
9469
9470         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9471
9472         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9473         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9474         warning ifndef __NR_tkill.  Move setting of errno there too.
9475         Delete unnecessary resetting of errno after syscall.
9476         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9477
9478         * configure.ac: Check for dladdr.
9479         * config.in: Regenerate.
9480         * configure: Regenerate.
9481         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9482         (try_thread_db_load): Update.
9483
9484         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9485
9486 2009-12-18  Doug Evans  <dje@google.com>
9487
9488         * event-loop.c: Include unistd.h if it exists.
9489
9490         * linux-low.c (my_waitpid): Move definition away from being in
9491         between linux_tracefork_child/linux_test_for_tracefork.
9492
9493         * gdb_proc_service.h (psaddr_t): Fix type.
9494         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9495         signature to match glibc.
9496
9497 2009-12-16  Doug Evans  <dje@google.com>
9498
9499         * linux-low.c (linux_read_memory): Fix argument to read.
9500
9501 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9502
9503         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9504         events, don't leave current_inferior pointing at null.
9505
9506 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9507
9508         * win32-low.c (LOG): Delete.
9509         (OUTMSG): Output to stderr.
9510         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9511         on compile time LOG macro.
9512         (win32_wait): Fix debug output.
9513
9514 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9515
9516         * win32-low.c (win32_add_one_solib): If the dll name is
9517         "ntdll.dll", prepend the system directory to the dll path.
9518
9519 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9520
9521         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9522
9523 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9524             Vladimir Prus  <vladimir@codesourcery.com>
9525
9526         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9527         * configure.ac: Check for __mcoldfire__ and set
9528         gdb_cv_m68k_is_coldfire.
9529         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9530         reg-cf.o and reg-m68k.o.
9531         * configure: Regenerated.
9532
9533 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9534
9535         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9536         Pass it to thread_db_free.
9537         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9538         proper `detaching' argument to linux_remove_process.
9539         * linux-low.h (thread_db_free): Add `detaching' parameter.
9540         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9541         to thread_db_free.
9542         (thread_db_free): Add `detaching' parameter.  Only
9543         call td_ta_clear_event if detaching from process.
9544
9545 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9546
9547         * thread-db.c (thread_db_free): Fix typo.
9548
9549 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9550
9551         PR gdb/10838
9552         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9553
9554 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9555
9556         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9557         with an i686 compiler.
9558         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9559         needed.
9560         * configure: Rebuilt.
9561
9562 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9563
9564         PR gdb/10783
9565
9566         * server.c (handle_search_memory_1): Correct read_addr initialization
9567         in loop for searching subsequent chunks.
9568
9569 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9570
9571         * configure.ac: New --with-libthread-db option.
9572         * thread-db.c: Allow direct dependence on libthread_db.
9573         (thread_db_free): Adjust.
9574         * config.in: Regenerate.
9575         * configure: Likewise.
9576
9577 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9578
9579         PR gdb/10757
9580         * thread-db.c (attach_thread): New function.
9581         (maybe_attach_thread): Return success/failure.
9582         (find_new_threads_callback): Adjust.
9583         (thread_db_find_new_threads): Loop until no new threads.
9584
9585 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9586
9587         * proc-service.c (ps_lgetregs): Formatting.
9588
9589 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9590
9591         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9592         * configure.ac: Adjust.
9593         * linux-low.h (struct process_info_private): Move members to struct
9594         thread_db.
9595         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9596         * linux-low.c (linux_remove_process): Adjust.
9597         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9598         * server.c (handle_query): Move code ...
9599         (handle_monitor_command): ... here. New function.
9600         * target.h (struct target_ops): New member.
9601         * thread-db.c (struct thread_db): New.
9602         (libthread_db_search_path): New variable.
9603         (thread_db_create_event, thread_db_enable_reporting)
9604         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9605         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9606         (try_thread_db_load_1, dladdr_to_soname): New functions.
9607         (try_thread_db_load, thread_db_load_search): New functions.
9608         (thread_db_init): Search for libthread_db.
9609         (thread_db_free): New function.
9610         (thread_db_handle_monitor_command): Likewise.
9611         * config.in: Regenerate.
9612         * configure: Regenerate.
9613
9614 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9615
9616         * spu-low.c (spu_kill): Wait for inferior to terminate.
9617         Call clear_inferiors.
9618         (spu_detach): Call clear_inferiors.
9619
9620 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9621
9622         * aclocal.m4: Regenerate.
9623         * config.in: Likewise.
9624         * configure: Likewise.
9625
9626 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9627
9628         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9629         (parse_spufs_run): New function.
9630         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9631         (ppc_breakpoint_at): Handle SPU breakpoints.
9632
9633 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9634
9635         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9636         (SPUFS_MAGIC): Define.
9637         (spu_enumerate_spu_ids): New function.
9638         (linux_qxfer_spu): New function.
9639         (linux_target_ops): Install linux_qxfer_spu.
9640
9641 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9642
9643         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
9644         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
9645         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
9646         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
9647         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
9648         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
9649         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
9650         (init_registers_powerpc_cell32l): Add prototype.
9651         (init_registers_powerpc_cell64l): Likewise.
9652         (ppc_arch_setup): Detect Cell/B.E. architecture.
9653
9654 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9655
9656         * Makefile.in (datarootdir): New variable.
9657
9658 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9659
9660         * linux-low.c (linux_write_memory): Update debugging output.
9661         * Makefile.in (clean): Add new descriptions.
9662         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
9663         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
9664         * configure.srv: Add new files for arm*-*-linux*.
9665         * linux-arm-low.c: Add new declarations.
9666         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
9667         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
9668         (HWCAP_VFPv3D16): New.
9669         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
9670         instead of __IWMMXT__.
9671         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
9672         (arm_arch_setup): New.
9673         (target_regsets): Remove #ifdef.  Add VFP regset.
9674         (the_low_target): Use arm_arch_setup.
9675
9676 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9677
9678         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
9679         the main thread again.
9680
9681 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
9682
9683         Adding Neutrino gdbserver.
9684         * configure: Regenerated.
9685         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
9686         * configure.srv (i[34567]86-*-nto*): New target.
9687         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
9688         * remote-utils.c [__QNX__]: Include sys/iomgr.h
9689         (nto_comctrl) [__QNX__]: New function.
9690         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
9691
9692 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
9693
9694         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
9695         srv_tgtobj.
9696
9697 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
9698             Pedro Alves  <pedro@codesourcery.com>
9699
9700         * win32-i386-low.c (i386_get_thread_context): Handle systems that
9701         don't support CONTEXT_EXTENDED_REGISTERS.
9702         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
9703         (the_low_target): Install them.
9704         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
9705         failing with ERROR_PIPE_NOT_CONNECTED.
9706
9707 2009-06-30  Doug Evans  <dje@google.com>
9708             Pierre Muller  <muller@ics.u-strasbg.fr>
9709
9710         Add h/w watchpoint support to x86-linux, win32-i386.
9711         * Makefile.in (SFILES): Add i386-low.c
9712         (i386_low_h): Define.
9713         (i386-low.o): Add dependencies.
9714         (linux-x86-low.o): Add i386-low.h dependency.
9715         (win32-i386-low.o): Ditto.
9716         * i386-low.c: New file.
9717         * i386-low.h: New file.
9718         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
9719         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
9720         * linux-low.c (linux_add_process): Initialize arch_private.
9721         (linux_remove_process): Free arch_private.
9722         (add_lwp): Initialize arch_private.
9723         (delete_lwp): Free arch_private.
9724         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
9725         provided.
9726         * linux-low.h (process_info_private): New member arch_private.
9727         (lwp_info): New member arch_private.
9728         (linux_target_ops): New members new_process, new_thread,
9729         prepare_to_resume.
9730         (ptid_of): New macro.
9731         * linux-x86-low.c: Include stddef.h, i386-low.h.
9732         (arch_process_info): New struct.
9733         (arch_lwp_info): New struct.
9734         (x86_linux_dr_get, x86_linux_dr_set): New functions.
9735         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9736         (i386_dr_low_get_status): New function.
9737         (x86_insert_point, x86_remove_point): New functions.
9738         (x86_stopped_by_watchpoint): New function.
9739         (x86_stopped_data_address): New function.
9740         (x86_linux_new_process, x86_linux_new_thread): New functions.
9741         (x86_linux_prepare_to_resume): New function.
9742         (the_low_target): Add entries for insert_point, remove_point,
9743         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
9744         prepare_to_resume.
9745         * server.c (debug_hw_points): New global.
9746         (monitor_show_help): Document set debug-hw-points.
9747         (handle_query): Process "set debug-hw-points".
9748         * server.h (debug_hw_points): Declare.
9749         (paddress): Declare.
9750         * utils.c (NUMCELLS, CELLSIZE): New macros.
9751         (get_sell, xsnprintf, paddress): New functions.
9752         * win32-arm-low.c (the_low_target): Add entries for insert_point,
9753         remove_point, stopped_by_watchpoint, stopped_data_address.
9754         * win32-i386-low.c: Include i386-low.h.
9755         (debug_reg_state): Replaces dr.
9756         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9757         (i386_dr_low_get_status): New function.
9758         (i386_insert_point, i386_remove_point): New functions.
9759         (i386_stopped_by_watchpoint): New function.
9760         (i386_stopped_data_address): New function.
9761         (i386_initial_stuff): Update.
9762         (get_thread_context,set_thread_context,i386_thread_added): Update.
9763         (the_low_target): Add entries for insert_point,
9764         remove_point, stopped_by_watchpoint, stopped_data_address.
9765         * win32-low.c (win32_insert_watchpoint): New function.
9766         (win32_remove_watchpoint): New function.
9767         (win32_stopped_by_watchpoint): New function.
9768         (win32_stopped_data_address): New function.
9769         (win32_target_ops): Add entries for insert_watchpoint,
9770         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
9771         * win32-low.h (win32_target_ops): New members insert_point,
9772         remove_point, stopped_by_watchpoint, stopped_data_address.
9773
9774 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
9775
9776         * server.c (process_serial_event): Re-return unsupported, not
9777         error, if the type isn't recognized.  Re-allow supporting only
9778         insert or remove packets.  Also call require_running for
9779         breakpoints.  Add missing break statement to default case.  Tidy.
9780         * target.h (struct target_ops): Rename insert_watchpoint to
9781         insert_point, and remove_watchpoint to remove_point.
9782
9783         * linux-low.h (struct linux_target_ops): Likewise.
9784         * linux-low.c (linux_insert_watchpoint): Rename to ...
9785         (linux_insert_point): ... this.  Adjust.
9786         (linux_remove_watchpoint): Rename to ...
9787         (linux_remove_point): ... this.  Adjust.
9788         (linux_target_ops): Adjust.
9789         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
9790         (cris_insert_point): ... this.
9791         (cris_remove_watchpoint): Rename to ...
9792         (cris_remove_point): ... this.
9793         (the_low_target): Adjust.
9794
9795 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
9796
9797         * server.c (handle_v_kill): Pass signal_pid to
9798         kill_inferior if multi_process is zero.
9799
9800 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
9801
9802         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
9803         * target.h (target_ops): Comment for *_watchpoint to make it clear
9804         the functions can get types '0' and '1'.
9805
9806 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
9807
9808         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
9809         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
9810         * regcache.c (get_regcache): Likewise.
9811         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
9812         * win32-low.c (child_fetch_inferior_registers): Remove check for
9813         regno 0.
9814
9815 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
9816             Pedro Alves <pedro@codesourcery.com>
9817
9818         * target.h (struct target_ops) <supports_multi_process>: New
9819         callback.
9820         (target_supports_multi_process): New.
9821         * server.c (handle_query): Even if GDB reports support, only
9822         enable multi-process if the target also supports it.  Report
9823         multi-process support only if the target backend supports it.
9824         * linux-low.c (linux_supports_multi_process): New function.
9825         (linux_target_ops): Install it as target_supports_multi_process
9826         callback.
9827
9828 2009-05-24  Doug Evans  <dje@google.com>
9829
9830         Global renaming of find_thread_pid to find_thread_ptid.
9831         * server.h (find_thread_ptid): Renamed from find_thread_pid.
9832         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
9833         All callers updated.
9834
9835         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
9836         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
9837         directly.
9838
9839         * linux-low.c (get_stop_pc): Print pc if debug_threads.
9840         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
9841         (linux_resume_one_lwp): Ditto.
9842
9843 2009-05-23  Doug Evans  <dje@google.com>
9844
9845         * linux-low.c (linux_resume_one_lwp): Change type of first arg
9846         from struct inferior_list_entry * to struct lwp_info *.
9847         All callers updated.
9848
9849 2009-05-13  Doug Evans  <dje@google.com>
9850
9851         * linux-x86-low.c: Don't include assert.h.
9852         (x86_siginfo_fixup): Use fatal, not assert.
9853         (x86_arch_setup): Fix comment.
9854
9855 2009-05-12  Doug Evans  <dje@google.com>
9856
9857         Biarch support for i386/amd64 gdbserver.
9858         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
9859         Add linux-x86-low.c.
9860         (linux-i386-low.o, linux-x86-64-low.o): Delete.
9861         (linux-x86-low.o): Add.
9862         * linux-x86-64-low.c: Delete.
9863         * linux-i386-low.c: Delete.
9864         * linux-x86-low.c: New file.
9865         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
9866         linux-x86-low.o.
9867         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
9868         linux-x86-low.o.
9869         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
9870         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
9871         (linux_child_pid_to_exec_file): New function.
9872         (elf_64_header_p, elf_64_file_p): New functions.
9873         (siginfo_fixup): New function.
9874         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
9875         give target a chance to convert layout.
9876         * linux-low.h (linux_target_ops): New member siginfo_fixup.
9877         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
9878
9879 2009-05-07  Doug Evans  <dje@google.com>
9880
9881         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
9882         (regsets_store_inferior_registers): Ditto.
9883
9884 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
9885
9886         PR server/10048
9887
9888         * linux-low.c (must_set_ptrace_flags): Delete.
9889         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
9890         of the global.
9891         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
9892         `lwp->must_set_ptrace_flags' instead.
9893         (linux_wait_for_event_1): Set ptrace options here.
9894         (linux_wait_1): ... not here.
9895
9896 2009-04-30  Doug Evans  <dje@google.com>
9897
9898         * inferiors.c (started_inferior_callback): New function.
9899         (attached_inferior_callback): New function.
9900         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
9901         * server.c (print_started_pid, print_attached_pid): New functions.
9902         (detach_or_kill_for_exit): New function.
9903         (main): Call it instead of for_each_inferior (kill_inferior_callback).
9904         * server.h (have_started_inferiors_p): Declare.
9905         (have_attached_inferiors_p): Declare.
9906
9907         * inferiors.c (remove_process): Fix memory leak, free process.
9908         * linux-low.c (linux_remove_process): New function.
9909         (linux_kill): Call it instead of remove_process.
9910         (linux_detach, linux_wait_1): Ditto.
9911
9912 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
9913
9914         * configure.srv: Add x86 Windows CE target.
9915
9916 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9917
9918         * inferiors.c (get_thread_process): Make global.
9919         * server.h (get_thread_process): Add prototype.
9920         * thread-db.c (find_one_thread): Use get_thread_process
9921         instead of current_process.
9922         (thread_db_get_tls_address): Do not crash if called when
9923         thread layer is not yet initialized.
9924
9925 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9926
9927         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
9928         * spu-low.c (current_tid): Rename to ...
9929         (current_ptid): ... this.
9930         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
9931         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
9932         ptid_get_lwp (current_ptid) instead of current_tid.
9933         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
9934         instead of current_tid.  Use find_process_pid to verify pid
9935         argument is valid.  Pass proper argument to remove_process.
9936         (spu_thread_alive): Compare current_ptid instead of current_tid.
9937         (spu_resume): Likewise.
9938
9939 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
9940
9941         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
9942         variable.
9943
9944 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9945
9946         Implement the multiprocess extensions, and add linux multiprocess
9947         support.
9948
9949         * server.h (ULONGEST): Declare.
9950         (struct ptid, ptid_t): New.
9951         (minus_one_ptid, null_ptid): Declare.
9952         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9953         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
9954         (struct inferior_list_entry): Change `id' type from unsigned from
9955         to ptid_t.
9956         (struct sym_cache, struct breakpoint, struct
9957         process_info_private): Forward declare.
9958         (struct process_info): Declare.
9959         (current_process): Declare.
9960         (all_processes): Declare.
9961         (initialize_inferiors): Declare.
9962         (add_thread): Adjust to use ptid_t.
9963         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
9964         (add_process, remove_process, find_thread_pid): Declare.
9965         (find_inferior_id): Adjust to use ptid_t.
9966         (cont_thread, general_thread, step_thread): Change type to ptid_t.
9967         (multi_process): Declare.
9968         (push_event): Adjust to use ptid_t.
9969         (read_ptid, write_ptid): Declare.
9970         (prepare_resume_reply): Adjust to use ptid_t.
9971         (clear_symbol_cache): Declare.
9972         * inferiors.c (all_processes): New.
9973         (null_ptid, minus_one_ptid): New.
9974         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9975         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
9976         (add_thread): Change unsigned long to ptid.  Remove gdb_id
9977         parameter.  Adjust.
9978         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
9979         (gdb_id_to_thread): Rename to ...
9980         (find_thread_pid): ... this.  Change unsigned long to ptid.
9981         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
9982         (loaded_dll, pull_pid_from_list): Adjust.
9983         (add_process, remove_process, find_process_pid)
9984         (get_thread_process, current_process, initialize_inferiors): New.
9985         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
9986         (struct target_waitstatus) <related_pid>: Ditto.
9987         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
9988         return type to int.
9989         (struct target_ops) <join>: Add `pid' argument.
9990         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
9991         (struct target_ops) <wait>: Add `ptid' field.  Change return type
9992         to ptid.
9993         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
9994         (mywait): Add `ptid' argument.  Change return type to ptid_t.
9995         (target_pid_to_str): Declare.
9996         * target.c (set_desired_inferior): Adjust to use ptids.
9997         (mywait): Add new `ptid' argument.  Adjust.
9998         (target_pid_to_str): New.
9999         * mem-break.h (free_all_breakpoints): Declare.
10000         * mem-break.c (breakpoints): Delelete.
10001         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
10002         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
10003         to use per-process breakpoint list.
10004         (free_all_breakpoints): New.
10005         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
10006         (symbol_cache, all_symbols_looked_up): Delete.
10007         (hexchars): New.
10008         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
10009         read_ptid): New.
10010         (prepare_resume_reply): Change ptid argument's type from unsigned
10011         long to ptid_t.  Adjust.  Implement W;process and X;process.
10012         (free_sym_cache, clear_symbol_cache): New.
10013         (look_up_one_symbol): Adjust to per-process symbol cache.  *
10014         * server.c (cont_thread, general_thread, step_thread): Change type
10015         to ptid_t.
10016         (attached): Delete.
10017         (multi_process): New.
10018         (last_ptid): Change type to ptid_t.
10019         (struct vstop_notif) <ptid>: Change type to ptid_t.
10020         (queue_stop_reply, push_event): Change `ptid' argument's type to
10021         ptid_t.
10022         (discard_queued_stop_replies): Add `pid' argument.
10023         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
10024         changes.  Don't reference the `attached' global.
10025         (attach_inferior): Adjust to mywait interface changes.
10026         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
10027         features.  Handle and report "multiprocess+".  Handle
10028         "qAttached:PID".
10029         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
10030         changes.
10031         (handle_v_kill): New.
10032         (handle_v_stopped): Adjust to use target_pid_to_str.
10033         (handle_v_requests): Allow multiple attaches and runs when
10034         multiprocess extensions are in effect.  Handle "vKill".
10035         (myresume): Adjust to use ptids.
10036         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
10037         (handle_status): Adjust to discard_queued_stop_replies interface
10038         change.
10039         (first_thread_of, kill_inferior_callback)
10040         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
10041         (main): Call initialize_inferiors.  Adjust to use ptids, killing
10042         and detaching from all inferiors.  Handle multiprocess packet
10043         variants.
10044         * linux-low.h: Include gdb_proc_service.h.
10045         (struct process_info_private): New.
10046         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
10047         <lwpid_of>: Use ptid_get_lwp.
10048         (get_lwp_thread): Adjust.
10049         (struct lwp_info): Add `dead' member.
10050         (find_lwp_pid): Declare.
10051         * linux-low.c (thread_db_active): Delete.
10052         (new_inferior): Adjust comment.
10053         (inferior_pid): Delete.
10054         (linux_add_process): New.
10055         (handle_extended_wait): Adjust.
10056         (add_lwp): Change unsigned long to ptid.
10057         (linux_create_inferior): Add process to processes table.  Adjust
10058         to use ptids.  Don't set new_inferior here.
10059         (linux_attach_lwp): Rename to ...
10060         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
10061         it.  Adjust to use ptids.
10062         (linux_attach_lwp): New.
10063         (linux_attach): Add process to processes table.  Don't set
10064         new_inferior here.
10065         (struct counter): New.
10066         (second_thread_of_pid_p, last_thread_of_process_p): New.
10067         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
10068         multiple processes.
10069         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
10070         processes.  Remove process from process table.
10071         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
10072         to multiple processes.
10073         (any_thread_of): New.
10074         (linux_detach): Add `pid' argument, and handle it.  Remove process
10075         from processes table.
10076         (linux_join): Add `pid' argument.  Handle it.
10077         (linux_thread_alive): Change unsighed long argument to ptid_t.
10078         Consider dead lwps as not being alive.
10079         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
10080         threads we're not interested in.
10081         (same_lwp, find_lwp_pid): New.
10082         (linux_wait_for_lwp): Change `pid' argument's type from int to
10083         ptid_t.  Adjust.
10084         (linux_wait_for_event): Rename to ...
10085         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
10086         from int to ptid_t.  Adjust.
10087         (linux_wait_for_event): New.
10088         (linux_wait_1): Add `ptid' argument.  Change return type to
10089         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
10090         that exit from the process table.
10091         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
10092         Adjust.
10093         (mark_lwp_dead): New.
10094         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
10095         stopping all threads, mark its main lwp as dead.
10096         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
10097         ptids.
10098         (fetch_register, usr_store_inferior_registers)
10099         (regsets_fetch_inferior_registers)
10100         (regsets_store_inferior_registers, linux_read_memory)
10101         (linux_write_memory): Inline `inferior_pid'.
10102         (linux_look_up_symbols): Adjust to use per-process
10103         `thread_db_active'.
10104         (linux_request_interrupt): Adjust to use ptids.
10105         (linux_read_auxv): Inline `inferior_pid'.
10106         (initialize_low): Don't reference thread_db_active.
10107         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
10108         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
10109         (ps_getpid): Return the pid of the current inferior.
10110         * thread-db.c (proc_handle, thread_agent): Delete.
10111         (thread_db_create_event, thread_db_enable_reporting): Adjust to
10112         per-process data.
10113         (find_one_thread): Change argument type to ptid_t.  Adjust to
10114         per-process data.
10115         (maybe_attach_thread): Adjust to per-process data and ptids.
10116         (thread_db_find_new_threads): Ditto.
10117         (thread_db_init): Ditto.
10118         * spu-low.c (spu_create_inferior, spu_attach): Add process to
10119         processes table.  Adjust to use ptids.
10120         (spu_kill, spu_detach): Adjust interface.  Remove process from
10121         processes table.
10122         (spu_join, spu_thread_alive): Adjust interface.
10123         (spu_wait): Adjust interface.  Remove process from processes
10124         table.  Adjust to use ptids.
10125         * win32-low.c (current_inferior_tid): Delete.
10126         (current_inferior_ptid): New.
10127         (debug_event_ptid): New.
10128         (thread_rec): Take a ptid.  Adjust.
10129         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
10130         (child_delete_thread): Ditto.
10131         (do_initial_child_stuff): Add `attached' argument.  Add process to
10132         processes table.
10133         (child_fetch_inferior_registers, child_store_inferior_registers):
10134         Adjust.
10135         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
10136         (win32_attach): Pass 1 to do_initial_child_stuff.
10137         (win32_kill): Adjust interface.  Remove process from processes
10138         table.
10139         (win32_detach): Ditto.
10140         (win32_join): Adjust interface.
10141         (win32_thread_alive): Take a ptid.
10142         (win32_resume): Adjust to use ptids.
10143         (get_child_debug_event): Ditto.
10144         (win32_wait): Adjust interface.  Remove exiting process from
10145         processes table.
10146
10147 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10148
10149         Non-stop mode support.
10150
10151         * server.h (non_stop): Declare.
10152         (gdb_client_data, handler_func): Declare.
10153         (delete_file_handler, add_file_handler, start_event_loop):
10154         Declare.
10155         (handle_serial_event, handle_target_event, push_event)
10156         (putpkt_notif): Declare.
10157         * target.h (enum resume_kind): New.
10158         (struct thread_resume): Replace `step' field by `kind' field.
10159         (TARGET_WNOHANG): Define.
10160         (struct target_ops) <wait>: Add `options' argument.
10161         <supports_non_stop, async, start_non_stop>: New fields.
10162         (target_supports_non_stop, target_async): New.
10163         (start_non_stop): Declare.
10164         (mywait): Add `options' argument.
10165         * target.c (mywait): Add `options' argument.  Print child exit
10166         notifications here.
10167         (start_non_stop): New.
10168         * server.c (non_stop, own_buf, mem_buf): New globals.
10169         (struct vstop_notif): New.
10170         (notif_queue): New global.
10171         (queue_stop_reply, push_event, discard_queued_stop_replies)
10172         (send_next_stop_reply): New.
10173         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10174         interface changes.
10175         (attach_inferior): In non-stop mode, don't wait for the target
10176         here.
10177         (handle_general_set): Handle QNonStop.
10178         (handle_query): When handling qC, return the current general
10179         thread, instead of the first thread of the list.
10180         (handle_query): If the backend supports non-stop mode, include
10181         QNonStop+ in the qSupported query response.
10182         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10183         and non-stop mode.
10184         (handle_v_attach, handle_v_run): Handle non-stop mode.
10185         (handle_v_stopped): New.
10186         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10187         (myresume): Adjust to use resume_kind.  Handle non-stop.
10188         (queue_stop_reply_callback): New.
10189         (handle_status): Handle non-stop mode.
10190         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10191         Refactor serial protocol handling from here ...
10192         (process_serial_event): ... to this new function.  When GDB
10193         selects any thread, select one here.  In non-stop mode, wait until
10194         GDB acks all pending events before exiting.
10195         (handle_serial_event, handle_target_event): New.
10196         * remote-utils.c (remote_open): Install remote_desc in the event
10197         loop.
10198         (remote_close): Remove remote_desc from the event loop.
10199         (putpkt_binary): Rename to...
10200         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10201         (putpkt_binary): New as wrapper around putpkt_binary_1.
10202         (putpkt_notif): New.
10203         (prepare_resume_reply): In non-stop mode, don't change the
10204         general_thread.
10205         * event-loop.c: New.
10206         * Makefile.in (OBJ): Add event-loop.o.
10207         (event-loop.o): New rule.
10208
10209         * linux-low.h (pid_of): Moved here.
10210         (lwpid_of): New.
10211         (get_lwp_thread): Use lwpid_of.
10212         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10213         * linux-low.c (pid_of): Delete.
10214         (inferior_pid): Use lwpid_of.
10215         (linux_event_pipe): New.
10216         (target_is_async_p): New.
10217         (delete_lwp): New.
10218         (handle_extended_wait): Use lwpid_of.
10219         (add_lwp): Don't set lwpid field.
10220         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10221         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10222         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10223         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10224         first.  Adjust to linux_wait_for_event interface changes.  Use
10225         lwpid_of.
10226         (linux_detach): Don't delete the main lwp here.
10227         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10228         (status_pending_p): Don't consider explicitly suspended lwps.
10229         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10230         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10231         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10232         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10233         pointer.  Add status pointer argument.  Return a pid instead of a
10234         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10235         changes.  In non-stop mode, don't switch to a random thread.
10236         (linux_wait): Rename to...
10237         (linux_wait_1): ... this.  Add target_options argument, and handle
10238         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10239         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10240         clean exit and signal exit code.  Don't stop all threads in
10241         non-stop mode.  In all-stop mode, only stop all threads when
10242         reporting a stop to GDB.  Handle explicit thread stop requests.
10243         (async_file_flush, async_file_mark): New.
10244         (linux_wait): New.
10245         (send_sigstop): Use lwpid_of.
10246         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10247         interface changes.  In non-stop mode, don't switch to a random
10248         thread.
10249         (linux_resume_one_lwp): Use lwpid_of.
10250         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10251         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10252         non-stop mode, don't look for pending flag in all threads.
10253         (resume_status_pending_p): Don't consider explicitly suspended
10254         threads.
10255         (my_waitpid): Reimplement.  Emulate __WALL.
10256         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10257         Use lwpid_of.
10258         (sigchld_handler, linux_supports_non_stop, linux_async)
10259         (linux_start_non_stop): New.
10260         (linux_target_ops): Register linux_supports_non_stop, linux_async
10261         and linux_start_non_stop.
10262         (initialize_low): Install SIGCHLD handler.
10263         * thread-db.c (thread_db_create_event, find_one_thread)
10264         (thread_db_get_tls_address): Use lwpid_of.
10265         * win32-low.c (win32_detach): Adjust to use resume_kind.
10266         (win32_wait): Add `options' argument.
10267         * spu-low.c (spu_resume): Adjust to use resume_kind.
10268         (spu_wait): Add `options' argument.
10269
10270 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10271
10272         Decouple target code from remote protocol.
10273
10274         * target.h (enum target_waitkind): New.
10275         (struct target_waitstatus): New.
10276         (struct target_ops) <wait>: Return an unsigned long.  Take a
10277         target_waitstatus pointer instead of a char pointer.
10278         (mywait): Likewise.
10279         * target.c (mywait): Change prototype to return an unsigned long.
10280         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10281         * server.h (thread_from_wait, old_thread_from_wait): Delete
10282         declarations.
10283         (prepare_resume_reply): Change prototype to take a
10284         target_waitstatus.
10285         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10286         (last_status, last_ptid): New.
10287         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10288         pid instead of a signal.
10289         (attach_inferior): Remove "status" and "signal" parameters.
10290         Adjust.
10291         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10292         not as an address.
10293         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10294         (handle_v_requests, myresume): Remove "status" and "signal"
10295         parameters.  Adjust.
10296         (handle_status): New.
10297         (main): Delete local `status'.  Adjust.
10298         * remote-utils.c: Include target.h.
10299         (prepare_resume_reply): Change prototype to take a
10300         target_waitstatus.  Adjust.
10301
10302         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10303         interface.
10304         * spu-low.c (spu_wait): Adjust.
10305         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10306         Delete.
10307         (win32_wait): Adjust.
10308
10309 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10310
10311         * target.h (struct thread_resume): Delete leave_stopped member.
10312         (struct target_ops): Add a `n' argument to the `resume' callback.
10313         * server.c (start_inferior): Adjust.
10314         (handle_v_cont, myresume): Adjust.
10315         * linux-low.c (check_removed_breakpoint): Adjust to resume
10316         interface change, and to removed leave_stopped field.
10317         (resume_ptr): Delete.
10318         (struct thread_resume_array): New.
10319         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10320         resume interface change.
10321         (linux_continue_one_thread, linux_queue_one_thread)
10322         (resume_status_pending_p): Check if the resume field is NULL
10323         instead of checking the leave_stopped member.
10324         (linux_resume): Adjust to the target resume interface change.
10325         * spu-low.c (spu_resume): Adjust to the target resume interface
10326         change.
10327         * win32-low.c (win32_detach, win32_resume): Ditto.
10328
10329 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10330
10331         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10332         flag.
10333         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10334         pending.
10335         (linux_continue_one_thread): Only preserve the stepping flag if
10336         there's a pending breakpoint.
10337
10338 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10339
10340         * server.c (main): After the inferior having exited, call
10341         remote_close before exiting gdbserver.
10342
10343 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10344
10345         Fix size of FPSCR in Power 7 processors.
10346         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10347         (PPC_FEATURE_HAS_DFP): New #define.
10348         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10349         size of the FPSCR.
10350
10351 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10352
10353         * server.c (handle_query) Whitespace and formatting.
10354
10355 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10356
10357         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10358         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10359         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10360         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10361         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10362         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10363         Makefile.in, configure.ac: Fix whitespace throughout.
10364         * configure: Regenerate.
10365
10366 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10367
10368         * inferiors.c (find_inferior): Make it safe for the callback
10369         function to delete the currently iterated inferior.
10370
10371 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10372
10373         * Makefile.in (linuw_low_h): Move higher.
10374         (thread-db.o): Depend on $(linux_low_h).
10375
10376 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10377
10378         Rename "process" to "lwp" throughout.
10379
10380         * linux-low.c (all_processes): Rename to...
10381         (all_lwps): ... this.
10382         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10383         (add_process): Rename to ...
10384         (add_lwp): ... this.  Adjust.
10385         (linux_create_inferior): Adjust.
10386         (linux_attach_lwp): Adjust.
10387         (linux_attach): Adjust.
10388         (linux_kill_one_process): Rename to ...
10389         (linux_kill_one_lwp): ... this.  Adjust.
10390         (linux_kill): Adjust.
10391         (linux_detach_one_process): Rename to ...
10392         (linux_detach_one_lwp): ... this.  Adjust.
10393         (linux_detach): Adjust.
10394         (check_removed_breakpoint): Adjust.
10395         (status_pending_p): Adjust.
10396         (linux_wait_for_process): Rename to ...
10397         (linux_wait_for_lwp): ... this.  Adjust.
10398         (linux_wait_for_event): Adjust.
10399         (send_sigstop): Adjust.
10400         (wait_for_sigstop): Adjust.
10401         (stop_all_processes): Rename to ...
10402         (stop_all_lwps): ... this.
10403         (linux_resume_one_process): Rename to ...
10404         (linux_resume_one_lwp): ... this.  Adjust.
10405         (linux_set_resume_request, linux_continue_one_thread)
10406         (linux_queue_one_thread, resume_status_pending_p)
10407         (usr_store_inferior_registers, regsets_store_inferior_registers)
10408         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10409         Adjust.
10410         * linux-low.h (get_process): Rename to ...
10411         (get_lwp): ... this.  Adjust.
10412         (get_thread_process): Rename to ...
10413         (get_thread_lwp): ... this.  Adjust.
10414         (get_process_thread): Rename to ...
10415         (get_lwp_thread): ... this.  Adjust.
10416         (struct process_info): Rename to ...
10417         (struct lwp_info): ... this.
10418         (all_processes): Rename to ...
10419         (all_lwps): ... this.
10420         * proc-service.c (ps_lgetregs): Adjust.
10421         * thread-db.c (thread_db_create_event, find_one_thread)
10422         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10423
10424 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10425
10426         * server.c (handle_query): Handle "qAttached".
10427
10428 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10429
10430         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10431         GPLv3, update license URL.
10432
10433 2009-03-01  Doug Evans  <dje@google.com>
10434
10435         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10436         (server_h): Add gdb_signals.h.
10437         (signals.o): Update.
10438         * server.h (target_signal_from_host,target_signal_to_host_p)
10439         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10440
10441 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10442
10443         * remote-utils.c (getpkt): Also generate remote-debug
10444         information if noack_mode is set.
10445
10446 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10447
10448         * server.c (handle_query): Report qXfer:siginfo:read and
10449         qXfer:siginfo:write as supported and handle them.
10450         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10451         * linux-low.c (linux_xfer_siginfo): New.
10452         (linux_target_ops): Set it.
10453
10454 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10455
10456         * server.c (gdbserver_usage): Mention --remote-debug.
10457         (main): Accept '--remote-debug' switch.
10458
10459 2009-01-18  Doug Evans  <dje@google.com>
10460
10461         * regcache.c (new_register_cache): No need to check result of xcalloc.
10462         * server.c (handle_search_memory): Back out calls to xmalloc,
10463         result is checked and error is returned to user upon failure.
10464         (handle_query): Ditto.  Add more checks for result of malloc.
10465         (handle_v_cont): Check result of malloc, report error back to
10466         user upon failure.
10467         (handle_v_run): Ditto.  Call freeargv.
10468         * server.h (freeargv): Declare.
10469         * utils.c (freeargv): New fn.
10470
10471 2009-01-15  Doug Evans  <dje@google.com>
10472
10473         * gdbreplay.c (perror_with_name): Make arg const char *.
10474         * server.h (target_signal_to_name): Make return type const char *.
10475         * thread-db.c (thread_db_err_str): Make return type const char *.
10476         * utils.c (perror_with_name): Make arg const char *.
10477
10478 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10479
10480         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10481         when handling a EXIT_PROCESS_DEBUG_EVENT.
10482
10483 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10484
10485         * gdbreplay.c (gdbreplay_version): Update copyright year.
10486         * server.c (gdbserver_version): Likewise.
10487
10488 2009-01-05  Doug Evans  <dje@google.com>
10489
10490         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10491         (handle_extended_wait): Improve comment.
10492
10493 2008-12-13  Doug Evans  <dje@google.com>
10494
10495         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10496         * server.h (ATTR_MALLOC): New macro.
10497         (xmalloc,xcalloc,xstrdup): Declare.
10498         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10499         * inferiors.c: Ditto.
10500         * linux-low.c: Ditto.
10501         * mem-break.c: Ditto.
10502         * regcache.c: Ditto.
10503         * remote-utils.c: Ditto.
10504         * server.c: Ditto.
10505         * target.c: Ditto.
10506         * win32-low.c: Ditto.
10507
10508 2008-12-12  Doug Evans  <dje@google.com>
10509
10510         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10511         in debugging printf.
10512
10513         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10514
10515 2008-12-09  Doug Evans  <dje@google.com>
10516
10517         * linux-low.h (struct process_info): Delete member tid, unused.
10518         * thread-db.c (find_one_thread): Update.
10519         (maybe_attach_thread): Update.
10520
10521 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10522
10523         * target.h (struct target_ops): Add qxfer_osdata member.
10524         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10525         and dirent.h.
10526         (linux_qxfer_osdata): New functions.
10527         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10528         callback.
10529         * server.c (handle_query): Handle "qXfer:osdata:read:".
10530         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10531         (buffer_xml_printf): New functions.
10532         * server.h (struct buffer): New.
10533         (buffer_grow_str, buffer_grow_str0): New macros.
10534         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10535         (buffer_xml_printf): Declare.
10536
10537 2008-11-24  Doug Evans  <dje@google.com>
10538
10539         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10540
10541 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10542
10543         * server.c (handle_v_run): Always use the supplied argument list.
10544
10545 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10546
10547         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10548         (xtensa_regmap_table): Add entry for scompare1.
10549
10550 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10551
10552         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10553         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10554         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10555         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10556         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10557         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10558         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10559         XML target descriptions.
10560         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10561         when inferior is running on an ISA 2.05 or later processor.  Add
10562         special case to return offset for full 64-bit slot of FPSCR when
10563         in 32-bits.
10564
10565 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10566
10567         * Makefile.in (SFILES, clean): Added sparc64 files.
10568         (reg-sparc64.o, reg-sparc64.c): New.
10569         * configure.srv (sparc*-*-linux*): New configuration.
10570         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10571         syscall arguments for SPARC.
10572         (regsets_store_inferior_registers): Likewise.
10573         * linux-sparc-low.c: New file.
10574
10575 2008-10-21  Doug Evans  <dje@google.com>
10576
10577         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10578         (READLINE_DIR,READLINE_DEP): Delete.
10579         (INTERNAL_CFLAGS): Update.
10580         (LINTFLAGS): Update.
10581
10582 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10583
10584         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10585         whole argv from the last run, not just argv[0].
10586
10587 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10588
10589         * regcache.c (new_register_cache): Return NULL if the register
10590         cache size isn't known yet.
10591         (free_register_cache): Avoid dereferencing a NULL regcache.
10592
10593 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10594
10595         * configure.srv: Merge MIPS and MIPS64.
10596
10597 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10598
10599         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10600
10601 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10602
10603         * Makefile.in: Add required vsx dependencies.
10604
10605         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10606         Declare init_registers_powerpc_vsx32l.
10607         Declare init_registers_powerpc_vsx64l.
10608         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10609         (ppc_arch_setup): Check for VSX in hwcap.
10610         (ppc_fill_vsxregset): New function.
10611         (ppc_store_vsxregset): New function.
10612         Add new VSX entry in regset_info target_regsets.
10613
10614         * configure.srv: Add new VSX dependencies.
10615
10616 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10617
10618         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10619         (remote_open): Set or clear transport_is_reliable.
10620         (putpkt_binary): Don't expect acks in noack mode.
10621         (getpkt): Don't send ack/nac in noack mode.
10622         * server.c (handle_general_set): Handle QStartNoAckMode.
10623         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10624         qSupported.
10625         (main): Reset noack_mode on every connection.
10626         * server.h (noack_mode): Declare.
10627
10628 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10629
10630         * Makefile.in (GDBREPLAY_OBS): New variable.
10631         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10632
10633 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10634             Daniel Jacobowitz  <dan@codesourcery.com>
10635
10636         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10637         (usr_store_inferior_registers): Likewise.
10638         (regsets_store_inferior_registers): Likewise.
10639
10640 2008-07-31  Rolf Jansen  <rj@surtec.com>
10641             Pedro Alves  <pedro@codesourcery.com>
10642
10643         * configure.ac: Check for memmem declaration.
10644         * server.c [HAVE_MALLOC_H]: Include malloc.h.
10645         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
10646         (disable_packet_qfThreadInfo): Unconditionally compile.
10647         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
10648         * configure, config.in: Regenerate.
10649
10650 2008-07-28  Doug Kwan  <dougkwan@google.com>
10651
10652         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
10653         (linux_write_memory): Remove declaration of errno.
10654
10655 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
10656
10657         * linux-low.c (handle_extended_wait): Do not use "status"
10658         variable uninitialized.
10659
10660 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
10661
10662         * server.c (handle_v_attach): Inhibit reporting dll changes.
10663
10664 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
10665
10666         * remote-utils.c (prepare_resume_reply): If requested, don't
10667         output "thread:TID" in the T stop reply.
10668
10669         * server.c (disable_packet_vCont, disable_packet_Tthread)
10670         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
10671         (handle_query): If requested, disable support for qC, qfThreadInfo
10672         and qsThreadInfo.
10673         (handle_v_requests): If requested, disable support for vCont.
10674         (gdbserver_show_disableable): New.
10675         (main): Handle --disable-packet and --disable-packet=LIST.
10676
10677         * server.h (disable_packet_vCont, disable_packet_Tthread)
10678         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
10679
10680 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
10681
10682         * server.c (gdbserver_usage): Mention --version.
10683
10684 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
10685
10686         * Makefile.in (gdbreplay.o): New rule.
10687
10688 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
10689
10690         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
10691         message, not gdbserver.
10692
10693 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
10694             Nathan Sidwell  <nathan@codesourcery.com>
10695             Joseph Myers  <joseph@codesourcery.com>
10696
10697         * acinclude.m4: Include ../../config/acx.m4.
10698         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
10699         * configure, config.in: Regenerate.
10700         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
10701         * server.c (gdbserver_version): Print PKGVERSION.
10702         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
10703         (main): Adjust gdbserver_usage calls.
10704         * gdbreplay.c (version, host_name): Add declarations.
10705         (gdbreplay_version, gdbreplay_usage): New.
10706         (main): Accept --version and --help options.
10707
10708 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
10709
10710         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
10711         (arm_breakpoint_at): Handle Thumb.
10712         (the_low_target): Add comment.
10713
10714 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
10715
10716         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
10717
10718 2008-05-09  Doug Evans  <dje@google.com>
10719
10720         * server.h (decode_search_memory_packet): Declare.
10721         * remote-utils.c (decode_search_memory_packet): New fn.
10722         * server.c (handle_search_memory_1): New fn.
10723         (handle_search_memory): New fn.
10724         (handle_query): Process qSearch:memory packets.
10725
10726 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
10727
10728         * regcache.c (registers_length): Remove.
10729         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
10730         full register packet.
10731         * regcache.h (registers_length): Remove prototype.
10732         * server.h (PBUFSIZ): Define to 16384.
10733
10734 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
10735
10736         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
10737         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
10738         powerpc-64l.o, and powerpc-altivec64l.o.
10739         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
10740         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
10741         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
10742         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
10743         rs6000/power-linux.xml, and rs6000/power64-linux.xml
10744         to srv_xmlfiles.
10745
10746         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
10747         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
10748         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
10749         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
10750         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
10751         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
10752         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
10753         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
10754         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
10755         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
10756         (clean): Update.
10757
10758         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
10759         (init_registers_powerpc_32l): ... this new prototype.
10760         (init_registers_powerpc_32): Remove, replace by ...
10761         (init_registers_powerpc_altivec32l): ... this new prototype.
10762         (init_registers_powerpc_e500): Remove, replace by ...
10763         (init_registers_powerpc_e500l): ... this new prototype.
10764         (init_registers_ppc64): Remove, replace by ...
10765         (init_registers_powerpc_64l): ... this new prototype.
10766         (init_registers_powerpc_64): Remove, replace by ...
10767         (init_registers_powerpc_altivec64l): ... this new prototype.
10768         (ppc_num_regs): Set to 73.
10769         (PT_ORIG_R3, PT_TRAP): Define if necessary.
10770         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
10771         (ppc_cannot_store_register): Handle orig_r3 and trap.
10772         (ppc_arch_setup): Update init_registers_... calls.
10773         (ppc_fill_gregset): Handle orig_r3 and trap.
10774
10775         * inferiors.c (clear_inferiors): Reset current_inferior.
10776
10777 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
10778
10779         * acinclude.m4: Add override.m4.
10780         * configure: Regenerate.
10781
10782 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10783
10784         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
10785         initial call to init_register_ppc64.
10786
10787 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10788
10789         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
10790         single powerpc*-*-linux* case.
10791         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
10792
10793 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
10794
10795         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
10796         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
10797         from reg_xmlfiles.
10798         * linux-ppc-low.c: Include <elf.h>.
10799         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
10800         (ppc_hwcap): New global variable.
10801         (ppc_regmap): Remove __SPE__ #ifdef sections.
10802         (ppc_regmap_e500): New global variable.
10803         (ppc_cannot_store_register): Update __SPE__ special case.
10804         (ppc_get_hwcap): New function.
10805         (ppc_arch_setup): Use it to determine whether inferior supports
10806         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
10807         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
10808         Do not access registers if target does not support AltiVec.
10809         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
10810         Do not access registers if target does not support SPE.
10811         (target_regsets): Unconditionally include AltiVec and SPE regsets.
10812
10813 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
10814
10815         * linux-low.c (disabled_regsets, num_regsets): New.
10816         (use_regsets_p): Delete.
10817         (linux_wait_for_process): Clear disabled_regsets.
10818         (regsets_fetch_inferior_registers): Check and set it.
10819         (regsets_store_inferior_registers): Likewise.
10820         (linux_fetch_registers, linux_store_registers): Do not use
10821         use_regsets_p.
10822         (initialize_low): Allocate disabled_regsets.
10823
10824 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
10825
10826         * Makefile.in (LIBOBJS): New.
10827         (OBS): Use LIBOBJS.
10828         (memmem.o): New rule.
10829         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
10830         * configure: Regenerated.
10831
10832 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
10833
10834         * server.c (handle_query): Never return "unsupported" for
10835         qXfer:features:read queries.
10836
10837 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
10838
10839         * server.c (get_features_xml): Fix inverted condition.
10840         (handle_query): Always support qXfer:feature:read.
10841
10842 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
10843
10844         * server.c (wrapper_argv): New.
10845         (start_inferior): Handle wrapper_argv.  If set, expect an extra
10846         trap.
10847         (gdbserver_usage): Document --wrapper.
10848         (main): Parse --wrapper.
10849
10850 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10851
10852         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
10853         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
10854         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
10855         (ppc_set_pc): Likewise.
10856         (ppc_arch_setup): New function.
10857         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
10858         of collect_register.
10859         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
10860
10861 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10862
10863         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
10864         instead of linux-ppc64-low.o.
10865         * linux-ppc64-low.c: Remove file.
10866         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
10867         (linux-ppc64-low.o): Remove rule.
10868
10869         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
10870         (init_registers_powerpc_64): Likewise.
10871         (ppc_regmap): Conditionally define depending on __powerpc64__.
10872         (ppc_cannot_store_register): Do not special-case "fpscr" when
10873         compiled on __powerpc64__.
10874         (ppc_collect_ptrace_register): New function.
10875         (ppc_supply_ptrace_register): New function.
10876         (ppc_breakpoint): Change type to "unsigned int".
10877         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
10878         (the_low_target): Conditionally provide initializers for the
10879         arch_setup member depending on __powerpc64__.  Install
10880         collect_ptrace_register and supply_ptrace_register members.
10881
10882 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10883
10884         * regcache.h (gdbserver_xmltarget): Add extern declaration.
10885         * server.c (gdbserver_xmltarget): Define.
10886         (get_features_xml): Use it to replace "target.xml" and arch_string.
10887
10888         * configure.srv: Remove srv_xmltarget.  Add XML files that were
10889         mentioned there to srv_xmlfiles instead.  Remove conditional tests
10890         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
10891         srv_xmlfiles and srv_regobj to include all possible choices.
10892         * configure.ac (srv_xmltarget): Remove.
10893         (srv_xmlfiles): Do not add "target.xml".
10894         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
10895         checks for supplementary target information.
10896         * configure: Regenerate.
10897         * Makefile.in (XML_TARGET): Remove.
10898         (target.xml): Remove rule.
10899         (clean): Do not clean up target.xml.
10900         (.PRECIOUS): Do not mention target.xml.
10901
10902         * target.h (struct target_ops): Remove arch_string member.
10903         * linux-low.c (linux_arch_string): Remove.
10904         (linux_target_ops): Remove arch_string initializer.
10905         * linux-low.h (struct linux_target_ops): Remove arch_string member.
10906         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
10907         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
10908         * spu-low.c (spu_arch_string): Remove.
10909         (spu_target_ops): Remove arch_string initializer.
10910         * win32-low.c (win32_arch_string): Remove.
10911         (win32_target_ops): Remove arch_string initializer.
10912         * win32-low.h (struct win32_target_ops): Remove arch_string member.
10913         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
10914         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
10915
10916 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10917
10918         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
10919         by collect_ptrace_register and supply_ptrace_register hooks.
10920         * linux-low.c (fetch_register): Use supply_ptrace_register callback
10921         instead of checking for the_low_target.left_pad_xfer.
10922         (usr_store_inferior_registers): Use collect_ptrace_register callback
10923         instead of checking for the_low_target.left_pad_xfer.
10924
10925         * linux-s390-low.c (s390_collect_ptrace_register): New function.
10926         (s390_supply_ptrace_register): Likewise.
10927         (s390_fill_gregset): Call s390_collect_ptrace_register.
10928         (the_low_target): Update.
10929
10930         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
10931         (ppc_supply_ptrace_register): Likewise.
10932         (the_low_target): Update.
10933
10934         * linux-i386-low.c (the_low_target): Update.
10935         * linux-x86-64-low.c (the_low_target): Update.
10936
10937 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10938
10939         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
10940         reg-s390.o and reg-s390x.o.
10941
10942         * linux-low.c (new_inferior): New global variable.
10943         (linux_create_inferior, linux_attach): Set it.
10944         (linux_wait_for_process): Call the_low_target.arch_setup after the
10945         target has stopped for the first time.
10946         (initialize_low): Do not call the_low_target.arch_setup.
10947
10948         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
10949         (s390_set_pc): Likewise.
10950         (s390_arch_setup): New function.
10951         (the_low_target): Use s390_arch_setup as arch_setup routine.
10952
10953         * regcache.c (realloc_register_cache): New function.
10954         (set_register_cache): Call it for each existing regcache.
10955
10956 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10957
10958         * server.h (init_registers): Remove prototype.
10959
10960         * linux-low.h (struct linux_target_ops): Add arch_setup field.
10961         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
10962         instead of init_registers ().
10963         * linux-arm-low.c (init_registers_arm): Add prototype.
10964         (init_registers_arm_with_iwmmxt): Likewise.
10965         (the_low_target): Add initializer for arch_setup field.
10966         * linux-cris-low.c (init_registers_cris): Add prototype.
10967         (the_low_target): Add initializer for arch_setup field.
10968         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
10969         (the_low_target): Add initializer for arch_setup field.
10970         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
10971         (the_low_target): Add initializer for arch_setup field.
10972         * linux-ia64-low.c (init_registers_ia64): Add prototype.
10973         (the_low_target): Add initializer for arch_setup field.
10974         * linux-m32r-low.c (init_registers_m32r): Add prototype.
10975         (the_low_target): Add initializer for arch_setup field.
10976         * linux-m68k-low.c (init_registers_m68k): Add prototype.
10977         (the_low_target): Add initializer for arch_setup field.
10978         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
10979         (init_registers_mips64_linux): Likewise.
10980         (the_low_target): Add initializer for arch_setup field.
10981         * linux-ppc-low.c (init_registers_ppc): Add prototype.
10982         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
10983         (the_low_target): Add initializer for arch_setup field.
10984         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
10985         (init_registers_powerpc_64): Likewise.
10986         (the_low_target): Add initializer for arch_setup field.
10987         * linux-s390-low.c (init_registers_s390): Add prototype.
10988         (init_registers_s390x): Likewise.
10989         (the_low_target): Add initializer for arch_setup field.
10990         * linux-sh-low.c (init_registers_sh): Add prototype.
10991         (the_low_target): Add initializer for arch_setup field.
10992         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
10993         (the_low_target): Add initializer for arch_setup field.
10994         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
10995         (the_low_target): Add initializer for arch_setup field.
10996
10997         * win32-low.h (struct win32_target_ops): Add arch_setup field.
10998         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
10999         instead of init_registers ().
11000         * win32-arm-low.c (init_registers_arm): Add prototype.
11001         (the_low_target): Add initializer for arch_setup field.
11002         * win32-i386-low.c (init_registers_i386): Add prototype.
11003         (the_low_target): Add initializer for arch_setup field.
11004
11005         * spu-low.c (init_registers_spu): Add prototype.
11006         (initialize_low): Call initialie_registers_spu () instead of
11007         initialize_registers ().
11008
11009 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
11010
11011         * server.c (handle_v_requests): When handling the vRun and vAttach
11012         packets, if already debugging a process, don't kill it.  Return an
11013         error instead.
11014
11015 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
11016
11017         * server.c (handle_query): Correct length check.
11018
11019 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
11020
11021         * win32-low.c (do_initial_child_stuff): Add process handle
11022         parameter.  Set current_process_handle and current_process_id from the
11023         parameters. Clear globals.
11024         (win32_create_inferior): Don't set current_process_handle and
11025         current_process_id here.  Instead pass them on the call to
11026         do_initial_child_stuff.
11027         (win32_attach): Likewise.
11028         (win32_clear_inferiors): New.
11029         (win32_kill): Don't close the current process handle or the
11030         current thread handle here.  Instead call win32_clear_inferiors.
11031         (win32_detach): Don't open a new handle to the process.  Call
11032         win32_clear_inferiors.
11033         (win32_join): Don't rely on current_process_handle; open a new
11034         handle using the process id.
11035         (win32_wait): Call win32_clear_inferiors when the inferior process
11036         has exited.
11037
11038 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
11039
11040         * server.c (monitor_show_help): Add "exit".
11041
11042 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
11043
11044         * Makefile.in (SFILES): Add linux-xtensa-low.c.
11045         (clean): Add reg-xtensa.c.
11046         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
11047         * configure.srv (xtensa*-*-linux*) New target.
11048         * linux-xtensa-low.c: New.
11049         * xtensa-xtregs.c: New.
11050
11051 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
11052
11053         * hostio.c: Don't include errno.h.
11054         (errno_to_fileio_errno): Move to hostio-errno.
11055         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
11056         error number outputting to the target->hostio_last_error callback.
11057         (hostio_packet_error): Use FILEIO_EINVAL directly.
11058         (handle_open, handle_pread, hostio_error, handle_unlink): Update
11059         calls to hostio_error.
11060         * hostio-errno.c: New.
11061         * server.h (hostio_last_error_from_errno): Declare.
11062         * target.h (target_ops): Add hostio_last_error member.
11063         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
11064         as hostio_last_error handler.
11065         * spu-low.c (spu_target_ops): Likewise.
11066         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
11067         (wince_hostio_last_error): New functions.
11068         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
11069         as hostio_last_error handler.
11070         (win32_target_ops) [!_WIN32_WCE]: Register
11071         hostio_last_error_from_errno as hostio_last_error handler.
11072         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
11073         (hostio-errno.o): New rule.
11074         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
11075         * configure.srv (srv_hostio_err_objs): New variable.  Default to
11076         hostio-errno.o.
11077         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
11078         * configure: Regenerate.
11079
11080 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11081
11082         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
11083         (linux_kill, linux_detach): Clean up the process list.
11084         * remote-utils.c (remote_open): Improve port number parsing.
11085         (putpkt_binary, input_interrupt): Only send interrupts if the target
11086         is running.
11087         * server.c (extended_protocol): Make static.
11088         (attached): Define earlier.
11089         (exit_requested, response_needed, program_argv): New variables.
11090         (target_running): New.
11091         (start_inferior): Clear attached here.
11092         (attach_inferior): Set attached here.
11093         (require_running): Define.
11094         (handle_query): Use require_running and target_running.  Implement
11095         "monitor exit".
11096         (handle_v_attach, handle_v_run): New.
11097         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
11098         (gdbserver_usage): Update.
11099         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
11100         --attach along with other options or after the port.  Save
11101         program_argv.  Support no initial program.  Resynchronize
11102         communication with GDB after an error.  Handle "monitor exit".
11103         Use require_running and target_running.  Always allow the extended
11104         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
11105         restart in extended mode.
11106         * README: Refer to the GDB manual.  Update --attach usage.
11107
11108 2007-12-20  Andreas Schwab  <schwab@suse.de>
11109
11110         * linux-low.c (STACK_SIZE): Define.
11111         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
11112         (linux_test_for_tracefork): Likewise.
11113
11114 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
11115
11116         * linux-low.c (linux_wait_for_event): Update messages.  Do not
11117         reinsert auto-delete breakpoints.
11118         * mem-break.c (struct breakpoint): Change return type of handler to
11119         int.
11120         (set_breakpoint_at): Update handler type.
11121         (reinsert_breakpoint_handler): Return 1 instead of calling
11122         delete_breakpoint.
11123         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
11124         setting a new one.
11125         (check_breakpoints): Delete auto-delete breakpoints and return 2.
11126         * mem-break.h (set_breakpoint_at): Update handler type.
11127         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
11128         * win32-low.c (auto_delete_breakpoint): New.
11129         (get_child_debug_event): Use it.
11130
11131 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
11132
11133         * configure.ac: Check for pread and pwrite.
11134         * hostio.c (handle_pread): Fall back to lseek and read.
11135         (handle_pwrite): Fall back to lseek and write.
11136         * config.in, configure: Regenerated.
11137
11138 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
11139
11140         * server.c (myresume): Add own_buf argument.
11141         (main): Update calls.
11142
11143 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
11144
11145         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
11146         * remote-utils.c (remote_open): Do not call disable_async_io.
11147         (block_async_io): Delete.
11148         (unblock_async_io): Make static.
11149         (initialize_async_io): New.
11150         * server.c (handle_v_cont): Handle async I/O here.
11151         (myresume): Likewise.  Move other common resume tasks here...
11152         (main): ... from here.  Call initialize_async_io.  Disable async
11153         I/O before the main loop.
11154         * server.h (initialize_async_io): Declare.
11155         (block_async_io, unblock_async_io): Delete prototypes.
11156         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
11157
11158 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
11159
11160         * remote-utils.c (readchar): Allow binary data in received messages.
11161
11162 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11163
11164         * win32-low.c (attaching): New global.
11165         (win32_create_inferior): Clear the `attaching' global.
11166         (win32_attach): Set the `attaching' global.
11167         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11168         attaching.  Only set a breakpoint at the entry point if not
11169         attaching.
11170
11171 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11172
11173         * server.c (main): Don't report dll events on the initial
11174         connection on attaches.
11175
11176 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11177
11178         * server.c (main): Relax numerical bases supported for the pid of
11179         the --attach command line argument.
11180
11181 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11182
11183         * win32-low.c (win32_attach): Call OpenProcess before
11184         DebugActiveProcess, not after.  Add last error output to error
11185         call.
11186
11187 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11188
11189         * win32-low.c (win32_get_thread_context)
11190         (win32_set_thread_context): New functions.
11191         (thread_rec): Use win32_get_thread_context.
11192         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11193         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11194         field.
11195
11196 2007-12-03  Leo Zayas
11197             Pedro Alves  <pedro_alves@portugalmail.pt>
11198
11199         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11200         global variables.
11201         (child_add_thread): Minor cleanup.
11202         (child_continue): Resume artificially suspended threads before
11203         calling ContinueDebugEvent.
11204         (suspend_one_thread): New.
11205         (fake_breakpoint_event): New.
11206         (get_child_debug_event): Change return type to int.  Check here if
11207         gdb sent an interrupt request.  If a soft interrupt was requested,
11208         fake a breakpoint event.  Return 0 if there is no event to handle,
11209         and 1 otherwise.
11210         (win32_wait): Don't check here if gdb sent an interrupt request.
11211         Ensure there is a valid event to handle.
11212         (win32_request_interrupt): Add soft interruption method as last
11213         resort.
11214
11215 2007-12-03  Leo Zayas
11216             Pedro Alves  <pedro_alves@portugalmail.pt>
11217
11218         * win32-low.h (win32_thread_info): Add descriptions to the
11219         structure members.  Replace `suspend_count' counter by a
11220         `suspended' flag.
11221         * win32-low.c (thread_rec): Update condition of when to get the
11222         context from the inferior.  Rely on ContextFlags being set if it
11223         has already been retrieved.  Only suspend the inferior thread if
11224         we haven't already.  Warn if that fails.
11225         (continue_one_thread): s/suspend_count/suspended/.  Only call
11226         ResumeThread once.  Warn if that fails.
11227
11228 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11229
11230         * win32-low.c (win32_wait): Don't read from the inferior when it
11231         has already exited.
11232
11233 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11234
11235         * Makefile.in (win32_low_h): New variable.
11236         (win32-low.o): Add dependency on $(win32_low_h).
11237         (win32-arm-low.o, win32-i386-low.o): New rules.
11238
11239 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11240
11241         * hostio.c: Correct copyright year.
11242
11243 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11244
11245         * Makefile.in (OBS): Add hostio.o.
11246         (hostio.o): New rule.
11247         * server.h (handle_vFile): Declare.
11248         * hostio.c: New file.
11249         * server.c (handle_v_requests): Take packet_len and new_packet_len
11250         for binary packets.  Call handle_vFile.
11251         (main): Update call to handle_v_requests.
11252
11253 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11254
11255         * linux-low.c: Include <sched.h>.
11256
11257 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11258
11259         * linux-low.c (linux_tracefork_grandchild): New.
11260         (linux_tracefork_child): Use clone.
11261         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11262
11263 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11264
11265         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11266
11267 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11268
11269         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11270
11271 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11272
11273         * inferiors.c (change_inferior_id): Delete.
11274         (add_pid_to_list, pull_pid_from_list): New.
11275         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11276         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11277         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11278         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11279         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11280         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11281         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11282         (using_threads): Always set to 1.
11283         (handle_extended_wait): New.
11284         (add_process): Do not set TID.
11285         (linux_create_inferior): Set must_set_ptrace_flags.
11286         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11287         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11288         (linux_thread_alive): Rename TID argument to LWPID.
11289         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11290         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11291         call to dead_thread_notify.  Call handle_extended_wait.
11292         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11293         (send_sigstop): Delete sigstop_sent.
11294         (wait_for_sigstop): Avoid TID.
11295         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11296         (linux_test_for_tracefork): New.
11297         (linux_lookup_signals): Use thread_db_active and
11298         linux_supports_tracefork_flag.
11299         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11300         * linux-low.h (get_process_thread): Avoid TID.
11301         (struct process_ifo): Move thread_known and tid to the end.  Remove
11302         sigstop_sent.
11303         (linux_attach_lwp, thread_db_init): Update prototypes.
11304         * server.h (change_inferior_id): Delete prototype.
11305         (add_pid_to_list, pull_pid_from_list): New prototypes.
11306         * thread-db.c (thread_db_use_events): New.
11307         (find_first_thread): Rename to...
11308         (find_one_thread): ...this.  Update callers and messages.  Do not
11309         call fatal.  Check thread_db_use_events.  Do not call
11310         change_inferior_id or new_thread_notify.
11311         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11312         (thread_db_init): Set thread_db_use_events.  Check use_events.
11313         * utils.c (fatal, warning): Correct message prefix.
11314
11315 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11316
11317         * Makefile.in (clean): Remove new files.
11318         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11319         (powerpc-64.o, powerpc-64.c): New rules.
11320         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11321         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11322         with SPE.
11323         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11324         SPE targets.
11325         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11326         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11327         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11328         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11329         (target_regsets): Add AltiVec and SPE register sets.
11330         * configure.ac: Check for AltiVec and SPE.
11331         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11332         (ppc_fill_vrregset, ppc_store_vrregset): New.
11333         (target_regsets): Add AltiVec register set.
11334         * configure: Regenerated.
11335
11336 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11337
11338         * linux-low.c (O_LARGEFILE): Define.
11339         (linux_read_memory): Use /proc/PID/mem.
11340         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11341         * configure, config.in: Regenerated.
11342
11343 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11344
11345         * linux-low.c (linux_wait_for_event): Do not pass signals while
11346         single-stepping.
11347
11348 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11349
11350         * win32-low.c (create_process): New.
11351         (win32_create_inferior): Use create_process instead of
11352         CreateProcess.  If create_process failed retry appending an ".exe"
11353         suffix.  Store the GetLastError result immediatelly after
11354         create_process calls and use it on the call to error.
11355
11356 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11357
11358         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11359
11360 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11361
11362         * configure.ac: Switch license to GPLv3.
11363
11364 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11365
11366         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11367
11368 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11369
11370         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11371         typedef.
11372         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11373         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11374         CloseToolhelp32Snapshot.
11375         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11376         CloseToolhelp32Snapshot.
11377
11378 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11379
11380         * server.c (main): Check for inferior exit before main loop.
11381
11382 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11383
11384         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11385         instead of on tmp_desc.
11386
11387 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11388             Daniel Jacobowitz  <dan@codesourcery.com>
11389
11390         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11391         (add_thread): Minor cleanups.
11392         (clear_inferiors): Move lower in the file.  Clear the DLL
11393         list.
11394         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11395         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11396         (xml_escape_text): New.
11397         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11398         for qSupported.
11399         (handle_v_cont): Report errors.
11400         (gdbserver_version): Update.
11401         (main): Correct size of own_buf.  Do not report initial DLL events.
11402         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11403         (unloaded_dll, xml_escape_text): New.
11404         * win32-low.c (enum target_waitkind): Update comments.
11405         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11406         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11407         (win32_EnumProcessModules, win32_GetModuleInformation)
11408         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11409         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11410         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11411         (win32_Module32First, win32_Module32Next, load_toolhelp)
11412         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11413         (get_child_debug_event): Handle DLL events.
11414         (win32_wait): Likewise.
11415
11416 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11417
11418         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11419         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11420
11421 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11422
11423         * win32-low.c (handle_output_debug_string): Ignore event if not
11424         waiting.
11425
11426 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11427
11428         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11429
11430 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11431
11432         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11433
11434 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11435
11436         * inferiors.c (change_inferior_id): Add comment.
11437         * linux-low.c (check_removed_breakpoint): Add an early
11438         prototype.  Improve debug output.
11439         (linux_attach): Doc update.
11440         (linux_detach_one_process, linux_detach): Clean up before releasing
11441         each process.
11442         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11443         * linux-low.h (struct process_info): Doc improvement.
11444         * mem-break.c (delete_all_breakpoints): New.
11445         * mem-break.h (delete_all_breakpoints): New prototype.
11446         * thread-db.c (find_first_thread): New.
11447         (thread_db_create_event): Call it instead of
11448         thread_db_find_new_threads.  Clean up unused variables.
11449         (maybe_attach_thread): Remove first thread handling.
11450         (thread_db_find_new_threads): Use find_first_thread.
11451         (thread_db_get_tls_address): Likewise.
11452
11453 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11454
11455         * thread-db.c (thread_db_find_new_threads): Add prototype.
11456         (thread_db_create_event): Check for the main thread before adding
11457         a new thread.
11458         (maybe_attach_thread): Only enable event reporting if TID == 0.
11459         (thread_db_get_tls_address): Check for new threads.
11460
11461 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11462
11463         * linux-low.c (linux_create_inferior): Try execv before execvp.
11464         * spu-low.c (spu_create_inferior): Likewise.
11465
11466 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11467
11468         * linux-low.c (linux_create_inferior): Change execv to execvp.
11469         * spu-low.c (spu_create_inferior): Likewies.
11470
11471 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11472
11473         * Makefile.in (clean): Clean new files instead of deleted ones.
11474         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11475         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11476         rules.
11477         * configure.srv: Specify XML files and new regformats for MIPS and
11478         MIPS64 GNU/Linux.
11479         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11480         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11481         an entry for the restart register.
11482         (mips_cannot_fetch_register, mips_cannot_store_register)
11483         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11484         register names to match the XML descriptions.
11485         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11486         restart register instead of $0.
11487
11488 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11489             Markus Deuling  <deuling@de.ibm.com>
11490
11491         * remote-utils.c (decode_xfer_write): New function.
11492         * server.h (decode_xfer_write): Add prototype.
11493         * server.c (handle_query): Add PACKET_LEN argument.  Support
11494         qXfer:spu:read and qXfer:spu:write packets.
11495         (main): Pass packet_len to handle_query.
11496         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11497         * target.h (target_ops): Add qxfer_spu.
11498
11499 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11500
11501         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11502         accessing non-seekable spufs files.
11503
11504 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11505
11506         * server.c (handle_query): Add reply for qC packet.
11507
11508 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11509             Leo Zayas  <lerele@champenstudios@com>
11510
11511         * server.h (check_remote_input_interrupt_request): New function.
11512         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11513         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11514         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11515         (check_remote_input_interrupt_request): New function.
11516         * server.h (check_remote_input_interrupt_request): Declare.
11517         * win32-low.c (winapi_DebugBreakProcess,
11518         winapi_GenerateConsoleCtrlEvent): New typedefs.
11519         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11520         to 250 ms.
11521         (win32_wait): Check for remote interrupt request
11522         with check_remote_input_interrupt_request.
11523         (win32_request_interrupt): New function.
11524         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11525
11526 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11527
11528         * win32-low.c (debug_registers_changed,
11529         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11530         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11531         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11532         (thread_rec): Get context using the low target.
11533         (child_add_thread): Call thread_added on the low target,
11534         which does the same thing.
11535         (regptr): Delete.
11536         (do_initial_child_stuff): Remove debug registers references.
11537         Set context using the low target.  Resume threads after
11538         setting the contexts.
11539         (child_continue): Remove dead variable.  Remove debug
11540         registers references.
11541         (child_fetch_inferior_registers): Go through the low target.
11542         (do_child_store_inferior_registers): Remove.
11543         (child_store_inferior_registers): Go through the low target.
11544         (win32_resume): Remove debug registers references.
11545         Set context using the low target.
11546         (handle_exception): Change return type to void.  Don't record
11547         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11548         first chance exception.
11549         (get_child_debug_event): Change return type to void.  Remove
11550         goto loop.  Always return after waiting for debug event.
11551         (win32_wait): Convert to switch statement.  Handle spurious
11552         events.
11553
11554         * win32-i386-low.c (debug_registers_changed,
11555         debug_registers_used): New.
11556         (initial_stuff): Rename to ...
11557         (i386_initial_stuff): ... this.  Clear debug registers
11558         state variables.
11559         (store_debug_registers): Delete.
11560         (i386_get_thread_context): New.
11561         (load_debug_registers): Delete.
11562         (i386_set_thread_context): New.
11563         (i386_thread_added): New.
11564         (single_step): Rename to ...
11565         (i386_single_step): ... this.
11566         (do_fetch_inferior_registers): Rename to ...
11567         (i386_fetch_inferior_register): ... this.
11568         (i386_store_inferior_register): New.
11569         (the_low_target): Adapt to new interface.
11570
11571         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11572         (arm_get_thread_context): New.
11573         (arm_set_thread_context): New.
11574         (regptr): New.
11575         (do_fetch_inferior_registers): Rename to ...
11576         (arm_fetch_inferior_register): ... this.
11577         (arm_store_inferior_register): New.
11578         (arm_wince_breakpoint): Reimplement as unsigned long.
11579         (arm_wince_breakpoint_len): Define.
11580         (the_low_target): Adapt to new interface.
11581
11582         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11583         load_debug_registers.  Add get_thread_context, set_thread_context,
11584         thread_added and store_inferior_register.  Rename
11585         fetch_inferior_registers to fetch_inferior_register.
11586         (regptr): Remove declaration.
11587
11588 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11589
11590         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11591         * spu-low.c (spu_detach): Likewise.
11592
11593 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11594
11595         * target.h (target_ops): Change return type of detach to int.
11596         Add join.
11597         (join_inferior): New.
11598         * server.c (main): Don't skip detach support on mingw32.
11599         If the inferior doesn't support detaching return error.
11600         Call join_inferior instead of using waitpid.
11601         * linux-low.c (linux_join): New.
11602         (linux_target_op): Add linux_join.
11603         * spu-low.c (spu_join): New.
11604         (spu_target_ops): Add spu_join.
11605         * win32-low.c (win32_detach): Adapt to new interface.
11606         Reopen current_process_handle before detaching.  Issue a child
11607         resume before detaching.
11608         (win32_join): New.
11609         (win32_target_op): Add win32_join.
11610
11611 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11612
11613         * win32-low.c (win32-attach): Fix return value.
11614         * target.h (target_ops): Describe ATTACH return values.
11615
11616 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11617
11618         * win32-low.c (GETPROCADDRESS): Define.
11619         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11620         (winapi_DebugSetProcessKillOnExit): Likewise.
11621         (win32_create_inferior): Force usage of ansi CreateProcessA.
11622         (win32_attach): Use GETPROCADDRESS.
11623         (win32_detach): Likewise.
11624
11625 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11626
11627         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11628
11629 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11630
11631         * win32-low.c: Commit leftover changes from 2007-03-29.
11632
11633 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11634
11635         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11636         fields short instead of int.  Add explicit padding.
11637         (i387_cache_to_fsave): Remove unnecessary casts.
11638         (i387_fsave_to_cache): Doc fix.
11639         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11640
11641 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11642
11643         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
11644         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
11645
11646 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11647
11648         * configure.srv (arm*-*-mingw32ce*): Move near the other
11649         arm targets.
11650
11651 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11652
11653         * configure.ac: Add errno checking.
11654         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
11655         sys/file.h and malloc.h.
11656         (AC_CHECK_DECLS): Add perror.
11657         (srv_mingwce): Handle.
11658         * configure.srv (i[34567]86-*-cygwin*): Add
11659         win32-i386-low.o to srv_tgtobj.
11660         (i[34567]86-*-mingw*): Likewise.
11661         (arm*-*-mingw32ce*): Add case.
11662         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11663         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
11664         [__MINGW32CE__] (strerror): New function.
11665         [__MINGW32CE__] (errno): Define to GetLastError.
11666         [__MINGW32CE__] (COUNTOF): New macro.
11667         (remote_open): Remove extra close call.
11668         * mem-break.c (delete_breakpoint_at): New function.
11669         * mem-break.h (delete_breakpoint_at): Declare.
11670         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11671         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
11672         [USE_WIN32API] (read, write): Add char* casts.
11673         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
11674         * server.h: Include wincecompat.h on Windows CE.
11675         [HAVE_ERRNO_H]: Check.
11676         (perror): Declare if not declared.
11677         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
11678         (perror_with_name): Remove errno declaration.
11679         * wincecompat.h: New.
11680         * wincecompat.c: New.
11681         * win32-low.h: New.
11682         * win32-arm-low.c: New.
11683         * win32-i386-low.c: New.
11684         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
11685         (OUTMSG2): Make it safe.
11686         (_T): New macro.
11687         (COUNTOF): New macro.
11688         (NUM_REGS): Get it from the low target.
11689         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
11690         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
11691         (thread_rec): Let low target handle debug registers.
11692         (child_add_thread): Likewise.
11693         (child_init_thread_list): Likewise.
11694         (continue_one_thread): Likewise.
11695         (regptr): New.
11696         (do_child_fetch_inferior_registers): Move to ...
11697         * win32-i386-low.c: ... here, and rename to ...
11698         (do_fetch_inferior_registers): ... this.
11699         * win32-low.c (child_fetch_inferior_registers):
11700         Go through the low target.
11701         (do_child_store_inferior_registers): Use regptr.
11702         (strwinerror): New function.
11703         (win32_create_inferior): Handle Windows CE.
11704         Use strwinerror instead of strerror on Windows error
11705         codes.  Add program to the error output.
11706         Don't close the main thread handle on Windows CE.
11707         (win32_attach): Use coredll.dll on Windows CE.
11708         (win32_kill): Close current process and current
11709         thread handles.
11710         (win32_detach): Use coredll.dll on Windows CE.
11711         (win32_resume): Let low target handle debug registers, and
11712         step request.
11713         (handle_exception): Add/Remove initial breakpoint.  Avoid
11714         non-existant WSTOPSIG on Windows CE.
11715         (win32_read_inferior_memory): Cast to remove warning.
11716         (win32_arch_string): Go through the low target.
11717         (initialize_low): Call set_breakpoint_data with the low
11718         target's breakpoint.
11719         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
11720         FOP_REGNUM, mappings): Move to ...
11721         * win32-i386-low.c: ... here.
11722         * win32-low.c (win32_thread_info): Move to ...
11723         * win32-low.h: ... here.
11724         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
11725         win32-arm-low.c and wincecompat.c.
11726         (all:): Add $EXEEXT.
11727         (install-only:): Likewise.
11728         (gdbserver:): Likewise.
11729         (gdbreplay:): Likewise.
11730         * config.in: Regenerate.
11731         * configure: Regenerate.
11732
11733 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11734
11735         * win32-low.c: Rename typedef thread_info to
11736         win32_thread_info throughout.
11737
11738 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11739
11740         * win32-i386-low.c: Rename to ...
11741         * win32-low.c: ... this.
11742         * configure.srv: Replace win32-i386-low.o with win32-low.o.
11743         * Makefile.in: Likewise.
11744
11745 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
11746
11747         * remote-utils.c (monitor_output): Constify msg parameter.
11748         * server.h (monitor_output): Likewise.
11749         * win32-i386-low.c (handle_output_debug_string): New.
11750         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
11751         handle_output_debug_string.
11752         (get_child_debug_event): Likewise.
11753
11754 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
11755
11756         * server.c (main): Correct strtoul check.
11757
11758 2007-03-27  Jon Ringle  <jon@ringle.org>
11759
11760         * linux-low.c: Check __ARCH_HAS_MMU__ also.
11761
11762 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
11763
11764         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
11765
11766 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
11767
11768         * terminal.h: Check HAVE_SGTTY_H.
11769
11770 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
11771
11772         * remote-utils.c (remote_open): Print out the assigned port number.
11773
11774 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
11775
11776         * remote-utils.c (monitor_output): New function.
11777         * server.c (debug_threads): Define here.
11778         (monitor_show_help): New function.
11779         (handle_query): Handle qRcmd.
11780         (main): Do not handle 'd' packet.
11781         * server.h (debug_threads, remote_debug, monitor_output): Declare.
11782         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
11783         of debug_threads.
11784
11785 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11786
11787         * Makefile.in (EXEEXT): New.
11788         (clean): Use $(EXEEXT).
11789
11790 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11791
11792         * target.h (target_ops): Rename send_signal to request_interrupt,
11793         and remove enum target_signal parameter.
11794         * linux-low.c (linux_request_interrupt): Rename from
11795         linux_send_signal, and always send SIGINT.
11796         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
11797         and always send SIGINT.
11798         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
11799         of send_signal.
11800         (input_interrupt): Likewise.
11801
11802 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11803
11804         * server.c (get_features_xml): Check if target implemented
11805         arch_string.
11806         * win32-i386-low.c (win32_arch_string): New.
11807         (win32_target_ops): Add win32_arch_string as arch_string member.
11808
11809 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
11810
11811         * spu-low.c (spu_arch_string): New.
11812         (spu_target_ops): Add spu_arch_string.
11813
11814 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
11815
11816         * remote-utils.c: Remove HAVE_TERMINAL_H check.
11817         * configure.ac: Do not check for terminal.h.
11818         * configure, config.in: Regenerated.
11819
11820 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11821
11822         * Makefile.in (OBS): Add $(XML_BUILTIN).
11823         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
11824         (clean): Update.
11825         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
11826         (arm-with-iwmmxt.c): New.
11827         * config.in, configure: Regenerate.
11828         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
11829         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
11830         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
11831         (arm*-*-linux*): Add iWMMXt and regset support.
11832         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
11833         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
11834         (arm_store_wmmxregset, target_regsets): New.
11835         * server.c (get_features_xml): Take annex argument.  Check builtin
11836         XML documents.
11837         (handle_query): Handle multiple annexes.
11838
11839 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11840
11841         * remote-utils.c [USE_WIN32API] (read, write): Define.
11842         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
11843         write.
11844
11845 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
11846
11847         * linux-i386-low.c (the_low_target): Set arch_string.
11848         * linux-x86-64-low.c (the_low_target): Likewise.
11849         * linux-low.c (linux_arch_string): New.
11850         (linux_target_ops): Add it.
11851         * linux-low.h (struct linux_target_ops): Add arch_string.
11852         * server.c (write_qxfer_response): Use const void * for DATA.
11853         (get_features_xml): New.
11854         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
11855         * target.h (struct target_ops): Add arch_string method.
11856
11857 2007-01-03  Denis Pilat  <denis.pilat@st.com>
11858             Daniel Jacobowitz  <dan@codesourcery.com>
11859
11860         * linux-low.c (linux_kill): Handle being called with no threads.
11861         * win32-i386-low.c (win32_kill): Likewise.
11862         (get_child_debug_event): Clear current_process_handle.
11863
11864 2006-12-30  Denis PILAT  <denis.pilat@st.com>
11865             Daniel Jacobowitz  <dan@codesourcery.com>
11866
11867         * remote-utils.c (remote_open): Check the type of specified
11868         serial port devices before opening them.
11869         * server.c (main): Kill the inferior if an error occurs during
11870         the first remote_open.
11871
11872 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
11873
11874         * README: Update supported targets.
11875
11876 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
11877
11878         * Makefile.in (clean): Remove reg-mips64.c.
11879         (reg-mips64.c, reg-mips64.o): New rules.
11880         * configure.srv: Handle mips64.  Include regset support for mips.
11881         * linux-mips-low.c (union mips_register): New.
11882         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
11883         (mips_breakpoint, mips_breakpoint_at): Use int.
11884         (mips_collect_register, mips_supply_register)
11885         (mips_collect_register_32bit, mips_supply_register_32bit)
11886         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
11887         (mips_store_fpregset, target_regsets): New.
11888         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
11889
11890 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
11891
11892         * configure.srv: Add target "spu*-*-*".
11893         * Makefile.in (clean): Remove reg-spu.c.
11894         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
11895         * spu-low.c: New file.
11896
11897 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11898
11899         * configure.ac: Correct td_thr_tls_get_addr test.
11900         * configure: Regenerated.
11901
11902 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11903
11904         * linux-low.c (linux_wait_for_event): Reformat.  Use the
11905         pass_signals array.
11906         * remote-utils.c (decode_address_to_semicolon): New.
11907         * server.c (pass_signals, handle_general_set): New.
11908         (handle_query): Mention QPassSignals for qSupported.
11909         (main): Call handle_general_set.
11910         * server.h (pass_signals, decode_address_to_semicolon): New.
11911
11912 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
11913
11914         * server.c (handle_query): Correct error handling for read_auxv.
11915
11916 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
11917
11918         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
11919         and srv_linux_thread_db to yes.
11920         * linux-s390-low.c (s390_fill_gregset): New function.
11921         (target_regsets): Define data structure.
11922
11923 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
11924
11925         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
11926         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
11927         * config.in, configure: Regenerated.
11928         * inferiors.c (gdb_id_to_thread): New function.
11929         (gdb_id_to_thread_id): Use it.
11930         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
11931         * linux-low.h (struct process_info): Add th member.
11932         (thread_db_get_tls_address): New prototype.
11933         * remote-utils.c (decode_address): Make non-static.
11934         * server.c (handle_query): Handle qGetTLSAddr.
11935         * server.h (gdb_id_to_thread, decode_address): New prototypes.
11936         * target.h (struct target_ops): Add get_tls_address.
11937         * thread-db.c (maybe_attach_thread): Save the thread handle.
11938         (thread_db_get_tls_address): New.
11939
11940 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
11941
11942         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
11943         (linux_resume_one_process): Take a siginfo_t *.  Update all
11944         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
11945         (struct pending_signals): Add a siginfo_t.
11946         (linux_wait_for_process): Always set last_status.
11947         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
11948         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
11949         * linux-low.h (struct process_info): Add last_status.
11950
11951 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
11952
11953         * remote-utils.c (try_rle): New function.
11954         (putpkt_binary): Use it.
11955
11956 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
11957
11958         * Makefile.in (clean): Clean reg-x86-64-linux.c.
11959         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
11960         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
11961         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
11962         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
11963         point registers.
11964
11965 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
11966
11967         * server.c (terminal_fd): New variable.
11968         (old_foreground_pgrp): Likewise.
11969         (restore_old_foreground_pgrp): New function.
11970         (start_inferior): Record the terminal file descriptor in terminal_fd
11971         and its original foreground group in old_foreground_pgrp.  Register
11972         restore_old_foreground_pgrp with atexit().
11973
11974 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
11975
11976         * server.c (handle_query): Correct qPart to qXfer.
11977
11978 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
11979
11980         * configure.ac: Check for more headers which are missing on
11981         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
11982         * configure.srv: Add Cygwin and mingw32.
11983         * remote-utils.c: Don't include headers unconditionally which
11984         are missing on mingw32.  Include <winsock.h> for mingw32.
11985         (remote_open): Adjust for mingw32 support.  Flush
11986         standard error after writing to it.
11987         (remote_close, putpkt_binary, input_interrupt, block_async_io)
11988         (unblock_async_io, enable_async_io, disable_async_io)
11989         (readchar, getpkt): Update for Winsock support.
11990         (prepare_resume_reply): Expect a protocol signal number.
11991         * server.c: Disable <sys/wait.h> on mingw32.
11992         (start_inferior): Adjust for mingw32 support.  Flush
11993         standard error after writing to it.
11994         (attach_inferior): Likewise.  Use protocol signal
11995         numbers.
11996         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
11997         and names.
11998         * win32-i386-low.c: New file.
11999         * Makefile.in (XM_CLIBS): Set.
12000         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
12001         (win32-i386-low.o): New dependency rule.
12002         * linux-low.c (linux_wait): Use target signal numbers.
12003         * target.h (struct target_ops): Doc fix.
12004         * server.h (target_signal_to_name): New prototype.
12005         * gdbreplay.c: Don't include headers unconditionally which
12006         are missing on mingw32.  Include <winsock.h> for mingw32.
12007         (remote_close, remote_open): Adjust for Winsock support.
12008         * configure, config.in: Regenerated.
12009
12010 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12011
12012         * server.c (decode_xfer_read, write_qxfer_response): New.
12013         (handle_query): Take a packet length argument.  Handle
12014         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
12015         the qSupported response.
12016         (main): Update call to handle_query.
12017
12018 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
12019
12020         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
12021         (putpkt_binary): Renamed from putpkt and adjusted for binary
12022         data.
12023         (putpkt): New wrapper for putpkt_binary.
12024         (readchar): Don't mask off the high bit.
12025         (decode_X_packet): New function.
12026         * server.c (main): Call putpkt_binary if a handler sets the packet
12027         length.  Save the length of the incoming packet.  Handle 'X'.
12028         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
12029
12030 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
12031
12032         * server.c (handle_query): Handle qSupported.
12033
12034 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12035
12036         * remote-utils.c (all_symbols_looked_up): New variable.
12037         (look_up_one_symbol): Check it.
12038         * server.h (look_up_one_symbol): New declaration.
12039         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
12040
12041 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12042
12043         * Makefile.in (linux-arm-low.o): Update dependencies.
12044         * linux-arm-low.c: Include "gdb_proc_service.h".
12045         (PTRACE_GET_THREAD_AREA): Define.
12046         (ps_get_thread_area): New function.
12047
12048 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
12049
12050         * configure.srv (m68k*-*-uclinux*): New target.
12051         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
12052         (linux_resume_one_process): Remove extraneous cast.
12053         (linux_read_offsets): New.
12054         (linux_target_op): Add linux_read_offsets on mmuless systems.
12055         * server.c (handle_query): Add qOffsets logic.
12056         * target.h (struct target_ops): Add read_offsets.
12057
12058 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12059
12060         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
12061         (PTRACE_GET_THREAD_AREA): Define.
12062         (ps_get_thread_area): New function.
12063         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
12064         (linux-x86-64-low.o): Update.
12065
12066 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12067
12068         * configure.ac: Remove checks for prfpregset_t.
12069         * gdb_proc_service.h: New file.
12070         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
12071         new "gdb_proc_service.h".
12072         * proc-service.c: Likewise.
12073         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
12074         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
12075         * Makefile.in (gdb_proc_service_h): Updated.
12076         * configure, config.in: Regenerated.
12077
12078 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12079
12080         * remote-utils.c (prepare_resume_reply): Move declaration
12081         of gdb_id_from_wait to the top of the block.
12082
12083 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
12084
12085         * linux-low.c (regsets_store_inferior_registers): Read the regset
12086         from the target before filling it.
12087
12088 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12089
12090         * server.c (attach_inferior): Return SIGTRAP for a successful
12091         attach.
12092
12093 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
12094
12095         * Makefile.in (OBS): Add version.o.
12096         (STAGESTUFF): Delete.
12097         (version.o): Add dependencies.
12098         (version.c): Replace rule.
12099         (clean): Remove version.c.
12100         * server.c (gdbserver_version): New.
12101         (gdbserver_usage): Use printf.
12102         (main): Handle --version and --help.
12103         * server.h (version, host_name): Add declarations.
12104
12105 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
12106
12107         * linux-arm-low.c:
12108         * linux-arm-low.c:
12109         * inferiors.c:
12110         * i387-fp.h:
12111         * i387-fp.c:
12112         * gdbreplay.c:
12113         * regcache.c:
12114         * proc-service.c:
12115         * mem-break.h:
12116         * mem-break.c:
12117         * linux-x86-64-low.c:
12118         * linux-sh-low.c:
12119         * linux-s390-low.c:
12120         * linux-ppc64-low.c:
12121         * linux-ppc-low.c:
12122         * linux-mips-low.c:
12123         * linux-m68k-low.c:
12124         * linux-m32r-low.c:
12125         * linux-low.h:
12126         * linux-low.c:
12127         * linux-ia64-low.c:
12128         * linux-i386-low.c:
12129         * linux-crisv32-low.c:
12130         * thread-db.c:
12131         * terminal.h:
12132         * target.h:
12133         * target.c:
12134         * server.h:
12135         * server.c:
12136         * remote-utils.c:
12137         * regcache.h:
12138         * utils.c:
12139         * Makefile.in:
12140         * configure.ac:
12141         * gdbserver.1: Add (C) after Copyright.  Update the FSF
12142         address.
12143
12144 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
12145
12146         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
12147         (arm_breakpoint_at): Recognize both breakpoints.
12148         (the_low_target): Use the correct breakpoint instruction.
12149
12150 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
12151
12152         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
12153         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
12154         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
12155         (the_low_target): Update.
12156
12157 2005-10-25  Andreas Schwab  <schwab@suse.de>
12158
12159         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12160
12161         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12162         (ia64_num_regs): Reduce to 462.
12163
12164 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12165
12166         * acinclude.m4: Correct quoting.
12167         * aclocal.m4: Regenerated.
12168
12169         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12170         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12171         (thread_db_init): Call thread_db_err_str.
12172         * configure.ac: Check for TD_VERSION.
12173         * config.in, configure: Regenerated.
12174
12175 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12176
12177         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12178
12179 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12180
12181         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12182         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12183         * config.in, configure: Regenerated.
12184         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12185         * linux-i386-low.c, linux-m68k-low.c: Update to use
12186         HAVE_PTRACE_GETREGS.
12187         * linux-low.c (regsets_fetch_inferior_registers)
12188         (regsets_store_inferior_registers): Only return 0 if we processed
12189         GENERAL_REGS.
12190         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12191         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12192
12193 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12194
12195         * inferiors.c (struct thread_info): Add gdb_id.
12196         (add_thread): Add gdb_id argument.
12197         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12198         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12199         calls to add_thread.
12200         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12201         * server.c (handle_query): Use thread_to_gdb_id.
12202         (handle_v_cont, main): Use gdb_id_to_thread_id.
12203         * server.h (add_thread): Update prototype.
12204         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12205         prototypes.
12206
12207 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12208
12209         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12210         left-padded registers.
12211         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12212         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12213
12214 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12215
12216         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12217         * configure: Regenerate.
12218         * config.in: Regenerate.
12219         * server.h (NEED_DECLARATION_STRERROR):
12220         Replace with !HAVE_DECL_STRERROR.
12221
12222 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12223
12224         * linux-low.c (linux_wait, linux_send_signal): Don't test
12225         an unsigned long variable for > 0 if it could be MAX_ULONG.
12226         * server.c (myresume): Likewise.
12227         * target.c (set_desired_inferior): Likewise.
12228
12229 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12230
12231         * configure.ac: Simplify and improve check for socklen_t.
12232         * configure, config.in: Regenerate.
12233
12234 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12235
12236         * acconfig.h: Remove.
12237         * configure.ac: Add a test for socklen_t.  Use three-argument
12238         AC_DEFINE throughout.
12239         * config.in: Regenerated using autoheader 2.59.
12240         * configure: Regenerated.
12241
12242         * gdbreplay.c (socklen_t): Provide a default.
12243         (remote_open): Use socklen_t.
12244         * remote-utils.c (socklen_t): Provide a default.
12245         (remote_open): Use socklen_t.
12246         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12247         unsigned char.
12248
12249         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12250         char for buffers.
12251         * linux-low.c (linux_read_memory, linux_write_memory)
12252         (linux_read_auxv): Likewise.
12253         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12254         (check_mem_write): Likewise.
12255         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12256         Likewise.
12257         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12258         (registers_from_string, register_data): Likewise.
12259         * server.c (handle_query, main): Likewise.
12260         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12261         (decode_M_packet): Likewise.
12262         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12263         * target.h (struct target_ops): Update read_memory, write_memory,
12264         and read_auxv.
12265         (read_inferior_memory, write_inferior_memory): Update.
12266         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12267         to unsigned char *.
12268         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12269         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12270         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12271         linux-s390-low.c, linux-sh-low.c: Update for changes in
12272         read_inferior_memory and the_low_target->breakpoint.
12273
12274 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12275
12276         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12277         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12278         * configure.srv: Add powerpc64-*-linux*.
12279         * linux-ppc64-low.c: New file.
12280
12281 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12282
12283         * linux-cris-low.c: New file with support for CRIS.
12284         * linux-crisv32-low.c: Ditto for CRISv32.
12285         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12286         (clean): Add reg-cris.c and reg-crisv32.c.
12287         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12288         reg-crisv32.o, and reg-crisv32.c to make rules.
12289         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12290         recognized targets.
12291
12292 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12293
12294         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12295         of sizeof (PTRACE_XFER_TYPE).
12296         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12297
12298 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12299
12300         * target.h (struct target_ops): Add insert_watchpoint,
12301         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12302         pointers for hardware watchpoint support.
12303         * linux-low.h (struct linux_target_ops): Ditto.
12304         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12305         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12306         to linux_target_ops.
12307         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12308         reply packet.
12309         * server.c (main): Recognize 'Z' and 'z' packets.
12310
12311 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12312
12313         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12314         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12315         (the_low_target): Add new members.
12316
12317 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12318
12319         * proc-service.c (ps_lgetregs): Search all_processes instead of
12320         all_threads.
12321
12322 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12323
12324         * server.c (start_inferior): Change return type to int.
12325         (attach_inferior): Change sigptr to int *.
12326         (handle_v_cont, handle_v_requests): Change signal to int *.
12327         (main): Change signal to int.
12328
12329 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12330
12331         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12332         * configure.srv: Add m32r*-*-linux*.
12333         * linux-m32r-low.c: New file.
12334
12335 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12336
12337         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12338
12339 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12340
12341         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12342         Take unsigned long arguments for PIDs.
12343         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12344         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12345         (wait_for_sigstop, linux_resume_one_process)
12346         (regsets_fetch_inferior_registers, linux_send_signal)
12347         (linux_read_auxv): Likewise.  Update the types of variables holding
12348         PIDs.  Update format string specifiers.
12349         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12350         * remote-utils.c (prepare_resume_reply): Likewise.
12351         * server.c (cont_thread, general_thread, step_thread)
12352         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12353         unsigned long.
12354         (handle_query): Update format specifiers.
12355         (handle_v_cont, main): Use strtoul for thread IDs.
12356         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12357         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12358         (general_thread, step_thread, thread_from_wait)
12359         (old_thread_from_wait): Update.
12360         * target.h (struct thread_resume): Use unsigned long for THREAD.
12361         (struct target_ops): Use unsigned long for arguments to attach and
12362         thread_alive.
12363
12364 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12365
12366         * acinclude.m4: Include bfd/bfd.m4 directly.
12367         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12368         <agriffis@toolchain.org>.
12369         * aclocal.m4, configure: Regenerated.
12370
12371 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12372
12373         * configure.ac: Rename configure.in, require autoconf 2.59.
12374         * configure: Re-generate.
12375
12376 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12377
12378         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12379         LIBS when finished.
12380         * aclocal.m4: Regenerated.
12381         * configure: Regenerated.
12382
12383 2004-11-21  Andreas Schwab  <schwab@suse.de>
12384
12385         * linux-m68k-low.c (m68k_num_gregs): Define.
12386         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12387         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12388         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12389         (m68k_breakpoint_at): New.  Add to the_low_target.
12390
12391         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12392         srv_linux_thread_db to yes.
12393
12394 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12395
12396         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12397         (ARCH_SET_FS): Likewise.
12398         (ARCH_GET_FS): Likewise.
12399         (ARCH_GET_GS): Likewise.
12400
12401 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12402
12403         * linux-i386-low.c (ps_get_thread_area): New.
12404         * linux-x86-64-low.c (ps_get_thread_area): New.
12405         * linux-low.c: Include <sys/syscall.h>.
12406         (linux_kill_one_process): Don't kill the first thread here.
12407         (linux_kill): Kill the first thread here.
12408         (kill_lwp): New function.
12409         (send_sigstop, linux_send_signal): Use it.
12410         * proc-service.c: Clean up #ifdefs.
12411         (fpregset_info): Delete.
12412         (ps_lgetregs): Update and enable implementation.
12413         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12414         implementations.
12415         * remote-utils.c (struct sym_cache, symbol_cache): New.
12416         (input_interrupt): Print a clearer message.
12417         (async_io_enabled): New variable.
12418         (enable_async_io, disable_async_io): Use it.  Update comments.
12419         (look_up_one_symbol): Use the symbol cache.
12420         * thread-db.c (thread_db_look_up_symbols): New function.
12421         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12422
12423 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12424
12425         * configure.in: Test for -rdynamic.
12426         * configure: Regenerated.
12427         * Makefile (INTERNAL_LDFLAGS): New.
12428         (gdbserver, gdbreplay): Use it.
12429
12430 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12431
12432         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12433
12434 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12435
12436         * linux-low.c (linux_wait): Clear all_processes list also.
12437
12438 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12439
12440         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12441         errno.
12442
12443 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12444
12445         * gdbreplay.c, server.h, utils.c: Update copyright years.
12446
12447 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12448
12449         * server.c (main): Print child status or termination signal from
12450         variable 'signal', not 'sig'.
12451
12452 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12453
12454         * linux-low.c (linux_read_memory): Change return type to
12455         int.  Check for and return error from ptrace().
12456         * target.c (read_inferior_memory): Change return type to int.  Pass
12457         back return status from the_target->read_memory().
12458         * target.h (struct target_ops): Adapt *read_memory() prototype.
12459         Update comment.
12460         (read_inferior_memory): Adapt prototype.
12461         * server.c (main): Return an error packet if
12462         read_inferior_memory() returns an error.
12463
12464 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12465
12466         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12467         Unify with other clean targets.
12468
12469 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12470
12471         * server.c (handle_v_cont): Call set_desired_inferior.
12472
12473 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12474
12475         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12476
12477 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12478
12479         * linux-low.c (linux_wait): Unblock async I/O.
12480         (linux_resume): Block and enable async I/O.
12481         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12482         * server.h (block_async_io, unblock_async_io): Add prototypes.
12483
12484 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12485
12486         * remote-utils.c (remote_open): Print a status notice after
12487         opening a TCP port.
12488         * server.c (attach_inferior): Print a status notice after
12489         attaching.
12490
12491 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12492
12493         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12494
12495 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12496
12497         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12498         error packet.
12499         * server.c, target.h: Update copyright years.
12500
12501 2004-02-25  Roland McGrath  <roland@redhat.com>
12502
12503         * target.h (struct target_ops): New member `read_auxv'.
12504         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12505         * linux-low.c (linux_read_auxv): New function.
12506         (linux_target_ops): Initialize `read_auxv' member to that.
12507
12508 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12509
12510         Committed by Jim Blandy  <jimb@redhat.com>.
12511
12512         * linux-s390-low.c (s390_num_regs): Update.
12513         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12514         instead of GPR_SIZE to distiguish s390 and s390x targets.
12515
12516 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12517
12518         * linux-low.c: Update copyright year.
12519         (check_removed_breakpoint): Clear pending_is_breakpoint.
12520         (linux_set_resume_request, linux_queue_one_thread)
12521         (resume_status_pending_p): New functions.
12522         (linux_continue_one_thread): Use process->resume.
12523         (linux_resume): Only resume threads if there are no pending events.
12524         * linux-low.h (struct process_info): Add resume request
12525         pointer.
12526
12527 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12528
12529         * regcache.c (new_register_cache): Clear the allocated register
12530         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12531
12532 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12533
12534         * linux-low.c (linux_resume): Take a struct thread_resume *
12535         argument.
12536         (linux_wait): Update call.
12537         (resume_ptr): New static variable.
12538         (linux_continue_one_thread): Renamed from
12539         linux_continue_one_process.  Use resume_ptr.
12540         (linux_resume): Use linux_continue_one_thread.
12541         * server.c (handle_v_cont, handle_v_requests): New functions.
12542         (myresume): New function.
12543         (main): Handle 'v' case.
12544         * target.h (struct thread_resume): New type.
12545         (struct target_ops): Change argument of "resume" to struct
12546         thread_resume *.
12547         (myresume): Delete macro.
12548
12549 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12550
12551         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12552         (uninstall): Support DESTDIR.
12553
12554 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12555
12556         * configure.srv: Add xscale*linux copy of arm*linux entry.
12557
12558 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12559
12560         * linux-arm-low.c (arm_reinsert_addr): New function.
12561         (the_low_target): Add arm_reinsert_addr.
12562
12563 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12564
12565         * mem-break.c: Remove whitespace at end of file.
12566
12567 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12568
12569         * configure.in: Check whether we need to prototype strerror.
12570         * server.h: Optionally prototype strerror.
12571         * gdbreplay.c (perror_with_name): Use strerror.
12572         * linux-low.c (linux_attach_lwp): Use strerror.
12573         * utils.c (perror_with_name): Use strerror.
12574         * config.in, configure: Regenerated.
12575
12576 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12577
12578         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12579         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12580
12581 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12582
12583         * Makefile.in (SFILES): Update.
12584         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12585         low-sun3.c: Remove files.
12586
12587 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12588
12589         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12590         (linux_detach_one_process, linux_detach): New functions.
12591         (linux_target_ops): Add linux_detach.
12592         * server.c (main): Handle 'D' packet.
12593         * target.h (struct target_ops): Add "detach" member.
12594         (detach_inferior): Define.
12595
12596 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12597
12598         From Kelley Cook  <kelleycook@wideopenwest.com>:
12599         * configure.srv: Accept i[34567]86 variants.
12600
12601 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12602
12603         * linux-low.c (linux_wait_for_event): Correct comment typos.
12604         (linux_resume_one_process): Call check_removed_breakpoint.
12605         (linux_send_signal): New function.
12606         (linux_target_ops): Add linux_send_signal.
12607         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12608         of kill.
12609         * target.h (struct target_ops): Add send_signal.
12610
12611 2003-05-29  Jim Blandy  <jimb@redhat.com>
12612
12613         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12614         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12615         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12616         away part of the register's value.
12617
12618 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12619
12620         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12621         (linux_wait_for_event, linux_init_signals): Likewise.
12622
12623 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12624
12625         * configure.in: Check for stdlib.h.
12626         * configure: Regenerated.
12627         * config.in: Regenerated.
12628
12629 2003-01-04  Andreas Schwab  <schwab@suse.de>
12630
12631         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12632
12633 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12634
12635         * Makefile.in: Remove obsolete code.
12636
12637 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12638
12639         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12640         defined(PT_FPR0_HI).
12641
12642 2002-11-17  Stuart Hughes  <seh@zee2.com>
12643
12644         * linux-arm-low.c (arm_num_regs): Increase.
12645         (arm_regmap): Include status register.
12646
12647 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
12648
12649         * linux-low.c (register_addr): Remove incorrect -1 check.
12650
12651 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
12652
12653         * linux-low.c (linux_create_inferior): Call setpgid.  Return
12654         the new PID.
12655         (unstopped_p, linux_signal_pid): Remove.
12656         (linux_target_ops): Remove linux_signal_pid.
12657         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
12658         global instead of target method.
12659         * target.h (struct target_ops): Remove signal_pid.  Update comment
12660         for create_inferior.
12661         * server.c (signal_pid): New variable.
12662         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
12663         gdbserver.  Set the child to be the foreground process group.
12664         (attach_inferior): Set signal_pid.
12665
12666 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
12667
12668         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
12669
12670 2002-08-20  Jim Blandy  <jimb@redhat.com>
12671
12672         * Makefile.in (LDFLAGS): Allow the configure script to establish a
12673         default for this.
12674
12675 2002-08-01  Andrew Cagney  <cagney@redhat.com>
12676
12677         * Makefile.in: Make chill references obsolete.
12678
12679 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
12680
12681         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
12682         * configure: Regenerate.
12683         * config.in: Regenerate.
12684
12685 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
12686
12687         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
12688         (perror_with_name, remote_close, remote_open, expect, play): Static.
12689
12690 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
12691
12692         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
12693         byte offsets instead of an array of indexes.
12694         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
12695
12696 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
12697
12698         * regcache.c: Add comment.
12699
12700 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
12701
12702         * thread-db.c: New file.
12703         * proc-service.c: New file.
12704         * acinclude.m4: New file.
12705         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
12706         proc-service.o, and thread-db.o.
12707         (linux-low.o): Add USE_THREAD_DB.
12708         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
12709         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
12710         * aclocal.m4: Regenerated.
12711         * config.in: Regenerated.
12712         * configure: Regenerated.
12713         * configure.in: Check for proc_service.h, sys/procfs.h,
12714         thread_db.h, and linux/elf.h headrs.
12715         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
12716         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
12717         Check for -lthread_db and thread support.
12718         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
12719         PowerPC, and SuperH.
12720         * i387-fp.c: Constify arguments.
12721         * i387-fp.h: Likewise.
12722         * inferiors.c: (struct thread_info): Renamed from
12723         `struct inferior_info'.  Remove PID member.  Use generic inferior
12724         list header.  All uses updated.
12725         (inferiors, signal_pid): Removed.
12726         (all_threads): New variable.
12727         (get_thread): Define.
12728         (add_inferior_to_list): New function.
12729         (for_each_inferior): New function.
12730         (change_inferior_id): New function.
12731         (add_inferior): Removed.
12732         (remove_inferior): New function.
12733         (add_thread): New function.
12734         (free_one_thread): New function.
12735         (remove_thread): New function.
12736         (clear_inferiors): Use for_each_inferior and free_one_thread.
12737         (find_inferior): New function.
12738         (find_inferior_id): New function.
12739         (inferior_target_data): Update argument type.
12740         (set_inferior_target_data): Likewise.
12741         (inferior_regcache_data): Likewise.
12742         (set_inferior_regcache_data): Likewise.
12743         * linux-low.c (linux_bp_reinsert): Remove.
12744         (all_processes, stopping_threads, using_thrads)
12745         (struct pending_signals, debug_threads, pid_of): New.
12746         (inferior_pid): Replace with macro.
12747         (struct inferior_linux_data): Remove.
12748         (get_stop_pc, add_process): New functions.
12749         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
12750         Use add_process and add_thread.
12751         (linux_attach_lwp): New function, based on old linux_attach.  Use
12752         add_process and add_thread.  Set stop_expected for new threads.
12753         (linux_attach): New function.
12754         (linux_kill_one_process): New function.
12755         (linux_kill): Kill all LWPs.
12756         (linux_thread_alive): Use find_inferior_id.
12757         (check_removed_breakpoints, status_pending_p): New functions.
12758         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
12759         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
12760         struct for the found process.
12761         (linux_wait_for_event): New function.
12762         (linux_wait): Use it.  Support LWPs.
12763         (send_sigstop, wait_for_sigstop, stop_all_processes)
12764         (linux_resume_one_process, linux_continue_one_process): New functions.
12765         (linux_resume): Support LWPs.
12766         (REGISTER_RAW_SIZE): Remove.
12767         (fetch_register): Use register_size instead.  Call supply_register.
12768         (usr_store_inferior_registers): Likewise.  Call collect_register.
12769         Fix recursive case.
12770         (regsets_fetch_inferior_registers): Improve error message.
12771         (regsets_store_inferior_registers): Add debugging.
12772         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
12773         (unstopped_p, linux_signal_pid): New functions.
12774         (linux_target_ops): Add linux_signal_pid.
12775         (linux_init_signals): New function.
12776         (initialize_low): Call it.  Initialize using_threads.
12777         * regcache.c (inferior_regcache_data): Add valid
12778         flag.
12779         (get_regcache): Fetch registers lazily.  Add fetch argument
12780         and update all callers.
12781         (regcache_invalidate_one, regcache_invalidate): New
12782         functions.
12783         (new_register_cache): Renamed from create_register_cache.
12784         Return the new regcache.
12785         (free_register_cache): Change argument to a void *.
12786         (registers_to_string, registers_from_string): Call get_regcache
12787         with fetch flag set.
12788         (register_data): Make static.  Pass fetch flag to get_regcache.
12789         (supply_register): Call get_regcache with fetch flag clear.
12790         (collect_register): Call get_regcache with fetch flag set.
12791         (collect_register_as_string): New function.
12792         * regcache.h: Update.
12793         * remote-utils.c (putpkt): Flush after debug output and use
12794         stderr.
12795         Handle input interrupts while waiting for an ACK.
12796         (input_interrupt): Use signal_pid method.
12797         (getpkt): Flush after debug output and use stderr.
12798         (outreg): Use collect_register_as_string.
12799         (new_thread_notify, dead_thread_notify): New functions.
12800         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
12801         and general_thread.
12802         (look_up_one_symbol): Flush after debug output.
12803         * server.c (step_thread, server_waiting): New variables.
12804         (start_inferior): Don't use signal_pid.  Update call to mywait.
12805         (attach_inferior): Update call to mywait.
12806         (handle_query): Handle qfThreadInfo and qsThreadInfo.
12807         (main): Don't fetch/store registers explicitly.  Use
12808         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
12809         calls to mywait.
12810         * server.h: Update.
12811         (struct inferior_list, struct_inferior_list_entry): New.
12812         * target.c (set_desired_inferior): New.
12813         (write_inferior_memory): Constify.
12814         (mywait): New function.
12815         * target.h: Update.
12816         (struct target_ops): New signal_pid method.
12817         (mywait): Removed macro, added prototype.
12818
12819         * linux-low.h (regset_func): Removed.
12820         (regset_fill_func, regset_store_func): New.
12821         (enum regset_type): New.
12822         (struct regset_info): Add type field.  Use new operation types.
12823         (struct linux_target_ops): stop_pc renamed to get_pc.
12824         Add decr_pc_after_break and breakpoint_at.
12825         (get_process, get_thread_proess, get_process_thread)
12826         (strut process_info, all_processes, linux_attach_lwp)
12827         (thread_db_init): New.
12828
12829         * linux-arm-low.c (arm_get_pc, arm_set_pc,
12830         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
12831         (the_low_target): Add new members.
12832         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
12833         (i386_store_fpxregset): Constify.
12834         (target_regsets): Add new kind identifier.
12835         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
12836         (i386_set_pc): Add debugging.
12837         (i386_breakpoint_at): New function.
12838         (the_low_target): Add new members.
12839         * linux-mips-low.c (mips_get_pc, mips_set_pc)
12840         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
12841         (mips_breakpoint_at): New.
12842         (the_low_target): Add new members.
12843         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
12844         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
12845         (the_low_target): Add new members.
12846         * linux-sh-low.c (sh_get_pc, sh_set_pc)
12847         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
12848         (the_low_target): Add new members.
12849         * linux-x86-64-low.c (target_regsets): Add new kind
12850         identifier.
12851
12852 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
12853
12854         From Martin Pool <mbp@samba.org>:
12855         * server.c (gdbserver_usage): New function.
12856         (main): Call it.
12857
12858 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
12859
12860         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
12861         stop_at -> stop_pc.
12862
12863 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
12864
12865         * Makefile.in: Remove obsolete code.
12866
12867 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
12868
12869         * linux-low.c (regsets_fetch_inferior_registers),
12870         (regsets_store_inferior_registers): Removed cast to int from
12871         ptrace() calls.
12872         * regcache.h: Added declaration of struct inferior_info.
12873
12874 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12875
12876         * inferiors.c (struct inferior_info): Add regcache_data.
12877         (add_inferior): Call create_register_cache.
12878         (clear_inferiors): Call free_register_cache.
12879         (inferior_regcache_data, set_inferior_regcache_data): New functions.
12880         * regcache.c (struct inferior_regcache_data): New.
12881         (registers): Remove.
12882         (get_regcache): New function.
12883         (create_register_cache, free_register_cache): New functions.
12884         (set_register_cache): Don't initialize the register cache here.
12885         (registers_to_string, registers_from_string, register_data): Call
12886         get_regcache.
12887         * regcache.h: Add prototypes.
12888         * server.h: Likewise.
12889
12890 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12891
12892         * mem-break.c: New file.
12893         * mem-break.h: New file.
12894         * Makefile.in: Add mem-break.o rule; update server.h
12895         dependencies.
12896         * inferiors.c (struct inferior_info): Add target_data
12897         member.
12898         (clear_inferiors): Free target_data member if set.
12899         (inferior_target_data, set_inferior_target_data): New functions.
12900         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
12901         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
12902         * linux-low.c (linux_bp_reinsert): New variable.
12903         (struct inferior_linux_data): New.
12904         (linux_create_inferior): Use set_inferior_target_data.
12905         (linux_attach): Likewise.  Call add_inferior.
12906         (linux_wait_for_one_inferior): New function.
12907         (linux_wait): Call it.
12908         (linux_write_memory): Add const.
12909         (initialize_low): Call set_breakpoint_data.
12910         * linux-low.h (struct linux_target_ops): Add breakpoint
12911         handling members.
12912         * server.c (attach_inferior): Remove extra add_inferior
12913         call.
12914         * server.h: Include mem-break.h.  Update inferior.c
12915         prototypes.
12916         * target.c (read_inferior_memory)
12917         (write_inferior_memory): New functions.
12918         * target.h (read_inferior_memory)
12919         (write_inferior_memory): Change macros to prototypes.
12920         (struct target_ops): Update comments.  Add const to write_memory
12921         definition.
12922
12923 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
12924
12925         * linux-low.c (usr_store_inferior_registers): Support
12926         registers which are allowed to fail to store.
12927         * linux-low.h (linux_target_ops): Likewise.
12928         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
12929         (ppc_cannot_store_register): FPSCR may not be storable.
12930
12931 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12932
12933         * server.h: Include <string.h> if HAVE_STRING_H.
12934         * ChangeLog: Correct paths in last ChangeLog entry.
12935
12936 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12937
12938         * linux-low.h: Remove obsolete prototypes.
12939         (struct linux_target_ops): New.
12940         (extern the_low_target): New.
12941         * linux-low.c (num_regs, regmap): Remove declarations.
12942         (register_addr): Use the_low_target explicitly.
12943         (fetch_register): Likewise.
12944         (usr_fetch_inferior_registers): Likewise.
12945         (usr_store_inferior_registers): Likewise.
12946         * linux-arm-low.c (num_regs): Remove.
12947         (arm_num_regs): Define.
12948         (arm_regmap): Renamed from regmap, made static.
12949         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
12950         made static.
12951         (arm_cannot_store_register): Renamed from cannot_store_register,
12952         made static.
12953         (the_low_target): New.
12954         * linux-i386-low.c (num_regs): Remove.
12955         (i386_num_regs): Define.
12956         (i386_regmap): Renamed from regmap, made static.
12957         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
12958         made static.
12959         (i386_cannot_store_register): Renamed from cannot_store_register,
12960         made static.
12961         (the_low_target): New.
12962         * linux-ia64-low.c (num_regs): Remove.
12963         (ia64_num_regs): Define.
12964         (ia64_regmap): Renamed from regmap, made static.
12965         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
12966         made static.
12967         (ia64_cannot_store_register): Renamed from cannot_store_register,
12968         made static.
12969         (the_low_target): New.
12970         * linux-m68k-low.c (num_regs): Remove.
12971         (m68k_num_regs): Define.
12972         (m68k_regmap): Renamed from regmap, made static.
12973         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
12974         made static.
12975         (m68k_cannot_store_register): Renamed from cannot_store_register,
12976         made static.
12977         (the_low_target): New.
12978         * linux-mips-low.c (num_regs): Remove.
12979         (mips_num_regs): Define.
12980         (mips_regmap): Renamed from regmap, made static.
12981         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
12982         made static.
12983         (mips_cannot_store_register): Renamed from cannot_store_register,
12984         made static.
12985         (the_low_target): New.
12986         * linux-ppc-low.c (num_regs): Remove.
12987         (ppc_num_regs): Define.
12988         (ppc_regmap): Renamed from regmap, made static.
12989         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
12990         made static.
12991         (ppc_cannot_store_register): Renamed from cannot_store_register,
12992         made static.
12993         (the_low_target): New.
12994         * linux-s390-low.c (num_regs): Remove.
12995         (s390_num_regs): Define.
12996         (s390_regmap): Renamed from regmap, made static.
12997         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
12998         made static.
12999         (s390_cannot_store_register): Renamed from cannot_store_register,
13000         made static.
13001         (the_low_target): New.
13002         * linux-sh-low.c (num_regs): Remove.
13003         (sh_num_regs): Define.
13004         (sh_regmap): Renamed from regmap, made static.
13005         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
13006         made static.
13007         (sh_cannot_store_register): Renamed from cannot_store_register,
13008         made static.
13009         (the_low_target): New.
13010         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
13011         (the_low_target): New.
13012
13013 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13014
13015         * Makefile.in: Add stamp-h target.
13016         * configure.in: Create stamp-h.
13017         * configure: Regenerated.
13018
13019 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13020
13021         * inferiors.c: New file.
13022         * target.c: New file.
13023         * target.h: New file.
13024         * Makefile.in:  Add target.o and inferiors.o.  Update
13025         dependencies.
13026         * linux-low.c (inferior_pid): New static variable,
13027         moved from server.c.
13028         (linux_create_inferior): Renamed from create_inferior.
13029         Call add_inferior.  Return 0 on success instead of a PID.
13030         (linux_attach): Renamed from myattach.
13031         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
13032         (linux_thread_alive): Renamed from mythread_alive.
13033         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
13034         child dies.
13035         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
13036         (regsets_store_inferior_registers): Correct error message.
13037         Add missing ``return 0''.
13038         (linux_fetch_registers): Renamed from fetch_inferior_registers.
13039         (linux_store_registers): Renamed from store_inferior_registers.
13040         (linux_read_memory): Renamed from read_inferior_memory.
13041         (linux_write_memory): Renamed from write_inferior_memory.
13042         (linux_target_ops): New structure.
13043         (initialize_low): Call set_target_ops ().
13044         * remote-utils.c (unhexify): New function.
13045         (hexify): New function.
13046         (input_interrupt): Send signals to ``signal_pid''.
13047         * server.c (inferior_pid): Remove.
13048         (start_inferior): Update create_inferior call.
13049         (attach_inferior): Call add_inferior.
13050         (handle_query): New function.
13051         (main): Call handle_query for `q' packets.
13052         * server.h: Include "target.h".  Remove obsolete prototypes.
13053         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
13054
13055 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13056
13057         * Makefile.in: Add WARN_CFLAGS.  Update configury
13058         dependencies.
13059         * configure.in: Check for <string.h>
13060         * configure: Regenerate.
13061         * config.in: Regenerate.
13062         * gdbreplay.c: Include needed system headers.
13063         (remote_open): Remove strchr prototype.
13064         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
13065         * regcache.c (supply_register): Change buf argument to const void *.
13066         (supply_register_by_name): Likewise.
13067         (collect_register): Change buf argument to void *.
13068         (collect_register_by_name): Likewise.
13069         * regcache.h: Add missing prototypes.
13070         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
13071         * server.c (handle_query): New function.
13072         (attached): New static variable, moved out of main.
13073         (main): Quiet longjmp clobber warnings.
13074         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
13075         * utils.c (error): Remove NORETURN.
13076         (fatal): Likewise.