Use arm_eabi_breakpoint on aarch32
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-12-11  Yao Qi  <yao.qi@linaro.org>
2
3         * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
4         arm breakpoint.
5
6 2015-12-07  Yao Qi  <yao.qi@linaro.org>
7
8         * configure.srv: Append arm.o to srv_tgtobj for
9         aarch64*-*-linux* target.
10         * linux-aarch32-low.c (arm_abi_breakpoint): New macro.  Moved
11         from linux-arm-low.c.
12         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
13         (arm_breakpoint_len, thumb_breakpoint): Likewise.
14         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
15         (thumb2_breakpoint_len): Likewise.
16         (arm_is_thumb_mode, arm_breakpoint_at): Likewise.
17         (arm_breakpoint_kinds): Likewise.
18         (arm_breakpoint_kind_from_pc): Likewise.
19         (arm_sw_breakpoint_from_kind): Likewise.
20         (arm_breakpoint_kind_from_current_state): Likewise.
21         * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
22         (arm_sw_breakpoint_from_kind): Declare.
23         (arm_breakpoint_kind_from_current_state): Declare.
24         (arm_breakpoint_at): Declare.
25         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
26         arm_sw_breakpoint_from_kind if process is 32-bit.
27         (aarch64_breakpoint_kind_from_pc): New function.
28         (aarch64_breakpoint_kind_from_current_state): New function.
29         (the_low_target): Initialize fields breakpoint_kind_from_pc
30         and breakpoint_kind_from_current_state.
31         * linux-arm-low.c (arm_breakpoint_kinds): Move to
32         linux-aarch32-low.c.
33         (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
34         (arm_breakpoint, arm_breakpoint_len): Likewise.
35         (thumb_breakpoint, thumb_breakpoint_len): Likewise.
36         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
37         (arm_is_thumb_mode): Likewise.
38         (arm_breakpoint_at): Likewise.
39         (arm_breakpoint_kind_from_pc): Likewise.
40         (arm_sw_breakpoint_from_kind): Likewise.
41         (arm_breakpoint_kind_from_current_state): Likewise.
42
43         Revert:
44         2015-08-04  Yao Qi  <yao.qi@linaro.org>
45
46         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
47         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
48         * server.c (extended_protocol): Remove "static".
49         * server.h (extended_protocol): Declare it.
50
51 2015-12-04  Josh Stone  <jistone@redhat.com>
52
53         * target.h (struct target_ops) <arch_setup>: Rename to ...
54         (struct target_ops) <post_create_inferior>: ... this.
55         (target_arch_setup): Rename to ...
56         (target_post_create_inferior): ... this, calling post_create_inferior.
57         * server.c (start_inferior): Update target_arch_setup calls to
58         target_post_create_inferior.
59         * linux-low.c (linux_low_ptrace_options): Forward declare.
60         (linux_arch_setup): Update its comment for general use.
61         (linux_post_create_inferior): New, run arch_setup and setup ptrace.
62         (struct linux_target_ops): Use linux_post_create_inferior.
63         * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
64         to post_create_inferior.
65         * nto-low.c (struct nto_target_ops): Likewise.
66         * spu-low.c (struct spu_target_ops): Likewise.
67         * win32-low.c (struct win32_target_ops): Likewise.
68
69 2015-12-03  Antoine Tremblay  <antoine.tremblay@ericsson.com>
70
71         * linux-arm-low.c: Remove duplicate arch/arm.h include.
72
73 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
74
75         * linux-arm-low.c (arm_reinsert_addr): Remove function.
76         (struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
77         * linux-cris-low.c (cris_reinsert_addr> Remove function.
78         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
79         * linux-crisv32-low.c (cris_reinsert_addr): Remove function.
80         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
81         * linux-mips-low.c (mips_reinsert_addr): Remove function.
82         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
83         * linux-nios2-low.c (nios2_reinsert_addr): Remove function.
84         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
85         * linux-sparc-low.c (sparc_reinsert_addr): Remove function.
86         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
87
88 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
89
90         * linux-low.c (linux_look_up_symbols): Don't call
91         linux_supports_traceclone.
92         * linux-low.h (thread_db_init): Remove use_events argument.
93         * thread-db.c (thread_db_use_event): Remove global variable.
94         (struct thread_db) <td_thr_event_enable_p>: Remove field.
95         (struct thread_db) <td_create_bp>: Remove field.
96         (thread_db_create_event): Remove function.
97         (thread_db_enable_reporting): Likewise.
98         (find_one_thread): Don't check for thread_db_use_events.
99         (attach_thread): Likewise.
100         (thread_db_load_search): Remove td_thr_event_enable_p initialization.
101         (try_thread_db_load_1): Don't check for thread_db_use_events.
102         (thread_db_init): Remove use_events argument and thread events
103         handling.
104         (remove_thread_event_breakpoints): Remove function.
105         (thread_db_detach): Remove call to remove_thred_event_breakpoints.
106
107 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
108
109         * linux-aarch64-low.c (aarch64_supports_hardware_single_step):
110         New function.
111         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
112         * linux-arm-low.c (arm_supports_hardware_single_step): New function.
113         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
114         * linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
115         (struct linux_target_ops) <bfin_supports_hardware_single_step>:
116         Initialize.
117         * linux-crisv32-low.c (cris_supports_hardware_single_step):
118         New function.
119         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
120         * linux-low.c (can_hardware_single_step): Use
121         supports_hardware_single_step.
122         (can_software_single_step): New function.
123         (start_step_over): Call can_software_single_step.
124         (linux_supports_hardware_single_step): New function.
125         (struct target_ops) <supports_software_single_step>: Initialize.
126         * linux-low.h (struct linux_target_ops)
127         <supports_hardware_single_step>: Initialize.
128         * linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
129         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
130         * linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
131         (struct linux_target_ops) <supports_hardware_single_step> Initialize.
132         * linux-s390-low.c (s390_supports_hardware_single_step): New function.
133         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
134         * linux-sh-low.c (sh_supports_hardware_single_step): New function.
135         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
136         * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
137         (struct linux_target_ops) <tic6x_supports_hardware_single_step>:
138         Initialize.
139         * linux-tile-low.c (tile_supports_hardware_single_step): New function.
140         (struct linux_target_ops) <tile_supports_hardware_single_step>:
141         Initialize.
142         * linux-x86-low.c (x86_supports_hardware_single_step) New function.
143         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
144         * linux-xtensa-low.c (xtensa_supports_hardware_single_step):
145         New function.
146         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
147         * target.h (struct target_ops): <supports_software_single_step>:
148         New field.
149         (target_supports_software_single_step): New macro.
150
151 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
152
153         * linux-low.c (linux_wait_1): Fix pc advance condition.
154         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
155         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
156
157 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
158
159         * linux-arm-low.c (arm_is_thumb_mode): New function.
160         (arm_breakpoint_at): Use arm_is_thumb_mode.
161         (arm_breakpoint_kind_from_current_state): New function.
162         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
163         Initialize.
164         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
165         (linux_breakpoint_kind_from_current_state): New function.
166         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
167         * linux-low.h (struct linux_target_ops)
168         <breakpoint_kind_from_current_state>: New field.
169         * target.h (struct target_ops): Likewise.
170         (target_breakpoint_kind_from_current_state): New macro.
171
172 2015-11-30  Pedro Alves  <palves@redhat.com>
173
174         * linux-low.c (linux_resume): Wake up the event loop before
175         returning.
176
177 2015-11-30  Pedro Alves  <palves@redhat.com>
178
179         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
180         check.
181         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
182         to -1.
183         * target.c (struct thread_search): New structure.
184         (thread_search_callback): New function.
185         (prev_general_thread): New global.
186         (prepare_to_access_memory, done_accessing_memory): New functions.
187         * target.h (prepare_to_access_memory, done_accessing_memory):
188         Replace macros with function declarations.
189
190 2015-11-30  Pedro Alves  <palves@redhat.com>
191
192         PR 14618
193         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
194         report TARGET_WAITKIND_NO_RESUMED.
195         * remote-utils.c (prepare_resume_reply): Handle
196         TARGET_WAITKIND_NO_RESUMED.
197         * server.c (report_no_resumed): New global.
198         (handle_query) <qSupported>: Handle "no-resumed+".  Report
199         "no-resumed+" support.
200         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
201         return error if the client doesn't support no-resumed events.
202         (push_stop_notification): New function.
203         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
204         events if the client supports them.
205
206 2015-11-30  Pedro Alves  <palves@redhat.com>
207
208         * linux-low.c (thread_still_has_status_pending_p): Don't check
209         vCont;t here.
210         (lwp_resumed): New function.
211         (status_pending_p_callback): Return early if the LWP is not
212         supposed to be resumed.
213
214 2015-11-30  Pedro Alves  <palves@redhat.com>
215
216         * linux-low.c (handle_extended_wait): Assert that the LWP's
217         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
218         thread create events, leave the new child's status pending.
219         (linux_low_filter_event): If GDB wants to hear about thread exit
220         events, leave the LWP marked dead and don't delete it.
221         (linux_wait_for_event_filtered): Don't check for thread exit.
222         (filter_exit_event): New function.
223         (linux_wait_1): Use it, when returning an exit event.
224         (linux_resume_one_lwp_throw): Assert that the LWP's
225         waitstatus is TARGET_WAITKIND_IGNORE.
226         * remote-utils.c (prepare_resume_reply): Handle
227         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
228         * server.c (report_thread_events): New global.
229         (handle_general_set): Handle QThreadEvents.
230         (handle_query) <qSupported>: Handle and report QThreadEvents+;
231         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
232         TARGET_WAITKIND_THREAD_EXITED.
233         * server.h (report_thread_events): Declare.
234
235 2015-11-30  Pedro Alves  <palves@redhat.com>
236
237         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
238         the thread's last_resume_kind was resume_stop.
239
240 2015-11-30  Pedro Alves  <palves@redhat.com>
241
242         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
243         before returning.
244
245 2015-11-30  Pedro Alves  <palves@redhat.com>
246
247         * server.c (handle_v_requests): Handle vCtrlC.
248
249 2015-11-30  Pedro Alves  <palves@redhat.com>
250
251         * gdbthread.h (find_any_thread_of_pid): Declare.
252         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
253         functions.
254         * server.c (handle_query): If current_thread is NULL, look for
255         another thread of the selected process.
256
257 2015-11-26  Daniel Colascione  <dancol@dancol.org>
258             Simon Marchi  <simon.marchi@ericsson.com>
259
260         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
261         * server.c (handle_qxfer_threads_worker): Refactor to include thread
262         name in reply.
263         * target.h (struct target_ops) <thread_name>: New field.
264         (target_thread_name): New macro.
265
266 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
267
268         * regcache.h (regcache_invalidate_pid): Add declaration.
269         * regcache.c (regcache_invalidate_pid): New function, extracted
270         from regcache_invalidate.
271         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
272         Add trivial documentation comment.
273         * lynx-low.c: Use regcache_invalidate_pid instead of
274         regcache_invalidate.
275
276 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
277
278         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
279         and Elf64_auxv_t if the target is Android.
280
281 2015-11-22  Doug Evans  <xdje42@gmail.com>
282
283         * target.h: #include <sys/types.h>.
284
285 2015-11-19  Pedro Alves  <palves@redhat.com>
286
287         * linux-low.c (linux_process_qsupported): Change prototype.
288         Adjust.
289         * linux-low.h (struct linux_target_ops) <process_qsupported>:
290         Change prototype.
291         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
292         and adjust to loop over all features.
293         * server.c (handle_query) <qSupported>: Adjust to call
294         target_process_qsupported once, passing it a vector of unprocessed
295         features.
296         * target.h (struct target_ops) <process_qsupported>: Change
297         prototype.
298         (target_process_qsupported): Adjust.
299
300 2015-11-19  Pedro Alves  <palves@redhat.com>
301
302         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
303         mode.
304         * configure: Regenerate.
305
306 2015-11-19  Pedro Alves  <palves@redhat.com>
307
308         * configure: Regenerate.
309
310 2015-11-19  Yao Qi  <yao.qi@linaro.org>
311
312         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
313         type to uint32_t.
314
315 2015-11-19  Yao Qi  <yao.qi@linaro.org>
316
317         * linux-aarch64-low.c (enum aarch64_operand_type): New.
318         (struct aarch64_operand): Move enum out.
319
320 2015-11-19  Yao Qi  <yao.qi@linaro.org>
321
322         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
323         struct user_fpsimd_state *.
324         (aarch64_store_fpregset): Likewise.
325
326 2015-11-19  Yao Qi  <yao.qi@linaro.org>
327
328         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
329         struct user_pt_regs *.
330         (aarch64_store_gregset): Likewise.
331
332 2015-11-18  Pedro Alves  <palves@redhat.com>
333
334         * Makefile.in (all_object_files): Add $IPA_OBJS.
335
336 2015-11-17  Pedro Alves  <palves@redhat.com>
337
338         * win32-low.c (win32_resume): Use gdb_signal_from_host,
339         GDB_SIGNAL_0 and gdb_signal_to_string.
340
341 2015-11-17  Pedro Alves  <palves@redhat.com>
342
343         * win32-low.c (handle_output_debug_string): Remove parameter.
344         (win32_kill): Remove our_status local and adjust call to
345         handle_output_debug_string.
346         (get_child_debug_event): Adjust call to
347         handle_output_debug_string.
348
349 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
350
351         * linux-mips-low.c (mips_fill_gregset): Add cast.
352         (mips_store_gregset): Likewise.
353         (mips_fill_fpregset): Likewise.
354         (mips_store_fpregset): Likewise.
355
356 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
357
358         * linux-mips-low.c (mips_add_watchpoint): Rename private to
359         priv.
360
361 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
362
363         * linux-mips-low.c (mips_linux_new_thread): Change type of
364         watch_type to enum target_hw_bp_type.
365
366 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
367
368                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
369                 Change return type to arm_hwbp_type.
370
371 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
372
373         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
374         (arm_store_gregset): Likewise.
375         * linux-arm-low.c (arm_get_hwcap): Likewise.
376         (arm_read_description): Likewise.
377
378 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
379
380         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
381
382 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
383
384         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
385         (ppc_fill_vsxregset): Likewise.
386         (ppc_store_vsxregset): Likewise.
387         (ppc_fill_vrregset): Likewise.
388         (ppc_store_vrregset): Likewise.
389         (ppc_fill_evrregset): Likewise.
390         (ppc_store_evrregset): Likewise.
391
392 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
393
394         * linux-ppc-low.c (ppc_usrregs_info): Remove
395         forward-declaration.
396         (ppc_arch_setup): Move lower in file.
397
398 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
399
400         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
401         (ps_pdwrite): Likewise.
402
403 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
404
405         * linux-arm-low.c (arm_new_thread): Move pointer dereference
406         to after assert checks.
407
408 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
409
410         * proc-service.c (ps_pdread): Add/adjust casts.
411         (ps_pdwrite): Add/adjust casts.
412
413 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
414
415         * server.c (handle_search_memory_1): Cast return value of
416         memmem.
417
418 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
419
420         * server.c (write_qxfer_response): Change type of data to
421         gdb_byte *.
422
423 2015-10-29  Pedro Alves  <palves@redhat.com>
424
425         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
426
427 2015-10-29  Pedro Alves  <palves@redhat.com>
428
429         * tracepoint.c (clear_installed_tracepoints): Add casts.
430
431 2015-10-29  Pedro Alves  <palves@redhat.com>
432
433         * server.c (handle_v_cont, process_serial_event): Add enum
434         gdb_signal casts to signal parsing code.
435
436 2015-10-29  Pedro Alves  <palves@redhat.com>
437
438         * linux-low.h (NULL_REGSET): Define.
439         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
440         * linux-arm-low.c (arm_regsets): Likewise.
441         * linux-crisv32-low.c (cris_regsets): Likewise.
442         * linux-m68k-low.c (m68k_regsets): Likewise.
443         * linux-mips-low.c (mips_regsets): Likewise.
444         * linux-nios2-low.c (nios2_regsets): Likewise.
445         * linux-ppc-low.c (ppc_regsets): Likewise.
446         * linux-s390-low.c (s390_regsets): Likewise.
447         * linux-sh-low.c (sh_regsets): Likewise.
448         * linux-sparc-low.c (sparc_regsets): Likewise.
449         * linux-tic6x-low.c (tic6x_regsets): Likewise.
450         * linux-tile-low.c (tile_regsets): Likewise.
451         * linux-x86-low.c (x86_regsets): Likewise.
452         * linux-xtensa-low.c (xtensa_regsets): Likewise.
453
454 2015-10-29  Pedro Alves  <palves@redhat.com>
455
456         * linux-low.h (NULL_REGSET): Define.
457         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
458         * linux-arm-low.c (arm_regsets): Likewise.
459         * linux-crisv32-low.c (cris_regsets): Likewise.
460         * linux-m68k-low.c (m68k_regsets): Likewise.
461         * linux-mips-low.c (mips_regsets): Likewise.
462         * linux-nios2-low.c (nios2_regsets): Likewise.
463         * linux-ppc-low.c (ppc_regsets): Likewise.
464         * linux-s390-low.c (s390_regsets): Likewise.
465         * linux-sh-low.c (sh_regsets): Likewise.
466         * linux-sparc-low.c (sparc_regsets): Likewise.
467         * linux-tic6x-low.c (tic6x_regsets): Likewise.
468         * linux-tile-low.c (tile_regsets): Likewise.
469         * linux-x86-low.c (x86_regsets): Likewise.
470         * linux-xtensa-low.c (xtensa_regsets): Likewise.
471
472 2015-10-26  Doug Evans  <dje@google.com>
473
474         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
475
476 2015-10-26  Doug Evans  <dje@google.com>
477
478         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
479
480 2015-10-26  Doug Evans  <dje@google.com>
481
482         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
483         for debug_printf.
484         (attach_thread, find_new_threads_callback): Ditto.
485
486 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
487
488         * mem-break.h (set_breakpoint_data): Remove.
489
490 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
491
492         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
493         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
494         (initialize_low): Remove set_breakpoint_data call.
495         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
496         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
497         (initialize_low): Remove set_breakpoint_data call.
498         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
499         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
500         (initialize_low): Remove set_breakpoint_data call.
501
502 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
503
504         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
505         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
506         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
507         * target.h (target_breakpoint_kind_from_pc): New macro.
508
509 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
510
511         * linux-low.c (default_breakpoint_kind_from_pc): New function.
512         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
513         the default breakpoint kind.
514
515 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
516
517         * linux-arm-low.c (arm_supports_z_point_type): Add software
518         breakpoint support.
519
520 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
521
522         * linux-arm-low.c: Refactor breakpoint definitions.
523         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
524         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
525
526 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
527
528         * Makefile.in: Add arm.c/o.
529         * configure.srv: Likewise.
530         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
531         (arm_breakpoint_kind_from_pc): New function.
532         (arm_sw_breakpoint_from_kind): Return proper kind.
533         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
534
535 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
536
537         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
538         removal.
539         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
540         (struct raw_breakpoint) <size>: Remove.
541         (struct raw_breakpoint) <kind>: Add.
542         (bp_size): New function.
543         (bp_opcode): Likewise.
544         (find_raw_breakpoint_at): Adjust for kind.
545         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
546         (remove_memory_breakpoint): Adjust for kind call bp_size.
547         (set_raw_breakpoint_at): Adjust for kind.
548         (set_breakpoint): Likewise.
549         (set_breakpoint_at): Call breakpoint_kind_from_pc.
550         (delete_raw_breakpoint): Adjust for kind.
551         (delete_breakpoint): Likewise.
552         (find_gdb_breakpoint): Likewise.
553         (set_gdb_breakpoint_1): Likewise.
554         (set_gdb_breakpoint): Likewise.
555         (delete_gdb_breakpoint_1): Likewise.
556         (delete_gdb_breakpoint): Likewise.
557         (uninsert_raw_breakpoint): Likewise.
558         (reinsert_raw_breakpoint): Likewise.
559         (set_breakpoint_data): Remove.
560         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
561         (check_mem_read): Adjust for kind call bp_size.
562         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
563         (clone_one_breakpoint): Adjust for kind.
564         * mem-break.h (set_gdb_breakpoint): Likewise.
565         (delete_gdb_breakpoint): Likewise.
566         * server.c (process_serial_event): Likewise.
567
568 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
569
570         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
571         (struct linux_target_ops) <breakpoint>: Remove.
572         (struct linux_target_ops) <breakpoint_len>: Remove.
573         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
574         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
575         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
576         (arm_sw_breakpoint_from_kind): New function.
577         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
578         (struct linux_target_ops) <breakpoint>: Remove.
579         (struct linux_target_ops) <breakpoint_len>: Remove.
580         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
581         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
582         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
583         (struct linux_target_ops) <breakpoint>: Remove.
584         (struct linux_target_ops) <breakpoint_len>: Remove.
585         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
586         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
587         * linux-crisv32-low.c (cris_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-low.c (linux_wait_1): Call breakpoint_kind_from_pc
593         and sw_breakpoint_from_kind to increment the pc.
594         (linux_breakpoint_kind_from_pc): New function.
595         (linux_sw_breakpoint_from_kind): New function.
596         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
597         (initialize_low): Call breakpoint_kind_from_pc and
598         sw_breakpoint_from_kind to replace breakpoint_data/len.
599         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
600         New field.
601         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
602         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
603         (struct linux_target_ops) <breakpoint>: Remove.
604         (struct linux_target_ops) <breakpoint_len>: Remove.
605         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
606         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
607         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
608         (struct linux_target_ops) <breakpoint>: Remove.
609         (struct linux_target_ops) <breakpoint_len>: Remove.
610         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
611         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
612         * linux-mips-low.c (mips_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-nios2-low.c (nios2_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-ppc-low.c (ppc_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-s390-low.c (s390_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-sh-low.c (sh_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-sparc-low.c (sparc_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-tic6x-low.c (tic6x_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-tile-low.c (tile_sw_breakpoint_from_kind): New function.
648         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
649         (struct linux_target_ops) <breakpoint>: Remove.
650         (struct linux_target_ops) <breakpoint_len>: Remove.
651         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
652         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
653         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
654         (struct linux_target_ops) <breakpoint>: Remove.
655         (struct linux_target_ops) <breakpoint_len>: Remove.
656         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
657         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
658
659 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
660
661         * linux-cris-low.c (cris_get_pc): Remove void arg.
662
663 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
664
665         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
666         variable name.
667
668 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
669
670         * inferiors.c (thread_pid_matches_callback): New function.
671         (find_thread_process): New function.
672         (remove_thread): Reset current_thread.
673         (remove_process): Assert threads have been removed first.
674
675 2015-10-15  Yao Qi  <yao.qi@linaro.org>
676
677         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
678         if it is 3.
679         (aarch64_remove_point): Likewise.
680         * regcache.c (regcache_register_size): New function.
681
682 2015-10-12  Yao Qi  <yao.qi@linaro.org>
683
684         * linux-aarch64-low.c: Update all callers as emit_load_store
685         is renamed to aarch64_emit_load_store.
686
687 2015-10-12  Yao Qi  <yao.qi@linaro.org>
688
689         * linux-aarch64-low.c: Update all callers of function renaming
690         from emit_insn to aarch64_emit_insn.
691
692 2015-10-12  Yao Qi  <yao.qi@linaro.org>
693
694         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
695         arch/aarch64-insn.h.
696         (struct aarch64_memory_operand): Likewise.
697         (ENCODE): Likewise.
698         (emit_insn): Move to arch/aarch64-insn.c.
699         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
700         (emit_load_store): Move to arch/aarch64-insn.c.
701         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
702         (can_encode_int32): Remove.
703
704 2015-10-12  Yao Qi  <yao.qi@linaro.org>
705
706         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
707         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
708         (aarch64_relocate_instruction): Likewise.
709         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
710         (struct aarch64_insn_visitor): Likewise.
711
712 2015-10-12  Yao Qi  <yao.qi@linaro.org>
713
714         * linux-aarch64-low.c (struct aarch64_insn_data): New.
715         (struct aarch64_insn_visitor): New.
716         (struct aarch64_insn_relocation_data): New.
717         (aarch64_ftrace_insn_reloc_b): New function.
718         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
719         (aarch64_ftrace_insn_reloc_cb): Likewise.
720         (aarch64_ftrace_insn_reloc_tb): Likewise.
721         (aarch64_ftrace_insn_reloc_adr): Likewise.
722         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
723         (aarch64_ftrace_insn_reloc_others): Likewise.
724         (visitor): New.
725         (aarch64_relocate_instruction): Use visitor.
726
727 2015-10-12  Yao Qi  <yao.qi@linaro.org>
728
729         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
730         int.  Add argument buf.
731         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
732         aarch64_relocate_instruction.
733
734 2015-10-12  Yao Qi  <yao.qi@linaro.org>
735
736         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
737         argument insn.  Remove local variable insn.  Don't call
738         target_read_uint32.
739         (aarch64_install_fast_tracepoint_jump_pad): Call
740         target_read_uint32.
741
742 2015-09-30  Yao Qi  <yao.qi@linaro.org>
743
744         * linux-aarch64-low.c (emit_movk): Shorten a long line.
745         (emit_load_store_pair): Likewise.
746
747 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
748
749         * dll.c (match_dll): Add cast(s).
750         (unloaded_dll): Likewise.
751         * linux-low.c (second_thread_of_pid_p): Likewise.
752         (delete_lwp_callback): Likewise.
753         (count_events_callback): Likewise.
754         (select_event_lwp_callback): Likewise.
755         (linux_set_resume_request): Likewise.
756         * server.c (accumulate_file_name_length): Likewise.
757         (emit_dll_description): Likewise.
758         (handle_qxfer_threads_worker): Likewise.
759         (visit_actioned_threads): Likewise.
760         * thread-db.c (any_thread_of): Likewise.
761         * tracepoint.c (same_process_p): Likewise.
762         (match_blocktype): Likewise.
763         (build_traceframe_info_xml): Likewise.
764
765 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
766
767         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
768         assignment.
769         (gdb_unparse_agent_expr): Likewise.
770         * hostio.c (require_data): Likewise.
771         (handle_pread): Likewise.
772         * linux-low.c (disable_regset): Likewise.
773         (fetch_register): Likewise.
774         (store_register): Likewise.
775         (get_dynamic): Likewise.
776         (linux_qxfer_libraries_svr4): Likewise.
777         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
778         (set_fast_tracepoint_jump): Likewise.
779         (uninsert_fast_tracepoint_jumps_at): Likewise.
780         (reinsert_fast_tracepoint_jumps_at): Likewise.
781         (validate_inserted_breakpoint): Likewise.
782         (clone_agent_expr): Likewise.
783         * regcache.c (init_register_cache): Likewise.
784         * remote-utils.c (putpkt_binary_1): Likewise.
785         (decode_M_packet): Likewise.
786         (decode_X_packet): Likewise.
787         (look_up_one_symbol): Likewise.
788         (relocate_instruction): Likewise.
789         (monitor_output): Likewise.
790         * server.c (handle_search_memory): Likewise.
791         (handle_qxfer_exec_file): Likewise.
792         (handle_qxfer_libraries): Likewise.
793         (handle_qxfer): Likewise.
794         (handle_query): Likewise.
795         (handle_v_cont): Likewise.
796         (handle_v_run): Likewise.
797         (captured_main): Likewise.
798         * target.c (write_inferior_memory): Likewise.
799         * thread-db.c (try_thread_db_load_from_dir): Likewise.
800         * tracepoint.c (init_trace_buffer): Likewise.
801         (add_tracepoint_action): Likewise.
802         (add_traceframe): Likewise.
803         (add_traceframe_block): Likewise.
804         (cmd_qtdpsrc): Likewise.
805         (cmd_qtdv): Likewise.
806         (cmd_qtstatus): Likewise.
807         (response_source): Likewise.
808         (response_tsv): Likewise.
809         (cmd_qtnotes): Likewise.
810         (gdb_collect): Likewise.
811         (initialize_tracepoint): Likewise.
812
813 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
814
815         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
816         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
817         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
818         <NOP>: New.
819         (enum aarch64_condition_codes): New enum.
820         (w0): New static global.
821         (fp): Likewise.
822         (lr): Likewise.
823         (struct aarch64_memory_operand) <type>: New
824         MEMORY_OPERAND_POSTINDEX type.
825         (postindex_memory_operand): New helper function.
826         (emit_ret): New function.
827         (emit_load_store_pair): New function, factored out of emit_stp
828         with support for MEMORY_OPERAND_POSTINDEX.
829         (emit_stp): Rewrite using emit_load_store_pair.
830         (emit_ldp): New function.
831         (emit_load_store): Likewise.
832         (emit_ldr): Mention post-index instruction in comment.
833         (emit_ldrh): New function.
834         (emit_ldrb): New function.
835         (emit_ldrsw): Mention post-index instruction in comment.
836         (emit_str): Likewise.
837         (emit_subs): New function.
838         (emit_cmp): Likewise.
839         (emit_and): Likewise.
840         (emit_orr): Likewise.
841         (emit_orn): Likewise.
842         (emit_eor): Likewise.
843         (emit_mvn): Likewise.
844         (emit_lslv): Likewise.
845         (emit_lsrv): Likewise.
846         (emit_asrv): Likewise.
847         (emit_mul): Likewise.
848         (emit_sbfm): Likewise.
849         (emit_sbfx): Likewise.
850         (emit_ubfm): Likewise.
851         (emit_ubfx): Likewise.
852         (emit_csinc): Likewise.
853         (emit_cset): Likewise.
854         (emit_nop): Likewise.
855         (emit_ops_insns): New helper function.
856         (emit_pop): Likewise.
857         (emit_push): Likewise.
858         (aarch64_emit_prologue): New function.
859         (aarch64_emit_epilogue): Likewise.
860         (aarch64_emit_add): Likewise.
861         (aarch64_emit_sub): Likewise.
862         (aarch64_emit_mul): Likewise.
863         (aarch64_emit_lsh): Likewise.
864         (aarch64_emit_rsh_signed): Likewise.
865         (aarch64_emit_rsh_unsigned): Likewise.
866         (aarch64_emit_ext): Likewise.
867         (aarch64_emit_log_not): Likewise.
868         (aarch64_emit_bit_and): Likewise.
869         (aarch64_emit_bit_or): Likewise.
870         (aarch64_emit_bit_xor): Likewise.
871         (aarch64_emit_bit_not): Likewise.
872         (aarch64_emit_equal): Likewise.
873         (aarch64_emit_less_signed): Likewise.
874         (aarch64_emit_less_unsigned): Likewise.
875         (aarch64_emit_ref): Likewise.
876         (aarch64_emit_if_goto): Likewise.
877         (aarch64_emit_goto): Likewise.
878         (aarch64_write_goto_address): Likewise.
879         (aarch64_emit_const): Likewise.
880         (aarch64_emit_call): Likewise.
881         (aarch64_emit_reg): Likewise.
882         (aarch64_emit_pop): Likewise.
883         (aarch64_emit_stack_flush): Likewise.
884         (aarch64_emit_zero_ext): Likewise.
885         (aarch64_emit_swap): Likewise.
886         (aarch64_emit_stack_adjust): Likewise.
887         (aarch64_emit_int_call_1): Likewise.
888         (aarch64_emit_void_call_2): Likewise.
889         (aarch64_emit_eq_goto): Likewise.
890         (aarch64_emit_ne_goto): Likewise.
891         (aarch64_emit_lt_goto): Likewise.
892         (aarch64_emit_le_goto): Likewise.
893         (aarch64_emit_gt_goto): Likewise.
894         (aarch64_emit_ge_got): Likewise.
895         (aarch64_emit_ops_impl): New static global variable.
896         (aarch64_emit_ops): New target function, return
897         &aarch64_emit_ops_impl.
898         (struct linux_target_ops): Install it.
899
900 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
901
902         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
903         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
904         aarch64-ipa.o.
905         * linux-aarch64-ipa.c: New file.
906         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
907         and endian.h.
908         (aarch64_get_thread_area): New target method.
909         (extract_signed_bitfield): New helper function.
910         (aarch64_decode_ldr_literal): New function.
911         (enum aarch64_opcodes): New enum.
912         (struct aarch64_register): New struct.
913         (struct aarch64_operand): New struct.
914         (x0): New static global.
915         (x1): Likewise.
916         (x2): Likewise.
917         (x3): Likewise.
918         (x4): Likewise.
919         (w2): Likewise.
920         (ip0): Likewise.
921         (sp): Likewise.
922         (xzr): Likewise.
923         (aarch64_register): New helper function.
924         (register_operand): Likewise.
925         (immediate_operand): Likewise.
926         (struct aarch64_memory_operand): New struct.
927         (offset_memory_operand): New helper function.
928         (preindex_memory_operand): Likewise.
929         (enum aarch64_system_control_registers): New enum.
930         (ENCODE): New macro.
931         (emit_insn): New helper function.
932         (emit_b): New function.
933         (emit_bcond): Likewise.
934         (emit_cb): Likewise.
935         (emit_tb): Likewise.
936         (emit_blr): Likewise.
937         (emit_stp): Likewise.
938         (emit_ldp_q_offset): Likewise.
939         (emit_stp_q_offset): Likewise.
940         (emit_load_store): Likewise.
941         (emit_ldr): Likewise.
942         (emit_ldrsw): Likewise.
943         (emit_str): Likewise.
944         (emit_ldaxr): Likewise.
945         (emit_stxr): Likewise.
946         (emit_stlr): Likewise.
947         (emit_data_processing_reg): Likewise.
948         (emit_data_processing): Likewise.
949         (emit_add): Likewise.
950         (emit_sub): Likewise.
951         (emit_mov): Likewise.
952         (emit_movk): Likewise.
953         (emit_mov_addr): Likewise.
954         (emit_mrs): Likewise.
955         (emit_msr): Likewise.
956         (emit_sevl): Likewise.
957         (emit_wfe): Likewise.
958         (append_insns): Likewise.
959         (can_encode_int32_in): New helper function.
960         (aarch64_relocate_instruction): New function.
961         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
962         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
963         (struct linux_target_ops): Install aarch64_get_thread_area,
964         aarch64_install_fast_tracepoint_jump_pad and
965         aarch64_get_min_fast_tracepoint_insn_len.
966
967 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
968
969         * Makefile.in (aarch64-insn.o): New rule.
970         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
971
972 2015-09-21  Yao Qi  <yao.qi@linaro.org>
973
974         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
975
976 2015-09-21  Yao Qi  <yao.qi@linaro.org>
977
978         * tracepoint.c (max_jump_pad_size): Remove.
979
980 2015-09-18  Yao Qi  <yao.qi@linaro.org>
981
982         * linux-aarch64-low.c: Don't include sys/uio.h.
983         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
984
985 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
986
987         * tracepoint.c (eval_result_type): Change prototype.
988         (condition_true_at_tracepoint): Fix argument to compiled_cond.
989
990 2015-09-15  Pedro Alves  <palves@redhat.com>
991
992         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
993         Check whether to report exec events instead of checking whether
994         multiprocess is enabled.
995
996 2015-09-15  Pedro Alves  <palves@redhat.com>
997
998         PR remote/18965
999         * remote-utils.c (prepare_resume_reply): Merge
1000         TARGET_WAITKIND_VFORK_DONE switch case with the
1001         TARGET_WAITKIND_FORKED case.
1002
1003 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1004
1005         * server.c (handle_query): Check string comparison using
1006         "else if" instead of "if".
1007
1008 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1009
1010         * server.c (vCont_supported): New global variable.
1011         (handle_query): Set vCont_supported to 1 if "vContSupported+"
1012         matches.  Append ";vContSupported+" to own_buf.
1013         (handle_v_requests): Append ";s;S" to own_buf if target supports
1014         hardware single step or vCont_supported is false.
1015         (capture_main): Set vCont_supported to zero.
1016
1017 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1018
1019         * linux-low.c (linux_supports_conditional_breakpoints): Rename
1020         it to ...
1021         (linux_supports_hardware_single_step): ... New function.
1022         (linux_target_ops): Update.
1023         * lynx-low.c (lynx_target_ops): Set field
1024         supports_hardware_single_step to target_can_do_hardware_single_step.
1025         * nto-low.c (nto_target_ops): Likewise.
1026         * spu-low.c (spu_target_ops): Likewise.
1027         * win32-low.c (win32_target_ops): Likewise.
1028         * target.c (target_can_do_hardware_single_step): New function.
1029         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1030         Remove.  <supports_hardware_single_step>: New field.
1031         (target_supports_conditional_breakpoints): Remove.
1032         (target_supports_hardware_single_step): New macro.
1033         (target_can_do_hardware_single_step): Declare.
1034         * server.c (handle_query): Use target_supports_hardware_single_step
1035         instead of target_supports_conditional_breakpoints.
1036
1037 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1038
1039         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
1040         function.
1041         (struct linux_target_ops the_low_target): Install
1042         aarch64_linux_siginfo_fixup.
1043
1044 2015-09-11  Don Breazeal  <donb@codesourcery.com>
1045             Luis Machado  <lgustavo@codesourcery.com>
1046
1047         * linux-low.c (linux_mourn): Static declaration.
1048         (linux_arch_setup): Move in front of
1049         handle_extended_wait.
1050         (linux_arch_setup_thread): New function.
1051         (handle_extended_wait): Handle exec events.  Call
1052         linux_arch_setup_thread.  Make event_lwp argument a
1053         pointer-to-a-pointer.
1054         (check_zombie_leaders): Do not check stopped threads.
1055         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
1056         (linux_low_filter_event): Add lwp and thread for exec'ing
1057         non-leader thread if leader thread has been deleted.
1058         Refactor code into linux_arch_setup_thread and call it.
1059         Pass child lwp pointer by reference to handle_extended_wait.
1060         (linux_wait_for_event_filtered): Update comment.
1061         (linux_wait_1): Prevent clobbering exec event status.
1062         (linux_supports_exec_events): New function.
1063         (linux_target_ops) <supports_exec_events>: Initialize new member.
1064         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
1065         new member.
1066         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
1067         * server.c (report_exec_events): New global variable.
1068         (handle_query): Handle qSupported query for exec-events feature.
1069         (captured_main): Initialize report_exec_events.
1070         * server.h (report_exec_events): Declare new global variable.
1071         * target.h (struct target_ops) <supports_exec_events>: New
1072         member.
1073         (target_supports_exec_events): New macro.
1074         * win32-low.c (win32_target_ops) <supports_exec_events>:
1075         Initialize new member.
1076
1077 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
1078
1079         * linux-low.c (linux_low_enable_btrace): Remove.
1080         (linux_target_ops): Replace linux_low_enable_btrace with
1081         linux_enable_btrace.
1082
1083 2015-09-03  Yao Qi  <yao.qi@linaro.org>
1084
1085         * linux-aarch64-low.c (aarch64_insert_point): Call
1086         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
1087         returns true.
1088
1089 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1090
1091         * linux-low.c (check_stopped_by_breakpoint): Use
1092         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
1093
1094 2015-08-27  Pedro Alves  <palves@redhat.com>
1095
1096         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
1097
1098 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
1099
1100         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
1101         the XNEW-family equivalent.
1102         (compile_bytecodes): Likewise.
1103         * dll.c (loaded_dll): Likewise.
1104         * event-loop.c (append_callback_event): Likewise.
1105         (create_file_handler): Likewise.
1106         (create_file_event): Likewise.
1107         * hostio.c (handle_open): Likewise.
1108         * inferiors.c (add_thread): Likewise.
1109         (add_process): Likewise.
1110         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
1111         * linux-arm-low.c (arm_new_process): Likewise.
1112         (arm_new_thread): Likewise.
1113         * linux-low.c (add_to_pid_list): Likewise.
1114         (linux_add_process): Likewise.
1115         (handle_extended_wait): Likewise.
1116         (add_lwp): Likewise.
1117         (enqueue_one_deferred_signal): Likewise.
1118         (enqueue_pending_signal): Likewise.
1119         (linux_resume_one_lwp_throw): Likewise.
1120         (linux_resume_one_thread): Likewise.
1121         (linux_read_memory): Likewise.
1122         (linux_write_memory): Likewise.
1123         * linux-mips-low.c (mips_linux_new_process): Likewise.
1124         (mips_linux_new_thread): Likewise.
1125         (mips_add_watchpoint): Likewise.
1126         * linux-x86-low.c (initialize_low_arch): Likewise.
1127         * lynx-low.c (lynx_add_process): Likewise.
1128         * mem-break.c (set_raw_breakpoint_at): Likewise.
1129         (set_breakpoint): Likewise.
1130         (add_condition_to_breakpoint): Likewise.
1131         (add_commands_to_breakpoint): Likewise.
1132         (clone_agent_expr): Likewise.
1133         (clone_one_breakpoint): Likewise.
1134         * regcache.c (new_register_cache): Likewise.
1135         * remote-utils.c (look_up_one_symbol): Likewise.
1136         * server.c (queue_stop_reply): Likewise.
1137         (start_inferior): Likewise.
1138         (queue_stop_reply_callback): Likewise.
1139         (handle_target_event): Likewise.
1140         * spu-low.c (fetch_ppc_memory): Likewise.
1141         (store_ppc_memory): Likewise.
1142         * target.c (set_target_ops): Likewise.
1143         * thread-db.c (thread_db_load_search): Likewise.
1144         (try_thread_db_load_1): Likewise.
1145         * tracepoint.c (add_tracepoint): Likewise.
1146         (add_tracepoint_action): Likewise.
1147         (create_trace_state_variable): Likewise.
1148         (cmd_qtdpsrc): Likewise.
1149         (cmd_qtro): Likewise.
1150         (add_while_stepping_state): Likewise.
1151         * win32-low.c (child_add_thread): Likewise.
1152         (get_image_name): Likewise.
1153
1154 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1155
1156         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1157
1158 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1159
1160         * Makefile.in (aarch64-linux.o): New rule.
1161         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1162         srv_tgtobj.
1163         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1164         (aarch64_init_debug_reg_state): Make it extern.
1165         (aarch64_linux_prepare_to_resume): Remove.
1166
1167 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1168
1169         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1170         lwp_arch_private_info and ptid_of_lwp.
1171
1172 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1173
1174         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1175         Find proc_info by find_process_pid.  All callers updated.
1176
1177 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1178
1179         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1180         Remove.
1181         (debug_reg_change_callback): Remove.
1182         (aarch64_notify_debug_reg_change): Remove.
1183
1184 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1185
1186         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1187         Call current_lwp_ptid.
1188
1189 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1190
1191         * linux-aarch64-low.c (debug_reg_change_callback): Use
1192         debug_printf.
1193
1194 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1195
1196         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1197
1198 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1199
1200         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1201
1202 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1203
1204         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1205         the code.
1206
1207 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1208
1209         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1210         Remove.
1211         (debug_reg_change_callback): Remove argument entry and add argument
1212         lwp.  Remove local variable thread.  Don't print thread id in the
1213         debugging output.  Don't check whether pid of thread equals to pid.
1214         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1215         iterate_over_lwps instead find_inferior.
1216
1217 2015-08-24  Pedro Alves  <palves@redhat.com>
1218
1219         * inferiors.c (get_first_process): New function.
1220         * inferiors.h (get_first_process): New declaration.
1221         * remote-utils.c (read_ptid): Default to the first process in the
1222         list, instead of to the current thread's process.
1223
1224 2015-08-24  Pedro Alves  <palves@redhat.com>
1225
1226         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1227         * event-loop.c: Likewise.
1228         * remote-utils.c: Likewise.
1229         * tracepoint.c: Likewise.
1230
1231 2015-08-24  Pedro Alves  <palves@redhat.com>
1232
1233         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1234         ptid_get_lwp.
1235
1236 2015-08-21  Pedro Alves  <palves@redhat.com>
1237
1238         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1239         instead of literal 1.
1240
1241 2015-08-21  Pedro Alves  <palves@redhat.com>
1242
1243         * tdesc.c (default_description): Explicitly zero-initialize.
1244
1245 2015-08-21  Pedro Alves  <palves@redhat.com>
1246
1247         PR gdb/18749
1248         * inferiors.c (remove_thread): Discard any pending stop reply for
1249         this thread.
1250         * server.c (remove_all_on_match_pid): Rename to ...
1251         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1252         instead of a pid.
1253         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1254         extern.
1255         (handle_v_kill, kill_inferior_callback, captured_main)
1256         (process_serial_event): Adjust.
1257         * server.h (discard_queued_stop_replies): Declare.
1258
1259 2015-08-21  Pedro Alves  <palves@redhat.com>
1260
1261         * linux-low.c (wait_for_sigstop): Always switch to no thread
1262         selected if the previously current thread dies.
1263         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1264         process instead of the current thread's.
1265         * remote-utils.c (input_interrupt): Don't check if there's no
1266         current thread.
1267         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1268         current thread to the general thread fails, error out.
1269         (handle_qxfer_auxv, handle_qxfer_libraries)
1270         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1271         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1272         (handle_query): Check if there's a thread selected instead of
1273         checking whether there's any thread in the thread list.
1274         (handle_qxfer_threads, handle_qxfer_btrace)
1275         (handle_qxfer_btrace_conf): Don't error out early if there's no
1276         thread in the thread list.
1277         (handle_v_cont, myresume): Don't set the current thread to the
1278         continue thread.
1279         (process_serial_event) <Hg handling>: Also set thread_id if the
1280         previous general thread is still alive.
1281         (process_serial_event) <g/G handling>: If setting the current
1282         thread to the general thread fails, error out.
1283         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1284         thread's lwp instead of the current thread's.
1285         * target.c (set_desired_thread): If the desired thread was not
1286         found, leave the current thread pointing to NULL.  Return an int
1287         (boolean) indicating success.
1288         * target.h (set_desired_thread): Change return type to int.
1289
1290 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1291
1292         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1293         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1294         #includes.
1295         (ps_get_thread_area): New function.
1296
1297 2015-08-19  Gary Benson  <gbenson@redhat.com>
1298
1299         * hostio.c (handle_pread): Do not attempt to read more data
1300         than hostio_reply_with_data can fit in a packet.
1301
1302 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1303
1304         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1305
1306 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1307
1308         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1309
1310 2015-08-06  Pedro Alves  <palves@redhat.com>
1311
1312         * tracepoint.c (expr_eval_result): Now an int.
1313
1314 2015-08-06  Pedro Alves  <palves@redhat.com>
1315
1316         * gdbthread.h (struct regcache): Forward declare.
1317         (struct thread_info) <regcache_data>: Now a struct regcache
1318         pointer.
1319         * inferiors.c (inferior_regcache_data)
1320         (set_inferior_regcache_data): Now work with struct regcache
1321         pointers.
1322         * inferiors.h (struct regcache): Forward declare.
1323         (inferior_regcache_data, set_inferior_regcache_data): Now work
1324         with struct regcache pointers.
1325         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1326         (free_register_cache_thread): Remove struct regcache pointer
1327         casts.
1328
1329 2015-08-06  Pedro Alves  <palves@redhat.com>
1330
1331         * server.c (captured_main): On error, print the exception message
1332         to stderr, and if run_once is set, throw a quit.
1333
1334 2015-08-06  Pedro Alves  <palves@redhat.com>
1335
1336         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1337         the current thread.
1338
1339 2015-08-06  Pedro Alves  <palves@redhat.com>
1340
1341         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1342         reading beyond the passed in buffer length.
1343
1344 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1345
1346         * tracepoint.c (symbol_list) <required>: Remove.
1347
1348 2015-08-06  Pedro Alves  <palves@redhat.com>
1349
1350         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1351         count if stopping and suspending threads.
1352         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1353         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1354         (linux_detach): Complete an ongoing step-over.
1355         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1356         throughout.
1357         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1358         (linux_wait_1): If passing a signal to the inferior after
1359         finishing a step-over, unsuspend and re-resume all lwps.  If we
1360         see a single-step event but the thread should be continuing, don't
1361         pass the trap to gdb.
1362         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1363         internal_error instead of gdb_assert.
1364         (enqueue_pending_signal): New function.
1365         (check_ptrace_stopped_lwp_gone): Add debug output.
1366         (start_step_over): Use internal_error instead of gdb_assert.
1367         (complete_ongoing_step_over): New function.
1368         (linux_resume_one_thread): Don't resume a suspended thread.
1369         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1370         it stepping.
1371
1372 2015-08-06  Pedro Alves  <palves@redhat.com>
1373
1374         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1375         (linux_thread_alive): Use lwp_is_marked_dead.
1376         (extended_event_reported): Delete.
1377         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1378         instead of extended_event_reported.
1379         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1380         as well.
1381         (lwp_is_marked_dead): New function.
1382         (lwp_running): Use lwp_is_marked_dead.
1383         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1384         comment.
1385
1386 2015-08-06  Pedro Alves  <palves@redhat.com>
1387
1388         * linux-low.c (linux_wait_1): Move fork event output out of the
1389         !report_to_gdb check.  Pass event_child->waitstatus to
1390         target_waitstatus_to_string instead of ourstatus.
1391
1392 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1393
1394         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1395         if current_thread is 32 bit.
1396
1397 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1398
1399         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1400         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1401         * server.c (extended_protocol): Remove "static".
1402         * server.h (extended_protocol): Declare it.
1403
1404 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1405
1406         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1407         both aarch64 and aarch32.
1408         (aarch64_set_pc): Likewise.
1409
1410 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1411
1412         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1413         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1414         arm-with-neon.xml to srv_xmlfiles.
1415         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1416         (is_64bit_tdesc): New function.
1417         (aarch64_linux_read_description): New function.
1418         (aarch64_arch_setup): Call aarch64_linux_read_description.
1419         (regs_info): Rename to regs_info_aarch64.
1420         (aarch64_regs_info): Return right regs_info.
1421         (initialize_low_arch): Call initialize_low_arch_aarch32.
1422
1423 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1424
1425         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1426         * linux-aarch32-low.c: New file.
1427         * linux-aarch32-low.h: New file.
1428         * linux-arm-low.c (arm_fill_gregset): Move it to
1429         linux-aarch32-low.c.
1430         (arm_store_gregset): Likewise.
1431         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1432         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1433         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1434         (regs_info): Rename to regs_info_arm.
1435         (arm_regs_info): Return regs_info_aarch32 if
1436         have_ptrace_getregset is 1 and target description is
1437         arm_with_neon or arm_with_vfpv3.
1438         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1439         Call initialize_low_arch_aarch32 instead.
1440
1441 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1442
1443         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1444         * linux-low.c: ... here.
1445         * linux-low.h (have_ptrace_getregset): Declare it.
1446
1447 2015-08-04  Pedro Alves  <palves@redhat.com>
1448
1449         * thread-db.c (struct thread_db): Use new typedefs.
1450         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1451         CHK calls.
1452         (disable_thread_event_reporting): Cast result of dlsym to
1453         destination function pointer type.
1454         (thread_db_mourn): Use td_ta_delete_ftype.
1455
1456 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1457
1458         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1459         arch variant.
1460         (CDX_BREAKPOINT): Define for R2.
1461         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1462         (the_low_target): Add comments.
1463
1464 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1465
1466         * linux-arm-low.c (arm_hwcap): Remove it.
1467         (arm_read_description): New local variable arm_hwcap.  Don't
1468         set arm_hwcap to zero.
1469
1470 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1471
1472         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1473         Use regcache->tdesc instead.
1474         (arm_store_wmmxregset): Likewise.
1475         (arm_fill_vfpregset): Likewise.
1476         (arm_store_vfpregset): Likewise.
1477
1478 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1479
1480         * linux-arm-low.c: Include arch/arm.h.
1481         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1482         (arm_store_gregset): Likewise.
1483
1484 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1485
1486         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1487         ptrace's 4th parameter.
1488
1489 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1490
1491         * configure.srv (case aarch64*-*-linux*): Don't set
1492         srv_linux_usrregs.
1493
1494 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1495
1496         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1497         sys/ptrace.h.
1498         * linux-arm-low.c: Likewise.
1499         * linux-cris-low.c: Likewise.
1500         * linux-crisv32-low.c: Likewise.
1501         * linux-low.c: Likewise.
1502         * linux-m68k-low.c: Likewise.
1503         * linux-mips-low.c: Likewise.
1504         * linux-nios2-low.c: Likewise.
1505         * linux-s390-low.c: Likewise.
1506         * linux-sparc-low.c: Likewise.
1507         * linux-tic6x-low.c: Likewise.
1508         * linux-tile-low.c: Likewise.
1509         * linux-x86-low.c: Likewise.
1510
1511 2015-07-24  Pedro Alves  <palves@redhat.com>
1512
1513         * config.in: Regenerate.
1514         * configure: Regenerate.
1515
1516 2015-07-24  Pedro Alves  <palves@redhat.com>
1517
1518         * acinclude.m4: Include ../ptrace.m4.
1519         * configure.ac: Call GDB_AC_PTRACE.
1520         * config.in, configure: Regenerate.
1521
1522 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1523
1524         * linux-low.c (linux_create_inferior): Remove setting to
1525         proc->priv->new_inferior.
1526         (linux_attach): Likewise.
1527         (linux_low_filter_event): Likewise.
1528         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1529
1530 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1531
1532         * linux-low.c (linux_arch_setup): New function.
1533         (linux_low_filter_event): If proc->tdesc is NULL and
1534         proc->attached is true, call the_low_target.arch_setup.
1535         Otherwise, keep status pending, and return.
1536         (linux_resume_one_lwp_throw): Don't call get_pc if
1537         thread->while_stepping isn't NULL.  Don't call
1538         get_thread_regcache if proc->tdesc is NULL.
1539         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1540         (linux_target_ops): Install arch_setup.
1541         * server.c (start_inferior): Call the_target->arch_setup.
1542         * target.h (struct target_ops) <arch_setup>: New field.
1543         (target_arch_setup): New marco.
1544         * lynx-low.c (lynx_target_ops): Update.
1545         * nto-low.c (nto_target_ops): Update.
1546         * spu-low.c (spu_target_ops): Update.
1547         * win32-low.c (win32_target_ops): Update.
1548
1549 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1550
1551         * linux-low.c (linux_add_process): Don't set
1552         proc->priv->new_inferior.
1553         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1554         (linux_attach): Likewise.
1555
1556 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1557
1558         * server.c (start_inferior): Code refactor.
1559
1560 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1561
1562         * server.c (process_serial_event): Set general_thread.
1563
1564 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1565
1566         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1567         aarch64_linux_get_debug_reg_capacity.
1568
1569 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1570
1571         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1572         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1573         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1574         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1575         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1576         (AARCH64_HWP_ALIGNMENT): Likewise.
1577         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1578         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1579         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1580         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1581         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1582         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1583         (struct aarch64_debug_reg_state): Likewise.
1584         (struct arch_lwp_info): Likewise.
1585         (aarch64_align_watchpoint): Likewise.
1586         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1587         (aarch64_watchpoint_length): Likewise.
1588         (aarch64_point_encode_ctrl_reg): Likewise
1589         (aarch64_point_is_aligned): Likewise.
1590         (aarch64_align_watchpoint): Likewise.
1591         (aarch64_linux_set_debug_regs):
1592         (aarch64_dr_state_insert_one_point): Likewise.
1593         (aarch64_dr_state_remove_one_point): Likewise.
1594         (aarch64_handle_breakpoint): Likewise.
1595         (aarch64_handle_aligned_watchpoint): Likewise.
1596         (aarch64_handle_unaligned_watchpoint): Likewise.
1597         (aarch64_handle_watchpoint): Likewise.
1598
1599 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1600
1601         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1602         and don't aarch64_get_debug_reg_state.  All callers update.
1603         (aarch64_handle_aligned_watchpoint): Likewise.
1604         (aarch64_handle_unaligned_watchpoint): Likewise.
1605         (aarch64_handle_watchpoint): Likewise.
1606         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1607         (aarch64_remove_point): Likewise.
1608
1609 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1610
1611         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1612         debug_printf.
1613         (aarch64_handle_unaligned_watchpoint): Likewise.
1614
1615 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1616
1617         Revert the previous 3 commits:
1618         Move gdb_regex* to common/
1619         Move linux_find_memory_regions_full & co.
1620         gdbserver build-id attribute generator
1621
1622 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1623             Jan Kratochvil  <jan.kratochvil@redhat.com>
1624
1625         gdbserver build-id attribute generator.
1626         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1627         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1628         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1629         (find_phdr): New.
1630         (get_dynamic): Use find_pdhr to traverse program headers.
1631         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1632         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1633         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
1634         (get_hex_build_id): New.
1635         (linux_qxfer_libraries_svr4): Add optional build-id attribute
1636         to reply XML document.
1637
1638 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1639             Jan Kratochvil  <jan.kratochvil@redhat.com>
1640
1641         * target.c: Include target/target-utils.h and fcntl.h.
1642         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
1643         (target_fileio_read_stralloc): New functions.
1644
1645 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1646
1647         * Makefile.in (OBS): Add gdb_regex.o.
1648         (gdb_regex.o): New.
1649         * config.in: Rebuilt.
1650         * configure: Rebuilt.
1651
1652 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1653             Jan Kratochvil  <jan.kratochvil@redhat.com>
1654
1655         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
1656         * Makefile.in (OBS): Add target-utils.o.
1657         (linux-maps.o, target-utils.o): New.
1658         * configure.srv (srv_linux_obj): Add linux-maps.o.
1659
1660 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
1661
1662         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
1663         function, return 1.
1664         (the_low_target): Install it.
1665
1666 2015-07-14  Pedro Alves  <palves@redhat.com>
1667
1668         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
1669         Instead, ignore ECHILD, and throw an error for other errnos.
1670
1671 2015-07-10  Pedro Alves  <palves@redhat.com>
1672
1673         * event-loop.c (struct callback_event) <data>: Change type to
1674         gdb_client_data instance instead of gdb_client_data pointer.
1675         (append_callback_event): Adjust.
1676
1677 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
1678
1679         * linux-aarch64-low.c: Add comments for each linux_target_ops
1680         method.  Remove comments already covered in target_ops and
1681         linux_target_ops definitions.
1682         (the_low_target): Add comments for each unimplemented method.
1683
1684 2015-07-09  Yao Qi  <yao.qi@linaro.org>
1685
1686         * linux-aarch64-low.c (aarch64_regmap): Remove.
1687         (aarch64_usrregs_info): Remove.
1688         (regs_info): Set field usrregs to NULL.
1689
1690 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
1691
1692         * linux-low.c: Include "rsp-low.h"
1693         (linux_low_encode_pt_config, linux_low_encode_raw): New.
1694         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
1695         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
1696         (handle_btrace_enable_pt): New.
1697         (handle_btrace_general_set): Support "pt".
1698         (handle_btrace_conf_general_set): Support "pt:size".
1699
1700 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1701
1702         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
1703         Z_PACKET_SW_BP.
1704
1705 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1706
1707         * linux-aarch64-low.c: Remove comment about endianness.
1708         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
1709         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
1710         memcmp.
1711
1712 2015-06-24  Gary Benson  <gbenson@redhat.com>
1713
1714         * linux-i386-ipa.c (stdint.h): Do not include.
1715         * lynx-i386-low.c (stdint.h): Likewise.
1716         * lynx-ppc-low.c (stdint.h): Likewise.
1717         * mem-break.c (stdint.h): Likewise.
1718         * thread-db.c (stdint.h): Likewise.
1719         * tracepoint.c (stdint.h): Likewise.
1720         * win32-low.c (stdint.h): Likewise.
1721
1722 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
1723
1724         * server.c (write_qxfer_response): Update call to
1725         remote_escape_output.
1726
1727 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
1728             Jan Kratochvil  <jan.kratochvil@redhat.com>
1729
1730         Merge multiple hex conversions.
1731         * gdbreplay.c (tohex): Rename to 'fromhex'.
1732         (logchar): Use fromhex.
1733
1734 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1735
1736         * server.c (handle_qxfer_libraries): Set `version' attribute for
1737         <library-list>.
1738
1739 2015-06-10  Gary Benson  <gbenson@redhat.com>
1740
1741         * target.h (struct target_ops) <multifs_open>: New field.
1742         <multifs_unlink>: Likewise.
1743         <multifs_readlink>: Likewise.
1744         * linux-low.c (nat/linux-namespaces.h): New include.
1745         (linux_target_ops): Initialize the_target->multifs_open,
1746         the_target->multifs_unlink and the_target->multifs_readlink.
1747         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
1748         * hostio.c (hostio_fs_pid): New static variable.
1749         (hostio_handle_new_gdb_connection): New function.
1750         (handle_setfs): Likewise.
1751         (handle_open): Use the_target->multifs_open as appropriate.
1752         (handle_unlink): Use the_target->multifs_unlink as appropriate.
1753         (handle_readlink): Use the_target->multifs_readlink as
1754         appropriate.
1755         (handle_vFile): Handle vFile:setfs packets.
1756         * server.c (handle_query): Call hostio_handle_new_gdb_connection
1757         after target_handle_new_gdb_connection.
1758
1759 2015-06-10  Gary Benson  <gbenson@redhat.com>
1760
1761         * configure.ac (AC_CHECK_FUNCS): Add setns.
1762         * config.in: Regenerate.
1763         * configure: Likewise.
1764         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
1765         (linux-namespaces.o): New rule.
1766         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
1767
1768 2015-06-09  Gary Benson <gbenson@redhat.com>
1769
1770         * hostio.c (handle_open): Process mode argument with
1771         fileio_to_host_mode.
1772
1773 2015-06-01  Yao Qi  <yao.qi@linaro.org>
1774
1775         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
1776         * linux-x86-low.c: Likewise.
1777
1778 2015-05-28  Don Breazeal  <donb@codesourcery.com>
1779
1780         * linux-low.c (handle_extended_wait): Initialize
1781         thread_info.last_resume_kind for new fork children.
1782
1783 2015-05-15  Pedro Alves  <palves@redhat.com>
1784
1785         * target.h (target_handle_new_gdb_connection): Rewrite using if
1786         wrapped in do/while.
1787
1788 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
1789
1790         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
1791         * configure, config.in: Regenerate.
1792         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
1793         Declare typedef.
1794
1795 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1796
1797         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
1798         PTRACE_EVENT_VFORK_DONE.
1799         (linux_low_ptrace_options, extended_event_reported): Add vfork
1800         events.
1801         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
1802         and "vforkdone" for RSP 'T' Stop Reply Packet.
1803         * server.h (report_vfork_events): Declare
1804         global variable.
1805
1806 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1807
1808         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
1809         (the_low_target) <new_fork>: Initialize new member.
1810         * linux-arm-low.c (arm_new_fork): New function.
1811         (the_low_target) <new_fork>: Initialize new member.
1812         * linux-low.c (handle_extended_wait): Call new target function
1813         new_fork.
1814         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
1815         * linux-mips-low.c (mips_add_watchpoint): New function
1816         extracted from mips_insert_point.
1817         (the_low_target) <new_fork>: Initialize new member.
1818         (mips_linux_new_fork): New function.
1819         (mips_insert_point): Call mips_add_watchpoint.
1820         * linux-x86-low.c (x86_linux_new_fork): New function.
1821         (the_low_target) <new_fork>: Initialize new member.
1822
1823 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1824
1825         * linux-low.c (handle_extended_wait): Implement return value,
1826         rename argument 'event_child' to 'event_lwp', handle
1827         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
1828         (linux_low_ptrace_options): New function.
1829         (linux_low_filter_event): Call linux_low_ptrace_options,
1830         use different argument fo linux_enable_event_reporting,
1831         use return value from handle_extended_wait.
1832         (extended_event_reported): New function.
1833         (linux_wait_1): Call extended_event_reported and set
1834         status to report fork events.
1835         (linux_write_memory): Add pid to debug message.
1836         (reset_lwp_ptrace_options_callback): New function.
1837         (linux_handle_new_gdb_connection): New function.
1838         (linux_target_ops): Initialize new structure member.
1839         * linux-low.h (struct lwp_info) <waitstatus>: New member.
1840         * lynx-low.c: Initialize new structure member.
1841         * remote-utils.c (prepare_resume_reply): Implement stop reason
1842         "fork" for "T" stop message.
1843         * server.c (handle_query): Call handle_new_gdb_connection.
1844         * server.h (report_fork_events): Declare global flag.
1845         * target.h (struct target_ops) <handle_new_gdb_connection>:
1846         New member.
1847         (target_handle_new_gdb_connection): New macro.
1848         * win32-low.c: Initialize new structure member.
1849
1850 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1851
1852         * mem-break.c (APPEND_TO_LIST): Define macro.
1853         (clone_agent_expr): New function.
1854         (clone_one_breakpoint): New function.
1855         (clone_all_breakpoints): New function.
1856         * mem-break.h: Declare new functions.
1857
1858 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1859
1860         * linux-low.c (linux_supports_fork_events): New function.
1861         (linux_supports_vfork_events): New function.
1862         (linux_target_ops): Initialize new structure members.
1863         (initialize_low): Call linux_check_ptrace_features.
1864         * lynx-low.c (lynx_target_ops): Initialize new structure
1865         members.
1866         * server.c (report_fork_events, report_vfork_events):
1867         New global flags.
1868         (handle_query): Add new features to qSupported packet and
1869         response.
1870         (captured_main): Initialize new global variables.
1871         * target.h (struct target_ops) <supports_fork_events>:
1872         New member.
1873         <supports_vfork_events>: New member.
1874         (target_supports_fork_events): New macro.
1875         (target_supports_vfork_events): New macro.
1876         * win32-low.c (win32_target_ops): Initialize new structure
1877         members.
1878
1879 2015-05-12  Gary Benson <gbenson@redhat.com>
1880
1881         * server.c (handle_qxfer_exec_file): Use current process
1882         if annex is empty.
1883
1884 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
1885
1886         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
1887         Remove HAVE_PTRACE_GETREGS conditionals.
1888         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
1889         instead of PTRACE_GETREGS and PTRACE_SETREGS.
1890
1891 2015-05-08  Yao Qi  <yao.qi@linaro.org>
1892
1893         * linux-low.c (linux_supports_conditional_breakpoints): New
1894         function.
1895         (linux_target_ops): Install new target method.
1896         * lynx-low.c (lynx_target_ops): Install NULL hook for
1897         supports_conditional_breakpoints.
1898         * nto-low.c (nto_target_ops): Likewise.
1899         * spu-low.c (spu_target_ops): Likewise.
1900         * win32-low.c (win32_target_ops): Likewise.
1901         * server.c (handle_query): Check
1902         target_supports_conditional_breakpoints.
1903         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1904         New field.
1905         (target_supports_conditional_breakpoints): New macro.
1906
1907 2015-05-06  Pedro Alves  <palves@redhat.com>
1908
1909         PR server/18081
1910         * server.c (start_inferior): If the process exits, mourn it.
1911
1912 2015-04-21  Gary Benson <gbenson@redhat.com>
1913
1914         * hostio.c (fileio_open_flags_to_host): Factored out to
1915         fileio_to_host_openflags in common/fileio.c.  Single use
1916         updated.
1917
1918 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1919
1920         * linux-xtensa-low.c (xtensa_fill_gregset)
1921         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
1922         XCHAL_HAVE_LOOP.
1923
1924 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1925
1926         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
1927         (regs_info): Replace usrregs pointer with NULL.
1928
1929 2015-04-17  Gary Benson  <gbenson@redhat.com>
1930
1931         * target.h (struct target_ops) <pid_to_exec_file>: New field.
1932         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
1933         * server.c (handle_qxfer_exec_file): New function.
1934         (qxfer_packets): Add exec-file entry.
1935         (handle_query): Report qXfer:exec-file:read as supported packet.
1936
1937 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
1938
1939         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
1940
1941 2015-04-09  Gary Benson <gbenson@redhat.com>
1942
1943         * hostio-errno.c (errno_to_fileio_error): Remove function.
1944         Update caller to use remote_fileio_to_fio_error.
1945
1946 2015-04-09  Yao Qi  <yao.qi@linaro.org>
1947
1948         * linux-low.c (linux_insert_point): Call
1949         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
1950         (linux_remove_point): Call remove_memory_breakpoint if type is
1951         raw_bkpt_type_sw.
1952         * linux-x86-low.c (x86_insert_point): Don't call
1953         insert_memory_breakpoint.
1954         (x86_remove_point): Don't call remove_memory_breakpoint.
1955
1956 2015-04-01  Pedro Alves  <palves@redhat.com>
1957             Cleber Rosa  <crosa@redhat.com>
1958
1959         * server.c (gdbserver_usage): Reorganize and extend the usage
1960         message.
1961
1962 2015-03-24  Pedro Alves  <palves@redhat.com>
1963
1964         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
1965         output.  Also dump TRAP_TRACE.
1966         (linux_low_filter_event): In debug output, distinguish a
1967         resume_stop SIGSTOP from a delayed SIGSTOP.
1968
1969 2015-03-24  Gary Benson  <gbenson@redhat.com>
1970
1971         * linux-x86-low.c (x86_linux_new_thread): Moved to
1972         nat/x86-linux.c.
1973         (x86_linux_prepare_to_resume): Likewise.
1974
1975 2015-03-24  Gary Benson  <gbenson@redhat.com>
1976
1977         * Makefile.in (x86-linux-dregs.o): New rule.
1978         * configure.srv: Add x86-linux-dregs.o to relevant targets.
1979         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
1980         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
1981         (x86_linux_dr_get): Likewise.
1982         (x86_linux_dr_set): Likewise.
1983         (update_debug_registers_callback): Likewise.
1984         (x86_linux_dr_set_addr): Likewise.
1985         (x86_linux_dr_get_addr): Likewise.
1986         (x86_linux_dr_set_control): Likewise.
1987         (x86_linux_dr_get_control): Likewise.
1988         (x86_linux_dr_get_status): Likewise.
1989         (x86_linux_update_debug_registers): Likewise.
1990
1991 2015-03-24  Gary Benson  <gbenson@redhat.com>
1992
1993         * linux-x86-low.c (x86_linux_update_debug_registers):
1994         New function, factored out from...
1995         (x86_linux_prepare_to_resume): ...this.
1996
1997 2015-03-24  Gary Benson  <gbenson@redhat.com>
1998
1999         * linux-x86-low.c (x86_linux_dr_get): Update comments.
2000         (x86_linux_dr_set): Likewise.
2001         (update_debug_registers_callback): Likewise.
2002         (x86_linux_dr_set_addr): Likewise.
2003         (x86_linux_dr_get_addr): Likewise.
2004         (x86_linux_dr_set_control): Likewise.
2005         (x86_linux_dr_get_control): Likewise.
2006         (x86_linux_dr_get_status): Likewise.
2007         (x86_linux_prepare_to_resume): Likewise.
2008
2009 2015-03-24  Gary Benson  <gbenson@redhat.com>
2010
2011         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
2012         Use perror_with_name.  Pass string through gettext.
2013         (x86_linux_dr_set): Likewise.
2014
2015 2015-03-24  Gary Benson  <gbenson@redhat.com>
2016
2017         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
2018         (x86_linux_dr_set_addr): ...this.
2019         (x86_dr_low_get_addr): Rename to...
2020         (x86_linux_dr_get_addr): ...this.
2021         (x86_dr_low_set_control): Rename to...
2022         (x86_linux_dr_set_control): ...this.
2023         (x86_dr_low_get_control): Rename to...
2024         (x86_linux_dr_get_control): ...this.
2025         (x86_dr_low_get_status): Rename to...
2026         (x86_linux_dr_get_status): ...this.
2027         (x86_dr_low): Update with new function names.
2028
2029 2015-03-24  Gary Benson  <gbenson@redhat.com>
2030
2031         * Makefile.in (x86-linux.o): New rule.
2032         * configure.srv: Add x86-linux.o to relevant targets.
2033         * linux-low.c (lwp_set_arch_private_info): New function.
2034         (lwp_arch_private_info): Likewise.
2035         * linux-x86-low.c: Include nat/x86-linux.h.
2036         (arch_lwp_info): Removed structure.
2037         (update_debug_registers_callback):
2038         Use lwp_set_debug_registers_changed.
2039         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
2040         and lwp_set_debug_registers_changed.
2041         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2042
2043 2015-03-24  Gary Benson  <gbenson@redhat.com>
2044
2045         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
2046         * linux-arm-low.c (arm_new_thread): Likewise.
2047         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
2048         * linux-mips-low.c (mips_linux_new_thread): Likewise.
2049         * linux-x86-low.c (x86_linux_new_thread): Likewise.
2050         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
2051
2052 2015-03-24  Gary Benson  <gbenson@redhat.com>
2053
2054         * linux-low.c (ptid_of_lwp): New function.
2055         (lwp_is_stopped): Likewise.
2056         (lwp_stop_reason): Likewise.
2057         * linux-x86-low.c (update_debug_registers_callback):
2058         Use lwp_is_stopped.
2059         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
2060         lwp_stop_reason.
2061
2062 2015-03-24  Gary Benson  <gbenson@redhat.com>
2063
2064         * linux-low.h (linux_stop_lwp): Remove declaration.
2065
2066 2015-03-24  Gary Benson  <gbenson@redhat.com>
2067
2068         * linux-low.h: Include nat/linux-nat.h.
2069         * linux-low.c (iterate_over_lwps_args): New structure.
2070         (iterate_over_lwps_filter): New function.
2071         (iterate_over_lwps): Likewise.
2072         * linux-x86-low.c (update_debug_registers_callback):
2073         Update signature to what iterate_over_lwps expects.
2074         Remove PID check that iterate_over_lwps now performs.
2075         (x86_dr_low_set_addr): Use iterate_over_lwps.
2076         (x86_dr_low_set_control): Likewise.
2077
2078 2015-03-24  Gary Benson  <gbenson@redhat.com>
2079
2080         * linux-x86-low.c (x86_debug_reg_state): New function.
2081         (x86_linux_prepare_to_resume): Use the above.
2082
2083 2015-03-24  Gary Benson  <gbenson@redhat.com>
2084
2085         * linux-low.c (current_lwp_ptid): New function.
2086         * linux-x86-low.c: Include nat/linux-nat.h.
2087         (x86_dr_low_get_addr): Use current_lwp_ptid.
2088         (x86_dr_low_get_control): Likewise.
2089         (x86_dr_low_get_status): Likewise.
2090
2091 2015-03-20  Pedro Alves  <palves@redhat.com>
2092
2093         * tracepoint.c (cmd_qtstatus): Make "str" const.
2094
2095 2015-03-20  Pedro Alves  <palves@redhat.com>
2096
2097         * server.c (handle_general_set): Make "req_str" const.
2098
2099 2015-03-19  Pedro Alves  <palves@redhat.com>
2100
2101         * linux-low.c (linux_resume_one_lwp): Rename to ...
2102         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
2103         instead call perror_with_name.
2104         (check_ptrace_stopped_lwp_gone): New function.
2105         (linux_resume_one_lwp): Reimplement as wrapper around
2106         linux_resume_one_lwp_throw that swallows errors if the LWP is
2107         gone.
2108
2109 2015-03-19  Pedro Alves  <palves@redhat.com>
2110
2111         * linux-low.c (count_events_callback, select_event_lwp_callback):
2112         No longer check whether the thread has resume_stop as last resume
2113         kind.
2114
2115 2015-03-19 Pedro Alves  <palves@redhat.com>
2116
2117         * linux-low.c (count_events_callback, select_event_lwp_callback):
2118         Use the lwp's status_pending_p field, not the thread's.
2119
2120 2015-03-19  Pedro Alves  <palves@redhat.com>
2121
2122         * linux-low.c (select_event_lwp_callback): Update comments to
2123         no longer mention SIGTRAP.
2124
2125 2015-03-18  Gary Benson  <gbenson@redhat.com>
2126
2127         * server.c (handle_query): Do not report vFile:fstat as supported.
2128
2129 2015-03-11  Gary Benson  <gbenson@redhat.com>
2130
2131         * hostio.c (sys/types.h): New include.
2132         (sys/stat.h): Likewise.
2133         (common-remote-fileio.h): Likewise.
2134         (handle_fstat): New function.
2135         (handle_vFile): Handle vFile:fstat packets.
2136
2137 2015-03-11  Gary Benson  <gbenson@redhat.com>
2138
2139         * configure.ac (AC_CHECK_MEMBERS): Add checks for
2140         struct stat.st_blocks and struct stat.st_blksize.
2141         * configure: Regenerate.
2142         * config.in: Likewise.
2143         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
2144         (OBS): Add common-remote-fileio.o.
2145         (common-remote-fileio.o): New rule.
2146
2147 2015-03-09  Pedro Alves  <palves@redhat.com>
2148
2149         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2150         'struct sockaddr' pointer in 'accept' call.
2151
2152 2015-03-09  Pedro Alves  <palves@redhat.com>
2153
2154         Revert:
2155         2015-03-07  Pedro Alves  <palves@redhat.com>
2156         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2157         or <winsock2.h> here.  Instead include "gdb_socket.h".
2158         (remote_open): Use union gdb_sockaddr_u.
2159         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2160         or <winsock2.h> here.  Instead include "gdb_socket.h".
2161         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2162         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2163         or <sys/un.h>.
2164         (init_named_socket, gdb_agent_helper_thread): Use union
2165         gdb_sockaddr_u.
2166
2167 2015-03-07  Pedro Alves  <palves@redhat.com>
2168
2169         * configure.ac (build_warnings): Move
2170         -Wdeclaration-after-statement to the C-specific set.
2171         * configure: Regenerate.
2172
2173 2015-03-07  Pedro Alves  <palves@redhat.com>
2174
2175         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2176         or <winsock2.h> here.  Instead include "gdb_socket.h".
2177         (remote_open): Use union gdb_sockaddr_u.
2178         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2179         or <winsock2.h> here.  Instead include "gdb_socket.h".
2180         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2181         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2182         or <sys/un.h>.
2183         (init_named_socket, gdb_agent_helper_thread): Use union
2184         gdb_sockaddr_u.
2185
2186 2015-03-07  Pedro Alves  <palves@redhat.com>
2187
2188         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2189         instead.
2190
2191 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2192
2193         * linux-aarch64-low.c (aarch64_insert_point): Use
2194         show_debug_regs as a boolean.
2195         (aarch64_remove_point): Likewise.
2196
2197 2015-03-05  Pedro Alves  <palves@redhat.com>
2198
2199         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2200         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2201         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2202         * nto-low.c (nto_target_ops): Likewise.
2203         * spu-low.c (spu_target_ops): Likewise.
2204         * win32-low.c (win32_target_ops): Likewise.
2205
2206 2015-03-04  Pedro Alves  <palves@redhat.com>
2207
2208         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2209         Decide whether a breakpoint triggered based on the SIGTRAP's
2210         siginfo.si_code.
2211         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2212         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2213         (linux_low_filter_event): Check for breakpoints before checking
2214         watchpoints.
2215         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2216         siginfo.si_code.
2217         (linux_stopped_by_sw_breakpoint)
2218         (linux_supports_stopped_by_sw_breakpoint)
2219         (linux_stopped_by_hw_breakpoint)
2220         (linux_supports_stopped_by_hw_breakpoint): New functions.
2221         (linux_target_ops): Install new target methods.
2222
2223 2015-03-04  Pedro Alves  <palves@redhat.com>
2224
2225         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2226         * server.c (swbreak_feature, hwbreak_feature): New globals.
2227         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2228         (captured_main): Clear swbreak_feature and hwbreak_feature.
2229         * server.h (swbreak_feature, hwbreak_feature): Declare.
2230         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2231         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2232         supports_stopped_by_hw_breakpoint>: New fields.
2233         (target_supports_stopped_by_sw_breakpoint)
2234         (target_stopped_by_sw_breakpoint)
2235         (target_supports_stopped_by_hw_breakpoint)
2236         (target_stopped_by_hw_breakpoint): Declare.
2237
2238 2015-03-04  Pedro Alves  <palves@redhat.com>
2239
2240         enum lwp_stop_reason -> enum target_stop_reason
2241         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2242         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2243         (linux_wait_1, stuck_in_jump_pad_callback)
2244         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2245         (linux_stopped_by_watchpoint):
2246         * linux-low.h (enum lwp_stop_reason): Delete.
2247         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2248         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2249
2250 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2251
2252         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2253
2254 2015-03-03  Gary Benson  <gbenson@redhat.com>
2255
2256         * hostio.c (handle_vFile): Fix prefix lengths.
2257
2258 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2259
2260         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2261         ptr_bits.
2262
2263 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2264
2265         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2266         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2267         (clean): Add "rm -f" for above C files.
2268         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2269         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2270         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2271         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2272         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2273         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2274         (init_registers_s390x_vx_linux64)
2275         (init_registers_s390x_tevx_linux64)
2276         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2277         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2278         declarations.
2279         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2280         (s390_store_vxrs_high): New functions.
2281         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2282         NT_S390_VXRS_HIGH.
2283         (s390_arch_setup): Add logic for selecting one of the new target
2284         descriptions.  Activate the new vector regsets if applicable.
2285         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2286         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2287         and init_registers_s390x_tevx_linux64.
2288
2289 2015-03-01  Pedro Alves  <palves@redhat.com>
2290
2291         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2292         parameter.
2293
2294 2015-02-27  Pedro Alves  <palves@redhat.com>
2295
2296         * linux-x86-low.c (u_debugreg_offset): New function.
2297         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2298
2299 2015-02-27  Pedro Alves  <palves@redhat.com>
2300
2301         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2302         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2303         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2304         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2305         (ps_lsetfpregs, ps_getpid)
2306         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2307         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2308         (ps_lsetxregs, ps_plog): Declare.
2309
2310 2015-02-27  Pedro Alves  <palves@redhat.com>
2311
2312         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2313         IP_AGENT_EXPORT_FUNC.
2314         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2315         IP_AGENT_EXPORT_FUNC.
2316         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2317         (IP_AGENT_EXPORT): Delete.
2318         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2319         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2320         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2321         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2322         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2323         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2324         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2325         (traceframe_read_count, traceframe_write_count)
2326         (traceframes_created, trace_state_variables, get_raw_reg)
2327         (get_trace_state_variable_value, set_trace_state_variable_value)
2328         (ust_loaded, helper_thread_id, cmd_buf): Use
2329         IPA_SYM_EXPORTED_NAME.
2330         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2331         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2332         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2333         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2334         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2335         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2336         EXTERN_C_PUSH/EXTERN_C_POP.
2337         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2338         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2339         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2340         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2341         (traceframe_write_count, traceframe_read_count)
2342         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2343         (about_to_request_buffer_space, get_trace_state_variable_value)
2344         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2345         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2346         EXTERN_C_PUSH/EXTERN_C_POP.
2347         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2348         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2349         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2350         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2351         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2352         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2353         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2354         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2355         Define.
2356         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2357         (IP_AGENT_EXPORT_VAR_DECL): Define.
2358         (tracing): Declare.
2359         (gdb_agent_get_raw_reg): Declare.
2360
2361 2015-02-27  Tom Tromey  <tromey@redhat.com>
2362             Pedro Alves  <palves@redhat.com>
2363
2364         Rename symbols whose names are reserved C++ keywords throughout.
2365
2366 2015-02-27  Pedro Alves  <palves@redhat.com>
2367
2368         * Makefile.in (COMPILER): New, get it from autoconf.
2369         (CXX): Get from autoconf instead.
2370         (COMPILE.pre): Use COMPILER.
2371         (CC-LD): Rename to ...
2372         (CC_LD): ... this.  Use COMPILER.
2373         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2374         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2375         * acinclude.m4: Include build-with-cxx.m4.
2376         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2377         Disable -Werror by default if building in C++ mode.
2378         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2379         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2380         the C++ compiler.  Save/restore CXXFLAGS too.
2381         * configure: Regenerate.
2382
2383 2015-02-27  Pedro Alves  <palves@redhat.com>
2384
2385         * acinclude.m4: Include libiberty.m4.
2386         * configure.ac: Call libiberty_INIT.
2387         * config.in, configure: Regenerate.
2388
2389 2015-02-26  Pedro Alves  <palves@redhat.com>
2390
2391         * linux-low.c (linux_wait_1): When incrementing the PC past a
2392         program breakpoint always use the_low_target.breakpoint_len as
2393         increment, rather than the maximum between that and
2394         the_low_target.decr_pc_after_break.
2395
2396 2015-02-23  Pedro Alves  <palves@redhat.com>
2397
2398         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2399         thread was doing a step-over; always adjust the PC if
2400         we stepped over a permanent breakpoint.
2401         (linux_wait_1): If we stepped over breakpoint that was on top of a
2402         permanent breakpoint, manually advance the PC past it.
2403
2404 2015-02-23  Pedro Alves  <palves@redhat.com>
2405
2406         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2407         modes.
2408         (x86_fill_gregset, x86_store_gregset): Use it when handling
2409         $orig_eax.
2410
2411 2015-02-20  Pedro Alves  <palves@redhat.com>
2412
2413         * thread-db.c: Include "nat/linux-procfs.h".
2414         (thread_db_init): Skip listing new threads if the kernel supports
2415         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2416
2417 2015-02-20  Pedro Alves  <palves@redhat.com>
2418
2419         * linux-low.c (status_pending_p_callback): Use ptid_match.
2420
2421 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2422
2423         PR breakpoints/16812
2424         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2425         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2426         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2427
2428 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2429
2430         PR breakpoints/15956
2431         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2432
2433 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2434
2435         * linux-low.c (linux_low_btrace_conf): Print size.
2436         * server.c (handle_btrace_conf_general_set): New.
2437         (hanle_general_set): Call handle_btrace_conf_general_set.
2438         (handle_query): Report Qbtrace-conf:bts:size as supported.
2439
2440 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2441
2442         * linux-low.c (linux_low_enable_btrace): Update parameters.
2443         (linux_low_btrace_conf): New.
2444         (linux_target_ops)<to_btrace_conf>: Initialize.
2445         * server.c (current_btrace_conf): New.
2446         (handle_btrace_enable): Rename to ...
2447         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2448         to target_enable_btrace.  Update comment.  Update users.
2449         (handle_qxfer_btrace_conf): New.
2450         (qxfer_packets): Add btrace-conf entry.
2451         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2452         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2453         (target_ops)<read_btrace_conf>: New.
2454         (target_enable_btrace): Update parameters.
2455         (target_read_btrace_conf): New.
2456
2457 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2458
2459         * server.c (handle_btrace_general_set): Remove call to
2460         target_supports_btrace.
2461         (supported_btrace_packets): New.
2462         (handle_query): Call supported_btrace_packets.
2463         * target.h: include btrace-common.h.
2464         (btrace_target_info): Removed.
2465         (supports_btrace, target_supports_btrace): Update parameters.
2466
2467 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2468
2469         * Makefile.in (SFILES): Add common/btrace-common.c.
2470         (OBS): Add common/btrace-common.o.
2471         (btrace-common.o): Add build rules.
2472         * linux-low: Include btrace-common.h.
2473         (linux_low_read_btrace): Use struct btrace_data.  Call
2474         btrace_data_init and btrace_data_fini.
2475
2476 2015-02-06  Pedro Alves  <palves@redhat.com>
2477
2478         * thread-db.c (find_new_threads_callback): Add debug output.
2479
2480 2015-02-04  Pedro Alves  <palves@redhat.com>
2481
2482         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2483         (resume_stopped_resumed_lwps): New function.
2484         (linux_wait_for_event_filtered): Use it.
2485
2486 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2487
2488         * Makefile.in (SFILES): Add linux-personality.c.
2489         (linux-personality.o): New rule.
2490         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2491         list of objects to be built.
2492         * linux-low.c: Include nat/linux-personality.h.
2493         (linux_create_inferior): Remove code to disable address space
2494         randomization (moved to ../nat/linux-personality.c).  Create
2495         cleanup to disable address space randomization.
2496
2497 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2498
2499         * Makefile.in (posix-strerror.o): New rule.
2500         (mingw-strerror.o): Likewise.
2501         * configure: Regenerated.
2502         * configure.ac: Source file ../common/common.host.  Initialize new
2503         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2504
2505 2015-01-14  Yao Qi  <yao@codesourcery.com>
2506
2507         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2508         (ppc-linux.o): New rule.
2509         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2510         * configure.ac: AC_CHECK_FUNCS(getauxval).
2511         * config.in: Re-generated.
2512         * configure: Re-generated.
2513         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2514         ppc64_64bit_inferior_p
2515
2516 2015-01-14  Yao Qi  <yao@codesourcery.com>
2517
2518         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2519          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2520         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2521         (PT_ORIG_R3, PT_TRAP): Likewise.
2522         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2523         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2524         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2525
2526 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2527
2528         * i387-fp.c (i387_cache_to_xsave): In look over
2529         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2530         zmmh_low_space field by use of zmmh_high_space.
2531
2532 2015-01-09  Pedro Alves  <palves@redhat.com>
2533
2534         * linux-low.c (step_over_bkpt): Move higher up in the file.
2535         (handle_extended_wait): Don't store the stop_pc here.
2536         (get_stop_pc): Adjust comments and rename to ...
2537         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2538         stopped for a software breakpoint or hardware breakpoint.
2539         (thread_still_has_status_pending_p): New function.
2540         (status_pending_p_callback): Use
2541         thread_still_has_status_pending_p.  If the event is no longer
2542         interesting, resume the LWP.
2543         (handle_tracepoints): Add assert.
2544         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2545         (wstatus_maybe_breakpoint): New function.
2546         (cancel_breakpoint): Delete function.
2547         (check_stopped_by_watchpoint): New function, factored out from
2548         linux_low_filter_event.
2549         (lp_status_maybe_breakpoint): Delete function.
2550         (linux_low_filter_event): Remove filter_ptid argument.
2551         Leave thread group exits pending here.  Store the LWP's stop PC.
2552         Always leave events pending.
2553         (linux_wait_for_event_filtered): Pull all events out of the
2554         kernel, and leave them all pending.
2555         (count_events_callback, select_event_lwp_callback): Consider all
2556         events.
2557         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2558         (select_event_lwp): Only give preference to the stepping LWP in
2559         all-stop mode.  Adjust comments.
2560         (ignore_event): New function.
2561         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2562         references to cancel_breakpoints.  Adjust to renames.  Also give
2563         equal priority to all LWPs that have had events in non-stop mode.
2564         If reporting a software breakpoint event, unadjust the LWP's PC.
2565         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2566         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2567         Adjust.
2568         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2569         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2570         (linux_stopped_by_watchpoint): Adjust.
2571         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2572         * linux-low.h (enum lwp_stop_reason): New.
2573         (struct lwp_info) <stop_pc>: Adjust comment.
2574         <stopped_by_watchpoint>: Delete field.
2575         <stop_reason>: New field.
2576         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2577         * mem-break.c (software_breakpoint_inserted_here)
2578         (hardware_breakpoint_inserted_here): New function.
2579         * mem-break.h (software_breakpoint_inserted_here)
2580         (hardware_breakpoint_inserted_here): Declare.
2581         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2582         (cancel_breakpoints): Delete.
2583         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2584         (upload_fast_traceframes): Remove references to
2585         cancel_breakpoints.
2586
2587 2015-01-09  Pedro Alves  <palves@redhat.com>
2588
2589         * thread-db.c (find_new_threads_callback): Ignore thread if the
2590         kernel thread ID is -1.
2591
2592 2015-01-09  Pedro Alves  <palves@redhat.com>
2593
2594         * linux-low.c (linux_attach_fail_reason_string): Move to
2595         nat/linux-ptrace.c, and rename.
2596         (linux_attach_lwp): Update comment.
2597         (attach_proc_task_lwp_callback): New function.
2598         (linux_attach): Adjust to rename and use
2599         linux_proc_attach_tgid_threads.
2600         (linux_attach_fail_reason_string): Delete declaration.
2601
2602 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2603
2604         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2605         * server.c (gdbserver_version): Likewise.
2606
2607 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2608
2609         * remote-utils.c: Include ctype.h.
2610         (input_interrupt): Explicitly handle the case when the char
2611         received is the NUL byte.  Improve the printing of non-ASCII
2612         characters.
2613
2614 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2615
2616         * linux-low.c (linux_low_filter_event): Update call to
2617         linux_enable_event_reporting following the addition of
2618         a new parameter to that function.
2619
2620 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2621
2622         PR server/17457
2623         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2624         (AARCH64_FPCR_REGNO): Likewise.
2625         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2626         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2627         (aarch64_store_fpregset): Likewise.
2628
2629 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2630
2631         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2632         Remove FIXME comment about assumption about N.
2633
2634 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
2635
2636         * configure.ac: If large-file support is disabled in GDBserver,
2637         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
2638         * configure: Regenerate.
2639
2640 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2641
2642         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
2643         warning upon ENODATA from ptrace.
2644         * linux-s390-low.c (s390_store_tdb): New.
2645         (s390_regsets): Add regset for NT_S390_TDB.
2646
2647 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2648
2649         * linux-low.c (regsets_store_inferior_registers): Skip regsets
2650         without a fill_function.
2651         * linux-s390-low.c (s390_fill_last_break): Remove.
2652         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
2653         (s390_arch_setup): Use regset's size instead of fill_function for
2654         loop end condition.
2655
2656 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2657
2658         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
2659         the regset's store function when ptrace returned an error.
2660         * regcache.c (get_thread_regcache): Invalidate register cache
2661         before fetching inferior's registers.
2662
2663 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2664
2665         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
2666         while-loop as for-loop.
2667         (regsets_store_inferior_registers): Likewise.
2668
2669 2014-11-28  Yao Qi  <yao@codesourcery.com>
2670
2671         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
2672         * config.in, configure: Re-generate.
2673         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
2674         is defined.
2675
2676 2014-11-21  Yao Qi  <yao@codesourcery.com>
2677
2678         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
2679         (AC_CHECK_HEADERS): Remove malloc.h.
2680         * configure: Re-generated.
2681         * config.in: Re-generated.
2682         * server.h: Don't include alloca.h and malloc.h.
2683         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
2684         Don't include malloc.h.
2685
2686 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
2687
2688         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
2689         corresponding ERRNO check in same block.
2690
2691 2014-11-12  Pedro Alves  <palves@redhat.com>
2692
2693         * server.c (cont_thread): Update comment.
2694         (start_inferior, attach_inferior): No longer clear cont_thread.
2695         (handle_v_cont): No longer set cont_thread.
2696         (captured_main): Clear cont_thread each time a GDB connects.
2697
2698 2014-11-12  Pedro Alves  <palves@redhat.com>
2699
2700         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
2701         thread, and don't resume all threads if the Hc thread has exited.
2702
2703 2014-11-12  Pedro Alves  <palves@redhat.com>
2704
2705         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
2706         the process group instead of to a specific LWP.
2707
2708 2014-10-15  Pedro Alves  <palves@redhat.com>
2709
2710         PR server/17487
2711         * win32-arm-low.c (arm_set_thread_context): Remove current_event
2712         parameter.
2713         (arm_set_thread_context): Delete.
2714         (the_low_target): Adjust.
2715         * win32-i386-low.c (debug_registers_changed)
2716         (debug_registers_used): Delete.
2717         (update_debug_registers_callback): New function.
2718         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
2719         needing to update their debug registers.
2720         (win32_get_current_dr): New function.
2721         (x86_dr_low_get_addr, x86_dr_low_get_control)
2722         (x86_dr_low_get_status): Fetch the debug register from the thread
2723         record's context.
2724         (i386_initial_stuff): Adjust.
2725         (i386_get_thread_context): Remove current_event parameter.  Don't
2726         clear debug_registers_changed nor copy DR values to
2727         debug_reg_state.
2728         (i386_set_thread_context): Delete.
2729         (i386_prepare_to_resume): New function.
2730         (i386_thread_added): Mark the thread as needing to update irs
2731         debug registers.
2732         (the_low_target): Remove i386_set_thread_context and install
2733         i386_prepare_to_resume.
2734         * win32-low.c (win32_get_thread_context): Adjust.
2735         (win32_set_thread_context): Use SetThreadContext
2736         directly.
2737         (win32_prepare_to_resume): New function.
2738         (win32_require_context): New function, factored out from ...
2739         (thread_rec): ... this.
2740         (continue_one_thread): Call win32_prepare_to_resume on each thread
2741         we're about to continue.
2742         (win32_resume): Call win32_prepare_to_resume on the event thread.
2743         * win32-low.h (struct win32_thread_info)
2744         <debug_registers_changed>: New field.
2745         (struct win32_target_ops): Change prototype of set_thread_context,
2746         delete set_thread_context and add prepare_to_resume.
2747         (win32_require_context): New declaration.
2748
2749 2014-10-08  Gary Benson  <gbenson@redhat.com>
2750
2751         * server.h: Do not include common-exceptions.h.
2752
2753 2014-10-08  Gary Benson  <gbenson@redhat.com>
2754
2755         * server.h: Do not include cleanups.h.
2756
2757 2014-09-30  James Hogan  <james.hogan@imgtec.com>
2758
2759         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
2760         mips64-dsp-linux.c.
2761
2762 2014-09-23  Yao Qi  <yao@codesourcery.com>
2763
2764         * linux-low.c (lp_status_maybe_breakpoint): New function.
2765         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
2766         (count_events_callback): Likewise.
2767         (select_event_lwp_callback): Likewise.
2768         (cancel_breakpoints_callback): Likewise.
2769
2770 2014-09-19  Don Breazeal  <donb@codesourcery.com>
2771
2772         * linux-low.c (handle_extended_wait): Call
2773         linux_ptrace_get_extended_event.
2774         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
2775         linux_is_extended_waitstatus.
2776
2777 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
2778
2779         * Makefile.in (CPPFLAGS): Define.
2780         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
2781         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
2782
2783 2014-09-16  Gary Benson  <gbenson@redhat.com>
2784
2785         * inferiors.h (current_inferior): Renamed as...
2786         (current_thread): New variable.  All uses updated.
2787         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
2788         (maybe_move_out_of_jump_pad): Likewise.
2789         (cancel_breakpoint): Likewise.
2790         (linux_low_filter_event): Likewise.
2791         (wait_for_sigstop): Likewise.
2792         (linux_resume_one_lwp): Likewise.
2793         (need_step_over_p): Likewise.
2794         (start_step_over): Likewise.
2795         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
2796         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
2797         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
2798         and save_inferior as saved_thread.
2799         * regcache.c (get_thread_regcache): Renamed saved_inferior as
2800         saved_thread.
2801         (regcache_invalidate_thread): Likewise.
2802         * remote-utils.c (prepare_resume_reply): Likewise.
2803         * thread-db.c (thread_db_get_tls_address): Likewise.
2804         (disable_thread_event_reporting): Likewise.
2805         (remove_thread_event_breakpoints): Likewise.
2806         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
2807         as saved_thread.
2808         * target.h (set_desired_inferior): Renamed as...
2809         (set_desired_thread): New declaration.  All uses updated.
2810         * server.c (myresume): Updated comment to reference thread instead
2811         of inferior.
2812         (handle_serial_event): Likewise.
2813         (handle_target_event): Likewise.
2814
2815 2014-09-12  Tom Tromey  <tromey@redhat.com>
2816             Gary Benson  <gbenson@redhat.com>
2817
2818         * regcache.h: Include common-regcache.h.
2819         (regcache_read_pc): Don't declare.
2820         * regcache.c (get_thread_regcache_for_ptid): New function.
2821
2822 2014-09-11  Tom Tromey  <tromey@redhat.com>
2823             Gary Benson  <gbenson@redhat.com>
2824
2825         * symbol.c: New file.
2826         * Makefile.in (SFILES): Add symbol.c.
2827         (OBS): Add symbol.o.
2828
2829 2014-09-11  Gary Benson  <gbenson@redhat.com>
2830
2831         * target.c (target_stop_ptid, target_continue_ptid): New
2832         functions.
2833
2834 2014-09-11  Tom Tromey  <tromey@redhat.com>
2835             Gary Benson  <gbenson@redhat.com>
2836
2837         * target.h: Include target/target.h.
2838         * target.c (target_read_memory, target_read_uint32)
2839         (target_write_memory): New functions.
2840
2841 2014-09-11  Gary Benson  <gbenson@redhat.com>
2842
2843         * server.h (debug_hw_points): Don't declare.
2844         * server.c (debug_hw_points): Don't define.  Replace all uses
2845         with show_debug_regs.
2846         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
2847         all uses with show_debug_regs.
2848
2849 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
2850
2851         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
2852         endianness into account.
2853         (ppc_supply_ptrace_register): Likewise.
2854
2855 2014-09-03  James Hogan  <james.hogan@imgtec.com>
2856
2857         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
2858         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2859
2860 2014-09-03  Gary Benson  <gbenson@redhat.com>
2861
2862         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
2863         ALL_DEBUG_ADDRESS_REGISTERS.
2864
2865 2014-09-02  Gary Benson  <gbenson@redhat.com>
2866
2867         * i386-low.h: Renamed as...
2868         * x86-low.h: New file.  All type, function and variable name
2869         prefixes changed from "i386_" to "x86_".  All references updated.
2870         * i386-low.c: Renamed as...
2871         * x86-low.c: New file.  All type, function and variable name
2872         prefixes changed from "i386_" to "x86_".  All references updated.
2873
2874 2014-09-02  Gary Benson  <gbenson@redhat.com>
2875
2876         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
2877         (x86_linux_new_thread): Likewise.
2878
2879 2014-08-29  Gary Benson  <gbenson@redhat.com>
2880
2881         * server.h (setjmp.h): Do not include.
2882         (toplevel): Do not declare.
2883         (common-exceptions.h): Include.
2884         (cleanups.h): Likewise.
2885         * server.c (toplevel): Do not define.
2886         (exit_code): New static global.
2887         (detach_or_kill_for_exit_cleanup): New function.
2888         (main): New function.  Original main renamed to...
2889         (captured_main): New function.
2890         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
2891
2892 2014-08-29  Gary Benson  <gbenson@redhat.com>
2893
2894         * Makefile.in (SFILES): Add common/common-exceptions.c.
2895         (OBS): Add common-exceptions.o.
2896         (common-exceptions.o): New rule.
2897         * utils.c (prepare_to_throw_exception): New function.
2898
2899 2014-08-29  Gary Benson  <gbenson@redhat.com>
2900
2901         * config.in: Regenerate.
2902         * configure: Likewise.
2903
2904 2014-08-29  Gary Benson  <gbenson@redhat.com>
2905
2906         * Makefile.in (SFILES): Add common/cleanups.c.
2907         (OBS): cleanups.o.
2908         (cleanups.o): New rule.
2909
2910 2014-08-29  Gary Benson  <gbenson@redhat.com>
2911
2912         * utils.c (internal_vwarning): New function.
2913
2914 2014-08-28  Gary Benson  <gbenson@redhat.com>
2915
2916         * utils.h (fatal): Remove declaration.
2917         * utils.c (fatal): Remove function.
2918
2919 2014-08-28  Gary Benson  <gbenson@redhat.com>
2920
2921         * tracepoint.c (gdb_agent_init): Replace fatal with
2922         perror_with_name.
2923         (initialize_tracepoint): Likewise.
2924
2925 2014-08-28  Gary Benson  <gbenson@redhat.com>
2926
2927         * remote-utils.c (remote_prepare): Replace fatal with error.
2928
2929 2014-08-28  Gary Benson  <gbenson@redhat.com>
2930
2931         * linux-low.c (linux_async): Replace fatal with warning.
2932         Tidy up and return.
2933         (linux_start_non_stop): Return -1 if linux_async failed.
2934
2935 2014-08-28  Gary Benson  <gbenson@redhat.com>
2936
2937         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
2938         gdb_assert.
2939         (i386_dr_low_get_addr): Remove vague comment.
2940         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
2941         gdb_assert.
2942
2943 2014-08-28  Gary Benson  <gbenson@redhat.com>
2944
2945         * inferiors.c (get_thread_process): Replace check with gdb_assert.
2946         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
2947         internal_error.
2948         (linux_resume_one_lwp): Likewise.
2949         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
2950         gdb_assert.
2951         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
2952         with internal_error.
2953         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
2954         (init_register_cache): Replace fatal with gdb_assert_not_reached.
2955         (find_register_by_name): Replace fatal with internal_error.
2956         (find_regno): Likewise.
2957         * tdesc.c (init_target_desc): Replace check with gdb_assert.
2958         * thread-db.c (thread_db_create_event): Likewise.
2959         (thread_db_load_search): Likewise.
2960         (try_thread_db_load_1): Likewise.
2961         * tracepoint.c (get_jump_space_head): Replace fatal with
2962         internal_error.
2963         (claim_trampoline_space): Likewise.
2964         (have_fast_tracepoint_trampoline_buffer): Likewise.
2965         (cmd_qtstart): Likewise.
2966         (stop_tracing): Likewise.
2967         (fast_tracepoint_collecting): Likewise.
2968         (target_malloc): Likewise.
2969         (download_tracepoint): Likewise.
2970         (download_trace_state_variables): Replace check with gdb_assert.
2971         (upload_fast_traceframes): Replace fatal with internal_error.
2972
2973 2014-08-19  Tom Tromey  <tromey@redhat.com>
2974             Gary Benson  <gbenson@redhat.com>
2975
2976         * Makefile.in (SFILES): Add common/common-debug.c.
2977         (OBS): Add common-debug.o.
2978         (common-debug.o): New rule.
2979         * debug.h (debug_printf): Don't declare.
2980         * debug.c (debug_printf): Renamed and rewritten as...
2981         (debug_vprintf): New function.
2982
2983 2014-08-19  Gary Benson  <gbenson@redhat.com>
2984
2985         * utils.h: Do not include print-utils.h.
2986
2987 2014-08-19  Tom Tromey  <tromey@redhat.com>
2988             Gary Benson  <gbenson@redhat.com>
2989
2990         * server.h: Add static assertion.
2991         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
2992
2993 2014-08-19  Tom Tromey  <tromey@redhat.com>
2994             Gary Benson  <gbenson@redhat.com>
2995
2996         * Makefile.in (SFILES): Add common/errors.c.
2997         (OBS): Add errors.o.
2998         (IPA_OBS): Add errors-ipa.o.
2999         (errors.o): New rule.
3000         (errors-ipa.o): Likewise.
3001         * utils.h (perror_with_name, error, warning): Don't declare.
3002         * utils.c (warning): Renamed and rewritten as...
3003         (vwarning): New function.
3004         (error): Renamed and rewritten as...
3005         (verror): New function.
3006         (internal_error): Renamed and rewritten as...
3007         (internal_verror): New function.
3008
3009 2014-08-07  Gary Benson  <gbenson@redhat.com>
3010
3011         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
3012         * configure: Regenerate.
3013         * config.in: Likewise.
3014         * server.h: Do not include errno.h.
3015         * event-loop.c: Likewise.
3016         * hostio-errno.c: Likewise.
3017         * linux-low.c: Likewise.
3018         * remote-utils.c: Likewise.
3019         * spu-low.c: Likewise.
3020         * utils.c: Likewise.
3021         * gdbreplay.c: Unconditionally include errno.h.
3022
3023 2014-08-07  Gary Benson  <gbenson@redhat.com>
3024
3025         * server.h: Do not include string.h.
3026         * event-loop.c: Likewise.
3027         * linux-low.c: Likewise.
3028         * regcache.c: Likewise.
3029         * remote-utils.c: Likewise.
3030         * spu-low.c: Likewise.
3031         * utils.c: Likewise.
3032
3033 2014-08-07  Gary Benson  <gbenson@redhat.com>
3034
3035         * server.h: Do not include gdb_assert.h.
3036
3037 2014-08-07  Gary Benson  <gbenson@redhat.com>
3038
3039         * server.h: Do not include common-utils.h.
3040
3041 2014-08-07  Gary Benson  <gbenson@redhat.com>
3042
3043         * server.h: Do not include ptid.h.
3044         * notif.h: Likewise.
3045
3046 2014-08-07  Gary Benson  <gbenson@redhat.com>
3047
3048         * server.h: Do not include gdb_locale.h.
3049
3050 2014-08-07  Gary Benson  <gbenson@redhat.com>
3051
3052         * server.h: Do not include gdb/signals.h.
3053         * win32-low.c: Likewise.
3054
3055 2014-08-07  Gary Benson  <gbenson@redhat.com>
3056
3057         * server.h: Do not include pathmax.h.
3058
3059 2014-08-07  Gary Benson  <gbenson@redhat.com>
3060
3061         * server.h: Do not include libiberty.h.
3062         * linux-bfin-low.c: Likewise.
3063
3064 2014-08-07  Gary Benson  <gbenson@redhat.com>
3065
3066         * server.h: Do not include ansidecl.h.
3067
3068 2014-08-07  Gary Benson  <gbenson@redhat.com>
3069
3070         * linux-x86-low.c: Do not include stddef.h.
3071         * lynx-ppc-low.c: Likewise.
3072         * tracepoint.c: Likewise.
3073
3074 2014-08-07  Gary Benson  <gbenson@redhat.com>
3075
3076         * server.h: Do not include stdarg.h.
3077         * nto-low.c: Likewise.
3078
3079 2014-08-07  Gary Benson  <gbenson@redhat.com>
3080
3081         * server.h: Do not include stdlib.h.
3082         * inferiors.c: Likewise.
3083         * linux-low.c: Likewise.
3084         * regcache.c: Likewise.
3085         * spu-low.c: Likewise.
3086         * tracepoint.c: Likewise.
3087         * utils.c: Likewise.
3088
3089 2014-08-07  Gary Benson  <gbenson@redhat.com>
3090
3091         * server.h: Do not include stdio.h.
3092         * linux-low.c: Likewise.
3093         * remote-utils.c: Likewise.
3094         * spu-low.c: Likewise.
3095         * utils.c: Likewise.
3096         * wincecompat.c: Likewise.
3097
3098 2014-08-06  Gary Benson  <gbenson@redhat.com>
3099
3100         * regcache.c (init_register_cache): Move conditionals inside if.
3101
3102 2014-08-06  Gary Benson  <gbenson@redhat.com>
3103
3104         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
3105
3106 2014-07-31  Gary Benson  <gbenson@redhat.com>
3107
3108         * ax.h: Do not include server.h.
3109         * gdbthread.h: Likewise.
3110         * lynx-low.h: Likewise.
3111         * notif.h: Likewise.
3112
3113 2014-07-30  Gary Benson  <gbenson@redhat.com>
3114
3115         * server.h: Include common-defs.h.
3116         Do not include config.h or build-gnulib-gdbserver/config.h.
3117
3118 2014-07-30  Gary Benson  <gbenson@redhat.com>
3119
3120         * hostio-errno.c: Move server.h to top of includes list.
3121         * inferiors.c: Likewise.
3122         * linux-x86-low.c: Likewise.
3123         * notif.c: Include server.h.
3124
3125 2014-07-24  Tom Tromey  <tromey@redhat.com>
3126             Gary Benson  <gbenson@redhat.com>
3127
3128         * server.h (CORE_ADDR): Now unsigned.
3129
3130 2014-07-16  Pedro Alves  <palves@redhat.com>
3131
3132         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
3133
3134 2014-07-15  Pedro Alves  <palves@redhat.com>
3135
3136         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
3137         copy.
3138
3139 2014-07-11  Pedro Alves  <palves@redhat.com>
3140
3141         * linux-low.c (kill_wait_lwp): New function, based on
3142         kill_one_lwp_callback, but use my_waitpid directly.
3143         (kill_one_lwp_callback, linux_kill): Use it.
3144
3145 2014-06-23  Pedro Alves  <palves@redhat.com>
3146
3147         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
3148         before setting DR0..DR3.
3149
3150 2014-06-20  Gary Benson  <gbenson@redhat.com>
3151
3152         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3153         * configure: Regenerated.
3154         * config.in: Likewise.
3155
3156 2014-06-20  Gary Benson  <gbenson@redhat.com>
3157
3158         * Makefile.in (SFILES): Update locations for files moved
3159         from common to nat.
3160         (object file files): Reordered.
3161
3162 2014-06-20  Gary Benson  <gbenson@redhat.com>
3163
3164         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3165         (i386_dr_low_set_addr): Likewise.
3166         (i386_dr_low_get_addr): Likewise.
3167         (i386_dr_low_can_set_control): Likewise.
3168         (i386_dr_low_set_control): Likewise.
3169         (i386_dr_low_get_control): Likewise.
3170         (i386_dr_low_get_status): Likewise.
3171         (i386_get_debug_register_length): Likewise.
3172         * linux-x86-low.c (i386_dr_low_set_addr):
3173         Changed signature.  Made static.
3174         (i386_dr_low_get_addr): Likewise.
3175         (i386_dr_low_set_control): Likewise.
3176         (i386_dr_low_get_control): Likewise.
3177         (i386_dr_low_get_status): Likewise.
3178         (i386_dr_low): New global variable.
3179         * win32-i386-low.c (i386_dr_low_set_addr):
3180         Changed signature.  Made static.
3181         (i386_dr_low_get_addr): Likewise.
3182         (i386_dr_low_set_control): Likewise.
3183         (i386_dr_low_get_control): Likewise.
3184         (i386_dr_low_get_status): Likewise.
3185         (i386_dr_low): New global variable.
3186
3187 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3188
3189         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3190         * Makefile.in (AR, AR_FLAGS): Define.
3191         * configure: Regenerate.
3192
3193 2014-06-19  Gary Benson  <gbenson@redhat.com>
3194
3195         * Makefile.in (i386-dregs.o): New rule.
3196         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3197         * i386-low.c (target.h): Remove include.
3198         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3199         (DR_CONTROL_SHIFT): Likewise.
3200         (DR_CONTROL_SIZE): Likewise.
3201         (DR_RW_EXECUTE): Likewise.
3202         (DR_RW_WRITE): Likewise.
3203         (DR_RW_READ): Likewise.
3204         (DR_RW_IORW): Likewise.
3205         (DR_LEN_1): Likewise.
3206         (DR_LEN_2): Likewise.
3207         (DR_LEN_4): Likewise.
3208         (DR_LEN_8): Likewise.
3209         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3210         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3211         (DR_ENABLE_SIZE): Likewise.
3212         (DR_LOCAL_SLOWDOWN): Likewise.
3213         (DR_GLOBAL_SLOWDOWN): Likewise.
3214         (DR_CONTROL_RESERVED): Likewise.
3215         (I386_DR_CONTROL_MASK): Likewise.
3216         (I386_DR_VACANT): Likewise.
3217         (I386_DR_LOCAL_ENABLE): Likewise.
3218         (I386_DR_GLOBAL_ENABLE): Likewise.
3219         (I386_DR_DISABLE): Likewise.
3220         (I386_DR_SET_RW_LEN): Likewise.
3221         (I386_DR_GET_RW_LEN): Likewise.
3222         (I386_DR_WATCH_HIT): Likewise.
3223         (i386_wp_op_t): Likewise.
3224         (i386_show_dr): Likewise.
3225         (i386_length_and_rw_bits): Likewise.
3226         (i386_insert_aligned_watchpoint): Likewise.
3227         (i386_remove_aligned_watchpoint): Likewise.
3228         (i386_handle_nonaligned_watchpoint): Likewise.
3229         i386_update_inferior_debug_regs(): Likewise.
3230         (i386_dr_insert_watchpoint): Likewise.
3231         (i386_dr_remove_watchpoint): Likewise.
3232         (i386_dr_region_ok_for_watchpoint): Likewise.
3233         (i386_dr_stopped_data_address): Likewise.
3234         (i386_dr_stopped_by_watchpoint): Likewise.
3235
3236 2014-06-19  Gary Benson  <gbenson@redhat.com>
3237
3238         * i386-low.c (i386_dr_show): Renamed to
3239         i386_show_dr and made static.  All uses updated.
3240         (i386_dr_length_and_rw_bits): Renamed to
3241         i386_length_and_rw_bits and made static.
3242         All uses updated.
3243         (i386_dr_insert_aligned_watchpoint): Renamed to
3244         i386_insert_aligned_watchpoint and made static.
3245         All uses updated.
3246         (i386_dr_remove_aligned_watchpoint): Renamed to
3247         i386_remove_aligned_watchpoint and made static.
3248         All uses updated.
3249         (i386_dr_update_inferior_debug_regs): Renamed to
3250         i386_update_inferior_debug_regs and made static.
3251         All uses updated.
3252
3253 2014-06-18  Gary Benson  <gbenson@redhat.com>
3254
3255         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3256         (i386_dr_low_can_set_control): Likewise.
3257         (i386_get_debug_register_length): Likewise.
3258         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3259         (i386_dr_low_can_set_control): Likewise.
3260         (i386_get_debug_register_length): Likewise.
3261
3262 2014-06-17  Gary Benson  <gbenson@redhat.com>
3263
3264         * i386-low.h (i386-dregs.h): New include.
3265         (DR_FIRSTADDR): Now in i386-dregs.h.
3266         (DR_LASTADDR): Likewise.
3267         (DR_NADDR): Likewise.
3268         (DR_STATUS): Likewise.
3269         (DR_CONTROL): Likewise.
3270         (i386_debug_reg_state): Likewise.
3271         (i386_dr_insert_watchpoint): Likewise.
3272         (i386_dr_remove_watchpoint): Likewise.
3273         (i386_dr_region_ok_for_watchpoint): Likewise.
3274         (i386_dr_stopped_data_address): Likewise.
3275         (i386_dr_stopped_by_watchpoint): Likewise.
3276         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3277
3278 2014-06-18  Gary Benson  <gbenson@redhat.com>
3279
3280         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3281         i386_dr_insert_watchpoint.
3282         (i386_low_remove_watchpoint): Renamed to
3283         i386_dr_remove_watchpoint.
3284         (i386_low_region_ok_for_watchpoint): Renamed to
3285         i386_dr_region_ok_for_watchpoint.
3286         (i386_low_stopped_data_address): Renamed to
3287         i386_dr_stopped_data_address.
3288         (i386_low_stopped_by_watchpoint): Renamed to
3289         i386_dr_stopped_by_watchpoint.
3290         * i386-low.c (i386_show_dr): Renamed to
3291         i386_dr_show and made nonstatic.  All uses updated.
3292         (i386_length_and_rw_bits): Renamed to
3293         i386_dr_length_and_rw_bits and made nonstatic.
3294         All uses updated.
3295         (i386_insert_aligned_watchpoint): Renamed to
3296         i386_dr_insert_aligned_watchpoint and made nonstatic.
3297         All uses updated.
3298         (i386_remove_aligned_watchpoint): Renamed to
3299         i386_dr_remove_aligned_watchpoint and made nonstatic.
3300         All uses updated.
3301         (i386_update_inferior_debug_regs): Renamed to
3302         i386_dr_update_inferior_debug_regs and made nonstatic.
3303         All uses updated.
3304         (i386_low_insert_watchpoint): Renamed to
3305         i386_dr_insert_watchpoint.  All uses updated.
3306         (i386_low_remove_watchpoint): Renamed to
3307         i386_dr_remove_watchpoint.  All uses updated.
3308         (i386_low_region_ok_for_watchpoint): Renamed to
3309         i386_dr_region_ok_for_watchpoint.  All uses updated.
3310         (i386_low_stopped_data_address): Renamed to
3311         i386_dr_stopped_data_address.  All uses updated.
3312         (i386_low_stopped_by_watchpoint): Renamed to
3313         i386_dr_stopped_by_watchpoint.  All uses updated.
3314
3315 2014-06-18  Gary Benson  <gbenson@redhat.com>
3316
3317         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3318         (i386_dr_low_can_set_control): Likewise.
3319         (i386_insert_aligned_watchpoint): New check.
3320
3321 2014-06-18  Gary Benson  <gbenson@redhat.com>
3322
3323         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3324         Renamed to state.
3325
3326 2014-06-18  Gary Benson  <gbenson@redhat.com>
3327
3328         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3329         instead of fatal and error.
3330         (i386_handle_nonaligned_watchpoint): Likewise.
3331
3332 2014-06-18  Gary Benson  <gbenson@redhat.com>
3333
3334         * i386-low.c (i386_get_debug_register_length): New macro.
3335         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3336         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3337         phex to format values.
3338
3339 2014-06-18  Gary Benson  <gbenson@redhat.com>
3340
3341         * i386-low.h: Comment changes.
3342         * i386-low.c: Likewise.
3343
3344 2014-06-18  Gary Benson  <gbenson@redhat.com>
3345
3346         * i386-low.c: Whitespace changes.
3347
3348 2014-06-12  Tom Tromey  <tromey@redhat.com>
3349
3350         * utils.c (freeargv): Remove.
3351
3352 2014-06-12  Tom Tromey  <tromey@redhat.com>
3353
3354         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3355         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3356         (parse_debug_format_options): Likewise.
3357         (gdbserver_usage): Likewise.
3358         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3359         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3360         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3361         against libiberty.
3362         ($(LIBGNU)): Depend on libiberty.
3363         (all-lib): Recurse into all subdirs.
3364         (install-only): Invoke "install" target in subdirs.
3365         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3366         targets.
3367         * configure: Rebuild.
3368         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3369         for vasprintf, vsnprintf, or gettimeofday.
3370         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3371         srv_tgtobj.
3372
3373 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3374
3375         * development.sh: Delete.
3376         * Makefile.in (config.status): Adjust dependency on development.sh.
3377         * configure.ac: Adjust development.sh source call.
3378         * configure: Regenerate.
3379
3380 2014-06-02  Pedro Alves  <palves@redhat.com>
3381
3382         * ax.c (gdb_free_agent_expr): New function.
3383         * ax.h (gdb_free_agent_expr): New declaration.
3384         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3385         list.
3386         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3387         static.
3388         (clear_breakpoint_conditions_and_commands): New function.
3389         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3390         (clear_breakpoint_conditions_and_commands): New declaration.
3391
3392 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3393
3394         * linux-aarch64-low.c (asm/ptrace.h): Include.
3395
3396 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3397
3398         Fix TLS access for -static -pthread.
3399         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3400         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3401         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3402
3403 2014-05-20  Pedro Alves  <palves@redhat.com>
3404
3405         * linux-aarch64-low.c (aarch64_insert_point)
3406         (aarch64_remove_point): No longer check whether the type is
3407         supported here.  Adjust to new interface.
3408         (the_low_target): Install aarch64_supports_z_point_type as
3409         supports_z_point_type method.
3410         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3411         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3412         instead of a Z packet char.  Adjust.
3413         (arm_supports_z_point_type): New function.
3414         (arm_insert_point, arm_remove_point): Adjust to new interface.
3415         (the_low_target): Install arm_supports_z_point_type.
3416         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3417         (cris_insert_point, cris_remove_point): Adjust to new interface.
3418         Don't check whether the type is supported here.
3419         (the_low_target): Install cris_supports_z_point_type.
3420         * linux-low.c (linux_supports_z_point_type): New function.
3421         (linux_insert_point, linux_remove_point): Adjust to new interface.
3422         * linux-low.h (struct linux_target_ops) <insert_point,
3423         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3424         raw_breakpoint pointer parameter.
3425         <supports_z_point_type>: New method.
3426         * linux-mips-low.c (mips_supports_z_point_type): New function.
3427         (mips_insert_point, mips_remove_point): Adjust to new interface.
3428         Use mips_supports_z_point_type.
3429         (the_low_target): Install mips_supports_z_point_type.
3430         * linux-ppc-low.c (the_low_target): Install NULL as
3431         supports_z_point_type method.
3432         * linux-s390-low.c (the_low_target): Install NULL as
3433         supports_z_point_type method.
3434         * linux-sparc-low.c (the_low_target): Install NULL as
3435         supports_z_point_type method.
3436         * linux-x86-low.c (x86_supports_z_point_type): New function.
3437         (x86_insert_point): Adjust to new insert_point interface.  Use
3438         insert_memory_breakpoint.  Adjust to new
3439         i386_low_insert_watchpoint interface.
3440         (x86_remove_point): Adjust to remove_point interface.  Use
3441         remove_memory_breakpoint.  Adjust to new
3442         i386_low_remove_watchpoint interface.
3443         (the_low_target): Install x86_supports_z_point_type.
3444         * lynx-low.c (lynx_target_ops): Install NULL as
3445         supports_z_point_type callback.
3446         * nto-low.c (nto_supports_z_point_type): New.
3447         (nto_insert_point, nto_remove_point): Adjust to new interface.
3448         (nto_target_ops): Install nto_supports_z_point_type.
3449         * mem-break.c: Adjust intro comment.
3450         (struct raw_breakpoint) <raw_type, size>: New fields.
3451         <inserted>: Update comment.
3452         <shlib_disabled>: Delete field.
3453         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3454         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3455         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3456         (raw_bkpt_type_to_target_hw_bp_type): New function.
3457         (find_enabled_raw_code_breakpoint_at): New function.
3458         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3459         (insert_memory_breakpoint): New function, based off
3460         set_raw_breakpoint_at.
3461         (remove_memory_breakpoint): New function.
3462         (set_raw_breakpoint_at): Reimplement.
3463         (set_breakpoint): New, based on set_breakpoint_at.
3464         (set_breakpoint_at): Reimplement.
3465         (delete_raw_breakpoint): Go through the_target->remove_point
3466         instead of assuming memory breakpoints.
3467         (find_gdb_breakpoint_at): Delete.
3468         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3469         (find_gdb_breakpoint): New function.
3470         (set_gdb_breakpoint_at): Delete.
3471         (z_type_supported): New function.
3472         (set_gdb_breakpoint_1): New function, loosely based off
3473         set_gdb_breakpoint_at.
3474         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3475         (delete_gdb_breakpoint_at): Delete.
3476         (delete_gdb_breakpoint_1): New function, loosely based off
3477         delete_gdb_breakpoint_at.
3478         (delete_gdb_breakpoint): New function.
3479         (clear_gdb_breakpoint_conditions): Rename to ...
3480         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3481         breakpoint.
3482         (add_condition_to_breakpoint): Make static.
3483         (add_breakpoint_condition): Take a struct breakpoint pointer
3484         instead of an address.  Adjust.
3485         (gdb_condition_true_at_breakpoint): Rename to ...
3486         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3487         z_type parameter.
3488         (gdb_condition_true_at_breakpoint): Reimplement.
3489         (add_breakpoint_commands): Take a struct breakpoint pointer
3490         instead of an address.  Adjust.
3491         (gdb_no_commands_at_breakpoint): Rename to ...
3492         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3493         parameter.  Return true if no breakpoint was found.  Change debug
3494         output.
3495         (gdb_no_commands_at_breakpoint): Reimplement.
3496         (run_breakpoint_commands): Rename to ...
3497         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3498         and change return type to boolean.
3499         (run_breakpoint_commands): New function.
3500         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3501         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3502         breakpoint.  Go through the_target->remove_point instead of
3503         assuming memory breakpoint.
3504         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3505         software and hardware breakpoints.
3506         (reinsert_raw_breakpoint): Go through the_target->insert_point
3507         instead of assuming memory breakpoint.
3508         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3509         software and hardware breakpoints.
3510         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3511         Check both software and hardware breakpoints.
3512         (validate_inserted_breakpoint): Assert the breakpoint is a
3513         software breakpoint.  Set the inserted flag to -1 instead of
3514         setting shlib_disabled.
3515         (delete_disabled_breakpoints): Adjust.
3516         (validate_breakpoints): Only validate software breakpoints.
3517         Adjust to inserted flag change.
3518         (check_mem_read, check_mem_write): Skip breakpoint types other
3519         than software breakpoints.  Adjust to inserted flag change.
3520         * mem-break.h (enum raw_bkpt_type): New enum.
3521         (raw_breakpoint, struct process_info): Forward declare.
3522         (Z_packet_to_target_hw_bp_type): Delete declaration.
3523         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3524         (set_gdb_breakpoint, delete_gdb_breakpoint)
3525         (clear_breakpoint_conditions): New declarations.
3526         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3527         (breakpoint_inserted_here): Update comment.
3528         (add_breakpoint_condition, add_breakpoint_commands): Replace
3529         address parameter with a breakpoint pointer parameter.
3530         (gdb_breakpoint_here): Update comment.
3531         (delete_gdb_breakpoint_at): Delete.
3532         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3533         * server.c (process_point_options): Take a struct breakpoint
3534         pointer instead of an address.  Adjust.
3535         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3536         delete_gdb_breakpoint.
3537         * spu-low.c (spu_target_ops): Install NULL as
3538         supports_z_point_type method.
3539         * target.h: Include mem-break.h.
3540         (struct target_ops) <prepare_to_access_memory>: Update comment.
3541         <supports_z_point_type>: New field.
3542         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3543         instead of a char.  Also take a raw breakpoint pointer.
3544         * win32-arm-low.c (the_low_target): Install NULL as
3545         supports_z_point_type.
3546         * win32-i386-low.c (i386_supports_z_point_type): New function.
3547         (i386_insert_point, i386_remove_point): Adjust to new interface.
3548         (the_low_target): Install i386_supports_z_point_type.
3549         * win32-low.c (win32_supports_z_point_type): New function.
3550         (win32_insert_point, win32_remove_point): Adjust to new interface.
3551         (win32_target_ops): Install win32_supports_z_point_type.
3552         * win32-low.h (struct win32_target_ops):
3553         <supports_z_point_type>: New method.
3554         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3555         instead of a char.  Also take a raw breakpoint pointer.
3556
3557 2014-05-20  Pedro Alves  <palves@redhat.com>
3558
3559         * mem-break.h: Include break-common.h.
3560         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3561         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3562         (Z_packet_to_target_hw_bp_type): New declaration.
3563         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3564         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3565         (Z_PACKET_ACCESS_WP): Delete macros.
3566         (Z_packet_to_hw_type): Delete function.
3567         * i386-low.h: Don't include break-common.h here.
3568         (Z_packet_to_hw_type): Delete declaration.
3569         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3570         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3571         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3572         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3573         * linux-aarch64-low.c: Don't include break-common.h here.
3574         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3575         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3576         (Z_packet_to_target_hw_bp_type): Delete function.
3577         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3578         function.
3579         (mips_insert_point, mips_remove_point): Use
3580         Z_packet_to_target_hw_bp_type.
3581
3582 2014-05-20  Pedro Alves  <palves@redhat.com>
3583
3584         * linux-aarch64-low.c: Include break-common.h.
3585         (enum target_point_type): Delete.
3586         (Z_packet_to_point_type): Rename to ...
3587         (Z_packet_to_target_hw_bp_type): ... this, and return a
3588         target_hw_bp_type instead.
3589         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3590         instead of an enum target_point_type.
3591         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3592         breakpoint type.
3593         (aarch64_dr_state_insert_one_point)
3594         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3595         (aarch64_handle_aligned_watchpoint)
3596         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3597         Take an enum target_hw_bp_type instead of an enum
3598         target_point_type.
3599         (aarch64_supports_z_point_type): New function.
3600         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3601         use Z_packet_to_target_hw_bp_type.
3602
3603 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3604
3605         * configure.ac: Only use -Werror by default when DEVELOPMENT
3606         is true.
3607         * configure: Regenerate.
3608
3609 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3610
3611         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3612         * linux-x86-low.c (X86_64_USER_REGS): New.
3613         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3614
3615 2014-04-28  Yao Qi  <yao@codesourcery.com>
3616
3617         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3618         name.
3619
3620 2014-04-25  Pedro Alves  <palves@redhat.com>
3621
3622         PR server/16255
3623         * linux-low.c (linux_attach_fail_reason_string): New function.
3624         (linux_attach_lwp): Delete.
3625         (linux_attach_lwp_1): Rename to ...
3626         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3627         argument.  Remove "initial" parameter.  Return int instead of
3628         void.  Don't error or warn here.
3629         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3630         failure to attach to the tgid.  Call warning when failing to
3631         attach to an lwp.
3632         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3633         argument.  Remove "initial" parameter.  Return int instead of
3634         void.  Don't error or warn here.
3635         (linux_attach_fail_reason_string): New declaration.
3636         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
3637         interface change.  Use linux_attach_fail_reason_string.
3638
3639 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
3640             Walfred Tedeschi  <walfred.tedeschi@intel.com>
3641
3642         * Makefile.in: Added rules to handle new files
3643         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
3644         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
3645         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
3646         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
3647         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
3648         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
3649         x32-avx512-linux.o.
3650         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
3651         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
3652         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
3653         i386/x32-avx512.xml.
3654         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
3655         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
3656         i386/x32-avx512-linux.xml.
3657         * i387-fp.c (num_avx512_k_registers): New constant for number
3658         of K registers.
3659         (num_avx512_zmmh_low_registers): New constant for number of
3660         lower ZMM registers (0-15).
3661         (num_avx512_zmmh_high_registers): New constant for number of
3662         higher ZMM registers (16-31).
3663         (num_avx512_ymmh_registers): New contant for number of higher
3664         YMM registers (ymm16-31 added by avx521 on x86_64).
3665         (num_avx512_xmm_registers): New constant for number of higher
3666         XMM registers (xmm16-31 added by AVX512 on x86_64).
3667         (struct i387_xsave): Add space for AVX512 registers.
3668         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
3669         Add code to handle AVX512 registers.
3670         (i387_xsave_to_cache): Add code to handle AVX512 registers.
3671         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
3672         prototypei from generated file.
3673         (tdesc_amd64_avx512_linux): Likewise.
3674         (init_registers_x32_avx512_linux): Likewise.
3675         (tdesc_x32_avx512_linux): Likewise.
3676         (init_registers_i386_avx512_linux): Likewise.
3677         (tdesc_i386_avx512_linux): Likewise.
3678         (x86_64_regmap): Add AVX512 registers.
3679         (x86_linux_read_description): Add code to handle AVX512 XSTATE
3680         mask.
3681         (initialize_low_arch): Add code to initialize AVX512 registers.
3682
3683 2014-04-23  Pedro Alves  <palves@redhat.com>
3684
3685         * mem-break.c (find_gdb_breakpoint_at): Make static.
3686         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
3687
3688 2014-04-23  Pedro Alves  <palves@redhat.com>
3689
3690         * i386-low.c: Don't include break-common.h here.
3691         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3692         prototype to take target_hw_bp_type as argument instead of a Z
3693         packet char.
3694         * i386-low.h: Include break-common.h here.
3695         (Z_packet_to_hw_type): Declare.
3696         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3697         prototypes.
3698         * linux-x86-low.c (x86_insert_point): Convert the packet number to
3699         a target_hw_bp_type before calling i386_low_insert_watchpoint.
3700         (x86_remove_point): Convert the packet number to a
3701         target_hw_bp_type before calling i386_low_remove_watchpoint.
3702         * win32-i386-low.c (i386_insert_point): Convert the packet number
3703         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
3704         (i386_remove_point): Convert the packet number to a
3705         target_hw_bp_type before calling i386_low_remove_watchpoint.
3706
3707 2014-04-23  Pedro Alves  <palves@redhat.com>
3708
3709         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
3710
3711 2014-04-10  Pedro Alves  <palves@redhat.com>
3712
3713         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
3714         Check if the condition or command is NULL before checking if the
3715         breakpoint is known.  On success, return true.
3716         * mem-break.h (add_breakpoint_condition): Document return.
3717         (add_breakpoint_commands): Add describing comment.
3718         * server.c (skip_to_semicolon): New function.
3719         (process_point_options): Use it.
3720
3721 2014-04-09  Pedro Alves  <palves@redhat.com>
3722
3723         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
3724         to lwpid_of.
3725
3726 2014-02-27  Pedro Alves  <palves@redhat.com>
3727
3728         PR 12702
3729         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
3730         macros.
3731         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
3732         output.
3733         (last_thread_of_process_p): Take a PID argument instead of a
3734         thread pointer.
3735         (linux_wait_for_lwp): Delete.
3736         (num_lwps, check_zombie_leaders, not_stopped_callback): New
3737         functions.
3738         (linux_low_filter_event): New function, party factored out from
3739         linux_wait_for_event.
3740         (linux_wait_for_event): Rename to ...
3741         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
3742         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
3743         sigsuspend.  Check for zombie leaders.
3744         (linux_wait_for_event): Reimplement as wrapper around
3745         linux_wait_for_event_filtered.
3746         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
3747         a normal or signal exit is seen, it's the whole process exiting.
3748         (wait_for_sigstop): No longer a for_each_inferior callback.
3749         Rewrite on top of linux_wait_for_event_filtered.
3750         (stop_all_lwps): Call wait_for_sigstop directly.
3751         * server.c (resume, handle_target_event): Handle
3752         TARGET_WAITKIND_NO_RESUMED.
3753
3754 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3755
3756         * win32-low.c (psapi_get_dll_name,
3757         * win32_CreateToolhelp32Snapshot): Delete.
3758         (win32_CreateToolhelp32Snapshot, win32_Module32First)
3759         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
3760         Delete.
3761         (handle_load_dll): Add function description.
3762         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
3763
3764 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3765
3766         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
3767         Add comment.
3768         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
3769         base address when calling win32_add_one_solib.
3770         (handle_load_dll): Delete local variable load_addr.
3771         Remove 0x1000 offset applied to DLL base address when calling
3772         win32_add_one_solib.
3773         (handle_unload_dll): Add comment.
3774
3775 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3776
3777         * win32-low.c (win32_add_all_dlls): Renames
3778         win32_ensure_ntdll_loaded.  Rewrite function documentation.
3779         Adjust implementation to always load all DLLs.
3780         Add 0x1000 offset to DLL base address when calling
3781         win32_add_one_solib.
3782         (child_initialization_done): New static global.
3783         (do_initial_child_stuff): Set child_initialization_done to
3784         zero during child initialization, and 1 after.  Replace call
3785         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
3786         Add comment.
3787         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
3788         (handle_unload_dll): Add function documentation.
3789         (get_child_debug_event): Ignore load and unload DLL events
3790         during child initialization.
3791
3792 2014-02-20  Doug Evans  <dje@google.com>
3793
3794         Remove global all_lwps.
3795         * inferiors.h (ptid_of): Move here from linux-low.h.
3796         (pid_of, lwpid_of): Ditto.
3797         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
3798         parameter is a struct thread_info * now.
3799         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
3800         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
3801         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
3802         directly.
3803         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
3804         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
3805         * linux-arm-low.c (update_registers_callback): Update, "entry"
3806         parameter is a struct thread_info * now.
3807         Fetch lwpid from current_inferior directly.
3808         (arm_insert_point): Pass &all_threads to find_inferior instead of
3809         &all_lwps.
3810         (arm_remove_point): Ditto.
3811         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
3812         (arm_prepare_to_resume): Fetch pid from thread.
3813         (arm_read_description): Fetch lwpid from current_inferior directly.
3814         * linux-low.c (all_lwps): Delete.
3815         (delete_lwp): Delete call to remove_inferior.
3816         (handle_extended_wait): Fetch lwpid from thread.
3817         (add_lwp): Don't set lwp->entry.id.  Remove call to
3818         add_inferior_to_list.
3819         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
3820         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
3821         (kill_one_lwp_callback): Ditto.
3822         (linux_kill): Don't dereference NULL pointer.
3823         Fetch ptid,lwpid from thread.
3824         (get_detach_signal): Fetch ptid from thread.
3825         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
3826         Simplify call to regcache_invalidate_thread.
3827         (delete_lwp_callback): Update, "entry" parameter is a
3828         struct thread_info * now.  Fetch pid from thread.
3829         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
3830         (status_pending_p_callback): Update, "entry" parameter is a
3831         struct thread_info * now.  Fetch ptid from thread.
3832         (find_lwp_pid): Update, "entry" parameter is a
3833         struct thread_info * now.
3834         (linux_wait_for_lwp): Fetch pid from thread.
3835         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
3836         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
3837         (enqueue_one_deferred_signal): Fetch lwpid from thread.
3838         (dequeue_one_deferred_signal): Ditto.
3839         (cancel_breakpoint): Fetch ptid from current_inferior.
3840         (linux_wait_for_event): Pass &all_threads to find_inferior,
3841         not &all_lwps.  Fetch ptid, lwpid from thread.
3842         (count_events_callback): Update, "entry" parameter is a
3843         struct thread_info * now.
3844         (select_singlestep_lwp_callback): Ditto.
3845         (select_event_lwp_callback): Ditto.
3846         (cancel_breakpoints_callback): Ditto.
3847         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
3848         not &all_lwps.
3849         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
3850         (unsuspend_one_lwp): Update, "entry" parameter is a
3851         struct thread_info * now.
3852         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
3853         not &all_lwps.
3854         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
3855         Fetch lwpid from thread, not lwp.
3856         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
3857         Pass &all_threads to find_inferior, not &all_lwps.
3858         (send_sigstop): Fetch lwpid from thread, not lwp.
3859         (send_sigstop_callback): Update, "entry" parameter is a
3860         struct thread_info * now.
3861         (suspend_and_send_sigstop_callback): Ditto.
3862         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
3863         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
3864         struct thread_info * now.
3865         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
3866         from thread, lwp.
3867         (lwp_running): Update, "entry" parameter is a
3868         struct thread_info * now.
3869         (stop_all_lwps): Fetch ptid from thread.
3870         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
3871         (linux_resume_one_lwp): Fetch lwpid from thread.
3872         (linux_set_resume_request): Update, "entry" parameter is a
3873         struct thread_info * now.  Fetch pid, lwpid from thread.
3874         (resume_status_pending_p): Update, "entry" parameter is a
3875         struct thread_info * now.
3876         (need_step_over_p): Ditto.  Fetch lwpid from thread.
3877         (start_step_over): Fetch lwpid from thread.
3878         (linux_resume_one_thread): Update, "entry" parameter is a
3879         struct thread_info * now.  Fetch lwpid from thread.
3880         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
3881         (proceed_one_lwp): Update, "entry" parameter is a
3882         struct thread_info * now.  Fetch lwpid from thread.
3883         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
3884         struct thread_info * now.
3885         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
3886         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
3887         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
3888         directly.
3889         (regsets_store_inferior_registers): Ditto.
3890         (fetch_register, store_register): Ditto.
3891         (linux_read_memory, linux_write_memory): Ditto.
3892         (linux_request_interrupt): Ditto.
3893         (linux_read_auxv): Ditto.
3894         (linux_xfer_siginfo): Ditto.
3895         (linux_qxfer_spu): Ditto.
3896         (linux_qxfer_libraries_svr4): Ditto.
3897         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
3898         moved to inferiors.h.
3899         (get_lwp): Delete.
3900         (get_thread_lwp): Update.
3901         (struct lwp_info): Delete member "entry".  Simplify comment for
3902         member "thread".
3903         (all_lwps): Delete.
3904         * linux-mips-low.c (mips_read_description): Fetch lwpid from
3905         current_inferior directly.
3906         (update_watch_registers_callback): Update, "entry" parameter is a
3907         struct thread_info * now.  Fetch pid from thread.
3908         (mips_linux_prepare_to_resume): Fetch ptid from thread.
3909         (mips_insert_point): Fetch lwpid from current_inferior.
3910         Pass &all_threads to find_inferior, not &all_lwps.
3911         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
3912         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
3913         directly.
3914         (mips_stopped_data_address): Ditto.
3915         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
3916         directly.
3917         * linux-tile-low.c (tile_arch_setup): Ditto.
3918         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
3919         (update_debug_registers_callback): Update, "entry" parameter is a
3920         struct thread_info * now.  Fetch pid from thread.
3921         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
3922         Pass &all_threads to find_inferior, not &all_lwps.
3923         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
3924         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
3925         Pass &all_threads to find_inferior, not &all_lwps.
3926         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
3927         (i386_dr_low_get_status): Ditto.
3928         (x86_linux_prepare_to_resume): Fetch ptid from thread.
3929         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
3930         (x86_linux_read_description): Ditto.
3931         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
3932
3933 2014-02-20  Doug Evans  <dje@google.com>
3934
3935         * inferiors.c (get_first_inferior): Fix buglet.
3936
3937 2014-02-19  Doug Evans  <dje@google.com>
3938
3939         * gdbthread.h (add_thread): Change result type to struct thread_info *.
3940         * inferiors.c (add_thread): Change result type to struct thread_info *.
3941         All callers updated.
3942         (add_lwp): Call add_thread here instead of in callers.
3943         All callers updated.
3944         * linux-low.h (get_lwp_thread): Rewrite.
3945         (struct lwp_info): New member "thread".
3946
3947 2014-02-19  Doug Evans  <dje@google.com>
3948
3949         * linux-low.c (add_lwp): Change result to struct lwp_info *.
3950         All callers updated.
3951
3952 2014-02-19  Doug Evans  <dje@google.com>
3953
3954         * inferiors.c (add_thread): Fix whitespace.
3955
3956 2014-02-19  Doug Evans  <dje@google.com>
3957
3958         * dll.c (clear_dlls): Replace accessing list implemention details
3959         with API function.
3960         * gdbthread.h (get_first_thread): Declare.
3961         * inferiors.c (for_each_inferior_with_data): New function.
3962         (get_first_thread): New function.
3963         (find_thread_ptid): Simplify.
3964         (get_first_inferior): New function.
3965         (clear_list): Delete.
3966         (one_inferior_p): New function.
3967         (clear_inferior_list): New function.
3968         (clear_inferiors): Update.
3969         * inferiors.h (for_each_inferior_with_data): Declare.
3970         (clear_inferior_list): Declare.
3971         (one_inferior_p): Declare.
3972         (get_first_inferior): Declare.
3973         * linux-low.c (linux_wait_for_event): Replace accessing list
3974         implemention details with API function.
3975         * server.c (target_running): Ditto.
3976         (accumulate_file_name_length): New function.
3977         (emit_dll_description): New function.
3978         (handle_qxfer_libraries): Replace accessing list implemention
3979         details with API function.
3980         (handle_qxfer_threads_worker): New function.
3981         (handle_qxfer_threads_proper): Replace accessing list implemention
3982         details with API function.
3983         (handle_query): Ditto.
3984         (visit_actioned_threads_callback_ftype): New typedef.
3985         (visit_actioned_threads_data): New struct.
3986         (visit_actioned_threads): Rewrite to be find_inferior callback.
3987         (resume): Call find_inferior.
3988         (handle_status): Replace accessing list implemention
3989         details with API function.
3990         (process_serial_event): Replace accessing list implemention details
3991         with API function.
3992         * target.c (set_desired_inferior): Replace accessing list implemention
3993         details with API function.
3994         * tracepoint.c (same_process_p): New function.
3995         (gdb_agent_about_to_close): Replace accessing list implemention
3996         details with API function.
3997         * win32-low.c (child_delete_thread): Replace accessing list
3998         implemention details with API function.
3999         (match_dll_by_basename): New function.
4000         (dll_is_loaded_by_basename): New function.
4001         (win32_ensure_ntdll_loaded): Replace accessing list implemention
4002         details call to dll_is_loaded_by_basename.
4003
4004 2014-02-19  Doug Evans  <dje@google.com>
4005
4006         * dll.h (struct dll_info): Add comment.
4007         * gdbthread.h (struct thread_info): Add comment.
4008         (current_ptid): Simplify.
4009         * inferiors.c (add_process): Update.
4010         (remove_process): Update.
4011         * inferiors.h (struct process_info): Rename member "head" to "entry".
4012         * linux-low.c (delete_lwp): Update.
4013         (add_lwp): Update.
4014         (last_thread_of_process_p): Update.
4015         (kill_one_lwp_callback, linux_kill): Update.
4016         (status_pending_p_callback): Update.
4017         (wait_for_sigstop): Update.  Simplify read of ptid.
4018         (start_step_over): Update.
4019         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
4020         (get_lwp_thread): Update.
4021         (struct lwp_info): Rename member "head" to "entry".
4022         * regcache.h (inferior_list_entry): Delete.
4023         * server.c (kill_inferior_callback): Update.
4024         (detach_or_kill_inferior_callback): Update.
4025         (print_started_pid): Update.
4026         (print_attached_pid): Update.
4027         (process_serial_event): Simplify read of ptid.
4028         * thread-db.c (thread_db_create_event): Update.
4029         (thread_db_get_tls_address): Update.
4030         * win32-low.c (current_inferior_ptid): Simplify.
4031
4032 2014-02-19  Tom Tromey  <tromey@redhat.com>
4033
4034         * target.h (struct target_ops) <supports_btrace>: Add target_ops
4035         argument.
4036         (target_supports_btrace): Update.
4037
4038 2014-02-14  Yao Qi  <yao@codesourcery.com>
4039
4040         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
4041         (rsp-low-ipa.o): New target.
4042
4043 2014-02-12  Tom Tromey  <tromey@redhat.com>
4044
4045         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
4046         convert_ascii_to_int.
4047         * regcache.c (registers_to_string): Likewise.
4048         * remote-utils.c (decode_M_packet): Likewise.
4049         * server.c (process_serial_event): Likewise.
4050
4051 2014-02-12  Tom Tromey  <tromey@redhat.com>
4052
4053         * server.c (handle_query, handle_v_run): Use hex2bin, not
4054         unhexify.
4055         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
4056
4057 2014-02-12  Tom Tromey  <tromey@redhat.com>
4058
4059         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
4060         convert_int_to_ascii.
4061         * regcache.c (registers_to_string, collect_register_as_string):
4062         Likewise.
4063         * remote-utils.c (look_up_one_symbol, relocate_instruction):
4064         Likewise.
4065         * server.c (process_serial_event): Likewise.
4066         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
4067         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
4068
4069 2014-02-12  Tom Tromey  <tromey@redhat.com>
4070
4071         * remote-utils.c (look_up_one_symbol, monitor_output): Use
4072         bin2hex, not hexify.
4073         * tracepoint.c (cmd_qtstatus): Likewise.
4074
4075 2014-02-12  Tom Tromey  <tromey@redhat.com>
4076
4077         * remote-utils.c (monitor_output): Pass explicit length to
4078         hexify.
4079
4080 2014-02-12  Tom Tromey  <tromey@redhat.com>
4081
4082         * tracepoint.c: Include rsp-low.h.
4083         * server.c: Include rsp-low.h.
4084         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
4085         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
4086         declare.
4087         * remote-utils.c: Include rsp-low.h.
4088         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
4089         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
4090         (convert_int_to_ascii, convert_ascii_to_int): Move to
4091         common/rsp-low.c.
4092         * regcache.c: Include rsp-low.h.
4093         * ax.c: Include rsp-low.h.
4094         * Makefile.in (SFILES): Add common/rsp-low.c.
4095         (OBS): Add rsp-low.o.
4096         (rsp-low.o): New target.
4097
4098 2014-02-12  Tom Tromey  <tromey@redhat.com>
4099
4100         * utils.h (pulongest, plongest, phex_nz): Don't declare.
4101         Include print-utils.h.
4102         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
4103         (plongest, thirty_two, phex_nz): Remove.
4104         * Makefile.in (SFILES): Add common/print-utils.c.
4105         (OBS): Add print-utils.o.
4106         (print-utils-ipa.o): New target.
4107         (print-utils.o): New target.
4108         (IPA_OBJS): Add print-utils-ipa.o.
4109
4110 2014-02-06  Tom Tromey  <tromey@redhat.com>
4111
4112         * Makefile.in (SFILES): Fix indentation.
4113
4114 2014-02-05  Doug Evans  <dje@google.com>
4115
4116         * linux-low.c (linux_wait_for_event): Improve comment.
4117         (linux_wait_1): Keep current_inferior in sync with event_child.
4118
4119 2014-01-22  Doug Evans  <dje@google.com>
4120
4121         * gdbthread.h (gdb_id_to_thread): Delete, unused.
4122
4123 2014-01-22  Doug Evans  <dje@google.com>
4124
4125         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
4126         * configure: Regenerate.
4127         * config.in: Regenerate.
4128         * Makefile.in (SFILES): Add debug.c.
4129         (OBS): Add debug.o.
4130         * debug.c: New file.
4131         * debug.h: New file.
4132         * linux-aarch64-low.c (*): Update all debugging printfs to use
4133         debug_printf instead of fprintf.
4134         * linux-arm-low.c (*): Ditto.
4135         * linux-cris-low.c (*): Ditto.
4136         * linux-crisv32-low.c (*): Ditto.
4137         * linux-m32r-low.c (*): Ditto.
4138         * linux-sparc-low.c (*): Ditto.
4139         * linux-x86.c (*): Ditto.
4140         * linux-low.c (*): Ditto.
4141         (linux_wait_1): Add calls to debug_enter, debug_exit.
4142         (linux_wait): Remove redundant debugging printf.
4143         (stop_all_lwps): Add calls to debug_enter, debug_exit.
4144         (linux_resume, unstop_all_lwps): Ditto.
4145         * mem-break.c (*): Update all debugging printfs to use
4146         debug_printf instead of fprintf.
4147         * remote-utils.c (*): Ditto.
4148         * thread-db.c (*): Ditto.
4149         * server.c #include <ctype.h>, "gdb_vecs.h".
4150         (debug_threads): Moved to debug.c.
4151         (*): Update all debugging printfs to use debug_printf instead of
4152         fprintf.
4153         (start_inferior): Replace call to fflush with call to debug_flush.
4154         (monitor_show_help): Mention set debug-format.
4155         (parse_debug_format_options): New function.
4156         (handle_monitor_command): Handle "monitor set debug-format".
4157         (gdbserver_usage): Mention --debug-format.
4158         (main): Parse --debug-format.
4159         * server.h (debug_threads): Declaration moved to debug.h.
4160         #include "debug.h".
4161         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4162         trace_debug_1 that uses debug_printf.
4163         (tracepoint_look_up_symbols): Update all debugging printfs to use
4164         debug_printf instead of fprintf.
4165
4166 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4167
4168         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4169         sys/ptrace.h.
4170
4171 2014-01-17  Pedro Alves  <palves@redhat.com>
4172
4173         PR build/16445
4174         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4175         defined after including gdb_proc_service.h.
4176
4177 2014-01-16  Doug Evans  <dje@google.com>
4178
4179         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4180         (match_dll): Use it.
4181
4182 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4183
4184         * target.h (target_ops) <read_btrace>: Change parameters and
4185         return type to allow error reporting.
4186         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4187         trace reading errors on.
4188         * linux-low.c (linux_low_read_btrace): Pass trace reading
4189         errors on.
4190         (linux_low_disable_btrace): New.
4191
4192 2014-01-15  Doug Evans  <dje@google.com>
4193
4194         * inferiors.c (thread_id_to_gdb_id): Delete.
4195         * inferiors.h (thread_id_to_gdb_id): Delete.
4196
4197 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4198
4199         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4200         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4201         versions.
4202
4203 2014-01-08  Pedro Alves  <palves@redhat.com>
4204
4205         * server.c (handle_status): Don't discard previous queued stop
4206         replies or thread's pending status here.
4207         (main) <disconnection>: Do it here instead.
4208
4209 2014-01-08  Pedro Alves  <palves@redhat.com>
4210
4211         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4212         * server.c (visit_actioned_threads, handle_pending_status): New
4213         function.
4214         (handle_v_cont): Factor out parts to ...
4215         (resume): ... this new function.  If in all-stop, and a thread
4216         being resumed has a pending status, report it without actually
4217         resuming.
4218         (myresume): Adjust to use the new 'resume' function.
4219         (clear_pending_status_callback, set_pending_status_callback)
4220         (find_status_pending_thread_callback): New functions.
4221         (handle_status): Handle the case of multiple threads having
4222         interesting statuses to report.  Report threads' real last signal
4223         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4224         with an interesting thread to report the status for, instead of
4225         always reporting the status of the first thread.
4226
4227 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4228
4229         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4230         * gdbreplay.c (gdbreplay_version): Likewise.
4231
4232 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4233
4234         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4235         iov.iov_len with the real length in use.
4236
4237 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4238
4239         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4240         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4241         for all targets that use win32-low.c.
4242         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4243         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4244
4245 2013-12-13  Pedro Alves  <palves@redhat.com>
4246
4247         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4248         if equal to TARGET_WAITKIND_LOADED.
4249         * win32-low.c (cached_status): New static global.
4250         (win32_wait): Add declaration.
4251         (do_initial_child_stuff): Flush all initial pending debug events
4252         up to the initial breakpoint.
4253         (win32_wait): If CACHED_STATUS was set, return that instead
4254         of doing a real wait.  Remove the code resuming the execution
4255         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4256         during the initial phase.  Also remove the code changing
4257         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4258         TARGET_WAITKIND_STOPPED.
4259
4260 2013-12-11  Yao Qi  <yao@codesourcery.com>
4261
4262         * notif.c (handle_notif_ack): Return 0 if no notification
4263         matches.
4264
4265 2013-11-20  Doug Evans  <dje@google.com>
4266
4267         * linux-low.c (linux_set_resume_request): Fix comment.
4268
4269 2013-11-20  Doug Evans  <dje@google.com>
4270
4271         * linux-low.c (resume_status_pending_p): Tweak comment.
4272
4273 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4274
4275         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4276         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4277         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4278         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4279         (srv_amd64_regobj): Add amd64-mpx.o.
4280         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4281         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4282         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4283         * i387-fp.c (num_pl_bnd_register) Added constant.
4284         (num_pl_bnd_cfg_registers) Added constant.
4285         (struct i387_xsave) Added reserved area and MPX fields.
4286         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4287         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4288         function.
4289         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4290         (init_registers_amd64_mpx_linux): Declare new function.
4291         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4292         (x86_64_regmap): Add MPX registers.
4293         (x86_linux_read_description): Add MPX case.
4294         (initialize_low_arch): Initialize MPX targets.
4295
4296 2013-11-18  Tom Tromey  <tromey@redhat.com>
4297
4298         * configure: Rebuild.
4299         * configure.ac: Don't check for stdlib.h.
4300         * gdbreplay.c: Unconditionally include stdlib.h.
4301
4302 2013-11-18  Tom Tromey  <tromey@redhat.com>
4303
4304         * config.in: Rebuild.
4305         * configure: Rebuild.
4306         * configure.ac: Don't use AC_HEADER_DIRENT.
4307
4308 2013-11-18  Tom Tromey  <tromey@redhat.com>
4309
4310         * server.h: Don't check HAVE_STRING_H.
4311         * gdbreplay.c: Don't check HAVE_STRING_H.
4312         * configure: Rebuild.
4313
4314 2013-11-18  Tom Tromey  <tromey@redhat.com>
4315
4316         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4317         LIBGNU.
4318
4319 2013-11-08  Tom Tromey  <tromey@redhat.com>
4320
4321         * configure, config.in: Rebuild.
4322         * configure.ac: Remove unused configury.
4323
4324 2013-11-08  Tom Tromey  <tromey@redhat.com>
4325
4326         * acinclude.m4: Include common.m4, codeset.m4.
4327         * configure, config.in: Rebuild.
4328         * configure.ac: Use GDB_AC_COMMON.
4329
4330 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4331
4332         * linux-s390-low.c (HWCAP_S390_TE): New define.
4333         (s390_arch_setup): Consider the TE field in the HWCAP for
4334         determining 'have_regset_tdb'.
4335
4336 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4337
4338         PR gdb/16014
4339         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4340         call to sizeof.
4341
4342 2013-10-02  Pedro Alves  <palves@redhat.com>
4343
4344         * server.c (process_serial_event): Don't output "GDBserver
4345         exiting" if GDB is connected through stdio.
4346         * target.c (mywait): Likewise, be silent if GDB is connected
4347         through stdio.
4348
4349 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4350
4351         * lynx-low.c (lynx_add_threads_after_attach): New function.
4352         (lynx_attach): Remove call to add_thread.  Add call to
4353         lynx_add_threads_after_attach instead.
4354
4355 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4356
4357         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4358         * config.in, configure: Regenerated.
4359
4360 2013-09-18  Yao Qi  <yao@codesourcery.com>
4361
4362         PR server/15959
4363         * server.c (start_inferior): Clear 'resume_info'.
4364
4365 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4366
4367         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4368         for each register.
4369
4370 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4371
4372         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4373         linux-tile-low.o to srv_tgtobj.
4374
4375 2013-09-16  Will Newton  <will.newton@linaro.org>
4376
4377         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4378         out regs.
4379
4380 2013-09-06  Pedro Alves  <palves@redhat.com>
4381
4382         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4383         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4384         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4385         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4386         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4387         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4388
4389 2013-09-06  Pedro Alves  <palves@redhat.com>
4390
4391         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4392         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4393
4394 2013-09-06  Pedro Alves  <palves@redhat.com>
4395
4396         * linux-amd64-ipa.c: Include tracepoint.h.
4397         * linux-i386-ipa.c: Include tracepoint.h.
4398
4399 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4400
4401         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4402         (ps_get_thread_area): New function.
4403
4404 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4405
4406         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4407         (initialize_low_arch): Call init_registers_crisv32 rather than
4408         init_register_crisv32.
4409
4410 2013-09-05  Pedro Alves  <palves@redhat.com>
4411
4412         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4413         to ...
4414         * hostio.h: ... this new file.
4415         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4416         win32-low.c: Include hostio.h.
4417
4418 2013-09-05  Pedro Alves  <palves@redhat.com>
4419
4420         * server.h (gdb_client_data, handler_func, callback_handler_func)
4421         (delete_file_handler, add_file_handler, append_callback_event)
4422         (delete_callback_event, start_event_loop, initialize_event_loop):
4423         Move to event-loop.h and include it.
4424         * event-loop.h: New file.
4425
4426 2013-09-05  Pedro Alves  <palves@redhat.com>
4427
4428         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4429         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4430         (loaded_dll, unloaded_dll): Move to ...
4431         * dll.h: ... this new file.
4432         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4433
4434 2013-09-05  Pedro Alves  <palves@redhat.com>
4435
4436         * server.h (current_process, get_thread_process, all_processes)
4437         (add_inferior_to_list, for_each_inferior, current_inferior)
4438         (remove_inferior, add_process, remove_process, find_process_pid)
4439         (have_started_inferiors_p, have_attached_inferiors_p)
4440         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4441         (clear_inferiors, find_inferior, find_inferior_id)
4442         (inferior_target_data, set_inferior_target_data)
4443         (inferior_regcache_data, set_inferior_regcache_data): Move to
4444         inferiors.h, and include it.
4445         * inferiors.h: New file.
4446
4447 2013-09-05  Pedro Alves  <palves@redhat.com>
4448
4449         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4450         Move ...
4451         * ax.h: ... here.
4452
4453 2013-09-05  Pedro Alves  <palves@redhat.com>
4454
4455         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4456         tracepoint.h.
4457         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4458         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4459         (handle_tracepoint_general_set, handle_tracepoint_query)
4460         (tracepoint_finished_step, tracepoint_was_hit)
4461         (release_while_stepping_state_list, current_traceframe)
4462         (in_readonly_region, traceframe_read_mem)
4463         (fetch_traceframe_registers, traceframe_read_sdata)
4464         (traceframe_read_info, struct fast_tpoint_collect_status)
4465         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4466         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4467         (supply_fast_tracepoint_registers)
4468         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4469         (ipa_tdesc, claim_trampoline_space)
4470         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4471         (agent_mem_read, agent_get_trace_state_variable_value)
4472         (agent_set_trace_state_variable_value, agent_tsv_read)
4473         (agent_mem_read_string, get_raw_reg_func_addr)
4474         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4475         * tracepoint.h: ... this new file.
4476
4477 2013-09-05  Pedro Alves  <palves@redhat.com>
4478
4479         * server.h (perror_with_name, error, fatal, warning, paddress)
4480         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4481         include it.
4482         * utils.h: New file.
4483
4484 2013-09-05  Pedro Alves  <palves@redhat.com>
4485
4486         * server.h (remote_debug, noack_mode, transport_is_reliable)
4487         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4488         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4489         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4490         (write_enn, initialize_async_io, enable_async_io)
4491         (disable_async_io, check_remote_input_interrupt_request)
4492         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4493         (dead_thread_notify, prepare_resume_reply)
4494         (decode_address_to_semicolon, decode_address, decode_m_packet)
4495         (decode_M_packet, decode_X_packet, decode_xfer_write)
4496         (decode_search_memory_packet, unhexify, hexify)
4497         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4498         (look_up_one_symbol, relocate_instruction)
4499         (monitor_output): Move to remote-utils.h, and include it.
4500         * remote-utils.h: New file.
4501
4502 2013-09-05  Pedro Alves  <palves@redhat.com>
4503
4504         * server.h (_): Delete.
4505
4506 2013-09-02  Pedro Alves  <palves@redhat.com>
4507
4508         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4509         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4510         allocated.
4511         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4512
4513 2013-09-02  Pierre Muller  <muller@sourceware.org>
4514
4515         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4516         or WriteProcessMemory complete successfully and handle
4517         ERROR_PARTIAL_COPY error.
4518
4519 2013-09-02  Pedro Alves  <palves@redhat.com>
4520
4521         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4522         error instead of EIO.
4523
4524 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4525
4526         PR server/15604
4527         * linux-low.c: Include filestuff.h.
4528         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4529         * lynx-low.c: Include filestuff.h.
4530         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4531         * server.c: Include filestuff.h.
4532         (main): Call notice_open_fds.
4533         * spu-low.c: Include filestuff.h.
4534         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4535
4536 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4537
4538         * Makefile.in: Explain why ../target and ../nat are not
4539         listed as include file search paths.
4540         (linux-waitpid.o): New object file rule.
4541         * configure.srv (srv_native_linux_obj): New variable.
4542         Replace all occurrences of linux native object files with
4543         $srv_native_linux_obj.
4544         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4545         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4546         (linux_enable_event_reporting): Remove declaration.
4547         (my_waitpid): Moved to common/linux-waitpid.c.
4548         (linux_wait_for_event): Pass ptid when calling
4549         linux_enable_event_reporting.
4550         (linux_supports_tracefork_flag): Remove.
4551         (linux_enable_event_reporting): Likewise.
4552         (linux_tracefork_grandchild): Remove.
4553         (STACK_SIZE): Moved to common/linux-ptrace.c.
4554         (linux_tracefork_child): Remove.
4555         (linux_test_for_tracefork): Remove.
4556         (linux_look_up_symbols): Call linux_supports_traceclone.
4557         (initialize_low): Remove call to linux_test_for_tracefork.
4558         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4559         common/linux-ptrace.h.
4560         (PTRACE_TYPE_ARG4): Likewise.
4561         Include linux-ptrace.h.
4562
4563 2013-08-21  Pedro Alves  <palves@redhat.com>
4564
4565         * config.in: Renegerate.
4566
4567 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4568
4569         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4570         (SFILES): Remove $(srcdir)/common/target-common.c and
4571         add $(srcdir)/target/waitstatus.c.
4572         (OBS): Remove target-common.o and add waitstatus.o.
4573         (server_h): Remove $(srcdir)/../common/target-common.h and
4574         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4575         and $(srcdir)/../target/waitstatus.h.
4576         (target-common.o): Remove.
4577         (waitstatus.o): New target object file.
4578         * target.h: Do not include target-common.h and
4579         include target/resume.h, target/wait.h and
4580         target/waitstatus.h.
4581
4582 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4583
4584         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4585         to PTRACE_TYPE_ARG3.
4586         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4587         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4588         PTRACE_TYPE_ARG4.
4589         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4590         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4591
4592 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4593             Daniel Jacobowitz  <dan@codesourcery.com>
4594             Yao Qi  <yao@codesourcery.com>
4595
4596         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4597         (mips-linux-watch.o): New rule.
4598         (mips_linux_watch_h): New variable.
4599         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4600         srv_tgtobj.
4601         * linux-mips-low.c: Include mips-linux-watch.h.
4602         (struct arch_process_info, struct arch_lwp_info): New.
4603         (update_watch_registers_callback): New function.
4604         (mips_linux_new_process, mips_linux_new_thread) New functions.
4605         (mips_linux_prepare_to_resume, mips_insert_point): New
4606         functions.
4607         (mips_remove_point, mips_stopped_by_watchpoint): New
4608         functions.
4609         (rsp_bp_type_to_target_hw_bp_type): New function.
4610         (mips_stopped_data_address): New function.
4611         (the_low_target): Add watchpoint support functions.
4612
4613 2013-07-27  Yao Qi  <yao@codesourcery.com>
4614
4615         * i386-low.c: Include break-common.h.
4616         (enum target_hw_bp_type): Remove.
4617
4618 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4619
4620         * Makefile.in (SFILES): /common/target-common.c.
4621         (OBS): Add target-common.o.
4622         (server_h): Add $(srcdir)/../common/target-common.h.
4623         (target-common.o): New target.
4624         * server.c (queue_stop_reply_callback): Free
4625         status string after use.
4626         * target.c (target_waitstatus_to_string): Remove.
4627         * target.h: Include target-common.h.
4628         (resume_kind): Likewise.
4629         (target_waitkind): Likewise.
4630         (target_waitstatus): Likewise.
4631         (TARGET_WNOHANG): Likewise.
4632
4633 2013-07-04  Yao Qi  <yao@codesourcery.com>
4634
4635         * Makefile.in (host_alias): Use @host_noncanonical@.
4636         (target_alias): Use @target_noncanonical@.
4637         * configure.ac: Use ACX_NONCANONICAL_TARGET and
4638         ACX_NONCANONICAL_HOST.
4639         * configure: Regenerated.
4640
4641         Revert:
4642         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4643
4644         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4645         * configure: Rebuild.
4646         * Makefile.in (version_host, version_target): Get from configure.
4647         (version.c): Use $(version_host) and $(version_target).
4648
4649 2013-07-03  Pedro Alves  <palves@redhat.com>
4650
4651         * Makefile.in (config.status): Depend on development.sh.
4652         * acinclude.m4: Include libmcheck.m4.
4653         * configure: Regenerate.
4654
4655 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4656
4657         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
4658         attribute inside the parentheses.
4659         (winapi_DebugSetProcessKillOnExit): Ditto.
4660         (winapi_DebugBreakProcess): Ditto.
4661         (winapi_GenerateConsoleCtrlEvent): Ditto.
4662
4663 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4664
4665         * notif.h (notif_event): Add a dummy member to avoid compiler
4666         errors.
4667
4668 2013-07-01  Pedro Alves  <palves@redhat.com>
4669
4670         * hostio.c (HOSTIO_PATH_MAX): Define.
4671         (require_filename, handle_open, handle_unlink, handle_readlink):
4672         Use it.
4673
4674 2013-07-01  Pedro Alves  <palves@redhat.com>
4675
4676         * server.h: Include "pathmax.h".
4677         * linux-low.c: Don't include sys/param.h.
4678         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
4679         MAXPATHLEN.
4680         * win32-low.c: Don't include sys/param.h.
4681         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
4682
4683 2013-07-01  Pedro Alves  <palves@redhat.com>
4684
4685         * event-loop.c: Don't check HAVE_UNISTD_H before including
4686         <unistd.h>.
4687         * gdbreplay.c: Likewise.
4688         * remote-utils.c: Likewise.
4689         * server.c: Likewise.
4690         * configure.ac: Don't check for unistd.h.
4691         * configure: Regenerate.
4692
4693 2013-06-28  Tom Tromey  <tromey@redhat.com>
4694
4695         * Makefile.in (version.c): Use version.in, not
4696         common/version.in.
4697
4698 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4699
4700         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4701         * configure: Rebuild.
4702         * Makefile.in (version_host, version_target): Get from configure.
4703         (version.c): Use $(version_host) and $(version_target).
4704
4705 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4706
4707         Fix trace-status to output user name without trailing colon.
4708         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
4709
4710 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4711
4712         Fix trace-status to output proper start-time and stop-time.
4713         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
4714         output start time and stop time in hex as gdb expects.
4715
4716 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
4717
4718         * tracepoint.c (build_traceframe_info_xml): Output trace state
4719         variables present in the trace buffer.
4720
4721 2013-06-24  Tom Tromey  <tromey@redhat.com>
4722
4723         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
4724         create-version.sh.
4725         (version.o): Remove.
4726         * gdbreplay.c: Include version.h.
4727         (version, host_name): Don't declare.
4728         * server.h: Include version.h.
4729         (version, host_name): Don't declare.
4730
4731 2013-06-12  Pedro Alves  <palves@redhat.com>
4732
4733         * linux-x86-low.c (linux_is_elf64): Delete global.
4734         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
4735         with local linux_pid_exe_is_elf_64_file use.
4736
4737 2013-06-11  Pedro Alves  <palves@redhat.com>
4738
4739         * linux-low.c (regset_disabled, disable_regset): New functions.
4740         (regsets_fetch_inferior_registers)
4741         (regsets_store_inferior_registers): Use them.
4742         (initialize_regsets_info); Don't allocate the disabled_regsets
4743         array here.
4744         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
4745         comment.
4746
4747 2013-06-11  Pedro Alves  <palves@redhat.com>
4748
4749         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
4750         xmalloc.
4751
4752 2013-06-11  Pedro Alves  <palves@redhat.com>
4753
4754         * linux-x86-low.c (initialize_low_arch): Call
4755         init_registers_x32_avx_linux.
4756
4757 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
4758
4759         Fix compatibility with Android Bionic.
4760         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
4761         it is not empty.
4762
4763 2013-06-07  Pedro Alves  <palves@redhat.com>
4764
4765         PR server/14823
4766         * Makefile.in (OBS): Add tdesc.o.
4767         (IPA_OBJS): Add tdesc-ipa.o.
4768         (tdesc-ipa.o): New rule.
4769         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
4770         interface.
4771         * linux-low.c (new_inferior): Delete.
4772         (disabled_regsets, num_regsets): Delete.
4773         (linux_add_process): Adjust to set the new per-process
4774         new_inferior flag.
4775         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
4776         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
4777         was a stop.  When calling arch_setup, switch the current inferior
4778         to the thread that got an event.
4779         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
4780         (regsets_fetch_inferior_registers)
4781         (regsets_store_inferior_registers): New regsets_info parameter.
4782         Adjust to use it.
4783         (linux_register_in_regsets): New regs_info parameter.  Adjust to
4784         use it.
4785         (register_addr, fetch_register, store_register): New usrregs_info
4786         parameter.  Adjust to use it.
4787         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
4788         parameter regs_info.  Adjust to use it.
4789         (linux_fetch_registers): Get the current inferior's regs_info, and
4790         adjust to use it.
4791         (linux_store_registers): Ditto.
4792         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
4793         (initialize_low): Don't initialize the target_regsets here.  Call
4794         initialize_low_arch.
4795         * linux-low.h (target_regsets): Delete declaration.
4796         (struct regsets_info): New.
4797         (struct usrregs_info): New.
4798         (struct regs_info): New.
4799         (struct process_info_private) <new_inferior>: New field.
4800         (struct linux_target_ops): Delete the num_regs, regmap, and
4801         regset_bitmap fields.  New field regs_info.
4802         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
4803         * i387-fp.c (num_xmm_registers): Delete.
4804         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
4805         calls to new interface.
4806         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
4807         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
4808         Infer the number of xmm registers from the regcache's target
4809         description.
4810         * i387-fp.h (num_xmm_registers): Delete.
4811         * inferiors.c (add_thread): Don't install the thread's regcache
4812         here.
4813         * proc-service.c (gregset_info): Fetch the current inferior's
4814         regs_info.  Adjust to use it.
4815         * regcache.c: Include tdesc.h.
4816         (register_bytes, reg_defs, num_registers)
4817         (gdbserver_expedite_regs): Delete.
4818         (get_thread_regcache): If the thread doesn't have a regcache yet,
4819         create one, instead of aborting gdbserver.
4820         (regcache_invalidate_one): Rename to ...
4821         (regcache_invalidate_thread): ... this.
4822         (regcache_invalidate_one): New.
4823         (regcache_invalidate): Only invalidate registers of the current
4824         process.
4825         (init_register_cache): Add target_desc parameter, and use it.
4826         (new_register_cache): Ditto.  Assert the target description has a
4827         non zero registers_size.
4828         (regcache_cpy): Add assertions.  Adjust.
4829         (realloc_register_cache, set_register_cache): Delete.
4830         (registers_to_string, registers_from_string): Adjust.
4831         (find_register_by_name, find_regno, find_register_by_number)
4832         (register_cache_size): Add target_desc parameter, and use it.
4833         (free_register_cache_thread, free_register_cache_thread_one)
4834         (regcache_release, register_cache_size): New.
4835         (register_size): Add target_desc parameter, and use it.
4836         (register_data, supply_register, supply_register_zeroed)
4837         (supply_regblock, supply_register_by_name, collect_register)
4838         (collect_register_as_string, collect_register_by_name): Adjust.
4839         * regcache.h (struct target_desc): Forward declare.
4840         (struct regcache) <tdesc>: New field.
4841         (init_register_cache, new_register_cache): Add target_desc
4842         parameter.
4843         (regcache_invalidate_thread): Declare.
4844         (regcache_invalidate_one): Delete declaration.
4845         (regcache_release): Declare.
4846         (find_register_by_number, register_cache_size, register_size)
4847         (find_regno): Add target_desc parameter.
4848         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
4849         declarations.
4850         * remote-utils.c: Include tdesc.h.
4851         (outreg, prepare_resume_reply): Adjust.
4852         * server.c: Include tdesc.h.
4853         (gdbserver_xmltarget): Delete declaration.
4854         (get_features_xml, process_serial_event): Adjust.
4855         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
4856         declare.
4857         (struct process_info) <tdesc>: New field.
4858         (ipa_tdesc): Declare.
4859         * tdesc.c: New file.
4860         * tdesc.h: New file.
4861         * tracepoint.c: Include tdesc.h.
4862         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
4863         (get_context_regcache): Adjust to pass ipa_tdesc down.
4864         (do_action_at_tracepoint): Adjust to get the register cache size
4865         from the context regcache's description.
4866         (traceframe_walk_blocks): Adjust to get the register cache size
4867         from the current trace frame's description.
4868         (traceframe_get_pc): Adjust to get current trace frame's
4869         description and pass it down.
4870         (gdb_collect): Adjust to get the register cache size from the
4871         IPA's description.
4872         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
4873         (gdbserver_xmltarget): Delete.
4874         (initialize_low_tracepoint): Set the ipa's target description.
4875         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
4876         (initialize_low_tracepoint): Set the ipa's target description.
4877         * linux-x86-low.c: Include tdesc.h.
4878         [__x86_64__] (is_64bit_tdesc): New.
4879         (ps_get_thread_area, x86_get_thread_area): Use it.
4880         (i386_cannot_store_register): Rename to ...
4881         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
4882         (i386_cannot_fetch_register): Rename to ...
4883         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
4884         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
4885         to new interface.
4886         (target_regsets): Rename to ...
4887         (x86_regsets): ... this.
4888         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
4889         interface.
4890         (x86_siginfo_fixup): Use is_64bit_tdesc.
4891         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
4892         (tdesc_x32_avx_linux, tdesc_x32_linux)
4893         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
4894         Declare.
4895         (x86_linux_update_xmltarget): Delete.
4896         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
4897         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
4898         (AMD64_LINUX_USER64_CS): New.
4899         (x86_linux_read_description): New, based on
4900         x86_linux_update_xmltarget.
4901         (same_process_callback): New.
4902         (x86_arch_setup_process_callback): New.
4903         (x86_linux_update_xmltarget): New.
4904         (x86_regsets_info): New.
4905         (amd64_linux_regs_info): New.
4906         (i386_linux_usrregs_info): New.
4907         (i386_linux_regs_info): New.
4908         (x86_linux_regs_info): New.
4909         (x86_arch_setup): Reimplement.
4910         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
4911         (x86_emit_ops): Ditto.
4912         (the_low_target): Adjust.  Install x86_linux_regs_info,
4913         x86_cannot_fetch_register, and x86_cannot_store_register.
4914         (initialize_low_arch): New.
4915         * linux-ia64-low.c (tdesc_ia64): Declare.
4916         (ia64_fetch_register): Adjust.
4917         (ia64_usrregs_info, regs_info): New globals.
4918         (ia64_regs_info): New function.
4919         (the_low_target): Adjust.
4920         (initialize_low_arch): New function.
4921         * linux-sparc-low.c (tdesc_sparc64): Declare.
4922         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
4923         Adjust.
4924         (sparc_arch_setup): New function.
4925         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
4926         (the_low_target): Adjust.
4927         (initialize_low_arch): New function.
4928         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
4929         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
4930         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
4931         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
4932         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
4933         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
4934         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
4935         (tdesc_powerpc_isa205_vsx64l): Declare.
4936         (ppc_cannot_store_register, ppc_collect_ptrace_register)
4937         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
4938         (ppc_set_pc, ppc_get_hwcap): Adjust.
4939         (ppc_usrregs_info): Forward declare.
4940         (!__powerpc64__) ppc_regmap_adjusted: New global.
4941         (ppc_arch_setup): Adjust to the current process'es target
4942         description.
4943         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
4944         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
4945         (ppc_store_evrregset): Adjust.
4946         (target_regsets): Rename to ...
4947         (ppc_regsets): ... this, and make static.
4948         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
4949         (ppc_regs_info): New function.
4950         (the_low_target): Adjust.
4951         (initialize_low_arch): New function.
4952         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
4953         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
4954         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
4955         (tdesc_s390x_linux64v2): Declare.
4956         (s390_collect_ptrace_register, s390_supply_ptrace_register)
4957         (s390_fill_gregset, s390_store_last_break): Adjust.
4958         (target_regsets): Rename to ...
4959         (s390_regsets): ... this, and make static.
4960         (s390_get_pc, s390_set_pc): Adjust.
4961         (s390_get_hwcap): New target_desc parameter, and use it.
4962         [__s390x__] (have_hwcap_s390_high_gprs): New global.
4963         (s390_arch_setup): Adjust to set the current process'es target
4964         description.  Don't adjust the regmap.
4965         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
4966         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
4967         (regs_info_3264): New globals.
4968         (s390_regs_info): New function.
4969         (the_low_target): Adjust.
4970         (initialize_low_arch): New function.
4971         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
4972         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
4973         [__mips64] (init_registers_mips_linux)
4974         (init_registers_mips_dsp_linux): Delete defines.
4975         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
4976         (have_dsp): New global.
4977         (mips_read_description): New, based on mips_arch_setup.
4978         (mips_arch_setup): Reimplement.
4979         (get_usrregs_info): New function.
4980         (mips_cannot_fetch_register, mips_cannot_store_register)
4981         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
4982         (mips_fill_fpregset, mips_store_fpregset): Adjust.
4983         (target_regsets): Rename to ...
4984         (mips_regsets): ... this, and make static.
4985         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
4986         (dsp_regs_info, regs_info): New globals.
4987         (mips_regs_info): New function.
4988         (the_low_target): Adjust.
4989         (initialize_low_arch): New function.
4990         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
4991         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
4992         Declare.
4993         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
4994         (arm_read_description): New, with bits factored from
4995         arm_arch_setup.
4996         (arm_arch_setup): Reimplement.
4997         (target_regsets): Rename to ...
4998         (arm_regsets): ... this, and make static.
4999         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
5000         (arm_regs_info): New function.
5001         (the_low_target): Adjust.
5002         (initialize_low_arch): New function.
5003         * linux-m68k-low.c (tdesc_m68k): Declare.
5004         (target_regsets): Rename to ...
5005         (m68k_regsets): ... this, and make static.
5006         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
5007         (m68k_regs_info): New function.
5008         (m68k_arch_setup): New function.
5009         (the_low_target): Adjust.
5010         (initialize_low_arch): New function.
5011         * linux-sh-low.c (tdesc_sharch): Declare.
5012         (target_regsets): Rename to ...
5013         (sh_regsets): ... this, and make static.
5014         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
5015         (sh_regs_info, sh_arch_setup): New functions.
5016         (the_low_target): Adjust.
5017         (initialize_low_arch): New function.
5018         * linux-bfin-low.c (tdesc_bfin): Declare.
5019         (bfin_arch_setup): New function.
5020         (bfin_usrregs_info, regs_info): New globals.
5021         (bfin_regs_info): New function.
5022         (the_low_target): Adjust.
5023         (initialize_low_arch): New function.
5024         * linux-cris-low.c (tdesc_cris): Declare.
5025         (cris_arch_setup): New function.
5026         (cris_usrregs_info, regs_info): New globals.
5027         (cris_regs_info): New function.
5028         (the_low_target): Adjust.
5029         (initialize_low_arch): New function.
5030         * linux-cris-low.c (tdesc_crisv32): Declare.
5031         (cris_arch_setup): New function.
5032         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
5033         (cris_regs_info): New function.
5034         (the_low_target): Adjust.
5035         (initialize_low_arch): New function.
5036         * linux-m32r-low.c (tdesc_m32r): Declare.
5037         (m32r_arch_setup): New function.
5038         (m32r_usrregs_info, regs_info): New globals.
5039         (m32r_regs_info): Adjust.
5040         (initialize_low_arch): New function.
5041         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
5042         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
5043         (tic6x_usrregs_info): Forward declare.
5044         (tic6x_read_description): New function, based on ...
5045         (tic6x_arch_setup): ... this.  Reimplement.
5046         (target_regsets): Rename to ...
5047         (tic6x_regsets): ... this, and make static.
5048         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
5049         (tic6x_regs_info): New function.
5050         (the_low_target): Adjust.
5051         (initialize_low_arch): New function.
5052         * linux-xtensa-low.c (tdesc_xtensa): Declare.
5053         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
5054         (target_regsets): Rename to ...
5055         (xtensa_regsets): ... this, and make static.
5056         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
5057         globals.
5058         (xtensa_arch_setup, xtensa_regs_info): New functions.
5059         (the_low_target): Adjust.
5060         (initialize_low_arch): New function.
5061         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
5062         (nios2_arch_setup): Set the current process'es tdesc.
5063         (target_regsets): Rename to ...
5064         (nios2_regsets): ... this.
5065         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
5066         (nios2_regs_info): New function.
5067         (the_low_target): Adjust.
5068         (initialize_low_arch): New function.
5069         * linux-aarch64-low.c (tdesc_aarch64): Declare.
5070         (aarch64_arch_setup): Set the current process'es tdesc.
5071         (target_regsets): Rename to ...
5072         (aarch64_regsets): ... this.
5073         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
5074         (aarch64_regs_info): New function.
5075         (the_low_target): Adjust.
5076         (initialize_low_arch): New function.
5077         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
5078         globals.
5079         (target_regsets): Rename to ...
5080         (tile_regsets): ... this.
5081         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
5082         (tile_regs_info): New function.
5083         (tile_arch_setup): Set the current process'es tdesc.
5084         (the_low_target): Adjust.
5085         (initialize_low_arch): New function.
5086         * spu-low.c (tdesc_spu): Declare.
5087         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
5088         * win32-arm-low.c (tdesc_arm): Declare.
5089         (arm_arch_setup): New function.
5090         (the_low_target): Install arm_arch_setup instead of
5091         init_registers_arm.
5092         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
5093         (init_windows_x86): Rename to ...
5094         (i386_arch_setup): ... this.  Set `win32_tdesc'.
5095         (the_low_target): Adjust.
5096         * win32-low.c (win32_tdesc): New global.
5097         (child_add_thread): Don't create the thread cache here.
5098         (do_initial_child_stuff): Set the new process'es tdesc.
5099         * win32-low.h (struct target_desc): Forward declare.
5100         (win32_tdesc): Declare.
5101         * lynx-i386-low.c (tdesc_i386): Declare global.
5102         (lynx_i386_arch_setup): Set `lynx_tdesc'.
5103         * lynx-low.c (lynx_tdesc): New global.
5104         (lynx_add_process): Set the new process'es tdesc.
5105         * lynx-low.h (struct target_desc): Forward declare.
5106         (lynx_tdesc): Declare global.
5107         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
5108         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
5109         * nto-low.c (nto_tdesc): New global.
5110         (do_attach): Set the new process'es tdesc.
5111         * nto-low.h (struct target_desc): Forward declare.
5112         (nto_tdesc): Declare.
5113         * nto-x86-low.c (tdesc_i386): Declare.
5114         (nto_x86_arch_setup): Set `nto_tdesc'.
5115
5116 2013-06-04  Gary Benson  <gbenson@redhat.com>
5117
5118         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
5119         to qSupported response when appropriate.
5120         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
5121         with nonzero-length annex.
5122         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
5123         arguments supplied in annex.
5124
5125 2013-05-31  Doug Evans  <dje@google.com>
5126
5127         PR server/15594
5128         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
5129         64 bits in 64-cross-32 environment.
5130
5131 2013-05-28  Pedro Alves  <palves@redhat.com>
5132
5133         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
5134         (aarch64-without-fpu.c): Delete rule.
5135         * configure.srv (aarch64*-*-linux*): Remove references to
5136         aarch64-without-fpu.o and aarch64-without-fpu.xml.
5137         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
5138         declaration.
5139
5140 2013-05-24  Pedro Alves  <palves@redhat.com>
5141
5142         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
5143         instead of strchr/decode_address.  Error if the range isn't split
5144         with a ','.  Don't assume there's be a ':' in the action.
5145
5146 2013-05-23  Yao Qi  <yao@codesourcery.com>
5147             Pedro Alves  <palves@redhat.com>
5148
5149         * linux-low.c (lwp_in_step_range): New function.
5150         (linux_wait_1): If the thread was range stepping and stopped
5151         outside the stepping range, report the stop to GDB.  Otherwise,
5152         continue stepping.  Add range stepping debug output.
5153         (linux_set_resume_request): Copy the step range from the resume
5154         request to the lwp.
5155         (linux_supports_range_stepping): New.
5156         (linux_target_ops) <supports_range_stepping>: Set to
5157         linux_supports_range_stepping.
5158         * linux-low.h (struct linux_target_ops)
5159         <supports_range_stepping>: New field.
5160         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5161         * linux-x86-low.c (x86_supports_range_stepping): New.
5162         (the_low_target) <supports_range_stepping>: Set to
5163         x86_supports_range_stepping.
5164         * server.c (handle_v_cont): Handle 'r' action.
5165         (handle_v_requests): Append ";r" if the target supports range
5166         stepping.
5167         * target.h (struct thread_resume) <step_range_start,
5168         step_range_end>: New fields.
5169         (struct target_ops) <supports_range_stepping>:
5170         New field.
5171         (target_supports_range_stepping): New macro.
5172
5173 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5174
5175         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5176         confusion in comment.
5177
5178 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5179
5180         * lynx-low.c (struct process_info_private): New type.
5181         (lynx_add_process): New function.
5182         (lynx_create_inferior, lynx_attach): Replace calls to
5183         add_process by calls to lynx_add_process.
5184         (lynx_resume): If PTID is null, then try using
5185         current_process()->private->last_wait_event_ptid.
5186         Add comments.
5187         (lynx_clear_inferiors): Delete.  The contents of that function
5188         has been inlined in lynx_mourn;
5189         (lynx_wait_1): Save the ptid in the process's private data.
5190         (lynx_mourn): Free the process' private data.  Replace call
5191         to lynx_clear_inferiors by call to clear_inferiors.
5192
5193 2013-05-17  Yao Qi  <yao@codesourcery.com>
5194
5195         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5196         the right place.
5197
5198 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5199
5200         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5201         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5202         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5203         PT_TEXT_END_ADDR guards.  Update comments.
5204         (linux_target_op) <read_offsets>: Conditionally define to
5205         linux_read_offsets if the target is UCLIBC and if it defines
5206         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5207
5208 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5209             Andrew Jenner  <andrew@codesourcery.com>
5210
5211         * Makefile.in (SFILES): Add linux-nios2-low.c.
5212         (clean): Add action to delete nios2-linux.c.
5213         (nios2-linux.c): New rule.
5214         * configure.srv: Add nios2*-*-linux*.
5215         * linux-nios2-low.c: New.
5216
5217 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5218
5219         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5220
5221 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5222
5223         PR gdb/15186
5224         * ax.c (ax_printf): Add fflush.
5225
5226 2013-04-22  Tom Tromey  <tromey@redhat.com>
5227
5228         * Makefile.in (SFILES): Add filestuff.c.
5229         (OBS): Add filestuff.o.
5230         (filestuff.o): New target.
5231         * config.in, configure: Rebuild.
5232         * configure.ac: Check for fdwalk, pipe2.
5233
5234 2013-04-17  Pedro Alves  <palves@redhat.com>
5235
5236         * configure.ac (USE_THREAD_DB): Delete variable.
5237         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5238         Don't AC_SUBST USE_THREAD_DB.
5239         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5240         * config.in, configure: Regenerate.
5241
5242 2013-04-16  Pedro Alves  <palves@redhat.com>
5243
5244         * linux-low.h (struct lwp_info) <thread_known>: Move under
5245         the USE_THREAD_DB #ifdef.
5246
5247 2013-04-16  Pedro Alves  <palves@redhat.com>
5248
5249         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5250         (linux-low.o): Delete rule.
5251         * linux-low.h: Always include "gdb_thread_db.h" instead of
5252         conditionally including thread_db.h.
5253         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5254         HAVE_THREAD_DB_H.
5255
5256 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5257
5258         * Makefile.in (install-only): Fix make install regression.
5259
5260 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5261
5262         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5263         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5264         installation.
5265         * gdbserver.1: Remove.
5266
5267 2013-03-22  Pedro Alves  <palves@redhat.com>
5268
5269         * linux-low.c (handle_extended_wait): Don't call
5270         linux_enable_event_reporting.
5271
5272 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5273
5274         PR build/9098:
5275         * Makefile.in (SHELL): Use @SHELL@.
5276
5277 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5278
5279         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5280         compiler warning.
5281
5282 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5283
5284         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5285         Remove extraneous NULL element.
5286
5287 2013-03-13  Yao Qi  <yao@codesourcery.com>
5288
5289         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5290         'V' block in trace frame.
5291
5292 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5293
5294         * target.h (struct target_ops): Add btrace ops.
5295         (target_supports_btrace): New macro.
5296         (target_enable_btrace): New macro.
5297         (target_disable_btrace): New macro.
5298         (target_read_btrace): New macro.
5299         * gdbthread.h (struct thread_info): Add btrace field.
5300         * server.c: Include btrace-common.h.
5301         (handle_btrace_general_set): New function.
5302         (handle_btrace_enable): New function.
5303         (handle_btrace_disable): New function.
5304         (handle_general_set): Call handle_btrace_general_set.
5305         (handle_qxfer_btrace): New function.
5306         (struct qxfer qxfer_packets[]): Add btrace entry.
5307         * inferiors.c (remove_thread): Disable btrace.
5308         * linux-low: Include linux-btrace.h.
5309         (linux_low_enable_btrace): New function.
5310         (linux_low_read_btrace): New function.
5311         (linux_target_ops): Add btrace ops.
5312         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5313         Add srv_linux_btrace=yes.
5314         (x86_64-*-linux*): Add linux-btrace.o.
5315         Add srv_linux_btrace=yes.
5316         * configure.ac: Define HAVE_LINUX_BTRACE.
5317         * config.in: Regenerated.
5318         * configure: Regenerated.
5319
5320 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5321
5322         * server.c (handle_qxfer): Preserve error message if -3 is
5323         returned.
5324         (qxfer): Document the -3 return value.
5325
5326 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5327
5328         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5329         (linux_btrace_h): New variable.
5330         (linux-btrace.o): New rule.
5331
5332 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5333             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5334
5335         * tracepoint.c (trace_buffer_size): New global.
5336         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5337         (init_trace_buffer): Change to one-argument function. Allocate
5338         trace buffer memory.
5339         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5340         handle QTBuffer:size packet.
5341         (cmd_bigqtbuffer_size): New function.
5342         (initialize_tracepoint): Call init_trace_buffer with
5343         DEFAULT_TRACE_BUFFER_SIZE.
5344         * server.c (handle_query): Add QTBuffer:size in the
5345         supported packets.
5346
5347 2013-03-07  Yao Qi  <yao@codesourcery.com>
5348
5349         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5350         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5351         of -1.
5352         (cmd_qtsp): Adjust condition.  Do post increment.
5353         Set cur_action and cur_step_action back to 0.
5354
5355 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5356
5357         PR server/15236
5358         * linux-low.c (linux_write_memory): Return early success if LEN is
5359         zero.
5360
5361 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5362
5363         * configure.srv: Add x86_64-*-cygwin* as target.
5364
5365 2013-02-28  Tom Tromey  <tromey@redhat.com>
5366
5367         * configure.ac: Invoke AC_SYS_LARGEFILE.
5368         * configure, config.in: Rebuild.
5369
5370 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5371
5372         * win32-low.c: Throughout, fix format strings and casts of
5373         printf-like functions to avoid type related warnings on all
5374         platforms.
5375         (get_child_debug_event): Print dwDebugEventCode as hex since
5376         that's how it's usually documented.
5377
5378 2013-02-28  Yao Qi  <yao@codesourcery.com>
5379
5380         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5381         pulongest.
5382
5383 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5384
5385         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5386         (reg-tilegx32.c): New rule.
5387         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5388         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5389         different register info initializer according to elf class.
5390         (init_registers_tilgx32): New function.  The tilegx32 register info
5391         initializer.
5392         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5393         (tile_store_gregset): Likewise.
5394
5395 2013-02-27  Yao Qi  <yao@codesourcery.com>
5396
5397         * server.c (process_point_options): Print debug message when
5398         debug_threads is true.
5399
5400 2013-02-26  Yao Qi  <yao@codesourcery.com>
5401
5402         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5403
5404 2013-02-19  Pedro Alves  <palves@redhat.com>
5405             Kai Tietz <ktietz@redhat.com>
5406
5407         PR gdb/15161
5408
5409         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5410         instead of strtoul to extract address from packet.
5411         (process_serial_event) <'z'>: Likewise.
5412
5413 2013-02-18  Yao Qi  <yao@codesourcery.com>
5414
5415         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5416
5417 2013-02-14  Pedro Alves  <palves@redhat.com>
5418
5419         Plug memory leak.
5420
5421         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5422         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5423
5424 2013-02-14  Pedro Alves  <palves@redhat.com>
5425
5426         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5427
5428 2013-02-14  Pedro Alves  <palves@redhat.com>
5429
5430         * tracepoint.c (save_string): Delete.
5431         (add_tracepoint_action): Use savestring instead of save_string.
5432
5433 2013-02-12  Pedro Alves  <palves@redhat.com>
5434
5435         * linux-xtensa-low.c: Ditto.
5436         * xtensa-xtregs.c: Ditto.
5437
5438 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5439
5440         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5441         thread_db.
5442
5443 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5444
5445         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5446         aarch64_num_wp_regs and aarch64_num_bp_regs to
5447         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5448
5449 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5450
5451         * linux-aarch64-low.c (ps_get_thread_area): Replace
5452         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5453
5454 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5455             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5456             Nigel Stephens  <nigel.stephens@arm.com>
5457             Yufeng Zhang  <yufeng.zhang@arm.com>
5458
5459         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5460         (aarch64.c, aarch64-without-fpu.c): New targets.
5461         * configure.srv (aarch64*-*-linux*): New.
5462         * linux-aarch64-low.c: New file.
5463
5464 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5465
5466         * linux-low.c (handle_extended_wait, linux_create_inferior)
5467         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5468         (dequeue_one_deferred_signal, linux_resume_one_thread)
5469         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5470         (linux_tracefork_grandchild, linux_test_for_tracefork)
5471         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5472         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5473         where the argument is 0.
5474
5475 2013-01-25  Yao Qi  <yao@codesourcery.com>
5476
5477         * event-loop.c: Include "queue.h".
5478         (gdb_event_p): New typedef.
5479         (struct gdb_event) <next_event>: Remove.
5480         (event_queue): Change to QUEUE(gdb_event_p).
5481         (async_queue_event): Remove.
5482         (gdb_event_xfree): New.
5483         (initialize_event_loop): New.
5484         (process_event): Use API from QUEUE.
5485         (wait_for_event): Likewise.
5486         * server.c (main): Call initialize_event_loop.
5487         * server.h (initialize_event_loop): Declare.
5488
5489 2013-01-18  Yao Qi  <yao@codesourcery.com>
5490
5491         * ax.h (struct eval_agent_expr_context): New.
5492         (gdb_eval_agent_expr): Update declaration.
5493         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5494         TFRAME.  Add new argument CTX.
5495         * server.h (struct eval_agent_expr_context): Declare.
5496         (agent_mem_read, agent_tsv_read): Update declaration.
5497         (agent_mem_read_string): Likewise.
5498         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5499         (add_traceframe_block): Add new argument TPOINT.
5500         Increase TPOINT->traceframe_usage.
5501         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5502         eval_tracepoint_agent_expr.
5503         (condition_true_at_tracepoint): Likewise.
5504         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5505         (agent_mem_read_string, agent_tsv_read): Likewise.
5506
5507 2013-01-16  Yao Qi  <yao@codesourcery.com>
5508
5509         * linux-low.c (linux_resume_one_lwp): Don't check
5510         'lwp->bp_reinsert != 0'.
5511
5512 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5513             Pedro Alves  <palves@redhat.com>
5514
5515         * lynx-low.c (ptrace_request_to_str): Define a temporary
5516         macro and use it to simplify this function's implementation.
5517
5518 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5519
5520         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5521         sets errno.
5522
5523 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5524
5525         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5526
5527 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5528
5529         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5530
5531 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5532
5533         * lynx-low.c (lynx_resume): Use the resume_info parameter
5534         to determine the ptid for the lynx_ptrace call, unless
5535         it is equal to minus_one_ptid, in which case we use the
5536         ptid of the current_inferior.
5537         (lynx_wait_1): After having received a thread create/exit
5538         event, resume the inferior's execution using the signaling
5539         thread's ptid, rather than the old ptid.
5540
5541 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5542
5543         * lynx-low.c (lynx_resume): Delete variable ret.
5544
5545 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5546
5547         * gdbreplay.c (gdbreplay_version): Update copyright year.
5548         * server.c (gdbserver_version): Likewise.
5549
5550 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5551
5552         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5553         new thread.
5554
5555 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5556
5557         * lynx-low.c (ptrace_request_to_str): Add handling for
5558         PTRACE_GETTRACESIG.
5559
5560 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5561
5562         * lynx-low.c (lynx_attach): Delete variable new_process.
5563
5564 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5565
5566         * lynx-low.c (lynx_create_inferior): Delete variable
5567         new_process.
5568
5569 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5570
5571         * lynx-low.c (ptrace_request_to_str): Do not handle
5572         PTRACE_GETTHREADLIST if this macro does not exist.
5573
5574 2012-12-15  Yao Qi  <yao@codesourcery.com>
5575
5576         * Makefile.in (OBS): Add notif.o.
5577         * notif.c, notif.h: New.
5578         * server.c: Include "notif.h".
5579         (struct vstop_notif) <next>: Remove.
5580         <base>: New field.
5581         (queue_stop_reply): Update.
5582         (push_event, send_next_stop_reply): Remove.
5583         (discard_queued_stop_replies): Update.
5584         (notif_stop): New variable.
5585         (handle_v_stopped): Remove.
5586         (handle_v_requests): Don't call handle_v_stopped.  Call
5587         handle_ack_notif instead.
5588         (queue_stop_reply_callback): Call notif_event_enque instead
5589         of queue_stop_reply.
5590         (handle_status): Don't call send_next_stop_reply, call
5591         notif_write_event instead.
5592         (kill_inferior_callback): Likewise.
5593         (detach_or_kill_inferior_callback): Likewise.
5594         (main): Call initialize_notif.
5595         (process_serial_event): Call QUEUE_is_empty.
5596         (handle_target_event): Call notif_push instead of push event.
5597         * server.h (push_event): Remove declaration.
5598
5599 2012-12-10  Tom Tromey  <tromey@redhat.com>
5600
5601         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5602         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5603         macros.
5604         (.c.o): Rewrite.
5605         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5606         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5607         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5608         (amd64-linux-ipa.o, ax.o): Rewrite.
5609         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5610         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5611         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5612         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5613         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5614         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5615         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5616         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5617         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5618         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5619         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5620         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5621         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5622         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5623         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5624         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5625         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5626         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5627         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5628         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5629         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5630         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5631         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5632         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5633         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
5634         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
5635         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
5636         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
5637         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
5638         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
5639         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
5640         (reg-tilegx.o): Remove.
5641         (all_object_files): New macro.
5642         Include .deps files.
5643         * aclocal.m4, configure: Rebuild.
5644         * acinclude.m4: Include depstand.m4, lead-dot.m4.
5645         * configure.ac: Invoke ZW_CREATE_DEPDIR,
5646         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
5647
5648 2012-12-05  Tom Tromey  <tromey@redhat.com>
5649
5650         PR gdb/14917:
5651         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
5652
5653 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
5654
5655         * configure.ac: Check for linux/perf_event.h.
5656         * config.in: Regenerated.
5657         * configure: Regenerated.
5658
5659 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
5660
5661         * hostio.c (handle_readlink): Decrease buffer size
5662         parameter passed to readlink by one byte.
5663
5664 2012-11-26  Yao Qi  <yao@codesourcery.com>
5665
5666         * configure.ac (build_warnings): Append '-Wempty-body'.
5667         * configure: Regenerated.
5668         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
5669         body.
5670
5671 2012-11-15  Pierre Muller  <muller@sourceware.org>
5672
5673         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
5674         * config.in: Regenerate.
5675         * configure: Regenerate.
5676         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
5677         Use "gdb_wait.h" header instead of <sys/wait.h> header.
5678         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5679         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
5680         header.
5681         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
5682         instead of <sys/wait.h> header.
5683         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5684
5685 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
5686
5687         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
5688         (various make rules): Remove -DGDBSERVER
5689
5690 2012-11-09  Yao Qi  <yao@codesourcery.com>
5691
5692         * spu-low.c (current_ptid): Move it to ..
5693         * gdbthread.h: ... here.  New.
5694         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
5695         * server.c (myresume, process_serial_event): Likewise.
5696         * thread-db.c (thread_db_find_new_threads): Likewise.
5697         * tracepoint.c (run_inferior_command): Likewise.
5698
5699 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
5700
5701         * server.c (handle_search_memory_1): Include access length in
5702         warning message.
5703
5704 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
5705
5706         * linux-crisv32-low.c: Fix compile errors.
5707
5708 2012-09-04  Yao Qi  <yao@codesourcery.com>
5709
5710         * tracepoint.c (cmd_qtsv): Adjust debug message.
5711         Don't check CUR_TPOINT.
5712
5713 2012-08-28  Yao Qi  <yao@codesourcery.com>
5714
5715         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
5716         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
5717         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
5718         Remove declarations of xmalloc, xreallloc, xstrdup and
5719         freeargv.
5720         * Makefile.in (libiberty_h): New.
5721         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
5722         (linux-bfin-low.o): Append dependency 'libiberty.h'.
5723
5724 2012-08-23  Yao Qi  <yao@codesourcery.com>
5725
5726         * server.h: Remove declaration of 'xsnprintf'.
5727
5728 2012-08-22  Keith Seitz  <keiths@redhat.com>
5729
5730         * server.h: Include build-gnulib-gbserver/config.h.
5731         * gdbreplay.c: Likewise.
5732
5733 2012-08-08  Doug Evans  <dje@google.com>
5734
5735         * Makefile.in (SFILES): Add gdb_vecs.c.
5736         (OBS): Add gdb_vecs.o.
5737         (gdb_vecs_h, host_defs_h): New variables.
5738         (thread-db.o): Add $(gdb_vecs_h) dependency.
5739         (gdb_vecs.o): New rule.
5740         * thread-db.c: #include "gdb_vecs.h".
5741         (thread_db_load_search): Use a vector to iterate over path elements.
5742         Handle text appearing after "$pdir".
5743
5744         * configure.ac: Add check for strstr.
5745         * config.in: Regenerate.
5746         * configure: Regenerate.
5747
5748 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
5749
5750         * hostio.c (handle_pread): If pread fails, fall back to attempting
5751         lseek/read.
5752         (handle_pwrite): Likewise for pwrite.
5753
5754 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
5755
5756         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
5757         between unsupported TYPE and unimplementable ADDR/LEN combination.
5758         (arm_insert_point): Act on new return value.
5759
5760 2012-07-31  Pedro Alves  <palves@redhat.com>
5761
5762         * server.c (process_point_options): Only skip tokens if we find
5763         one that is unrecognized.  Don't treat 'X' specially while
5764         skipping unrecognized tokens.
5765
5766 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
5767
5768         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
5769         to 4-byte-align HW breakpoint addresses for Thumb.
5770
5771 2012-07-27  Yao Qi  <yao@codesourcery.com>
5772
5773         PR remote/14161.
5774
5775         * server.h: Declare gdb_agent_about_to_close.
5776         * target.c (kill_inferior): Include "agent.h".
5777         New.  Send command 'kill'.
5778         * target.h (kill_inferior): Removed macro.
5779         * tracepoint.c (gdb_agent_about_to_close): New.
5780         (gdb_agent_helper_thread): Handle command 'close'.
5781         Wait endlessly until the inferior stops.
5782         Install gdb_agent_remove_socket to atexit hook.
5783         (agent_socket_name): New static variable.
5784         (gdb_agent_socket_init): Replace local variable 'name' with
5785         'agent_socket_name'.
5786         (gdb_agent_remove_socket): New.
5787
5788 2012-07-27  Yao Qi  <yao@codesourcery.com>
5789
5790         * server.c (process_point_options): Stop at 'X' when parsing.
5791
5792 2012-07-19  Michael Eager  <eager@eagercon.com>
5793
5794         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
5795         to hw_execute.
5796         * linux-x86-low.c (x86_insert_point, x86_remove_point):
5797         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
5798         hardware breakpoint.
5799
5800 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5801
5802         * gdbserver/linux-low.c (initialize_low): Call
5803         linux_ptrace_init_warnings.
5804
5805 2012-07-02  Doug Evans  <dje@google.com>
5806
5807         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
5808         pointer to int.
5809
5810 2012-07-02  Stan Shebs  <stan@codesourcery.com>
5811
5812         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
5813         (ax.o): Add it to build rule.
5814         (ax-ipa.o): Ditto.
5815         (OBS): Add format.o.
5816         (IPA_OBS): Add format.o.
5817         * server.c (handle_query): Claim support for breakpoint commands.
5818         (process_point_options): Add command case.
5819         (process_serial_event): Leave running if there are printfs in
5820         effect.
5821         * mem-break.h (any_persistent_commands): Declare.
5822         (add_breakpoint_commands): Declare.
5823         (gdb_no_commands_at_breakpoint): Declare.
5824         (run_breakpoint_commands): Declare.
5825         * mem-break.c (struct point_command_list): New struct.
5826         (struct breakpoint): New field command_list.
5827         (any_persistent_commands): New function.
5828         (add_commands_to_breakpoint): New function.
5829         (add_breakpoint_commands): New function.
5830         (gdb_no_commands_at_breakpoint): New function.
5831         (run_breakpoint_commands): New function.
5832         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
5833         locally.
5834         * ax.c: Include format.h.
5835         (ax_printf): New function.
5836         (gdb_eval_agent_expr): Add printf opcode.
5837
5838 2012-06-13  Yao Qi  <yao@codesourcery.com>
5839
5840         * server.c (start_inferior): Remove duplicated writes to fields
5841         'last_resume_kind' and 'last_status' of 'current_inferior'.
5842
5843 2012-06-12  Yao Qi  <yao@codesourcery.com>
5844             Pedro Alves  <palves@redhat.com>
5845
5846         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
5847         comment.
5848         * server.c (handle_v_cont): Extend comment.
5849
5850 2012-06-11  Yao Qi  <yao@codesourcery.com>
5851
5852         * linux-low.c (linux_attach): Add 'static'.
5853
5854 2012-06-06  Yao Qi  <yao@codesourcery.com>
5855
5856         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
5857
5858 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
5859
5860         Fix gcc -flto compilation warning.
5861         * server.c (main): Make variable multi_mode and attach volatile.
5862
5863 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5864
5865         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
5866         if the platform doesn't know about it.
5867
5868 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
5869
5870         * Makefile.in (SFILES): Add linux-tile-low.c.
5871         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
5872         * configure.srv: Handle tilegx-*-linux*.
5873         * linux-tile-low.c: New file.
5874
5875 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5876
5877         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
5878
5879 2012-05-24  Pedro Alves  <palves@redhat.com>
5880
5881         PR gdb/7205
5882
5883         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
5884
5885 2012-05-24  Pedro Alves  <palves@redhat.com>
5886
5887         PR gdb/7205
5888
5889         Replace target_signal with gdb_signal throughout.
5890
5891 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
5892
5893         * linux-low.c (linux_store_registers): Avoid the copying sequence
5894         when no data has been retrieved by ptrace.
5895
5896 2012-05-22  Will Deacon  <will.deacon@arm.com>
5897
5898         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
5899         Include asm/ptrace.h.
5900         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
5901         already defined.
5902
5903 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
5904
5905         * linux-low.c (linux_store_registers): Don't re-retrieve data
5906         with ptrace that has already been obtained from /proc.  Always
5907         copy any data retrieved with ptrace to the buffer supplied.
5908
5909 2012-05-11  Yao Qi  <yao@codesourcery.com>
5910             Pedro Alves  <palves@redhat.com>
5911
5912         * linux-low.c (enum stopping_threads_kind): New.
5913         (stopping_threads): Change type to `enum stopping_threads_kind'.
5914         (handle_extended_wait): If stopping and suspending threads, leave
5915         the new_lwp suspended too.
5916         (linux_wait_for_event): Adjust.
5917         (stop_all_lwps): Set `stopping_threads' to
5918         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
5919         whether we're suspending threads or just stopping them.  Assert no
5920         recursion happens.
5921
5922 2012-04-29  Yao Qi  <yao@codesourcery.com>
5923
5924         * server.h: Move some code to ...
5925         * gdbthread.h: ... here.  New.
5926         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
5927         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
5928         (nto-low.o, win32-low.o): Likewise.
5929         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
5930         * regcache.c, remote-utils.c, server.c: Likewise.
5931         * target.c, tracepoint.c, win32-low.c: Likewise.
5932
5933 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5934
5935         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
5936         (PTRACE_ARG4_TYPE): Likewise.
5937         (PTRACE_XFER_TYPE): Likewise.
5938         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
5939         ptrace to PTRACE_ARG3_TYPE.
5940         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
5941         (PTRACE_ARG4_TYPE): Likewise.
5942         (PTRACE_XFER_TYPE): Likewise.
5943         (linux_detach_one_lwp): Cast fourth argument of
5944         ptrace to long then PTRACE_ARG4_TYPE.
5945         (regsets_fetch_inferior_registers): Cast third argument of
5946         ptrace to long then PTRACE_ARG3_TYPE.
5947         (regsets_store_inferior_registers): Likewise.
5948
5949 2012-04-20  Pedro Alves  <palves@redhat.com>
5950
5951         * configure: Regenerate.
5952
5953 2012-04-19  Pedro Alves  <palves@redhat.com>
5954
5955         * Makefile.in (GNULIB_BUILDDIR): New.
5956         (LIBGNU, INCGNU, GNULIB_H): Adjust.
5957         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
5958         (all, install-only, uninstall, clean-info, all-lib, clean): No
5959         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
5960         (maintainer-clean realclean distclean): Use subdir_do.
5961         (subdir_do): New.
5962         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
5963         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
5964         * acinclude.m4: Include acx_configure_dir.m4.
5965         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
5966         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
5967         ACX_CONFIGURE_DIR.
5968         (GNULIB): New.
5969         (GNULIB_STDINT_H): Adjust.
5970         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
5971         * gdbreplay.c: Include build-gnulib/config.h.
5972         * server.h: Likewise.
5973         * aclocal.m4: Regenerate.
5974         * config.in: Regenerate.
5975         * configure: Regenerate.
5976
5977 2012-04-19  Pedro Alves  <palves@redhat.com>
5978
5979         * Makefile.in (LIBGNU, INCGNU): Adjust.
5980         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
5981         (all, install-only, uninstall, clean-info, all-lib, clean)
5982         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
5983         * configure.ac: Adjust AC_OUTPUT output.
5984         * aclocal.m4: Regenerate.
5985         * configure: Regenerate.
5986
5987 2012-04-19  Pedro Alves  <palves@redhat.com>
5988
5989         * Makefile.in (generated_files): New.
5990         (server_h): Remove the explicit dependency on config.h, and depend
5991         on $generated_files.
5992
5993 2012-04-19  Pedro Alves  <palves@redhat.com>
5994
5995         * Makefile.in (INCGNU): Add -Ignulib.
5996
5997 2012-04-19  Pedro Alves  <palves@redhat.com>
5998
5999         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
6000         (INCGNU): ... this, and spell out -I here.
6001         (GNULIB_LIB): Rename to ...
6002         (LIBGNU): ... this.
6003         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
6004
6005 2012-04-19  Pedro Alves  <palves@redhat.com>
6006
6007         * config.in: Regenerate.
6008
6009 2012-04-19  Pedro Alves  <palves@redhat.com>
6010
6011         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
6012         * server.h (memmem): Remove declaration.
6013         * config.in: Regenerate.
6014         * configure: Regenerate.
6015
6016 2012-04-19  Yao Qi  <yao@codesourcery.com>
6017
6018         * Makefile.in (SFILES): Add common/vec.c.
6019         (OBS): Add vec.o.
6020         (vec.o): New rule.
6021
6022 2012-04-19  Yao Qi  <yao@codesourcery.com>
6023
6024         * remote-utils.c (prepare_resume_reply): Replace with macro
6025         target_core_of_thread.
6026         * server.c (handle_qxfer_threads_proper): Likewise.
6027         * target.h (traget_core_of_thread): New macro.
6028
6029 2012-04-18  Pedro Alves  <palves@redhat.com>
6030
6031         * aclocal.m4: Regenerate.
6032         * configure: Regenerate.
6033
6034 2012-04-16  Yao Qi  <yao@codesourcery.com>
6035
6036         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
6037         duplicated on address.
6038
6039 2012-04-16  Yao Qi  <yao@codesourcery.com>
6040
6041         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
6042         (struct tracepoint_action_ops) <send>: New field.
6043         (m_tracepoint_action_send, r_tracepoint_action_send): New.
6044         (agent_expr_send, x_tracepoint_action_send): New.
6045         (l_tracepoint_action_send): New.
6046         (cmd_qtdp): Download and install tracepoint
6047         according to `use_agent'.
6048         (run_inferior_command): Add one more parameter `len'.
6049         Update callers.
6050         (tracepoint_send_agent): New.
6051         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
6052
6053 2012-04-16  Yao Qi  <yao@codesourcery.com>
6054
6055         * tracepoint.c (download_tracepoints): Moved to ...
6056         (cmd_qtstart): ... here.
6057
6058 2012-04-14  Yao Qi  <yao@codesourcery.com>
6059
6060         * tracepoint.c: Include inttypes.h.
6061         (struct collect_memory_action): Use sized types.
6062         (struct tracepoint): Likewise.
6063         (cmd_qtdp, stop_tracing): Update print specifiers.
6064         (cmd_qtp, response_tracepoint): Likewise.
6065         (collect_data_at_tracepoint): Likewise.
6066         (collect_data_at_step): Likewise.
6067
6068 2012-04-14  Yao Qi  <yao@codesourcery.com>
6069
6070         Import gnulib module inttypes.
6071         * aclocal.m4, config.in, configure: Regenerated.
6072
6073 2012-04-14  Yao Qi  <yao@codesourcery.com>
6074
6075         * Makefile.in (maintainer-clean, realclean, distclean): Remove
6076         Makefile and config.status at last.
6077
6078 2012-04-13  Yao Qi  <yao@codesourcery.com>
6079
6080         * tracepoint.c: Include stdint.h unconditionally.
6081
6082 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6083
6084         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
6085         on BFD_HAVE_SYS_PROCFS_TYPE.
6086         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
6087         * configure: Regenerate.
6088         * config.in: Likewise.
6089
6090 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
6091
6092         * Makefile.in (clean): Also remove x32.c x32-linux.c
6093         x32-avx.c x32-avx-linux.c.
6094         (x32.o): New target.
6095         (x32.c): Likewise.
6096         (x32-linux.o): Likewise.
6097         (x32-linux.c): Likewise.
6098         (x32-avx.o): Likewise.
6099         (x32-avx.c): Likewise.
6100         (x32-avx-linux.o): Likewise.
6101         (x32-avx-linux.c): Likewise.
6102
6103         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
6104         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
6105         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
6106         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
6107         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
6108         i386/x32-avx-linux.xml.
6109
6110         * linux-x86-low.c (init_registers_x32_linux): New prototype.
6111         (init_registers_x32_avx_linux): Likwise.
6112         (x86_linux_update_xmltarget): Call init_registers_x32_linux
6113         or init_registers_x32_avx_linux if linux_is_elf64 is false.
6114
6115 2012-04-13  Pedro Alves  <palves@redhat.com>
6116
6117         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
6118         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
6119         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
6120         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
6121         the sub-make.
6122
6123 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6124
6125         * linux-x86-low.c (compat_x32_clock_t): New.
6126         (compat_x32_siginfo_t): Likewise.
6127         (compat_x32_siginfo_from_siginfo): Likewise.
6128         (siginfo_from_compat_x32_siginfo): Likewise.
6129         (linux_is_elf64): Likewise.
6130         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
6131         and siginfo_from_compat_x32_siginfo for x32.
6132         (x86_arch_setup): Set linux_is_elf64.
6133
6134 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6135
6136         PR gdb/13969
6137         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
6138         e_machine field.
6139         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
6140         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
6141         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
6142         compatible with process.
6143
6144 2012-04-12  Yao Qi  <yao@codesourcery.com>
6145
6146         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
6147         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
6148         (install-only, install-info, clean): Handle sub dir gnulib.
6149         (all-lib, am--refresh): New targets.
6150         (memmem.o): Remove target.
6151         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6152         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6153         (AC_REPLACE_FUNCS): Remove memmem.
6154         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6155         (AC_OUTPUT): Generate Makefile in gnulib/.
6156         * aclocal.m4, config.in, configure: Regenerated.
6157
6158 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6159
6160         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6161
6162 2012-04-05  Pedro Alves  <palves@redhat.com>
6163
6164         -Werror=strict-aliasing
6165
6166         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6167         pointer.
6168
6169 2012-04-04  Pedro Alves  <palves@redhat.com>
6170
6171         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6172         (sparc_store_gregset_from_stack, sparc_store_gregset)
6173         (sparc_breakpoint_at): Fix formatting.
6174
6175 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6176
6177         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6178         are available.
6179         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6180         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6181         * config.in: Regenerate.
6182         * configure: Likewise.
6183
6184 2012-03-29  Pedro Alves  <palves@redhat.com>
6185
6186         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6187         Correct ptrace arguments.
6188
6189 2012-03-28  Pedro Alves  <palves@redhat.com>
6190
6191         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6192         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6193         (IA64_FR1_REGNUM): New defines.
6194         (ia64_fetch_register): New.
6195         (the_low_target): Install it.
6196         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6197         field.
6198         * linux-low.c (linux_fetch_registers): Try the
6199         the_low_target.fetch_register hook first.
6200
6201         * linux-arm-low.c (the_low_target): Adjust.
6202         * linux-bfin-low.c (the_low_target): Adjust.
6203         * linux-cris-low.c (the_low_target): Adjust.
6204         * linux-crisv32-low.c (the_low_target): Adjust.
6205         * linux-m32r-low.c (the_low_target): Adjust.
6206         * linux-m68k-low.c (the_low_target): Adjust.
6207         * linux-mips-low.c (the_low_target): Adjust.
6208         * linux-ppc-low.c (the_low_target): Adjust.
6209         * linux-s390-low.c (the_low_target): Adjust.
6210         * linux-sh-low.c (the_low_target): Adjust.
6211         * linux-sparc-low.c (the_low_target): Adjust.
6212         * linux-tic6x-low.c (the_low_target): Adjust.
6213         * linux-x86-low.c (the_low_target): Adjust.
6214         * linux-xtensa-low.c (the_low_target): Adjust.
6215
6216 2012-03-26  Pedro Alves  <palves@redhat.com>
6217
6218         * server.c (handle_qxfer_libraries): Don't bail early if
6219         the_target->qxfer_libraries_svr4 is not NULL.
6220
6221 2012-03-26  Pedro Alves  <palves@redhat.com>
6222
6223         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6224
6225 2012-03-23  Pedro Alves  <palves@redhat.com>
6226
6227         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6228         "library-list-svr4" element's start tag when the the DSO list is
6229         empty.
6230
6231 2012-03-23  Pedro Alves  <palves@redhat.com>
6232
6233         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6234         a variable whose type size is the same as the inferior's pointer
6235         size.
6236
6237 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6238
6239         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6240         struct siginfo.
6241         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6242         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6243         * linux-low.h: Include <signal.h>.
6244         (struct siginfo): Remove forward declaration.
6245         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6246         struct siginfo.
6247
6248 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6249
6250         * .gitignore: Ignore more files.
6251
6252 2012-03-19  Pedro Alves  <palves@redhat.com>
6253             Jan Kratochvil  <jan.kratochvil@redhat.com>
6254
6255         * server.c (cont_thread, general_thread): Add describing comments.
6256         (start_inferior): Clear `cont_thread'.
6257         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6258         of a process.
6259
6260 2012-03-15  Yao Qi  <yao@codesourcery.com>
6261
6262         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6263         handling to ...
6264         (cmd_qtdp): ... here.
6265
6266 2012-03-15  Yao Qi  <yao@codesourcery.com>
6267
6268         * tracepoint.c (struct tracepoint_action_ops): New.
6269         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6270         (m_tracepoint_action_download): New.
6271         (r_tracepoint_action_download): New.
6272         (x_tracepoint_action_download): New.
6273         (l_tracepoint_action_download): New.
6274         (add_tracepoint_action): Install `action->ops' according type.
6275         (download_tracepoint_1): Move code `download' function pointer
6276         of various tracepoint_action_ops.
6277
6278 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6279
6280         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6281         linux_ptrace_attach_warnings.
6282
6283 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6284
6285         * Makefile.in (linux-ptrace.o): New.
6286         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6287         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6288         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6289         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6290         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6291         of these targets.
6292         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6293
6294 2012-03-08  Yao Qi  <yao@codesourcery.com>
6295             Pedro Alves  <palves@redhat.com>
6296
6297         Fix PR server/13392.
6298         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6299         offset of JMP insn.
6300         * tracepoint.c (remove_tracepoint): New.
6301         (cmd_qtdp): Call remove_tracepoint when failed to install.
6302
6303 2012-03-07  Pedro Alves  <palves@redhat.com>
6304
6305         * linux-low.c (get_detach_signal): New.
6306         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6307         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6308         ptrace call.
6309         * server.c (program_signals, program_signals_p): New.
6310         (handle_general_set): Handle QProgramSignals.
6311         * server.h (program_signals, program_signals_p): Declare.
6312
6313 2012-03-05  Pedro Alves  <palves@redhat.com>
6314             Jan Kratochvil  <jan.kratochvil@redhat.com>
6315
6316         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6317         New comment why.
6318
6319 2012-03-03  Yao Qi  <yao@codesourcery.com>
6320
6321         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6322         agent_look_up_symbols.
6323
6324 2012-03-03  Yao Qi  <yao@codesourcery.com>
6325
6326         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6327         (linux-x86-low.o): Likewise.
6328         * server.h: Remove in_process_agent_loaded.
6329         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6330         common/agent.c.
6331         Update callers.
6332
6333 2012-03-03  Yao Qi  <yao@codesourcery.com>
6334
6335         * tracepoint.c (gdb_agent_capability): New global.
6336         (in_process_agent_loaded_ust): Renamed to
6337         `in_process_agent_supports_ust'.
6338         Update callers.
6339         (in_process_agent_supports_ust): Call agent_capability_check.
6340         (clear_installed_tracepoints): Assert that agent supports
6341         agent.
6342
6343 2012-03-03  Yao Qi  <yao@codesourcery.com>
6344
6345         * linux-low.c (linux_supports_agent): New.
6346         (linux_target_ops): Initialize field `supports_agent' with
6347         linux_supports_agent.
6348         * target.h (struct target_ops) <supports_agent>: New.
6349         (target_supports_agent): New macro.
6350         * server.c (handle_general_set): Handle packet 'QAgent'.
6351         (handle_query): Send `QAgent+'.
6352         * Makefile.in (server.o): Depends on agent.h.
6353
6354 2012-03-03  Yao Qi  <yao@codesourcery.com>
6355
6356         * Makefile.in (OBS): Add agent.o.
6357         Add new rule for agent.o.
6358         Track dependence of tracepoint.c on agent.h.
6359         * tracepoint.c (run_inferior_command_1):
6360         (run_inferior_command): Call agent_run_command.
6361         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6362         common/agent.c.
6363         (resume_thread, stop_thread): Likewise.
6364         (gdb_ust_socket_init): Renamed to ...
6365         (gdb_agent_socket_init): ... New.
6366         (gdb_ust_thread): Renamed to ...
6367         (gdb_agent_helper_thread): ... New.
6368         (gdb_ust_init): Move some code to ...
6369         (gdb_agent_init): ... here.  New.
6370         [HAVE_UST]: Call gdb_ust_init.
6371         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6372         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6373         * config.in, configure: Regenerated.
6374
6375 2012-03-02  Pedro Alves  <palves@redhat.com>
6376
6377         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6378         * linux-low.c (struct simple_pid_list): New.
6379         (stopped_pids): New a struct simple_pid_list pointer.
6380         (add_to_pid_list, pull_pid_from_list): New.
6381         (handle_extended_wait): Don't assume the first signal new children
6382         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6383         (linux_wait_for_lwp): Adjust.
6384
6385 2012-03-02  Yao Qi  <yao@codesourcery.com>
6386
6387         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6388         debug log.
6389
6390 2012-03-02  Yao Qi  <yao@codesourcery.com>
6391
6392         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6393         `stop_pc' and `tpoint'.  Update caller.
6394
6395 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6396
6397         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6398         * linux-low.c (use_linux_regsets): New macro.
6399         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6400         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6401         (linux_register_in_regsets): New function.
6402         (usr_fetch_inferior_registers): Skip registers covered by
6403         regsets.
6404         (usr_store_inferior_registers): Likewise.
6405         (usr_fetch_inferior_registers): New macro.
6406         (usr_store_inferior_registers): Likewise.
6407         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6408         (linux_store_registers): Likewise.
6409         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6410         prototype.
6411         (init_registers_mips64_dsp_linux): Likewise.
6412         (init_registers_mips_linux): New macro.
6413         (init_registers_mips_dsp_linux): Likewise.
6414         (mips_dsp_num_regs): Likewise.
6415         (DSP_BASE, DSP_CONTROL): New fallback macros.
6416         (mips_base_regs): New macro.
6417         (mips_regmap): Use it.  Fix the size.
6418         (mips_dsp_regmap): New variable.
6419         (mips_dsp_regset_bitmap): Likewise.
6420         (mips_arch_setup): New function.
6421         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6422         than mips_regmap.
6423         (mips_cannot_store_register): Likewise.
6424         (the_low_target): Update .arch_setup, .num_regs and .regmap
6425         initializers.  Add .regset_bitmap initializer.
6426         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6427         initializer.
6428         * linux-bfin-low.c (the_low_target): Likewise.
6429         * linux-cris-low.c (the_low_target): Likewise.
6430         * linux-crisv32-low.c (the_low_target): Likewise.
6431         * linux-ia64-low.c (the_low_target): Likewise.
6432         * linux-m32r-low.c (the_low_target): Likewise.
6433         * linux-m68k-low.c (the_low_target): Likewise.
6434         * linux-ppc-low.c (the_low_target): Likewise.
6435         * linux-s390-low.c (the_low_target): Likewise.
6436         * linux-sh-low.c (the_low_target): Likewise.
6437         * linux-sparc-low.c (the_low_target): Likewise.
6438         * linux-tic6x-low.c (the_low_target): Likewise.
6439         * linux-x86-low.c (the_low_target): Likewise.
6440         * linux-xtensa-low.c (the_low_target): Likewise.
6441         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6442         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6443         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6444         srv_xmlfiles.
6445         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6446         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6447
6448 2012-02-29  Yao Qi  <yao@codesourcery.com>
6449             Pedro Alves  <palves@redhat.com>
6450
6451         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6452         `step_over_finished' is true.
6453
6454 2012-02-27  Pedro Alves  <palves@redhat.com>
6455
6456         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6457         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6458
6459 2012-02-27  Pedro Alves  <palves@redhat.com>
6460
6461         PR server/9684
6462         * linux-low.c (pid_is_stopped): New.
6463         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6464
6465 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6466
6467         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6468         of conditions.
6469
6470 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6471
6472         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6473
6474 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6475
6476         * server.c (handle_query): Advertise support for target-side
6477         breakpoint condition evaluation.
6478         (process_point_options): New function.
6479         (process_serial_event): When inserting a breakpoint, check for
6480         a target-side condition that should be evaluated.
6481
6482         * mem-break.c: Include regcache.h and ax.h.
6483         (point_cond_list_t): New data structure.
6484         (breakpoint) <cond_list>: New field.
6485         (find_gdb_breakpoint_at): Make non-static.
6486         (delete_gdb_breakpoint_at): Clear any target-side
6487         conditions.
6488         (clear_gdb_breakpoint_conditions): New function.
6489         (add_condition_to_breakpoint): Likewise.
6490         (add_breakpoint_condition): Likewise.
6491         (gdb_condition_true_at_breakpoint): Likewise.
6492         (gdb_breakpoint_here): Return result directly instead
6493         of going through a local variable.
6494
6495         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6496         (clear_gdb_breakpoint_conditions): Likewise.
6497         (add_breakpoint_condition): Likewise.
6498         (gdb_condition_true_at_breakpoint): Likewise.
6499
6500         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6501         (need_step_over_p): Take target-side breakpoint condition into
6502         consideration.
6503
6504 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6505
6506         * server.h: Include tracepoint.h.
6507         (agent_mem_read, agent_get_trace_state_variable_value,
6508         agent_set_trace_state_variable_value,
6509         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6510         get_set_tsv_func_addr): New prototypes.
6511
6512         * ax.h: New include file.
6513         * ax.c: New source file.
6514
6515         * tracepoint.c: Include ax.h.
6516         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6517         agent_expr, eval_result_type): Move to ax.h.
6518         (parse_agent_expr): Rename to ...
6519         (gdb_parse_agent_expr): ... this, make it non-static and move
6520         to ax.h.
6521         (unparse_agent_expr) Rename to ...
6522         (gdb_unparse_agent_expr): ... this, make it non-static and move
6523         to ax.h.
6524         (eval_agent_expr): Rename to ...
6525         (eval_tracepoint_agent_expr): ... this.
6526         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6527         forward declarations.
6528         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6529         (agent_get_trace_state_variable_value): New function.
6530         (agent_set_trace_state_variable_value): New function.
6531         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6532         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6533         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6534         (condition_true_at_tracepoint): Likewise.
6535         (parse_agent_expr): Rename to ...
6536         (gdb_parse_agent_expr): ... this and move to ax.c.
6537         (unparse_agent_expr): Rename to ...
6538         (gdb_unparse_agent_expr): ... this and move to ax.c.
6539         (gdb_agent_op_name): Move to ax.c.
6540         (eval_agent_expr): Rename to ...
6541         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6542         and move to ax.c.
6543         (eval_tracepoint_agent_expr): New function.
6544         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6545         non-static.
6546         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6547         ax.c.
6548         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6549         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6550         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6551         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6552         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6553         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6554         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6555         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6556         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6557         (compile_bytecodes): Remove forward declaration.
6558         (is_goto_target): Move to ax.c.
6559         (compile_bytecodes): Move to ax.c and call
6560         agent_get_trace_state_variable_value (...) and
6561         agent_set_trace_state_variable_value (...).
6562
6563         * Makefile.in: Update ax.c and IPA dependencies.
6564
6565 2012-02-24  Pedro Alves  <palves@redhat.com>
6566
6567         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6568         (cmd_bigqtbuffer_circular): ... this.  Only handle
6569         'QTBuffer:circular:'.
6570         (handle_tracepoint_general_set): Adjust.
6571
6572 2012-02-16  Yao Qi  <yao@codesourcery.com>
6573
6574         * inferiors.c: Move code to ...
6575         * dll.c: .... here.  New.
6576         * server.h: Declare clear_dlls.
6577         * Makefile.in (SFILES): Add dll.c.
6578         (OBS): Add dll.o
6579         (dll.o): New rule.
6580
6581 2012-02-11  Yao Qi  <yao@codesourcery.com>
6582
6583         * server.c: (handle_monitor_command): Add a new parameter
6584         `own_buf'.
6585         (handle_query): Update caller.
6586
6587 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6588
6589         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6590         * configure, config.in: Regenerate.
6591         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6592         is not defined.
6593
6594 2012-02-02  Pedro Alves  <palves@redhat.com>
6595
6596         Try SIGKILL first, then PTRACE_KILL.
6597         * linux-low.c (linux_kill_one_lwp): New.
6598         (linux_kill_one_lwp): Rename to ...
6599         (kill_one_lwp_callback): ... this.  Use the new
6600         linux_kill_one_lwp.
6601
6602 2012-02-02  Pedro Alves  <palves@redhat.com>
6603
6604         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6605         inferior.
6606
6607 2012-01-27  Pedro Alves  <palves@redhat.com>
6608
6609         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6610         (elf_64_file_p): Make static.
6611         (linux_pid_exe_is_elf_64_file): New.
6612         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6613         Delete declarations.
6614         (linux_pid_exe_is_elf_64_file): Declare.
6615         * linux-x86-low.c (x86_arch_setup): Use
6616         linux_pid_exe_is_elf_64_file.
6617
6618 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6619
6620         * linux-low.c (linux_wait_for_event_1): Rename to ...
6621         (linux_wait_for_event): ... here and merge it with former
6622         linux_wait_for_event - new variable wait_ptid, use it.
6623         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6624
6625 2012-01-23  Pedro Alves  <palves@redhat.com>
6626
6627         * server.c (main): Avoid yet another case of infinite loop while
6628         detaching/killing after a longjmp.
6629
6630 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6631
6632         Code cleanup.
6633         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
6634
6635 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
6636
6637         * hostio.c (handle_readlink): New function.
6638         (handle_vFile): Call it to handle "vFile:readlink" packets.
6639
6640 2012-01-20  Pedro Alves  <palves@redhat.com>
6641             Ulrich Weigand  <ulrich.weigand@linaro.org>
6642
6643         * server.c (handle_v_requests): Only support vAttach and vRun to
6644         start multiple processes when in extended protocol mode.
6645
6646 2012-01-17  Pedro Alves  <palves@redhat.com>
6647
6648         * tracepoint.c (initialize_tracepoint): Use mmap instead of
6649         memalign plus mprotect to allocate the scratch buffer.
6650
6651 2012-01-13  Pedro Alves  <palves@redhat.com>
6652
6653         * server.c (attach_inferior): Clear `cont_thread'.
6654
6655 2012-01-13  Pedro Alves  <palves@redhat.com>
6656
6657         * server.c (main): Avoid infinite loop while detaching/killing
6658         after a longjmp.
6659
6660 2012-01-09  Doug Evans  <dje@google.com>
6661
6662         * server.c (start_inferior): Set last_ptid in --wrapper case.
6663
6664 2012-01-06  Yao Qi  <yao@codesourcery.com>
6665
6666         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
6667         defined.
6668         [IN_PROCESS_AGENT] (debug_agent): New global variable.
6669
6670 2012-01-04  Yao Qi  <yao@codesourcery.com>
6671
6672         * tracepoint.c (cmd_qtdp): Print debug message
6673         for static tracepoint.
6674
6675 2012-01-04  Yao Qi  <yao@codesourcery.com>
6676
6677         * tracepoint.c (trace_vdebug): Differentiate debug message
6678         between gdbserver and IPA.
6679
6680 2012-01-03  Yao Qi  <yao@codesourcery.com>
6681
6682         * tracepoint.c (tracepoint_was_hit): Don't collect for
6683         static tracepoint.
6684
6685 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6686
6687         * terminal.h: Reformat copyright header.
6688
6689 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6690
6691         * server.c (gdbserver_version): Update copyright year.
6692         * gdbreplay.c (gdbreplay_version): Likewise.
6693
6694 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
6695
6696         * linux-low.c (linux_create_inferior): Put empty if clause for write.
6697
6698         Revert:
6699         2011-12-18  Hui Zhu  <teawater@gmail.com>
6700         * linux-low.c (linux_create_inferior): Save return value to ret.
6701
6702 2011-12-18  Hui Zhu  <teawater@gmail.com>
6703
6704         * linux-low.c (linux_create_inferior): Save return value to ret.
6705
6706 2011-12-16  Doug Evans  <dje@google.com>
6707
6708         * linux-low.c (linux_create_inferior): If stdio connection,
6709         redirect stdin from /dev/null, stdout to stderr.
6710         * remote-utils.c (remote_is_stdio): New static global.
6711         (remote_connection_is_stdio): New function.
6712         (remote_prepare): Handle stdio connection.
6713         (remote_open): Ditto.
6714         (remote_close): Don't close stdin for stdio connections.
6715         (read_prim,write_prim): New functions.  Replace all calls to
6716         read/write to these.
6717         * server.c (main): Watch for "-" argument.  Move call to
6718         remote_prepare before start_inferior.
6719         * server.h (STDIO_CONNECTION_NAME): New macro.
6720         (remote_connection_is_stdio): Declare.
6721
6722         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
6723         in debugging output.
6724
6725 2011-12-15  Yao Qi  <yao@codesourcery.com>
6726
6727         * tracepoint.c: Include sys/syscall.h.
6728         (gdb_ust_thread): Remove preprocessor conditional.
6729
6730 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
6731
6732         * linux-low.c (linux_detach_one_lwp): Call
6733         the_low_target.prepare_to_resume before detaching.
6734
6735 2011-12-14  Yao Qi  <yao@codesourcery.com>
6736
6737         * tracepoint.c (gdb_ust_thread): Don't ignore return value
6738         of write.
6739
6740 2011-12-14  Yao Qi  <yao@codesourcery.com>
6741
6742         * i386-low.c (i386_low_stopped_data_address): Initialize local
6743         variable `control'.
6744
6745 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
6746
6747         PR remote/13492
6748
6749         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
6750         DR_CONTROL unless necessary.  Extend comments.
6751         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
6752         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
6753
6754 2011-12-13  Yao Qi  <yao@codesourcery.com>
6755
6756         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
6757         macros.
6758         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
6759
6760 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
6761
6762         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
6763         Print new debug message for such case.
6764
6765 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6766
6767         Fix overlapping memcpy.
6768         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
6769         the read_inferior_memory transfer.
6770         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
6771         write_inferior_memory transfer.
6772         (set_fast_tracepoint_jump): New variable buf.  Use it for the
6773         read_inferior_memory and write_inferior_memory transfers.
6774         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
6775         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
6776         Use it for the write_inferior_memory transfer.
6777         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
6778         buffers.
6779
6780 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6781
6782         * linux-low.c (fetch_register, store_register): Make code
6783         consistent, fix formatting.
6784
6785 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6786
6787         * linux-low.c (usr_store_inferior_registers): Factor out code
6788         to handle individual registers into...
6789         (store_register): ... this new function.
6790
6791 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
6792
6793         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
6794         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
6795         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
6796         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
6797         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
6798         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
6799         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
6800         (srv_xmlfiles): Add new XML files.
6801
6802         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
6803         and <sys/uio.h>.
6804         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
6805         (init_registers_s390_linux32v1): Add prototype.
6806         (init_registers_s390_linux32v2): Likewise.
6807         (init_registers_s390_linux64v1): Likewise.
6808         (init_registers_s390_linux64v2): Likewise.
6809         (init_registers_s390x_linux64v1): Likewise.
6810         (init_registers_s390x_linux64v2): Likewise.
6811         (s390_num_regs): Increment to 52.
6812         (s390_regmap): Add orig_r2 register.
6813         (s390_num_regs_3264): Increment to 68.
6814         (s390_regmap_3264): Add orig_r2 register.
6815         (s390_collect_ptrace_register): Handle orig_r2 register.
6816         (s390_supply_ptrace_register): Likewise.
6817         (s390_fill_last_break): New function.
6818         (s390_store_last_break): Likewise.
6819         (s390_fill_system_call): New function.
6820         (s390_store_system_call): Likewise.
6821         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
6822         register sets.
6823         (s390_check_regset): New function.
6824         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
6825         NT_S390_SYSTEM_CALL regsets and use appropriate description.
6826         Update target_regsets for available register sets.
6827
6828 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
6829             Jan Kratochvil  <jan.kratochvil@redhat.com>
6830
6831         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
6832         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
6833         New.
6834         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
6835         * linux-low.h (struct process_info_private): New member r_debug.
6836         * server.c (handle_qxfer_libraries): Call
6837         the_target->qxfer_libraries_svr4.
6838         (handle_qxfer_libraries_svr4): New function.
6839         (qxfer_packets): New entry "libraries-svr4".
6840         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
6841         * target.h (struct target_ops): New member qxfer_libraries_svr4.
6842         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
6843         PACKET_qXfer_libraries_svr4.
6844
6845 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
6846
6847         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
6848         PSW address/mask between 8-byte and 16-byte formats.
6849         (s390_supply_ptrace_register): Likewise.
6850         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
6851         basic addressing mode bit.
6852
6853 2011-11-24  Stan Shebs  <stan@codesourcery.com>
6854
6855         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
6856
6857 2011-11-17  Stan Shebs  <stan@codesourcery.com>
6858
6859         * tracepoint.c (struct tracepoint): New field traceframe_usage.
6860         (tracing_start_time): New global.
6861         (tracing_stop_time): New global.
6862         (tracing_user_name): New global.
6863         (tracing_notes): New global.
6864         (tracing_stop_note): New global.
6865         (cmd_qtstart): Set traceframe_usage, start_time.
6866         (stop_tracing): Set stop_time.
6867         (cmd_qtstatus): Report additional status.
6868         (cmd_qtp): New function.
6869         (handle_tracepoint_query): Call it.
6870         (cmd_qtnotes): New function.
6871         (handle_tracepoint_general_set): Call it.
6872         (get_timestamp): Rename from tsv_get_timestamp.
6873
6874 2011-11-14  Stan Shebs  <stan@codesourcery.com>
6875             Kwok Cheung Yeung  <kcy@codesourcery.com>
6876
6877         * linux-x86-low.c (small_jump_insn): New.
6878         (i386_install_fast_tracepoint_jump_pad): Add arguments for
6879         trampoline and error message, build a trampoline and issue a small
6880         jump instruction to it.
6881         (x86_install_fast_tracepoint_jump_pad): Add arguments for
6882         trampoline and error message.
6883         (x86_get_min_fast_tracepoint_insn_len): New.
6884         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
6885         * linux-low.h (struct linux_target_ops): Add arguments to
6886         install_fast_tracepoint_jump_pad operation, add new operation.
6887         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
6888         arguments.
6889         (linux_get_min_fast_tracepoint_insn_len): New function.
6890         (linux_target_op): Add new operation.
6891         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
6892         (gdb_trampoline_buffer_end): Ditto.
6893         (gdb_trampoline_buffer_error): Ditto.
6894         (struct ipa_sym_addresses): Add fields for new IPA variables.
6895         (symbol_list): Add entries for new IPA variables.
6896         (struct tracepoint): Add fields to hold the address range of the
6897         trampoline used by the tracepoint.
6898         (trampoline_buffer_head): New static variable.
6899         (trampoline_buffer_tail): Ditto.
6900         (claim_trampoline_space): New function.
6901         (have_fast_tracepoint_trampoline_buffer): New function.
6902         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
6903         structure.
6904         (install_fast_tracepoint): Ditto, also add error buffer argument.
6905         (cmd_qtminftpilen): New function.
6906         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
6907         (fast_tracepoint_from_trampoline_address): New function.
6908         (fast_tracepoint_collecting): Handle trampoline as part of jump
6909         pad space.
6910         (set_trampoline_buffer_space): New function.
6911         (initialize_tracepoint): Initialize new IPA variables.
6912         * target.h (struct target_ops): Add arguments to
6913         install_fast_tracepoint_jump_pad operation, add new
6914         get_min_fast_tracepoint_insn_len operation.
6915         (target_get_min_fast_tracepoint_insn_len): New.
6916         (install_fast_tracepoint_jump_pad): Add arguments.
6917         * server.h (IPA_BUFSIZ): Define.
6918         * linux-i386-ipa.c: Include extra header files.
6919         (initialize_fast_tracepoint_trampoline_buffer): New function.
6920         (initialize_low_tracepoint): Call it.
6921         * server.h (set_trampoline_buffer_space): Declare.
6922         (claim_trampoline_space): Ditto.
6923         (have_fast_tracepoint_trampoline_buffer): Ditto.
6924
6925 2011-11-14  Yao Qi  <yao@codesourcery.com>
6926
6927         * server.c (handle_query): Handle InstallInTrace for qSupported.
6928         * tracepoint.c (add_tracepoint): Sort list.
6929         (install_tracepoint, download_tracepoint): New.
6930         (cmd_qtdp): Call them to install and download tracepoints.
6931         (sort_tracepoints): Removed.
6932         (cmd_qtstart): Update.
6933
6934 2011-11-14  Yao Qi  <yao@codesourcery.com>
6935
6936         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
6937         * mem-break.h: Declare.
6938         * tracepoint.c (cmd_qtstart): Move some code to ...
6939         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
6940         New.
6941         (download_tracepoints): Move some code to ...
6942         (download_tracepoint_1): ... here.  New.
6943
6944 2011-11-08  Yao Qi  <yao@codesourcery.com>
6945
6946         * remote-utils.c (relocate_instruction): A comment fix.
6947
6948 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
6949
6950         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
6951         (i386_dr_low_get_control, i386_dr_low_get_status): Use
6952         dr_status_mirror and dr_control_mirror from debug_reg_state.
6953         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
6954         (i386_initial_stuff): Remove use of deleted globals.
6955         (i386_get_thread_context, i386_set_thread_context,
6956         i386_thread_added): Use dr_status_mirror and dr_control_mirror
6957         from debug_reg_state.
6958
6959 2011-11-05  Yao Qi  <yao@codesourcery.com>
6960
6961         * tracepoint.c (gdb_collect): Loop over tracepoints of same
6962         address as TPOINT's.
6963
6964 2011-11-02  Stan Shebs  <stan@codesourcery.com>
6965
6966         * tracepoint.c (agent_mem_read_string): New function.
6967         (eval_agent_expr): Call it for tracenz.
6968         * server.c (handle_query): Report support for tracenz.
6969
6970 2011-11-02  Yao Qi  <yao@codesourcery.com>
6971
6972         * tracepoint.c (cmd_qtstart): Remove unused local variables.
6973
6974 2011-11-02  Yao Qi  <yao@codesourcery.com>
6975
6976         * target.h: Fix a typo in comment.
6977
6978 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
6979
6980         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
6981         clobber the breakpoints' shadows with fast tracepoint jumps.
6982         * mem-break.h (check_mem_write): Add `myaddr' parameter.
6983         * target.c (write_inferior_memory): Also pass MYADDR down to
6984         check_mem_write.
6985
6986 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
6987
6988         * configure.ac: Check support for personality routine.
6989         * configure: Regenerate.
6990         * config.in: Likewise.
6991         * linux-low.c: Include <sys/personality.h>.
6992         Define ADDR_NO_RANDOMIZE if necessary.
6993         (linux_create_inferior): Disable address space randomization when
6994         forking inferior, if requested.
6995         (linux_supports_disable_randomization): New function.
6996         (linux_target_ops): Install it.
6997         * server.h (disable_randomization): Declare.
6998         * server.c (disable_randomization): New global variable.
6999         (handle_general_set): Handle QDisableRandomization.
7000         (handle_query): Likewise for qSupported.
7001         (main): Support --disable-randomization and --no-disable-randomization
7002         command line arguments.
7003         * target.h (struct target_ops): Add supports_disable_randomization.
7004         (target_supports_disable_randomization): New macro.
7005
7006 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
7007
7008         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
7009         ifdef check.
7010         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
7011         [!PT_GETDSBT] (target_loadmap): New definition.
7012         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
7013         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
7014         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
7015         and PT_GETDSBT to LINUX_LOADMAP.
7016         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
7017         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
7018
7019 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7020
7021         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
7022         (arm_linux_hwbp_cap): New static variable.
7023         (arm_linux_get_hwbp_cap): Replace by ...
7024         (arm_linux_init_hwbp_cap): ... this new function.
7025         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
7026         (arm_linux_get_hw_watchpoint_count): Likewise.
7027         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7028         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
7029         (arm_prepare_to_resume): Use perror_with_name instead of error.
7030
7031 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7032
7033         * linux-arm-low.c: Include <signal.h>.
7034         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
7035         (struct arm_linux_hwbp_cap): New data type.
7036         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
7037         (struct arm_linux_hw_breakpoint): New data type.
7038         (MAX_BPTS, MAX_WPTS): Define.
7039         (struct arch_process_info, struct arch_lwp_info): New data types.
7040         (arm_linux_get_hwbp_cap): New function.
7041         (arm_linux_get_hw_breakpoint_count): Likewise.
7042         (arm_linux_get_hw_watchpoint_count): Likewise.
7043         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7044         (arm_hwbp_control_initialize): Likewise.
7045         (arm_hwbp_control_is_enabled): Likewise.
7046         (arm_hwbp_control_is_initialized): Likewise.
7047         (arm_hwbp_control_disable): Likewise.
7048         (arm_linux_hw_breakpoint_equal): Likewise.
7049         (arm_linux_hw_point_initialize): Likewise.
7050         (struct update_registers_data): New data structure.
7051         (update_registers_callback: New function.
7052         (arm_insert_point): Likewise.
7053         (arm_remove_point): Likewise.
7054         (arm_stopped_by_watchpoint): Likewise.
7055         (arm_stopped_data_address): Likewise.
7056         (arm_new_process): Likewise.
7057         (arm_new_thread): Likewise.
7058         (arm_prepare_to_resume): Likewise.
7059         (the_low_target): Register arm_insert_point, arm_remove_point,
7060         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
7061         arm_new_thread, and arm_prepare_to_resume.
7062
7063 2011-09-15  Stan Shebs  <stan@codesourcery.com>
7064
7065         * server.h (struct emit_ops): Add compare-goto fields.
7066         * tracepoint.c (gdb_agent_op_sizes): New table.
7067         (emit_eq_goto): New function.
7068         (emit_ne_goto): New function.
7069         (emit_lt_goto): New function.
7070         (emit_le_goto): New function.
7071         (emit_gt_goto): New function.
7072         (emit_ge_goto): New function.
7073         (is_goto_target): New function.
7074         (compile_bytecodes): Recognize special cases of compare-goto
7075         combinations and call specialized emitters for them.
7076         * linux-x86-low.c (amd64_emit_eq_goto): New function.
7077         (amd64_emit_ne_goto): New function.
7078         (amd64_emit_lt_goto): New function.
7079         (amd64_emit_le_goto): New function.
7080         (amd64_emit_gt_goto): New function.
7081         (amd64_emit_ge_goto): New function.
7082         (amd64_emit_ops): Add the new functions.
7083         (i386_emit_eq_goto): New function.
7084         (i386_emit_ne_goto): New function.
7085         (i386_emit_lt_goto): New function.
7086         (i386_emit_le_goto): New function.
7087         (i386_emit_gt_goto): New function.
7088         (i386_emit_ge_goto): New function.
7089         (i386_emit_ops): Add the new functions.
7090
7091 2011-09-08  Stan Shebs  <stan@codesourcery.com>
7092
7093         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
7094         (i386_emit_epilogue): Restore %ebx.
7095
7096 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
7097
7098         * server.c (step_thread): Remove definition.
7099         (process_serial_event): Don't handle Hs.
7100         * server.h (step_thread): Remove declaration.
7101         * target.c (set_desired_inferior): Remove use of step_thread.
7102
7103 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7104
7105         * linux-low.c: Include linux-procfs.h.
7106         (linux_attach_lwp_1): Update comments.
7107         (linux_attach): Scan for existing threads when attaching to a
7108         process that is the tgid.
7109         * Makefile.in: Update dependencies.
7110
7111 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7112
7113         * configure.srv: Add linux-procfs.o dependencies.
7114
7115 2011-08-14  Yao Qi  <yao@codesourcery.com>
7116
7117         * target.h (struct target_ops): Fix indent.
7118         * win32-low.c (win32_target_ops): Fix comment.
7119
7120 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
7121             Yao Qi  <yao@codesourcery.com>
7122
7123         * Makefile.in (clean): Remove tic6x-*.c files.
7124         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
7125         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
7126         (tic6x-c64xp-linux.c): Likewise.
7127         * configure.srv: Add support for tic6x-*-uclinux.
7128         * linux-tic6x-low.c: New.
7129         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
7130
7131 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
7132             Yao Qi  <yao@codesourcery.com>
7133
7134         * target.h (struct target_ops): Add read_loadmap.
7135         * linux-low.c (struct target_loadseg): New type.
7136         (struct target_loadmap): New type.
7137         (linux_read_loadmap): New function.
7138         (linux_target_ops): Add linux_read_loadmap.
7139         * server.c (handle_query): Support qXfer:fdpic:read packet.
7140         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
7141         to NULL.
7142
7143 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7144
7145         * win32-low.c: Include <stdint.h>.
7146
7147 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
7148
7149         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7150         to the inferior here.
7151         (i386_remove_aligned_watchpoint): Ditto.
7152         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7153         fit part of the watchpoint in the debug registers.
7154         (i386_update_inferior_debug_regs): New.
7155         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7156         registers, and only update the inferior on success.
7157         (i386_low_remove_watchpoint): Ditto.
7158
7159 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7160
7161         * linux-low.c (compare_ints, unique, list_threads, show_process,
7162         linux_core_of_thread): Delete.
7163         (linux_target_ops): Change linux_core_of_thread to
7164         linux_common_core_of_thread.
7165         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7166         * utils.c (malloc_failure): Change type of argument.
7167         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7168         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7169         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7170         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7171         (IPA_OBJS): Add common-utils-ipa.o.
7172         (ptid_h, linux_osdata_h): New macros.
7173         (server_h): Add common/common-utils.h, common/xml-utils.h,
7174         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7175         common/ptid.h.
7176         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7177         ptid.o, buffer.o): New rules.
7178         (linux-low.o): Add common/linux-osdata.h as a dependency.
7179         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7180         * configure.ac: Add AC_HEADER_DIRENT check.
7181         * config.in: Regenerate.
7182         * configure: Regenerate.
7183         * remote-utils.c (xml_escape_text): Delete.
7184         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7185         buffer_xml_printf): Move to common/buffer.c.
7186         * server.c (main): Remove call to initialize_inferiors.
7187         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7188         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7189         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7190         internal_error, gdb_assert, gdb_assert_fail): Delete.
7191         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7192         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7193         common/buffer.h.
7194         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7195         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7196         initialize_inferiors): Delete.
7197
7198 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7199
7200         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7201         symbol error.
7202
7203 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7204
7205         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7206         assertion.
7207         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7208
7209 2011-05-26  Yao Qi  <yao@codesourcery.com>
7210
7211         * Makefile.in (thread-db.o): Track dependence to
7212         common/gdb_thread_db.h.
7213         * thread-db.c: include gdb_thread_db.h from right place.
7214
7215 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7216
7217         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7218         __FILE__ and __LINE__ to internal_error.
7219
7220 2011-05-13  Doug Evans  <dje@google.com>
7221
7222         * thread-db.c (try_thread_db_load_from_sdir): New function.
7223         (try_thread_db_load_from_dir): New function.
7224         (thread_db_load_search): Handle $sdir, ignore $pdir.
7225         Remove trying of system directories if search of
7226         libthread-db-search-path fails, that is now done via $sdir.
7227
7228 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7229
7230         * server.c (handle_query): Add EnableDisableTracepoints to the list
7231         of supported features.
7232         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7233         tracepoints.
7234         (cmd_qtenable_disable): New.
7235         (cmd_qtstart): Install tracepoints even if disabled.
7236         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7237         receiving a QTEnable or QTDisable packet.
7238         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7239         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7240         tracepoints.
7241         (gdb_probe): Skip data collection if static tracepoint is disabled.
7242
7243 2011-05-10  Doug Evans  <dje@google.com>
7244
7245         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7246
7247 2011-05-04  Doug Evans  <dje@google.com>
7248
7249         * linux-low.c (linux_join): Skip process lookup.
7250         * spu-low.c (spu_join): Ditto.
7251         * server.c (join_inferiors_callback): Delete.
7252         (process_serial_event): For 'D' packet (detach) call join_inferior
7253         directly.
7254
7255 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7256
7257         * README: Don't mention xscale*-*-linux*.
7258         * configure.srv (xscale*-*-linux*): Don't handle target.
7259
7260 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7261
7262         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7263         casting pointers.
7264         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7265         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7266         (i386_emit_void_call_2): Likewise.
7267
7268 2011-04-26  Yao Qi  <yao@codesourcery.com>
7269
7270         * linux-low.c: Move common macros to linux-ptrace.h.
7271         Include linux-ptrace.h.
7272         * Makefile.in (linux_ptrace_h): New.
7273         (linux-low.o): Depends on linux-ptrace.h.
7274
7275 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7276
7277         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7278         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7279         (remote_prepare): New function with most of the TCP code from ...
7280         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7281         setting transport_is_reliable.
7282         * server.c (run_once): New variable.
7283         (gdbserver_usage): Document it.
7284         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7285         the first run if RUN_ONCE.
7286         * server.h (run_once, remote_prepare): New declarations.
7287
7288 2011-04-19  Tom Tromey  <tromey@redhat.com>
7289
7290         * win32-low.c (handle_load_dll): Remove duplicate "the".
7291
7292 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7293
7294         Remove support for old Cygwin 1.5 versions.
7295         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7296         function to avoid warning.
7297         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7298         warning.
7299
7300 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7301
7302         * gdbserver/server.h (Macro _): Define it if not available.
7303
7304 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7305
7306         * hostio.c (handle_close): Remove unnecessary null test.
7307
7308 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7309
7310         * Makefile.in (maintainer-clean realclean distclean): Remove
7311         "make ...  subdir_do" command.
7312
7313 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7314
7315         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7316
7317         * server.c (handle_v_run): Free alloced buffer on early return.
7318
7319 2011-03-09  Yao Qi  <yao@codesourcery.com>
7320
7321         Revert:
7322         2011-03-04  Yao Qi  <yao@codesourcery.com>
7323
7324         * Makefile.in: Remove GNU make feature --directory.
7325
7326         2011-03-05  Yao Qi  <yao@codesourcery.com>
7327
7328         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7329         (subdir_do): New make target.  Copied from gdb/Makefile.
7330         (maintainer-clean, realclean, distclean, clean): Call corresponding
7331         make targets in common/Makefile.
7332
7333         2011-02-11  Yao Qi  <yao@codesourcery.com>
7334
7335         * configure.ac: Call AC_PROG_RANLIB.
7336         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7337         * configure: Regenerate.
7338
7339 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7340
7341         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7342
7343 2011-03-06  Yao Qi  <yao@codesourcery.com>
7344
7345         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7346
7347 2011-03-05  Yao Qi  <yao@codesourcery.com>
7348
7349         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7350         (subdir_do): New make target.  Copied from gdb/Makefile.
7351         (maintainer-clean, realclean, distclean, clean): Call corresponding
7352         make targets in common/Makefile.
7353
7354 2011-03-04  Yao Qi  <yao@codesourcery.com>
7355
7356         * Makefile.in: Remove GNU make feature --directory.
7357
7358 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7359
7360         * server.c (queue_stop_reply): Call xmalloc not malloc.
7361
7362 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7363
7364         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7365
7366 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7367
7368         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7369         (cmd_qtframe): Ditto.
7370         (cmd_qtbuffer): Ditto.
7371         (cmd_bigqtbuffer): Ditto.
7372
7373         * utils.c (decimal2str): Initialize 'width' to nine, then
7374         don't mess with it.
7375
7376 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7377
7378         * hostio.c (require_data): Free *data, not data.
7379
7380 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7381
7382         * hostio.c (require_data): Use free, not xfree.
7383
7384 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7385
7386         * server.c (handle_query): Discard unused value.
7387
7388         * hostio.c (require_data): Free malloc memory before returning
7389         error.
7390
7391 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7392
7393         * linux-low.c (list_threads): Call closedir for dirent.
7394
7395 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7396
7397         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7398         a case statement falls through.
7399
7400         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7401
7402         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7403         in comparison.
7404
7405 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7406
7407         * utils.c (decimal2str): Eliminate dead code and dead param.
7408         (pulongest): Drop dead param from call to decimal2str.
7409         (plongest): Ditto.
7410
7411 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7412
7413         Revert the following patch (not approved yet):
7414         2011-02-21  Hui Zhu  <teawater@gmail.com>
7415         * tracepoint.c (tp_printf): New function.
7416         (eval_agent_expr): Handle gdb_agent_op_printf.
7417
7418 2011-02-21  Hui Zhu  <teawater@gmail.com>
7419
7420         * tracepoint.c (tp_printf): New function.
7421         (eval_agent_expr): Handle gdb_agent_op_printf.
7422
7423 2011-02-18  Tom Tromey  <tromey@redhat.com>
7424
7425         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7426         (tracepoint.o): Likewise.
7427         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7428         (gdb_agent_op_names): Likewise.
7429
7430 2011-02-18  Tom Tromey  <tromey@redhat.com>
7431
7432         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7433         gdb_agent_op_rot>: New constants.
7434         (gdb_agent_op_names): Add pick and roll.
7435         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7436         cases.
7437
7438 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7439
7440         * aclocal.m4: Regenerated with aclocal-1.11.1.
7441
7442 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7443
7444         * server.c (handle_qxfer_traceframe_info): New.
7445         (qxfer_packets): Register "traceframe-info".
7446         (handle_query): Report support for qXfer:traceframe-info:read+.
7447         * tracepoint.c (match_blocktype): New.
7448         (traceframe_find_block_type): Rename to ...
7449         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7450         and use it.
7451         (traceframe_find_block_type): New, reimplemented on top of
7452         traceframe_walk_blocks.
7453         (build_traceframe_info_xml): New.
7454         (traceframe_read_info): New.
7455         * server.h (traceframe_read_info): Declare.
7456
7457 2011-02-11  Yao Qi  <yao@codesourcery.com>
7458
7459         * configure.ac: Call AC_PROG_RANLIB.
7460         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7461         * configure: Regenerate.
7462
7463 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7464
7465         * server.c (gdb_read_memory): Change return semantics to allow
7466         partial transfers.
7467         (handle_search_memory_1): Adjust.
7468         (process_serial_event) <'m' packet>: Handle partial transfers.
7469         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7470
7471 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7472
7473         * regcache.c (init_register_cache): Initialize
7474         regcache->register_status.
7475         (free_register_cache): Release regcache->register_status.
7476         (regcache_cpy): Copy register_status.
7477         (registers_to_string): Print 'x's for unavailable registers.
7478         (supply_register): Mark the register's status valid or
7479         unavailable, depending on whether a buffer was passed in or not.
7480         (supply_register_zeroed): New.
7481         (supply_regblock): Mark the registers' status valid or
7482         unavailable, depending on whether a buffer was passed in or not.
7483         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7484         (struct regcache): New `register_status' field.
7485         (supply_register_zeroed): Declare.
7486         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7487         supply_register_zeroed, rather than passing a NULL buffer to
7488         supply_register.
7489         * tracepoint.c (fetch_traceframe_registers): Update comment.
7490
7491 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7492
7493         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7494         buffer explicit.
7495
7496 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7497
7498         * server.h (decode_xfer_write): Change prototype.
7499         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7500         and don't extract the annex here.
7501         * server.c (decode_xfer_read): Remove `annex' parameter,
7502         and don't extract the annex here.
7503         (decode_xfer): New.
7504         (struct qxfer): New.
7505         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7506         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7507         (handle_qxfer_statictrace): New functions, abstracted out from
7508         handle_query, and made to use the struct qxfer interface.
7509         (handle_threads_qxfer_proper): Rename to ...
7510         (handle_qxfer_threads_proper): ... this.
7511         (handle_threads_qxfer): Rename to ...
7512         (handle_qxfer_threads): ... this.  Adjust.
7513         (qxfer_packets): New array.
7514         (handle_qxfer): New function.
7515         (handle_query): Use handle_qxfer.
7516
7517 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7518
7519         * gdbreplay.c: Shorten lines of >= 80 columns.
7520         * linux-low.c: Ditto.
7521         * linux-ppc-low.c: Ditto.
7522         * linux-s390-low.c: Ditto.
7523         * linux-sparc-low.c: Ditto.
7524         * linux-x86-low.c: Ditto.
7525         * linux-xtensa-low.c: Ditto.
7526         * mem-break.c: Ditto.
7527         * nto-low.c: Ditto.
7528         * regcache.h: Ditto.
7529         * remote-utils.c: Ditto.
7530         * server.c: Ditto.
7531         * server.h: Ditto.
7532         * thread-db.c: Ditto.
7533         * tracepoint.c: Ditto.
7534         * utils.c: Ditto.
7535         * win32-low.h: Ditto.
7536
7537 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7538
7539         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7540         update.
7541
7542 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7543
7544         * server.c (gdbserver_version): Update copyright year in version
7545         output.
7546         * gdbreplay.c (gdbreplay_version): Ditto.
7547
7548 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7549
7550         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7551         * linux-bfin-low.c: New file.
7552         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7553         PT_DATA_ADDR for BFIN targets.
7554         * Makefile.in (SFILES): Add linux-bfin-low.c.
7555         (clean): Remove reg-bfin.c.
7556         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7557         * README: Mention supported Blackfin targets.
7558
7559 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7560
7561         * .gitignore: New file.
7562
7563 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7564
7565         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7566
7567 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7568
7569         * Makefile.in: Add FLAGS_TO_PASS variable.
7570         (install): Remove dependency of install-only and recursively
7571         invoke make for install-only.
7572
7573 2010-10-04  Doug Evans  <dje@google.com>
7574
7575         * Makefile.in (uninstall): Use $(DESTDIR).
7576
7577 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7578
7579         PR gdb/11842
7580
7581         * linux-x86-low.c (compat_siginfo_from_siginfo)
7582         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7583         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7584         si_code < 0.
7585
7586 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7587
7588         * lynx-i386-low.c: New file.
7589         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7590
7591 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7592
7593         * lynx-low.c (ptrace_request_to_str): Remove handling for
7594         request values that have been removed in LynxOS 5.x.
7595
7596 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7597
7598         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7599         <ptrace.h>
7600
7601 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7602
7603         * configure.ac: Add --enable-inprocess-agent option.
7604         * configure: Rebuilt.
7605
7606 2010-09-06  Yao Qi  <yao@codesourcery.com>
7607
7608         * linux-low.c (linux_kill): Remove unused variable.
7609         (linux_stabilize_threads): Likewise.
7610         * server.c (start_inferior): Likewise.
7611         (queue_stop_reply_callback): Likewise.
7612         * tracepoint.c (do_action_at_tracepoint): Likewise.
7613
7614 2010-09-06  Yao Qi  <yao@codesourcery.com>
7615
7616         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7617         on return.
7618
7619 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7620
7621         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7622
7623 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7624
7625         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7626         "$(IPA_DEPFILES)".
7627
7628 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7629
7630         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7631         gdbserver/lynx-ppc-low.c: New files.
7632         * Makefile.in (lynx_low_h): New variable.
7633         (lynx-low.o, lynx-ppc-low.o): New rules.
7634         * configure.ac: On LynxOS, link with -lnetinet.
7635         * configure.srv: Add handling of powerpc-*-lynxos* targets.
7636         * configure: regenerate.
7637
7638 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7639
7640         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
7641         * configure.ac: Add check for vasprintf and vsnprintf.
7642         * configure, config.in: Regenerate.
7643         * server.h (vasprintf, vsnprintf): Add conditional declarations.
7644
7645 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7646
7647         * gdbreplay.c: Move include of alloca.h up, next to include of
7648         malloc.h.
7649         * server.h: Add include of malloc.h.
7650         * mem-break.c: Remove include of malloc.h.
7651         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
7652
7653 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7654
7655         * Makefile.in (memmem.o): Build with -Wno-error.
7656
7657 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7658
7659         * utils.c (xsnprintf): Make non-static.
7660         * server.h: Add xsnprintf declaration.
7661         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
7662         replace calls to snprintf by calls to xsnprintf throughout.
7663
7664 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7665
7666         * configure.ac: Add configure check for alloca.
7667         * configure, config.in: Regenerate.
7668         * server.h: Include alloca.h if it exists.
7669         * gdbreplay.c: Include alloca.h if it exists.
7670
7671 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7672
7673         * linux-low.c (__SIGRTMIN): Define if not already defined.
7674         (linux_create_inferior): Check for __ANDROID__ rather than
7675         __SIGRTMIN.
7676         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
7677         are already deferred.
7678         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
7679         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
7680         stopped and already has a pending signal to report.
7681         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
7682         a pending signal to report or is moving out of a jump pad.
7683         (linux_init_signals): Check for __ANDROID__ rather than
7684         __SIGRTMIN.
7685
7686 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7687
7688         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
7689         debug_threads check.  Avoid a linear search when not doing debug
7690         output.
7691
7692 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7693
7694         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
7695         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
7696         (struct file_handler) <fd>: Change type to gdb_fildes_t.
7697         (process_event): Change local fd's type to gdb_fildes_t.
7698         (create_file_handler): Adjust prototype.
7699         (delete_file_handler): Adjust prototype.
7700         (handle_file_event): Adjust prototype.  Use pfildes.
7701         (create_file_event): Adjsut prototype.
7702         * remote-utils.c (remote_desc, listen_desc): Change type to
7703         gdb_fildes_t.
7704         * server.h: New gdb_fildes_t typedef.
7705         [USE_WIN32API]: Include winsock2.h.
7706         (delete_file_handler, add_file_handler): Adjust prototypes.
7707         (pfildes): Declare.
7708         * utils.c (pfildes): New.
7709
7710 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7711
7712         * configure.ac (build_warnings): Add -Wno-char-subscripts.
7713         * configure: Regenerate.
7714
7715 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7716
7717         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
7718         (linux_done_accessing_memory): ... this.
7719         (linux_target_ops): Adjust.
7720         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
7721         * nto-low.c (nto_target_ops): Adjust comment.
7722         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
7723         * spu-low.c (spu_target_ops): Adjust comment.
7724         * target.h (target_ops): Rename unprepare_to_access_memory field
7725         to done_accessing_memory.
7726         (unprepare_to_access_memory): Rename to ...
7727         (done_accessing_memory): ... this.
7728
7729 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7730
7731         * linux-low.c (linux_prepare_to_access_memory): New.
7732         (linux_unprepare_to_access_memory): New.
7733         (linux_target_ops): Install them.
7734         * server.c (read_memory): Rename to ...
7735         (gdb_read_memory): ... this.  Use
7736         prepare_to_access_memory/prepare_to_access_memory.
7737         (write_memory): Rename to ...
7738         (gdb_write_memory): ... this.  Use
7739         prepare_to_access_memory/prepare_to_access_memory.
7740         (handle_search_memory_1): Adjust.
7741         (process_serial_event): Adjust.
7742         * target.h (struct target_ops): New fields
7743         prepare_to_access_memory and unprepare_to_access_memory.
7744         (prepare_to_access_memory, unprepare_to_access_memory): New.
7745         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
7746         prepare_to_access_memory/prepare_to_access_memory.
7747         * nto-low.c (nto_target_ops): Adjust.
7748         * spu-low.c (spu_target_ops): Adjust.
7749         * win32-low.c (win32_target_ops): Adjust.
7750
7751 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7752
7753         * Makefile.in (WARN_CFLAGS): Get it from configure.
7754         (WERROR_CFLAGS): New.
7755         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
7756         * configure.ac: Introduce --enable-werror, which adds -Werror to
7757         the compiler command line.  Enabled by default.  Disable with
7758         --disable-werror.  Add -Wdeclaration-after-statement
7759         Wpointer-arith and -Wformat-nonliteral to warning flags.
7760         * configure: Regenerate.
7761
7762 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7763
7764         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
7765
7766 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7767
7768         * gdbreplay.c (remote_error): New.
7769         (gdbchar): New.
7770         (expect): Use gdbchar.  Check for error reading from GDB.
7771         Clarify sync error output.
7772         (play): Check for errors writing to GDB.
7773         * linux-low.c (sigchld_handler): Really ignore `write' errors.
7774         * remote-utils.c (getpkt): Check for errors writing to the remote
7775         descriptor.
7776
7777 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7778
7779         * linux-low.c (linux_wait_1): Move non-debugging code out of
7780         `debug_threads' control.
7781
7782 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7783
7784         * linux-low.c (linux_wait_1): Don't set last_status here.
7785         * server.c (push_event, queue_stop_reply_callback): Assert we're
7786         not pushing a TARGET_WAITKIND_IGNORE event.
7787         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
7788         (myresume, handle_target_event): Set the thread's last_resume_kind
7789         and last_status from the target returned status.
7790
7791 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7792
7793         PR threads/10729
7794
7795         * linux-x86-low.c (update_debug_registers_callback): New.
7796         (i386_dr_low_set_addr): Use it.
7797         (i386_dr_low_get_addr): New.
7798         (i386_dr_low_set_control): Use update_debug_registers_callback.
7799         (i386_dr_low_get_control): New.
7800         (i386_dr_low_get_status): Adjust.
7801         * linux-low.c (linux_stop_lwp): New.
7802         * linux-low.h (linux_stop_lwp): Declare.
7803
7804         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
7805         argument instead of a i386_debug_reg_state.
7806         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
7807         a i386_debug_reg_state.
7808         (i386_insert_aligned_watchpoint): Adjust.
7809         (i386_remove_aligned_watchpoint): Adjust.
7810         (i386_low_stopped_data_address): Read the debug registers from the
7811         inferior instead of from the mirrors.
7812         * i386-low.h (struct i386_debug_reg_state): Extend comment.
7813         (i386_dr_low_get_addr): Declare.
7814         (i386_dr_low_get_control): Declare.
7815         (i386_dr_low_get_status): Change prototype.
7816
7817         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
7818         (i386_dr_low_get_addr): New.
7819         (i386_dr_low_get_control): New.
7820         (i386_dr_low_get_status): Adjust prototype.  Return
7821         dr_status_mirror.
7822         (i386_initial_stuff): Clear dr_status_mirror and
7823         dr_control_mirror.
7824         (i386_get_thread_context): Adjust.
7825         (i386_set_thread_context): Adjust.
7826         (i386_thread_added): Adjust.
7827
7828 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
7829
7830         * linux-low.h (linux_thread_area): Delete declaration.
7831
7832 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
7833
7834         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
7835         after its termination.
7836
7837 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
7838
7839         * linux-low.c (gdb_wants_lwp_stopped): Delete.
7840         (gdb_wants_all_stopped): Delete.
7841         (linux_wait_1): Don't call them.
7842         * server.c (handle_v_cont): Tag all threads as want-stopped.
7843         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
7844         stopped as "client-wants-stopped".
7845
7846 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
7847
7848         * Makefile.in (signals_h): New.
7849         (server_h): Depend on it.
7850         (server.o): Don't depend on $(signals_def).
7851         (signals.o): Depend on $(signals_def).
7852
7853 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
7854
7855         * Makefile.in (signals_def): New.
7856         (server_h): Append include/gdb/signals.h and signals_def.
7857         (server.o): Append signals_def.
7858
7859 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7860
7861         * server.c (handle_target_event): Use target_signal_to_host for
7862         resume_info.sig initialization.
7863         * target.h (struct thread_resume) <sig>: New comment.
7864
7865 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
7866
7867         * server.c (handle_query): strcpy() the returned string from paddress()
7868         instead of sprintf().
7869         * utils.c (paddress): Return phex_nz().
7870
7871 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
7872
7873         * server.c (handle_v_cont): Call mourn_inferior if process
7874         just exited.
7875         (myresume): Likewise.
7876
7877 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
7878
7879         Static tracepoints, and integration with UST.
7880
7881         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
7882         * mem-break.c (uninsert_all_breakpoints)
7883         (reinsert_all_breakpoints): New.
7884         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
7885         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
7886         (gdb_agent_ust_loaded, helper_thread_id)
7887         (gdb_agent_helper_thread_id): New macros.
7888         (struct ipa_sym_addresses): Add addr_ust_loaded,
7889         addr_helper_thread_id, addr_cmd_buf.
7890         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
7891         (in_process_agent_loaded_ust): New.
7892         (write_e_ust_not_loaded): New.
7893         (maybe_write_ipa_ust_not_loaded): New.
7894         (struct collect_static_trace_data_action): New.
7895         (enum tracepoint_type) <static_tracepoint>: New.
7896         (struct tracepoint) <handle>: Mention static tracepoints.
7897         (struct static_tracepoint_ctx): New.
7898         (CMD_BUF_SIZE): New.
7899         (add_tracepoint_action): Handle static tracepoint actions.
7900         (unprobe_marker_at): New.
7901         (clear_installed_tracepoints): Handle static tracepoints.
7902         (cmd_qtdp): Handle static tracepoints.
7903         (probe_marker_at): New.
7904         (cmd_qtstart): Handle static tracepoints.
7905         (response_tracepoint): Handle static tracepoints.
7906         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
7907         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
7908         (get_context_regcache): Handle static tracepoints.
7909         (do_action_at_tracepoint): Handle static tracepoint actions.
7910         (traceframe_find_block_type): Handle static trace data blocks.
7911         (traceframe_read_sdata): New.
7912         (download_tracepoints): Download static tracepoint actions.
7913         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
7914         (GDB_PROBE_NAME): New.
7915         (ust_ops): New.
7916         (GET_UST_SYM): New.
7917         (USTF): New.
7918         (dlsym_ust): New.
7919         (ust_marker_to_static_tracepoint): New.
7920         (gdb_probe): New.
7921         (collect_ust_data_at_tracepoint): New.
7922         (gdb_ust_probe): New.
7923         (UNIX_PATH_MAX, SOCK_DIR): New.
7924         (gdb_ust_connect_sync_socket): New.
7925         (resume_thread, stop_thread): New.
7926         (run_inferior_command): New.
7927         (init_named_socket): New.
7928         (gdb_ust_socket_init): New.
7929         (cstr_to_hexstr): New.
7930         (next_st): New.
7931         (first_marker, next_marker): New.
7932         (response_ust_marker): New.
7933         (cmd_qtfstm, cmd_qtsstm): New.
7934         (unprobe_marker_at, probe_marker_at): New.
7935         (cmd_qtstmat, gdb_ust_thread): New.
7936         (gdb_ust_init): New.
7937         (initialize_tracepoint_ftlib): Call gdb_ust_init.
7938         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
7939         (ST_REGENTRY): New.
7940         (x86_64_st_collect_regmap): New.
7941         (X86_64_NUM_ST_COLLECT_GREGS): New.
7942         (AMD64_RIP_REGNUM): New.
7943         (supply_static_tracepoint_registers): New.
7944         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
7945         (ST_REGENTRY): New.
7946         (i386_st_collect_regmap): New.
7947         (i386_NUM_ST_COLLECT_GREGS): New.
7948         (supply_static_tracepoint_registers): New.
7949         * server.c (handle_query): Handle qXfer:statictrace:read.
7950         <qSupported>: Report support for StaticTracepoints, and
7951         qXfer:statictrace:read features.
7952         * server.h (traceframe_read_sdata)
7953         (supply_static_tracepoint_registers): Declare.
7954         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
7955         (unpack_varlen_hex): Include in IPA build.
7956         * Makefile.in (ustlibs, ustinc): New.
7957         (IPA_OBJS): Add remote-utils-ipa.o.
7958         ($(IPA_LIB)): Link -ldl and -lpthread.
7959         (UST_CFLAGS): New.
7960         (IPAGENT_CFLAGS): Add UST_CFLAGS.
7961         * config.in, configure: Regenerate.
7962
7963 2010-06-20  Ian Lance Taylor  <iant@google.com>
7964             Pedro Alves  <pedro@codesourcery.com>
7965
7966         * linux-x86-low.c (always_true): Delete.
7967         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
7968         trying to fool the compiler with always_true.
7969
7970 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
7971
7972         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
7973         conditions in gdbserver.
7974
7975 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
7976
7977         * spu-low.c (spu_read_memory): Wrap around local store limit.
7978         (spu_write_memory): Likewise.
7979
7980 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
7981
7982         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
7983         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
7984         LONGEST uses.
7985         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
7986         uses.
7987         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
7988         uses with LONGEST uses.
7989
7990 2010-06-14  Stan Shebs  <stan@codesourcery.com>
7991             Pedro Alves  <pedro@codesourcery.com>
7992
7993         Bytecode compiler.
7994
7995         * linux-x86-low.c: Include limits.h.
7996         (add_insns): New.
7997         (always_true): New.
7998         (EMIT_ASM): New.
7999         (EMIT_ASM32): New.
8000         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
8001         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
8002         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
8003         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
8004         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
8005         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
8006         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
8007         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
8008         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
8009         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
8010         (amd64_emit_void_call_2): New.
8011         (amd64_emit_ops): New.
8012         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
8013         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
8014         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
8015         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
8016         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
8017         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
8018         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
8019         (i386_emit_call, i386_emit_reg, i386_emit_pop)
8020         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
8021         (i386_emit_stack_adjust, i386_emit_int_call_1)
8022         (i386_emit_void_call_2): New.
8023         (i386_emit_ops): New.
8024         (x86_emit_ops): New.
8025         (the_low_target): Install x86_emit_ops.
8026         * server.h (struct emit_ops): New.
8027         (get_raw_reg_func_addr): Declare.
8028         (current_insn_ptr, emit_error): Declare.
8029         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
8030         (set_trace_state_variable_value): New defines.
8031         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
8032         addr_get_trace_state_variable_value and
8033         addr_set_trace_state_variable_value.
8034         (symbol_list): New fields for get_raw_reg,
8035         get_trace_state_variable_value and set_trace_state_variable_value.
8036         (condfn): New typedef.
8037         (struct tracepoint): New field `compiled_cond'.
8038         (do_action_at_tracepoint): Clear compiled_cond.
8039         (get_trace_state_variable_value, set_trace_state_variable_value):
8040         Export in the IPA.
8041         (condition_true_at_tracepoint): If there's a compiled condition,
8042         run that.
8043         (current_insn_ptr, emit_error): New globals.
8044         (struct bytecode_address): New.
8045         (get_raw_reg_func_addr): New.
8046         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
8047         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
8048         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
8049         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
8050         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
8051         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
8052         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
8053         (compile_tracepoint_condition, compile_bytecodes): New.
8054         * target.h (emit_ops): Forward declare.
8055         (struct target_ops): New field emit_ops.
8056         (target_emit_ops): New.
8057         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
8058         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
8059         * linux-low.c (linux_emit_ops): New.
8060         (linux_target_ops): Install it.
8061         * linux-low.h (struct linux_target_ops): New field emit_ops.
8062
8063 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
8064
8065         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
8066         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
8067
8068 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8069             Stan Shebs  <stan@codesourcery.com>
8070
8071         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
8072         (all): Depend on $(extra_libraries).
8073         (install-only): Install the IPA.
8074         (IPA_OBJS, IPA_LIB): New.
8075         (clean): Remove the IPA lib.
8076         (IPAGENT_CFLAGS): New.
8077         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
8078         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
8079         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
8080         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
8081         * configure.ac: Check for atomic builtins support in the compiler.
8082         (IPA_DEPFILES, extra_libraries): Define.
8083         * configure.srv (ipa_obj): Add description.
8084         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
8085         (i[34567]86-*-linux*): Set ipa_obj.
8086         (x86_64-*-linux*): Set ipa_obj.
8087         * linux-low.c (stabilizing_threads): New.
8088         (supports_fast_tracepoints): New.
8089         (linux_detach): Stabilize threads before detaching.
8090         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
8091         the lwp is either not stabilizing, or is moving out of a jump pad.
8092         (linux_fast_tracepoint_collecting): New.
8093         (maybe_move_out_of_jump_pad): New.
8094         (enqueue_one_deferred_signal): New.
8095         (dequeue_one_deferred_signal): New.
8096         (linux_wait_for_event_1): If moving out of a jump pad, defer
8097         pending signals to later.
8098         (linux_stabilize_threads): New.
8099         (linux_wait_1): Check if threads need moving out of jump pads, and
8100         do it if so.
8101         (stuck_in_jump_pad_callback): New.
8102         (move_out_of_jump_pad_callback): New.
8103         (lwp_running): New.
8104         (linux_resume_one_lwp): Handle moving out of jump pads.
8105         (linux_set_resume_request): Dequeue deferred signals.
8106         (need_step_over_p): Also step over fast tracepoint jumps.
8107         (start_step_over): Also uninsert fast tracepoint jumps.
8108         (finish_step_over): Also reinsert fast tracepoint jumps.
8109         (linux_install_fast_tracepoint_jump): New.
8110         (linux_target_ops): Install linux_stabilize_threads and
8111         linux_install_fast_tracepoint_jump_pad.
8112         * linux-low.h (linux_target_ops) <get_thread_area,
8113         install_fast_tracepoint_jump_pad>: New fields.
8114         (struct lwp_info) <collecting_fast_tracepoint,
8115         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
8116         (linux_get_thread_area): Declare.
8117         * linux-x86-low.c (jump_insn): New.
8118         (x86_get_thread_area): New.
8119         (append_insns): New.
8120         (push_opcode): New.
8121         (amd64_install_fast_tracepoint_jump_pad): New.
8122         (i386_install_fast_tracepoint_jump_pad): New.
8123         (x86_install_fast_tracepoint_jump_pad): New.
8124         (the_low_target): Install x86_get_thread_area and
8125         x86_install_fast_tracepoint_jump_pad.
8126         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
8127         (struct fast_tracepoint_jump): New.
8128         (fast_tracepoint_jump_insn): New.
8129         (fast_tracepoint_jump_shadow): New.
8130         (find_fast_tracepoint_jump_at): New.
8131         (fast_tracepoint_jump_here): New.
8132         (delete_fast_tracepoint_jump): New.
8133         (set_fast_tracepoint_jump): New.
8134         (uninsert_fast_tracepoint_jumps_at): New.
8135         (reinsert_fast_tracepoint_jumps_at): New.
8136         (set_breakpoint_at): Use write_inferior_memory.
8137         (uninsert_raw_breakpoint): Use write_inferior_memory.
8138         (check_mem_read): Mask out fast tracepoint jumps.
8139         (check_mem_write): Mask out fast tracepoint jumps.
8140         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
8141         (set_fast_tracepoint_jump): Declare.
8142         (delete_fast_tracepoint_jump)
8143         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
8144         (reinsert_fast_tracepoint_jumps_at): Declare.
8145         * regcache.c: Don't compile many functions when building the
8146         in-process agent library.
8147         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
8148         the register buffer in the heap.
8149         (free_register_cache): If the register buffer isn't owned by the
8150         regcache, don't free it.
8151         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8152         pre-existing register caches.
8153         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8154         type.
8155         (convert_ascii_to_int): : Constify `from' parameter type.
8156         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8157         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8158         the needed buffer in-place.
8159         (relocate_instruction): New.
8160         * server.c (handle_query) <qSymbols>: If the target supports
8161         tracepoints, give it a chance of looking up symbols.  Report
8162         support for fast tracepoints.
8163         (handle_status): Stabilize threads.
8164         (process_serial_event): Adjust.
8165         * server.h (struct fast_tracepoint_jump): Forward declare.
8166         (struct process_info) <fast_tracepoint_jumps>: New field.
8167         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8168         (decode_X_packet, decode_M_packet): Adjust.
8169         (relocate_instruction): Declare.
8170         (in_process_agent_loaded): Declare.
8171         (tracepoint_look_up_symbols): Declare.
8172         (struct fast_tpoint_collect_status): Declare.
8173         (fast_tracepoint_collecting): Declare.
8174         (force_unlock_trace_buffer): Declare.
8175         (handle_tracepoint_bkpts): Declare.
8176         (initialize_low_tracepoint)
8177         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8178         * target.h (struct target_ops) <stabilize_threads,
8179         install_fast_tracepoint_jump_pad>: New fields.
8180         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8181         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8182         [HAVE_STDINT_H]: Include stdint.h.
8183         (trace_debug_1): Rename to ...
8184         (trace_vdebug): ... this.
8185         (trace_debug): Rename to ...
8186         (trace_debug_1): ... this.  Add `level' parameter.
8187         (trace_debug): New.
8188         (ATTR_USED, ATTR_NOINLINE): New.
8189         (IP_AGENT_EXPORT): New.
8190         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8191         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8192         (about_to_request_buffer_space, trace_buffer_is_full)
8193         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8194         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8195         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8196         (traceframe_write_count, traceframes_created)
8197         (trace_state_variables)
8198         New renaming defines.
8199         (struct ipa_sym_addresses): New.
8200         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8201         (symbol_list): New.
8202         (ipa_sym_addrs): New.
8203         (all_tracepoint_symbols_looked_up): New.
8204         (in_process_agent_loaded): New.
8205         (write_e_ipa_not_loaded): New.
8206         (maybe_write_ipa_not_loaded): New.
8207         (tracepoint_look_up_symbols): New.
8208         (debug_threads) [IN_PROCESS_AGENT]: New.
8209         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8210         (UNKNOWN_SIDE_EFFECTS): New.
8211         (stop_tracing): New.
8212         (flush_trace_buffer): New.
8213         (stop_tracing_bkpt): New.
8214         (flush_trace_buffer_bkpt): New.
8215         (read_inferior_integer): New.
8216         (read_inferior_uinteger): New.
8217         (read_inferior_data_pointer): New.
8218         (write_inferior_data_pointer): New.
8219         (write_inferior_integer): New.
8220         (write_inferior_uinteger): New.
8221         (struct collect_static_trace_data_action): Delete.
8222         (enum tracepoint_type): New.
8223         (struct tracepoint) <type>: New field `type'.
8224         <actions_str, step_actions, step_actions_str>: Only include in
8225         GDBserver.
8226         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8227         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8228         (tracepoints): Use IP_AGENT_EXPORT.
8229         (last_tracepoint): Don't include in the IPA.
8230         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8231         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8232         (alloced_trace_state_variables): New.
8233         (trace_state_variables): Use IP_AGENT_EXPORT.
8234         (traceframe_t): Delete unused variable.
8235         (circular_trace_buffer): Don't include in the IPA.
8236         (trace_buffer_start): Delete.
8237         (struct trace_buffer_control): New.
8238         (trace_buffer_free): Delete.
8239         (struct ipa_trace_buffer_control): New.
8240         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8241         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8242         New.
8243         (trace_buffer_ctrl): New.
8244         (TRACE_BUFFER_CTRL_CURR): New.
8245         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8246         Reimplement as macros.
8247         (trace_buffer_wrap): Delete.
8248         (traceframe_write_count, traceframe_read_count)
8249         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8250         (struct tracepoint_hit_ctx) <type>: New field.
8251         (struct fast_tracepoint_ctx): New.
8252         (memory_barrier): New.
8253         (cmpxchg): New.
8254         (record_tracepoint_error): Update atomically in the IPA.
8255         (clear_inferior_trace_buffer): New.
8256         (about_to_request_buffer_space): New.
8257         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8258         updating the same buffer.
8259         (add_tracepoint): Default the tracepoint's type to trap
8260         tracepoint, and orig_size to -1.
8261         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8262         internal variables.
8263         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8264         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8265         (cmd_qtdp): Handle fast tracepoints.
8266         (cmd_qtdv): Adjust.
8267         (max_jump_pad_size): New.
8268         (gdb_jump_pad_head): New.
8269         (get_jump_space_head): New.
8270         (claim_jump_space): New.
8271         (sort_tracepoints): New.
8272         (MAX_JUMP_SIZE): New.
8273         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8274         IPA.
8275         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8276         support.  Upload fast traceframes, and delete internal IPA
8277         breakpoints.
8278         (stop_tracing_handler): New.
8279         (flush_trace_buffer_handler): New.
8280         (cmd_qtstop): Upload fast tracepoints.
8281         (response_tracepoint): Handle fast tracepoints.
8282         (tracepoint_finished_step): Upload fast traceframes.  Set the
8283         tracepoint hit context's tracepoint type.
8284         (handle_tracepoint_bkpts): New.
8285         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8286         type.  Add comment about fast tracepoints.
8287         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8288         non-existing action_str field.
8289         (get_context_regcache): Handle fast tracepoints.
8290         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8291         to the regcache.
8292         (fast_tracepoint_from_jump_pad_address): New.
8293         (fast_tracepoint_from_ipa_tpoint_address): New.
8294         (collecting_t): New.
8295         (force_unlock_trace_buffer): New.
8296         (fast_tracepoint_collecting): New.
8297         (collecting): New.
8298         (gdb_collect): New.
8299         (write_inferior_data_ptr): New.
8300         (target_tp_heap): New.
8301         (target_malloc): New.
8302         (download_agent_expr): New.
8303         (UALIGN): New.
8304         (download_tracepoints): New.
8305         (download_trace_state_variables): New.
8306         (upload_fast_traceframes): New.
8307         (IPA_FIRST_TRACEFRAME): New.
8308         (IPA_NEXT_TRACEFRAME_1): New.
8309         (IPA_NEXT_TRACEFRAME): New.
8310         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8311         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8312         (gdb_jump_pad_buffer_end): New.
8313         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8314         (initialize_tracepoint): Adjust.
8315         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8316         buffer.  Initialize the low module.
8317         * utils.c (PREFIX, TOOLNAME): New.
8318         (malloc_failure): Use PREFIX.
8319         (error): In the IPA, an error causes an exit.
8320         (fatal, warning): Use PREFIX.
8321         (internal_error): Use TOOLNAME.
8322         (NUMCELLS): Increase to 10.
8323         * configure, config.in: Regenerate.
8324
8325 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8326
8327         * server.c (handle_query) <qSupported>: Do two passes over the
8328         qSupported string to avoid nesting strtok.
8329
8330 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8331
8332         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8333         (CDEPS): New.
8334         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8335         -Wl,--dynamic-list.
8336         * configure: Regenerate.
8337         * proc-service.list: New.
8338
8339 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8340
8341         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8342         New comment.
8343
8344 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8345
8346         * gdbreplay.c (remote_open): Check error return from socket() call by
8347         its equality to -1 not by it being negative.
8348         * remote-utils.c (remote_open): Likewise.
8349
8350 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8351
8352         * config.h: Regenerate.
8353
8354 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8355
8356         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8357         doesn't provide PTRACE_GET_THREAD_AREA.
8358
8359 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8360
8361         * linux-m68k-low.c: Include <asm/ptrace.h>
8362         (ps_get_thread_area): Implement.
8363
8364 2010-05-03  Doug Evans  <dje@google.com>
8365
8366         * event-loop.c (struct callback_event): New struct.
8367         (callback_list): New global.
8368         (append_callback_event, delete_callback_event): New functions.
8369         (process_callback): New function.
8370         (start_event_loop): Call it.
8371         * remote-utils.c (NOT_SCHEDULED): Define.
8372         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8373         moved out of readchar.
8374         (readchar): Rewrite.  Call reschedule before returning.
8375         (reset_readchar): New function.
8376         (remote_close): Call it.
8377         (process_remaining, reschedule): New functions.
8378         * server.h (callback_handler_func): New typedef.
8379         (append_callback_event, delete_callback_event): Declare.
8380
8381 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8382
8383         * proc-service.c (ps_pglobal_lookup): Use
8384         thread_db_look_up_one_symbol.
8385         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8386         parameter.  Use it instead of all_symbols_looked_up.
8387         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8388         field.
8389         (all_symbols_looked_up): Don't declare.
8390         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8391         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8392         field.
8393         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8394         Set all_symbols_looked_up here.
8395         (thread_db_look_up_one_symbol): New.
8396         (thread_db_get_tls_address): Adjust.
8397         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8398         thread_db object on the heap, and tentatively set it in the
8399         process structure.
8400         (thread_db_init): Don't set all_symbols_looked_up here.
8401         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8402
8403 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8404
8405         * linux-low.c (linux_kill, linux_detach): Adjust.
8406         (status_pending_p_callback): Remove redundant statement.  Check
8407         for !TARGET_WAITIKIND_IGNORE, instead of
8408         TARGET_WAITKIND_STOPPED.
8409         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8410         (linux_wait_for_event_1): Adjust.
8411         (linux_cancel_breakpoints): New.
8412         (unsuspend_one_lwp): New.
8413         (unsuspend_all_lwps): New.
8414         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8415         (send_sigstop_callback): Change return type to int, add new
8416         `except' parameter and handle it.
8417         (suspend_and_send_sigstop_callback): New.
8418         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8419         pass them down.  If SUSPEND, also increment the lwp's suspend
8420         count.
8421         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8422         (need_step_over_p): Don't consider suspended LWPs.
8423         (start_step_over): Adjust.
8424         (proceed_one_lwp): Change return type to int, add new `except'
8425         parameter and handle it.
8426         (unsuspend_and_proceed_one_lwp): New.
8427         (proceed_all_lwps): Use find_inferior instead of
8428         for_each_inferior.
8429         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8430         also decrement the suspend count of LWPs.  Pass `except' down,
8431         instead of hacking its suspend count.
8432         (linux_pause_all): Add `freeze' parameter.  Adjust.
8433         (linux_unpause_all): New.
8434         (linux_target_ops): Install linux_unpause_all.
8435         * server.c (handle_status): Adjust.
8436         * target.h (struct target_ops): New fields `unpause_all' and
8437         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8438         (pause_all): Add new `freeze' parameter.
8439         (unpause_all): New.
8440         (cancel_breakpoints): New.
8441         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8442         cancel breakpoints.
8443         (cmd_qtstart): Pause threads.
8444         (stop_tracing): Pause threads, and cancel breakpoints.
8445         * win32-low.c (win32_target_ops): Adjust.
8446
8447 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8448
8449         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8450         the inferior right away from here...
8451         (linux_wait_1): ... to here, and adjust to check the thread's
8452         last_resume_kind instead of the lwp's step or stop_expected flags.
8453
8454 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8455
8456         * README: Use consistent `GDB' and `GDBserver' spellings.
8457
8458 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8459
8460         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8461         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8462         (linux_detach_one_lwp): Assume the lwp is stopped.
8463         (any_thread_of): Delete.
8464         (linux_detach): Stop all lwps here.  Don't blindly delete all
8465         breakpoints.
8466         (delete_lwp_callback): New.
8467         (linux_mourn): Delete all lwps of the process that is gone.
8468         (linux_wait_1): Don't delete the last lwp of the process here.
8469         * mem-break.h (mark_breakpoints_out): Declare.
8470         * mem-break.c (mark_breakpoints_out): New.
8471         (free_all_breakpoints): Use it.
8472         * server.c (handle_target_event): If the process is gone, mark
8473         breakpoints out.
8474         * thread-db.c (struct thread_db) <create_bp>: New field.
8475         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8476         breakpoint reference in the thread_db struct.
8477         (thread_db_load_search): Clear the thread_db object.
8478         (try_thread_db_load_1): Ditto.
8479         (switch_to_process): New.
8480         (disable_thread_event_reporting): Use it.
8481         (remove_thread_event_breakpoints): New.
8482         (thread_db_detach, thread_db_mourn): Use it.
8483
8484 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8485
8486         * linux-low.c (linux_enable_event_reporting): New.
8487         (linux_wait_for_event_1, handle_extended_wait): Use it.
8488
8489 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8490
8491         * linux-low.c (linux_kill_one_lwp, linux_kill)
8492         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8493         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8494         SIGSTOP even if the LWP is stopped.
8495         (send_sigstop_callback): New.
8496         (stop_all_lwps): Use send_sigstop_callback instead.
8497         (linux_resume_one_thread): Adjust.
8498         (proceed_one_lwp): Still proceed an LWP that the client has
8499         requested to stop, if we haven't reported it as stopped yet.  Make
8500         sure that LWPs the client want stopped, have a pending SIGSTOP.
8501
8502 2010-04-26  Doug Evans  <dje@google.com>
8503
8504         * server.c (handle_general_set): Make static.
8505
8506         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8507         Print received char after testing for error/eof instead of before.
8508         (input_interrupt): Tweak comment.
8509
8510 2010-04-23  Doug Evans  <dje@google.com>
8511
8512         * server.c (start_inferior): Print inferior argv if --debug.
8513
8514 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8515
8516         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8517         * nto-x86-low.c: Include server.h
8518
8519 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8520
8521         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8522         be consistent with other sources of this directory.
8523         (init_registers_amd64): Correct name of source file of this function
8524         in the comment.
8525
8526 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8527
8528         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8529         64-bit executables.
8530
8531 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8532
8533         * win32-i386-low.c: Add 64-bit support.
8534         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8535         (init_registers_amd64): Declare.
8536         (mappings): Add 64-bit version of array.
8537         (init_windows_x86): New function.
8538         (the_low_target): Change init_arch field to init_windows_x86.
8539
8540 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8541
8542         * win32-low.c: Adapt to support also 64-bit architecture.
8543         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8544         (get_image_name): Use SIZE_T type for local variable `done'.
8545         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8546         (toolhelp_get_dll_name): Idem.
8547         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8548         Use uintptr_t typecast to avoid warning.
8549         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8550         (handle_exception): Use phex_nz to avoid warning.
8551         (win32_wait): Remove unused local variable `process'.
8552
8553 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8554
8555         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8556         `amd64-avx.o'.
8557
8558 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8559
8560         * configure.ac: Use `ws2_32' library for srv_mingw.
8561         * configure: Regenerate.
8562         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8563         * remote-utils.c: Likewise.
8564
8565 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8566
8567         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8568         if __x86_64__ is defined.
8569
8570 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8571
8572         * configure: Regenerate.
8573
8574 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8575
8576         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8577         * target.h (target_ops): New get_tib_address field.
8578         * win32-low.h (win32_thread_info): Add thread_local_base field.
8579         * win32-low.c (child_add_thread): Add tlb argument.
8580         Set thread_local_base field to TLB.
8581         (get_child_debug_event): Adapt to child_add_thread change.
8582         (win32_get_tib_address): New function.
8583         (win32_target_ops): Set get_tib_address field to
8584         win32_get_tib_address.
8585         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8586
8587 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8588
8589         * linux-low.c (linux_mourn): Also remove the process.
8590         * server.c (handle_target_event): Don't remove the process here.
8591         * nto-low.c (nto_mourn): New.
8592         (nto_target_ops): Install it.
8593         * spu-low.c (spu_mourn): New.
8594         (spu_target_ops): Install it.
8595         * win32-low.c (win32_mourn): New.
8596         (win32_target_ops): Install it.
8597
8598 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8599
8600         * server.h (buffer_xml_printf): Remove redundant `;'.
8601
8602 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8603
8604         * regcache.c (set_register_cache): Invalidate regcaches before
8605         changing the register cache layout.
8606         (regcache_invalidate_one): Allow a NULL regcache.
8607         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8608         regcaches before changing the register cache layout or the target
8609         regsets.
8610
8611 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8612
8613         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8614         variable warning on Linux/x86-64.
8615
8616 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8617
8618         GDBserver disconnected tracing support.
8619
8620         * linux-low.c (linux_remove_process): Delete.
8621         (add_lwp): Don't set last_resume_kind here.
8622         (linux_kill): Use `mourn'.
8623         (linux_detach): Use `thread_db_detach', and `mourn'.
8624         (linux_mourn): New.
8625         (linux_attach_lwp_1): Adjust comment.
8626         (linux_attach): last_resume_kind moved the thread_info; adjust.
8627         (status_pending_p_callback): Adjust.
8628         (linux_wait_for_event_1): Adjust.
8629         (count_events_callback, select_singlestep_lwp_callback)
8630         (select_event_lwp_callback, cancel_breakpoints_callback)
8631         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8632         (proceed_one_lwp): Adjust.
8633         (linux_async): Add debug output.
8634         (linux_thread_stopped): New.
8635         (linux_pause_all): New.
8636         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
8637         linux_pause_all.
8638         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
8639         (thread_db_free): Delete declaration.
8640         (thread_db_detach, thread_db_mourn): Declare.
8641         * thread-db.c (thread_db_init): Use thread_db_mourn.
8642         (thread_db_free): Delete, split in two.
8643         (disable_thread_event_reporting): New.
8644         (thread_db_detach): New.
8645         (thread_db_mourn): New.
8646
8647         * server.h (struct thread_info) <last_resume_kind>: New field.
8648         <attached>: Add comment.
8649         <gdb_detached>: New field.
8650         (handler_func): Change return type to int.
8651         (handle_serial_event, handle_target_event): Ditto.
8652         (gdb_connected): Declare.
8653         (tracing): Delete.
8654         (disconnected_tracing): Declare.
8655         (stop_tracing): Declare.
8656
8657         * server.c (handle_query) <qSupported>: Report support for
8658         disconnected tracing.
8659         (queue_stop_reply_callback): Account for running threads.
8660         (gdb_wants_thread_stopped): New.
8661         (gdb_wants_all_threads_stopped): New.
8662         (gdb_reattached_process): New.
8663         (handle_status): Clear the `gdb_detached' flag of all processes.
8664         In all-stop, stop all threads.
8665         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
8666         (process_serial_event): If the remote connection breaks, or if an
8667         exit was forced with "monitor exit", force an event loop exit.
8668         Handle disconnected tracing on detach.
8669         (handle_serial_event): Adjust.
8670         (handle_target_event): If GDB isn't connected, forward events back
8671         to the inferior, unless the last process exited, in which case,
8672         exit gdbserver.  Adjust interface.
8673
8674         * remote-utils.c (remote_open): Don't block in accept.  Instead
8675         register an event loop source on the listen socket file
8676         descriptor.  Refactor bits into ...
8677         (listen_desc): ... this new global.
8678         (gdb_connected): ... this new function.
8679         (enable_async_notification): ... this new function.
8680         (handle_accept_event): ... this new function.
8681         (remote_close): Clear remote_desc.
8682
8683         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
8684
8685         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
8686         New fields.
8687         (mourn_inferior): Define.
8688         (target_process_qsupported): Avoid the dangling else problem.
8689         (thread_stopped): Define.
8690         (pause_all): Define.
8691         (target_waitstatus_to_string): Declare.
8692         * target.c (target_waitstatus_to_string): New.
8693
8694         * tracepoint.c (tracing): Make extern.
8695         (disconnected_tracing): New.
8696         (stop_tracing): Make extern.  Handle tracing stops due to GDB
8697         disconnecting.
8698         (cmd_qtdisconnected): New.
8699         (cmd_qtstatus): Report disconnected tracing status in trace reply.
8700         (handle_tracepoint_general_set): Handle QTDisconnected.
8701
8702         * event-loop.c (event_handler_func): Change return type to int.
8703         (process_event): Bail out if the event handler wants the event
8704         loop to stop.
8705         (handle_file_event): Ditto.
8706         (start_event_loop): Bail out if the event handler wants the event
8707         loop to stop.
8708
8709         * nto-low.c (nto_target_ops): Adjust.
8710         * spu-low.c (spu_wait): Don't remove the process here.
8711         (spu_target_ops): Adjust.
8712         * win32-low.c (win32_wait): Don't remove the process here.
8713         (win32_target_ops): Adjust.
8714
8715 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8716
8717         * regcache.c (realloc_register_cache): Invalidate inferior's
8718         regcache before recreating it.
8719
8720 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
8721
8722         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
8723
8724 2010-04-09  Stan Shebs  <stan@codesourcery.com>
8725             Pedro Alves  <pedro@codesourcery.com>
8726
8727         * server.h (LONGEST): New.
8728         (struct thread_info) <while_stepping>: New field.
8729         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
8730         Declare.
8731         (initialize_tracepoint, handle_tracepoint_general_set)
8732         (handle_tracepoint_query, tracepoint_finished_step)
8733         (tracepoint_was_hit, release_while_stepping_state_list):
8734         (current_traceframe): Declare.
8735         * server.c (handle_general_set): Handle tracepoint packets.
8736         (read_memory): New.
8737         (write_memory): New.
8738         (handle_search_memory_1): Use read_memory.
8739         (handle_query): Report support for conditional tracepoints, trace
8740         state variables, and tracepoint sources.  Handle tracepoint
8741         queries.
8742         (main): Initialize the tracepoints module.
8743         (process_serial_event): Handle traceframe reads/writes.
8744
8745         * linux-low.c (handle_tracepoints): New.
8746         (linux_wait_1): Call it.
8747         (linux_resume_one_lwp): Handle while-stepping.
8748         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
8749         (linux_target_ops): Install them.
8750         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
8751         New field.
8752         * linux-x86-low.c (x86_supports_tracepoints): New.
8753         (the_low_target). Install it.
8754
8755         * mem-break.h (delete_breakpoint): Declare.
8756         * mem-break.c (delete_breakpoint): Make external.
8757
8758         * target.h (struct target_ops): Add `supports_tracepoints',
8759         `read_pc', and `write_pc' fields.
8760         (target_supports_tracepoints): Define.
8761         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
8762         (phex_nz): New.
8763
8764         * regcache.h (struct regcache) <registers_owned>: New field.
8765         (init_register_cache, regcache_cpy): Declare.
8766         (regcache_read_pc, regcache_write_pc): Declare.
8767         (register_cache_size): Declare.
8768         (supply_regblock): Declare.
8769         * regcache.c (init_register_cache): New.
8770         (new_register_cache): Use it.
8771         (regcache_cpy): New.
8772         (register_cache_size): New.
8773         (supply_regblock): New.
8774         (regcache_read_pc, regcache_write_pc): New.
8775
8776         * tracepoint.c: New.
8777
8778         * Makefile.in (OBS): Add tracepoint.o.
8779         (tracepoint.o): New rule.
8780
8781 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
8782
8783         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
8784         (i386-mmx.o): New.
8785         (i386-mmx.c): Likewise.
8786         (i386-mmx-linux.o): Likewise.
8787         (i386-mmx-linux.c): Likewise.
8788
8789         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
8790         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
8791         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
8792         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
8793
8794         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
8795         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
8796         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
8797
8798 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
8799
8800         * Makefile.in (clean): Updated.
8801         (i386-avx.o): New.
8802         (i386-avx.c): Likewise.
8803         (i386-avx-linux.o): Likewise.
8804         (i386-avx-linux.c): Likewise.
8805         (amd64-avx.o): Likewise.
8806         (amd64-avx.c): Likewise.
8807         (amd64-avx-linux.o): Likewise.
8808         (amd64-avx-linux.c): Likewise.
8809
8810         * configure.srv (srv_i386_regobj): Add i386-avx.o.
8811         (srv_i386_linux_regobj): Add i386-avx-linux.o.
8812         (srv_amd64_regobj): Add amd64-avx.o.
8813         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
8814         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
8815         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
8816         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
8817         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
8818         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
8819         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
8820
8821         * i387-fp.c: Include "i386-xstate.h".
8822         (i387_xsave): New.
8823         (i387_cache_to_xsave): Likewise.
8824         (i387_xsave_to_cache): Likewise.
8825         (x86_xcr0): Likewise.
8826
8827         * i387-fp.h (i387_cache_to_xsave): Likewise.
8828         (i387_xsave_to_cache): Likewise.
8829         (x86_xcr0): Likewise.
8830
8831         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
8832         * linux-crisv32-low.c (target_regsets): Likewise.
8833         * linux-m68k-low.c (target_regsets): Likewise.
8834         * linux-mips-low.c (target_regsets): Likewise.
8835         * linux-ppc-low.c (target_regsets): Likewise.
8836         * linux-s390-low.c (target_regsets): Likewise.
8837         * linux-sh-low.c (target_regsets): Likewise.
8838         * linux-sparc-low.c (target_regsets): Likewise.
8839         * linux-xtensa-low.c (target_regsets): Likewise.
8840
8841         * linux-low.c: Include <sys/uio.h>.
8842         (regsets_fetch_inferior_registers): Support nt_type.
8843         (regsets_store_inferior_registers): Likewise.
8844         (linux_process_qsupported): New.
8845         (linux_target_ops): Add linux_process_qsupported.
8846
8847         * linux-low.h (regset_info): Add nt_type.
8848         (linux_target_ops): Add process_qsupported.
8849
8850         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
8851         and <sys/uio.h>.
8852         (init_registers_i386_avx_linux): New.
8853         (init_registers_amd64_avx_linux): Likewise.
8854         (xmltarget_i386_linux_no_xml): Likewise.
8855         (xmltarget_amd64_linux_no_xml): Likewise.
8856         (PTRACE_GETREGSET): Likewise.
8857         (PTRACE_SETREGSET): Likewise.
8858         (x86_fill_xstateregset): Likewise.
8859         (x86_store_xstateregset): Likewise.
8860         (use_xml): Likewise.
8861         (x86_linux_update_xmltarget): Likewise.
8862         (x86_linux_process_qsupported): Likewise.
8863         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
8864         (x86_arch_setup): Don't call init_registers_amd64_linux nor
8865         init_registers_i386_linux here.  Call
8866         x86_linux_update_xmltarget.
8867         (the_low_target): Add x86_linux_process_qsupported.
8868
8869         * server.c (handle_query): Call target_process_qsupported.
8870
8871         * target.h (target_ops): Add process_qsupported.
8872         (target_process_qsupported): New.
8873
8874 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
8875
8876         * inferiors.c (add_thread): Set last_status kind to
8877         TARGET_WAITKIND_IGNORE.
8878         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
8879         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
8880         (linux_wait_1): Move `thread' local definition to block that uses
8881         it.  Don't NULL initialize `event_child'.
8882         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
8883         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
8884         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
8885
8886 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8887
8888         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
8889         an extended waitstatus, or by a watchpoint.
8890         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
8891         thread was stepping or has been stopped by a watchpoint.
8892
8893 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8894
8895         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
8896         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
8897         of another, then delete the previous, and validate all
8898         breakpoints.
8899         (validate_inserted_breakpoint): New.
8900         (delete_disabled_breakpoints): New.
8901         (validate_breakpoints): New.
8902         (check_mem_read): Validate breakpoints before trusting their
8903         shadow.  Delete disabled breakpoints.
8904         (check_mem_write): Validate breakpoints before trusting they
8905         should be inserted.  Delete disabled breakpoints.
8906         * mem-break.h (validate_breakpoints):
8907         * server.c (handle_query): Validate breakpoints when we see a
8908         qSymbol query.
8909
8910 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8911
8912         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
8913         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
8914         if we could tell there's a GDB breakpoint at stop_pc.
8915         (need_step_over_p): Don't do a step over if we find a GDB
8916         breakpoint at the resume PC.
8917
8918         * mem-break.c (struct raw_breakpoint): New.
8919         (enum bkpt_type): New type `gdb_breakpoint'.
8920         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
8921         fields.  New field `raw'.
8922         (find_raw_breakpoint_at): New.
8923         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
8924         breakpoint instead.
8925         (set_breakpoint_at): Adjust.
8926         (delete_raw_breakpoint): New.
8927         (release_breakpoint): New.
8928         (delete_breakpoint): Rename to...
8929         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
8930         release_breakpoint.  Return ENOENT.
8931         (delete_breakpoint): Reimplement.
8932         (find_breakpoint_at): Delete.
8933         (find_gdb_breakpoint_at): New.
8934         (delete_breakpoint_at): Delete.
8935         (set_gdb_breakpoint_at): New.
8936         (delete_gdb_breakpoint_at): New.
8937         (gdb_breakpoint_here): New.
8938         (set_reinsert_breakpoint): Use release_breakpoint.
8939         (uninsert_breakpoint): Rename to ...
8940         (uninsert_raw_breakpoint): ... this.
8941         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
8942         (reinsert_raw_breakpoint): Change parameter type to
8943         raw_breakpoint.
8944         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
8945         instead.
8946         (check_breakpoints): Adjust.  Use release_breakpoint.
8947         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
8948         (breakpoint_inserted_here): Ditto.
8949         (check_mem_read): Adjust to iterate over raw breakpoints instead.
8950         Don't trust the breakpoint's shadow if it is not inserted.
8951         (check_mem_write): Adjust to iterate over raw breakpoints instead.
8952         (delete_all_breakpoints): Adjust.
8953         (free_all_breakpoints): Mark all breakpoints as uninserted, and
8954         use delete_breakpoint_1.
8955
8956         * mem-break.h (breakpoints_supported): Delete declaration.
8957         (set_gdb_breakpoint_at): Declare.
8958         (gdb_breakpoint_here): Declare.
8959         (delete_breakpoint_at): Delete.
8960         (delete_gdb_breakpoint_at): Declare.
8961
8962         * server.h (struct raw_breakpoint): Forward declare.
8963         (struct process_info): New field `raw_breakpoints'.
8964
8965         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
8966         breakpoints.
8967
8968 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8969
8970         * linux-low.c (status_pending_p_callback): Fix comment.
8971         (linux_wait_for_event_1): Move most of the internal breakpoint
8972         handling from here...
8973         (linux_wait_1): ... to here.
8974         (count_events_callback): New.
8975         (select_singlestep_lwp_callback): New.
8976         (select_event_lwp_callback): New.
8977         (cancel_breakpoints_callback): New.
8978         (select_event_lwp): New.
8979         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
8980         priority to all LWPs that have had events that should be reported
8981         to the client.  Cancel breakpoints when about to reporting the
8982         event to the client, not while stopping lwps.  No longer cancel
8983         finished single-steps here.
8984         (cancel_finished_single_step): Delete.
8985         (cancel_finished_single_steps): Delete.
8986
8987 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8988
8989         * mem-break.c (enum bkpt_type): New.
8990         (struct breakpoint): New field `type'.
8991         (set_breakpoint_at): Change return type to struct breakpoint
8992         pointer.  Set type to `other_breakpoint' by default.
8993         (delete_breakpoint): Rewrite, supporting more than one breakpoint
8994         in the breakpoint list.
8995         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
8996         (reinsert_breakpoint): Rename to ...
8997         (reinsert_raw_breakpoint): ... this.
8998         (reinsert_breakpoints_at): Adjust.
8999         * mem-break.h (struct breakpoint): Declare.
9000         (set_breakpoint_at): Change return type to struct breakpoint
9001         pointer.
9002
9003 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9004
9005         * server.c (handle_query): Assign, not compare.
9006
9007 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9008
9009         Teach linux gdbserver to step-over-breakpoints.
9010
9011         * linux-low.c (can_hardware_single_step): New.
9012         (supports_breakpoints): New.
9013         (handle_extended_wait): If stopping threads, read the stop pc of
9014         the new cloned LWP.
9015         (get_pc): New.
9016         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
9017         low target doesn't support retrieving the PC.
9018         (add_lwp): Set last_resume_kind to resume_continue.
9019         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
9020         (linux_attach): Don't clear stop_expected.  Set the lwp's
9021         last_resume_kind to resume_stop.
9022         (linux_detach_one_lwp): Don't check for removed breakpoints.
9023         (check_removed_breakpoint): Delete.
9024         (status_pending_p): Rename to ...
9025         (status_pending_p_callback): ... this.  Don't check for removed
9026         breakpoints.  Don't consider threads that are stopped from GDB's
9027         perspective.
9028         (linux_wait_for_lwp): Always read the stop_pc here.
9029         (cancel_breakpoint): New.
9030         (step_over_bkpt): New global.
9031         (linux_wait_for_event_1): Implement stepping over breakpoints.
9032         (gdb_wants_lwp_stopped): New.
9033         (gdb_wants_all_stopped): New.
9034         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
9035         single-step traps here.  Store the thread's last reported target
9036         wait status.
9037         (send_sigstop): Don't clear stop_expected.  Always set it,
9038         instead.
9039         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
9040         (cancel_finished_single_step): New.
9041         (cancel_finished_single_steps): New.
9042         (wait_for_sigstop): Don't cancel finished single-step traps here.
9043         (linux_resume_one_lwp): Don't check for removed breakpoints.
9044         Don't set `step' on non-hardware step archs.
9045         (linux_set_resume_request): Ignore resume_stop requests if already
9046         stopping or stopped.  Set the lwp's last_resume_kind.
9047         (resume_status_pending_p): Don't check for removed breakpoints.
9048         (need_step_over_p): New.
9049         (start_step_over): New.
9050         (finish_step_over): New.
9051         (linux_resume_one_thread): Always queue a sigstop for resume_stop
9052         requests.  Clear the thread's last reported target waitstatus.
9053         Don't use the `suspended' flag.  Don't consider pending breakpoints.
9054         (linux_resume): Start a step-over if necessary.
9055         (proceed_one_lwp): New.
9056         (proceed_all_lwps): New.
9057         (unstop_all_lwps): New.
9058         * linux-low.h (struct lwp_info): Rewrite comment for the
9059         `suspended' flag.  Add the `stop_pc' field.  Delete the
9060         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
9061         Add `'last_resume_kind' and `need_step_over' fields.
9062         * inferiors.c (struct thread_info): Delete, moved elsewhere.
9063         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
9064         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
9065         (set_raw_breakpoint_at): New.
9066         (set_breakpoint_at): Rewrite to use it.
9067         (reinsert_breakpoint_handler): Delete.
9068         (set_reinsert_breakpoint): New.
9069         (reinsert_breakpoint_by_bp): Delete.
9070         (delete_reinsert_breakpoints): New.
9071         (uninsert_breakpoint): Rewrite.
9072         (uninsert_breakpoints_at): New.
9073         (reinsert_breakpoint): Rewrite.
9074         (reinsert_breakpoints_at): New.
9075         (check_breakpoints): Rewrite.
9076         (breakpoint_here): New.
9077         (breakpoint_inserted_here): New.
9078         (check_mem_read): Adjust.
9079         * mem-break.h (breakpoints_supported, breakpoint_here)
9080         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
9081         (reinsert_breakpoint_by_bp): Delete declaration.
9082         (delete_reinsert_breakpoints): Declare.
9083         (reinsert_breakpoint): Delete declaration.
9084         (reinsert_breakpoints_at): Declare.
9085         (uninsert_breakpoint): Delete declaration.
9086         (uninsert_breakpoints_at): Declare.
9087         (check_breakpoints): Adjust prototype.
9088         * server.h: Adjust include order.
9089         (struct thread_info): Declare here.  Add a `last_status' field.
9090
9091 2010-03-23  Michael Snyder  <msnyder@vmware.com>
9092
9093         * server.c (crc32): New function.
9094         (handle_query): Add handling for 'qCRC:' request.
9095
9096 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
9097
9098         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
9099         lwp had been stopped by a watchpoint.
9100
9101 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
9102
9103         * server.h (internal_error): Declare.
9104         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
9105         * utils.c (internal_error): New function.
9106
9107 2010-03-15  Andreas Schwab  <schwab@redhat.com>
9108
9109         * configure.srv: Fix typo setting srv_regobj.
9110
9111 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
9112
9113         * linux-low.c (fetch_register): Avoid passing a non string literal
9114         format to `error'.
9115         (usr_store_inferior_registers): Ditto.
9116
9117 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9118
9119         * linux-low.c (linux_write_memory): Bail out early if peeking
9120         memory failed.
9121
9122 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9123
9124         * linux-low.h (struct lwp_info): New fields
9125         `stopped_by_watchpoint' and `stopped_data_address'.
9126         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
9127         here, and cache them in the lwp object.
9128         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
9129         directly.
9130         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
9131         field.
9132         (linux_stopped_by_watchpoint): Rewrite.
9133         (linux_stopped_data_address): Rewrite.
9134
9135 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
9136
9137         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
9138         switching the current inferior, not before.
9139
9140 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
9141
9142         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
9143         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
9144         i386-linux.c and amd64-linux.c.
9145         (reg-i386.o): Removed.
9146         (reg-i386.c): Likewise.
9147         (reg-i386-linux.o): Likewise.
9148         (reg-i386-linux.c): Likewise.
9149         (reg-x86-64.o): Likewise.
9150         (reg-x86-64.c): Likewise.
9151         (reg-x86-64-linux.o): Likewise.
9152         (reg-x86-64-linux.c): Likewise.
9153         (i386.o): New.
9154         (i386.c): Likewise.
9155         (i386-linux.o): Likewise.
9156         (i386-linux.c): Likewise.
9157         (amd64.o): Likewise.
9158         (amd64.c): Likewise.
9159         (amd64-linux.o): Likewise.
9160         (amd64-linux.c): Likewise.
9161
9162         * configure.srv (srv_i386_regobj): New.
9163         (srv_i386_linux_regobj): Likewise.
9164         (srv_amd64_regobj): Likewise.
9165         (srv_amd64_linux_regobj): Likewise.
9166         (srv_i386_32bit_xmlfiles): Likewise.
9167         (srv_i386_64bit_xmlfiles): Likewise.
9168         (srv_i386_xmlfiles): Likewise.
9169         (srv_amd64_xmlfiles): Likewise.
9170         (srv_i386_linux_xmlfiles): Likewise.
9171         (srv_amd64_linux_xmlfiles): Likewise.
9172         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9173         srv_xmlfiles to $srv_i386_xmlfiles.
9174         (i[34567]86-*-mingw32ce*): Likewise.
9175         (i[34567]86-*-mingw*): Likewise.
9176         (i[34567]86-*-nto*): Likewise.
9177         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9178         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9179         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9180         (x86_64-*-linux*): Likewise.
9181
9182         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9183         (init_registers_amd64_linux): New.
9184         (x86_arch_setup): Replace init_registers_x86_64_linux with
9185         init_registers_amd64_linux.
9186
9187 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9188
9189         * configure.ac: Check for libdl.  If it is not available link against
9190         static libthread_db.
9191         * configure: Regenerate.
9192
9193 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9194
9195         PR9605
9196
9197         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9198         handing a read watchpoint.
9199         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9200
9201 2010-02-12  Doug Evans  <dje@google.com>
9202
9203         * linux-low.c (linux_supports_tracefork_flag): Document.
9204         (linux_look_up_symbols): Add comment.
9205
9206 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9207
9208         * regcache.c (supply_register): Clear regcache if buf is NULL.
9209
9210 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9211             Joel Brobecker  <brobecker@adacore.com>
9212
9213         * inferiors.c (find_inferior): Add function documentation.
9214         (unloaded_dll): Handle the case where the unloaded dll has not
9215         been previously registered in the dll list.
9216
9217 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9218
9219         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9220         (thumb2_breakpoint): New.
9221         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9222
9223 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9224
9225         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9226         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9227         breakpoints.
9228
9229 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9230
9231         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9232
9233 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9234
9235         * linux-s390-low.c (s390_collect_ptrace_register)
9236         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9237
9238 2010-01-21  Doug Evans  <dje@google.com>
9239
9240         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9241         (PTRACE_ARG4_TYPE): New macro.
9242         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9243         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9244         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9245         (usr_store_inferior_registers): Ditto.
9246         (linux_read_memory, linux_write_memory): Ditto.
9247         (linux_test_for_tracefork): Ditto.
9248
9249         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9250         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9251
9252 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9253
9254         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9255         target.
9256
9257 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9258
9259         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9260         prototype to take a regcache.  Adjust.
9261
9262 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9263
9264         * regcache.h (struct thread_info): Forward declare.
9265         (struct regcache): New.
9266         (new_register_cache): Adjust prototype.
9267         (get_thread_regcache): Declare.
9268         (free_register_cache): Adjust prototype.
9269         (registers_to_string, registers_from_string): Ditto.
9270         (supply_register, supply_register_by_name, collect_register)
9271         (collect_register_as_string, collect_register_by_name): Ditto.
9272         * regcache.c (struct inferior_regcache_data): Delete.
9273         (get_regcache): Rename to ...
9274         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9275         fetching registers.
9276         (regcache_invalidate_one): Adjust.
9277         (regcache_invalidate): Fix prototype.
9278         (new_register_cache): Return the new register cache.
9279         (free_register_cache): Change prototype.
9280         (realloc_register_cache): Adjust.
9281         (registers_to_string): Change prototype to take a regcache.  Adjust.
9282         (registers_from_string): Ditto.
9283         (register_data): Ditto.
9284         (supply_register): Ditto.
9285         (supply_register_by_name): Ditto.
9286         (collect_register): Ditto.
9287         (collect_register_as_string): Ditto.
9288         (collect_register_by_name): Ditto.
9289         * server.c (process_serial_event): Adjust.
9290         * linux-low.h (regset_fill_func, regset_store_func): Change
9291         prototype.
9292         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9293         Change prototype.
9294         * linux-low.c (get_stop_pc): Adjust.
9295         (check_removed_breakpoint): Adjust.
9296         (linux_wait_for_event): Adjust.
9297         (linux_resume_one_lwp): Adjust.
9298         (fetch_register): Add regcache parameter.  Adjust.
9299         (usr_store_inferior_registers): Ditto.
9300         (regsets_fetch_inferior_registers): Ditto.
9301         (regsets_store_inferior_registers): Ditto.
9302         (linux_fetch_registers, linux_store_registers): Ditto.
9303         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9304         regcache.  Adjust.
9305         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9306         Ditto.
9307         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9308         prototype to take a regcache.
9309         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9310         * remote-utils.c (convert_ascii_to_int, outreg)
9311         (prepare_resume_reply): Change prototype to take a regcache.
9312         Adjust.
9313         * target.h (struct target_ops) <fetch_registers, store_registers>:
9314         Change prototype to take a regcache.
9315         (fetch_inferior_registers, store_inferior_registers): Change
9316         prototype to take a regcache.  Adjust.
9317         * proc-service.c (ps_lgetregs): Adjust.
9318         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9319         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9320         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9321         take a regcache.  Adjust.
9322         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9323         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9324         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9325         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9326         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9327         (cris_cannot_fetch_register):
9328         (cris_breakpoint_at): Change prototype to take a regcache.
9329         Adjust.
9330         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9331         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9332         to take a regcache.  Adjust.
9333         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9334         Adjust.
9335         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9336         take a regcache.  Adjust.
9337         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9338         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9339         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9340         * linux-mips-low.c (mips_get_pc):
9341         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9342         (mips_reinsert_addr): Adjust.
9343         (mips_collect_register): Change prototype to take a regcache.
9344         Adjust.
9345         (mips_supply_register):
9346         (mips_collect_register_32bit, mips_supply_register_32bit)
9347         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9348         (mips_store_fpregset): Ditto.
9349         * linux-ppc-low.c (ppc_supply_ptrace_register)
9350         (ppc_supply_ptrace_register): Ditto.
9351         (parse_spufs_run): Adjust.
9352         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9353         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9354         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9355         take a regcache.  Adjust.
9356         * linux-s390-low.c (s390_collect_ptrace_register)
9357         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9358         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9359         (s390_arch_setup): Adjust.
9360         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9361         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9362         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9363         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9364         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9365         regcache.  Adjust.
9366         (sparc_breakpoint_at): Adjust.
9367         * linux-xtensa-low.c (xtensa_fill_gregset):
9368         (xtensa_store_gregset):
9369         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9370         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9371         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9372         prototype to take a regcache.  Adjust.
9373         * win32-arm-low.c (arm_fetch_inferior_register)
9374         (arm_store_inferior_register): Change prototype to take a
9375         regcache.  Adjust.
9376         * win32-i386-low.c (i386_fetch_inferior_register)
9377         (i386_store_inferior_register): Change prototype to take a
9378         regcache.  Adjust.
9379         * win32-low.c (child_fetch_inferior_registers)
9380         (child_store_inferior_registers): Change prototype to take a
9381         regcache.  Adjust.
9382         (win32_wait): Adjust.
9383         (win32_fetch_inferior_registers): Change prototype to take a
9384         regcache.  Adjust.
9385         (win32_store_inferior_registers): Adjust.
9386         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9387         store_inferior_register>: Change prototype to take a regcache.
9388
9389 2010-01-20  Doug Evans  <dje@google.com>
9390
9391         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9392         #ifdef.
9393         (linux_wait_for_event1, linux_init_signals): Ditto.
9394         (W_STOPCODE): Provide definition if missing.
9395
9396 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9397
9398         * linux-low.c (linux_core_of_thread): New.
9399         (compare_ints, show_process, list_threads): New.
9400         (linux_qxfer_osdata): Report threads and cores.
9401         (linux_target_op): Register linux_core_of_thread.
9402         * remote-utils.c (prepare_resume_reply): Report the core.
9403         (buffer_xml_printf): Support %d specifier.
9404         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9405         New.
9406         (handle_query): Handle qXfer:threads.  Announce availability
9407         thereof.
9408         * target.h (struct target_ops): New field core_of_thread.
9409
9410 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9411
9412         * Makefile.in (clean): Remove new generated files.
9413         (reg-s390.o, reg-s390.c): Remove rules.
9414         (reg-s390x.o, reg-s390x.c): Likewise.
9415         (s390-linux32.o, s390-linux32.c): Add rules.
9416         (s390-linux64.o, s390-linux64.c): Likewise.
9417         (s390x-linux64.o, s390x-linux64.c): Likewise.
9418         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9419         * linux-s390-low.c: Include <elf.h>.
9420         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9421         (init_registers_s390): Remove prototype.
9422         (init_registers_s390x): Likewise.
9423         (init_registers_s390_linux32): Add prototype.
9424         (init_registers_s390_linux64): Likewise.
9425         (init_registers_s390x_linux64): Likewise.
9426         (s390_num_regs_3264): New define.
9427         (s390_regmap_3264): New global variable.
9428         (s390_cannot_fetch_register): Remove obsolete check.
9429         (s390_cannot_store_register): Likewise.
9430         (s390_collect_ptrace_register): Handle upper/lower register halves.
9431         (s390_supply_ptrace_register): Likewise.
9432         (s390_fill_gregset): Update to register number changes.
9433         (s390_get_hwcap): New routine.
9434         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9435         Install appropriate regmap and register set.
9436
9437 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9438
9439         * server.c (gdbserver_version): Update copyright year to 2010.
9440         * gdbreplay.c (gdbreplay_version): Likewise.
9441
9442 2009-12-28  Doug Evans  <dje@google.com>
9443
9444         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9445         elf/external.h.  Include <elf.h> instead but only if necessary.
9446
9447 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9448
9449         * linux-low.c (linux_remove_process): Remove `detaching'
9450         parameter.  Don't release/detach from thread_db here.
9451         (linux_kill): Release/detach from thread_db here, ...
9452         (linux_detach): ... and here, before actually detaching.
9453         (linux_wait_1): ... and here, when a process exits.
9454         * thread-db.c (any_thread_of): New.
9455         (thread_db_free): Switch the current inferior to a thread of the
9456         passed in process.
9457
9458 2009-12-21  Doug Evans  <dje@google.com>
9459
9460         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9461
9462         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9463         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9464         warning ifndef __NR_tkill.  Move setting of errno there too.
9465         Delete unnecessary resetting of errno after syscall.
9466         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9467
9468         * configure.ac: Check for dladdr.
9469         * config.in: Regenerate.
9470         * configure: Regenerate.
9471         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9472         (try_thread_db_load): Update.
9473
9474         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9475
9476 2009-12-18  Doug Evans  <dje@google.com>
9477
9478         * event-loop.c: Include unistd.h if it exists.
9479
9480         * linux-low.c (my_waitpid): Move definition away from being in
9481         between linux_tracefork_child/linux_test_for_tracefork.
9482
9483         * gdb_proc_service.h (psaddr_t): Fix type.
9484         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9485         signature to match glibc.
9486
9487 2009-12-16  Doug Evans  <dje@google.com>
9488
9489         * linux-low.c (linux_read_memory): Fix argument to read.
9490
9491 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9492
9493         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9494         events, don't leave current_inferior pointing at null.
9495
9496 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9497
9498         * win32-low.c (LOG): Delete.
9499         (OUTMSG): Output to stderr.
9500         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9501         on compile time LOG macro.
9502         (win32_wait): Fix debug output.
9503
9504 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9505
9506         * win32-low.c (win32_add_one_solib): If the dll name is
9507         "ntdll.dll", prepend the system directory to the dll path.
9508
9509 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9510
9511         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9512
9513 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9514             Vladimir Prus  <vladimir@codesourcery.com>
9515
9516         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9517         * configure.ac: Check for __mcoldfire__ and set
9518         gdb_cv_m68k_is_coldfire.
9519         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9520         reg-cf.o and reg-m68k.o.
9521         * configure: Regenerated.
9522
9523 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9524
9525         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9526         Pass it to thread_db_free.
9527         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9528         proper `detaching' argument to linux_remove_process.
9529         * linux-low.h (thread_db_free): Add `detaching' parameter.
9530         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9531         to thread_db_free.
9532         (thread_db_free): Add `detaching' parameter.  Only
9533         call td_ta_clear_event if detaching from process.
9534
9535 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9536
9537         * thread-db.c (thread_db_free): Fix typo.
9538
9539 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9540
9541         PR gdb/10838
9542         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9543
9544 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9545
9546         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9547         with an i686 compiler.
9548         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9549         needed.
9550         * configure: Rebuilt.
9551
9552 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9553
9554         PR gdb/10783
9555
9556         * server.c (handle_search_memory_1): Correct read_addr initialization
9557         in loop for searching subsequent chunks.
9558
9559 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9560
9561         * configure.ac: New --with-libthread-db option.
9562         * thread-db.c: Allow direct dependence on libthread_db.
9563         (thread_db_free): Adjust.
9564         * config.in: Regenerate.
9565         * configure: Likewise.
9566
9567 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9568
9569         PR gdb/10757
9570         * thread-db.c (attach_thread): New function.
9571         (maybe_attach_thread): Return success/failure.
9572         (find_new_threads_callback): Adjust.
9573         (thread_db_find_new_threads): Loop until no new threads.
9574
9575 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9576
9577         * proc-service.c (ps_lgetregs): Formatting.
9578
9579 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9580
9581         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9582         * configure.ac: Adjust.
9583         * linux-low.h (struct process_info_private): Move members to struct
9584         thread_db.
9585         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9586         * linux-low.c (linux_remove_process): Adjust.
9587         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9588         * server.c (handle_query): Move code ...
9589         (handle_monitor_command): ... here. New function.
9590         * target.h (struct target_ops): New member.
9591         * thread-db.c (struct thread_db): New.
9592         (libthread_db_search_path): New variable.
9593         (thread_db_create_event, thread_db_enable_reporting)
9594         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9595         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9596         (try_thread_db_load_1, dladdr_to_soname): New functions.
9597         (try_thread_db_load, thread_db_load_search): New functions.
9598         (thread_db_init): Search for libthread_db.
9599         (thread_db_free): New function.
9600         (thread_db_handle_monitor_command): Likewise.
9601         * config.in: Regenerate.
9602         * configure: Regenerate.
9603
9604 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9605
9606         * spu-low.c (spu_kill): Wait for inferior to terminate.
9607         Call clear_inferiors.
9608         (spu_detach): Call clear_inferiors.
9609
9610 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9611
9612         * aclocal.m4: Regenerate.
9613         * config.in: Likewise.
9614         * configure: Likewise.
9615
9616 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9617
9618         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9619         (parse_spufs_run): New function.
9620         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9621         (ppc_breakpoint_at): Handle SPU breakpoints.
9622
9623 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9624
9625         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9626         (SPUFS_MAGIC): Define.
9627         (spu_enumerate_spu_ids): New function.
9628         (linux_qxfer_spu): New function.
9629         (linux_target_ops): Install linux_qxfer_spu.
9630
9631 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9632
9633         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
9634         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
9635         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
9636         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
9637         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
9638         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
9639         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
9640         (init_registers_powerpc_cell32l): Add prototype.
9641         (init_registers_powerpc_cell64l): Likewise.
9642         (ppc_arch_setup): Detect Cell/B.E. architecture.
9643
9644 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9645
9646         * Makefile.in (datarootdir): New variable.
9647
9648 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9649
9650         * linux-low.c (linux_write_memory): Update debugging output.
9651         * Makefile.in (clean): Add new descriptions.
9652         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
9653         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
9654         * configure.srv: Add new files for arm*-*-linux*.
9655         * linux-arm-low.c: Add new declarations.
9656         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
9657         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
9658         (HWCAP_VFPv3D16): New.
9659         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
9660         instead of __IWMMXT__.
9661         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
9662         (arm_arch_setup): New.
9663         (target_regsets): Remove #ifdef.  Add VFP regset.
9664         (the_low_target): Use arm_arch_setup.
9665
9666 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9667
9668         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
9669         the main thread again.
9670
9671 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
9672
9673         Adding Neutrino gdbserver.
9674         * configure: Regenerated.
9675         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
9676         * configure.srv (i[34567]86-*-nto*): New target.
9677         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
9678         * remote-utils.c [__QNX__]: Include sys/iomgr.h
9679         (nto_comctrl) [__QNX__]: New function.
9680         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
9681
9682 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
9683
9684         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
9685         srv_tgtobj.
9686
9687 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
9688             Pedro Alves  <pedro@codesourcery.com>
9689
9690         * win32-i386-low.c (i386_get_thread_context): Handle systems that
9691         don't support CONTEXT_EXTENDED_REGISTERS.
9692         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
9693         (the_low_target): Install them.
9694         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
9695         failing with ERROR_PIPE_NOT_CONNECTED.
9696
9697 2009-06-30  Doug Evans  <dje@google.com>
9698             Pierre Muller  <muller@ics.u-strasbg.fr>
9699
9700         Add h/w watchpoint support to x86-linux, win32-i386.
9701         * Makefile.in (SFILES): Add i386-low.c
9702         (i386_low_h): Define.
9703         (i386-low.o): Add dependencies.
9704         (linux-x86-low.o): Add i386-low.h dependency.
9705         (win32-i386-low.o): Ditto.
9706         * i386-low.c: New file.
9707         * i386-low.h: New file.
9708         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
9709         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
9710         * linux-low.c (linux_add_process): Initialize arch_private.
9711         (linux_remove_process): Free arch_private.
9712         (add_lwp): Initialize arch_private.
9713         (delete_lwp): Free arch_private.
9714         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
9715         provided.
9716         * linux-low.h (process_info_private): New member arch_private.
9717         (lwp_info): New member arch_private.
9718         (linux_target_ops): New members new_process, new_thread,
9719         prepare_to_resume.
9720         (ptid_of): New macro.
9721         * linux-x86-low.c: Include stddef.h, i386-low.h.
9722         (arch_process_info): New struct.
9723         (arch_lwp_info): New struct.
9724         (x86_linux_dr_get, x86_linux_dr_set): New functions.
9725         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9726         (i386_dr_low_get_status): New function.
9727         (x86_insert_point, x86_remove_point): New functions.
9728         (x86_stopped_by_watchpoint): New function.
9729         (x86_stopped_data_address): New function.
9730         (x86_linux_new_process, x86_linux_new_thread): New functions.
9731         (x86_linux_prepare_to_resume): New function.
9732         (the_low_target): Add entries for insert_point, remove_point,
9733         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
9734         prepare_to_resume.
9735         * server.c (debug_hw_points): New global.
9736         (monitor_show_help): Document set debug-hw-points.
9737         (handle_query): Process "set debug-hw-points".
9738         * server.h (debug_hw_points): Declare.
9739         (paddress): Declare.
9740         * utils.c (NUMCELLS, CELLSIZE): New macros.
9741         (get_sell, xsnprintf, paddress): New functions.
9742         * win32-arm-low.c (the_low_target): Add entries for insert_point,
9743         remove_point, stopped_by_watchpoint, stopped_data_address.
9744         * win32-i386-low.c: Include i386-low.h.
9745         (debug_reg_state): Replaces dr.
9746         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9747         (i386_dr_low_get_status): New function.
9748         (i386_insert_point, i386_remove_point): New functions.
9749         (i386_stopped_by_watchpoint): New function.
9750         (i386_stopped_data_address): New function.
9751         (i386_initial_stuff): Update.
9752         (get_thread_context,set_thread_context,i386_thread_added): Update.
9753         (the_low_target): Add entries for insert_point,
9754         remove_point, stopped_by_watchpoint, stopped_data_address.
9755         * win32-low.c (win32_insert_watchpoint): New function.
9756         (win32_remove_watchpoint): New function.
9757         (win32_stopped_by_watchpoint): New function.
9758         (win32_stopped_data_address): New function.
9759         (win32_target_ops): Add entries for insert_watchpoint,
9760         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
9761         * win32-low.h (win32_target_ops): New members insert_point,
9762         remove_point, stopped_by_watchpoint, stopped_data_address.
9763
9764 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
9765
9766         * server.c (process_serial_event): Re-return unsupported, not
9767         error, if the type isn't recognized.  Re-allow supporting only
9768         insert or remove packets.  Also call require_running for
9769         breakpoints.  Add missing break statement to default case.  Tidy.
9770         * target.h (struct target_ops): Rename insert_watchpoint to
9771         insert_point, and remove_watchpoint to remove_point.
9772
9773         * linux-low.h (struct linux_target_ops): Likewise.
9774         * linux-low.c (linux_insert_watchpoint): Rename to ...
9775         (linux_insert_point): ... this.  Adjust.
9776         (linux_remove_watchpoint): Rename to ...
9777         (linux_remove_point): ... this.  Adjust.
9778         (linux_target_ops): Adjust.
9779         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
9780         (cris_insert_point): ... this.
9781         (cris_remove_watchpoint): Rename to ...
9782         (cris_remove_point): ... this.
9783         (the_low_target): Adjust.
9784
9785 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
9786
9787         * server.c (handle_v_kill): Pass signal_pid to
9788         kill_inferior if multi_process is zero.
9789
9790 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
9791
9792         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
9793         * target.h (target_ops): Comment for *_watchpoint to make it clear
9794         the functions can get types '0' and '1'.
9795
9796 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
9797
9798         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
9799         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
9800         * regcache.c (get_regcache): Likewise.
9801         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
9802         * win32-low.c (child_fetch_inferior_registers): Remove check for
9803         regno 0.
9804
9805 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
9806             Pedro Alves <pedro@codesourcery.com>
9807
9808         * target.h (struct target_ops) <supports_multi_process>: New
9809         callback.
9810         (target_supports_multi_process): New.
9811         * server.c (handle_query): Even if GDB reports support, only
9812         enable multi-process if the target also supports it.  Report
9813         multi-process support only if the target backend supports it.
9814         * linux-low.c (linux_supports_multi_process): New function.
9815         (linux_target_ops): Install it as target_supports_multi_process
9816         callback.
9817
9818 2009-05-24  Doug Evans  <dje@google.com>
9819
9820         Global renaming of find_thread_pid to find_thread_ptid.
9821         * server.h (find_thread_ptid): Renamed from find_thread_pid.
9822         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
9823         All callers updated.
9824
9825         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
9826         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
9827         directly.
9828
9829         * linux-low.c (get_stop_pc): Print pc if debug_threads.
9830         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
9831         (linux_resume_one_lwp): Ditto.
9832
9833 2009-05-23  Doug Evans  <dje@google.com>
9834
9835         * linux-low.c (linux_resume_one_lwp): Change type of first arg
9836         from struct inferior_list_entry * to struct lwp_info *.
9837         All callers updated.
9838
9839 2009-05-13  Doug Evans  <dje@google.com>
9840
9841         * linux-x86-low.c: Don't include assert.h.
9842         (x86_siginfo_fixup): Use fatal, not assert.
9843         (x86_arch_setup): Fix comment.
9844
9845 2009-05-12  Doug Evans  <dje@google.com>
9846
9847         Biarch support for i386/amd64 gdbserver.
9848         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
9849         Add linux-x86-low.c.
9850         (linux-i386-low.o, linux-x86-64-low.o): Delete.
9851         (linux-x86-low.o): Add.
9852         * linux-x86-64-low.c: Delete.
9853         * linux-i386-low.c: Delete.
9854         * linux-x86-low.c: New file.
9855         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
9856         linux-x86-low.o.
9857         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
9858         linux-x86-low.o.
9859         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
9860         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
9861         (linux_child_pid_to_exec_file): New function.
9862         (elf_64_header_p, elf_64_file_p): New functions.
9863         (siginfo_fixup): New function.
9864         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
9865         give target a chance to convert layout.
9866         * linux-low.h (linux_target_ops): New member siginfo_fixup.
9867         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
9868
9869 2009-05-07  Doug Evans  <dje@google.com>
9870
9871         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
9872         (regsets_store_inferior_registers): Ditto.
9873
9874 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
9875
9876         PR server/10048
9877
9878         * linux-low.c (must_set_ptrace_flags): Delete.
9879         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
9880         of the global.
9881         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
9882         `lwp->must_set_ptrace_flags' instead.
9883         (linux_wait_for_event_1): Set ptrace options here.
9884         (linux_wait_1): ... not here.
9885
9886 2009-04-30  Doug Evans  <dje@google.com>
9887
9888         * inferiors.c (started_inferior_callback): New function.
9889         (attached_inferior_callback): New function.
9890         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
9891         * server.c (print_started_pid, print_attached_pid): New functions.
9892         (detach_or_kill_for_exit): New function.
9893         (main): Call it instead of for_each_inferior (kill_inferior_callback).
9894         * server.h (have_started_inferiors_p): Declare.
9895         (have_attached_inferiors_p): Declare.
9896
9897         * inferiors.c (remove_process): Fix memory leak, free process.
9898         * linux-low.c (linux_remove_process): New function.
9899         (linux_kill): Call it instead of remove_process.
9900         (linux_detach, linux_wait_1): Ditto.
9901
9902 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
9903
9904         * configure.srv: Add x86 Windows CE target.
9905
9906 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9907
9908         * inferiors.c (get_thread_process): Make global.
9909         * server.h (get_thread_process): Add prototype.
9910         * thread-db.c (find_one_thread): Use get_thread_process
9911         instead of current_process.
9912         (thread_db_get_tls_address): Do not crash if called when
9913         thread layer is not yet initialized.
9914
9915 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9916
9917         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
9918         * spu-low.c (current_tid): Rename to ...
9919         (current_ptid): ... this.
9920         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
9921         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
9922         ptid_get_lwp (current_ptid) instead of current_tid.
9923         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
9924         instead of current_tid.  Use find_process_pid to verify pid
9925         argument is valid.  Pass proper argument to remove_process.
9926         (spu_thread_alive): Compare current_ptid instead of current_tid.
9927         (spu_resume): Likewise.
9928
9929 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
9930
9931         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
9932         variable.
9933
9934 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9935
9936         Implement the multiprocess extensions, and add linux multiprocess
9937         support.
9938
9939         * server.h (ULONGEST): Declare.
9940         (struct ptid, ptid_t): New.
9941         (minus_one_ptid, null_ptid): Declare.
9942         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9943         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
9944         (struct inferior_list_entry): Change `id' type from unsigned from
9945         to ptid_t.
9946         (struct sym_cache, struct breakpoint, struct
9947         process_info_private): Forward declare.
9948         (struct process_info): Declare.
9949         (current_process): Declare.
9950         (all_processes): Declare.
9951         (initialize_inferiors): Declare.
9952         (add_thread): Adjust to use ptid_t.
9953         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
9954         (add_process, remove_process, find_thread_pid): Declare.
9955         (find_inferior_id): Adjust to use ptid_t.
9956         (cont_thread, general_thread, step_thread): Change type to ptid_t.
9957         (multi_process): Declare.
9958         (push_event): Adjust to use ptid_t.
9959         (read_ptid, write_ptid): Declare.
9960         (prepare_resume_reply): Adjust to use ptid_t.
9961         (clear_symbol_cache): Declare.
9962         * inferiors.c (all_processes): New.
9963         (null_ptid, minus_one_ptid): New.
9964         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9965         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
9966         (add_thread): Change unsigned long to ptid.  Remove gdb_id
9967         parameter.  Adjust.
9968         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
9969         (gdb_id_to_thread): Rename to ...
9970         (find_thread_pid): ... this.  Change unsigned long to ptid.
9971         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
9972         (loaded_dll, pull_pid_from_list): Adjust.
9973         (add_process, remove_process, find_process_pid)
9974         (get_thread_process, current_process, initialize_inferiors): New.
9975         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
9976         (struct target_waitstatus) <related_pid>: Ditto.
9977         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
9978         return type to int.
9979         (struct target_ops) <join>: Add `pid' argument.
9980         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
9981         (struct target_ops) <wait>: Add `ptid' field.  Change return type
9982         to ptid.
9983         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
9984         (mywait): Add `ptid' argument.  Change return type to ptid_t.
9985         (target_pid_to_str): Declare.
9986         * target.c (set_desired_inferior): Adjust to use ptids.
9987         (mywait): Add new `ptid' argument.  Adjust.
9988         (target_pid_to_str): New.
9989         * mem-break.h (free_all_breakpoints): Declare.
9990         * mem-break.c (breakpoints): Delelete.
9991         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
9992         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
9993         to use per-process breakpoint list.
9994         (free_all_breakpoints): New.
9995         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
9996         (symbol_cache, all_symbols_looked_up): Delete.
9997         (hexchars): New.
9998         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
9999         read_ptid): New.
10000         (prepare_resume_reply): Change ptid argument's type from unsigned
10001         long to ptid_t.  Adjust.  Implement W;process and X;process.
10002         (free_sym_cache, clear_symbol_cache): New.
10003         (look_up_one_symbol): Adjust to per-process symbol cache.  *
10004         * server.c (cont_thread, general_thread, step_thread): Change type
10005         to ptid_t.
10006         (attached): Delete.
10007         (multi_process): New.
10008         (last_ptid): Change type to ptid_t.
10009         (struct vstop_notif) <ptid>: Change type to ptid_t.
10010         (queue_stop_reply, push_event): Change `ptid' argument's type to
10011         ptid_t.
10012         (discard_queued_stop_replies): Add `pid' argument.
10013         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
10014         changes.  Don't reference the `attached' global.
10015         (attach_inferior): Adjust to mywait interface changes.
10016         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
10017         features.  Handle and report "multiprocess+".  Handle
10018         "qAttached:PID".
10019         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
10020         changes.
10021         (handle_v_kill): New.
10022         (handle_v_stopped): Adjust to use target_pid_to_str.
10023         (handle_v_requests): Allow multiple attaches and runs when
10024         multiprocess extensions are in effect.  Handle "vKill".
10025         (myresume): Adjust to use ptids.
10026         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
10027         (handle_status): Adjust to discard_queued_stop_replies interface
10028         change.
10029         (first_thread_of, kill_inferior_callback)
10030         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
10031         (main): Call initialize_inferiors.  Adjust to use ptids, killing
10032         and detaching from all inferiors.  Handle multiprocess packet
10033         variants.
10034         * linux-low.h: Include gdb_proc_service.h.
10035         (struct process_info_private): New.
10036         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
10037         <lwpid_of>: Use ptid_get_lwp.
10038         (get_lwp_thread): Adjust.
10039         (struct lwp_info): Add `dead' member.
10040         (find_lwp_pid): Declare.
10041         * linux-low.c (thread_db_active): Delete.
10042         (new_inferior): Adjust comment.
10043         (inferior_pid): Delete.
10044         (linux_add_process): New.
10045         (handle_extended_wait): Adjust.
10046         (add_lwp): Change unsigned long to ptid.
10047         (linux_create_inferior): Add process to processes table.  Adjust
10048         to use ptids.  Don't set new_inferior here.
10049         (linux_attach_lwp): Rename to ...
10050         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
10051         it.  Adjust to use ptids.
10052         (linux_attach_lwp): New.
10053         (linux_attach): Add process to processes table.  Don't set
10054         new_inferior here.
10055         (struct counter): New.
10056         (second_thread_of_pid_p, last_thread_of_process_p): New.
10057         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
10058         multiple processes.
10059         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
10060         processes.  Remove process from process table.
10061         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
10062         to multiple processes.
10063         (any_thread_of): New.
10064         (linux_detach): Add `pid' argument, and handle it.  Remove process
10065         from processes table.
10066         (linux_join): Add `pid' argument.  Handle it.
10067         (linux_thread_alive): Change unsighed long argument to ptid_t.
10068         Consider dead lwps as not being alive.
10069         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
10070         threads we're not interested in.
10071         (same_lwp, find_lwp_pid): New.
10072         (linux_wait_for_lwp): Change `pid' argument's type from int to
10073         ptid_t.  Adjust.
10074         (linux_wait_for_event): Rename to ...
10075         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
10076         from int to ptid_t.  Adjust.
10077         (linux_wait_for_event): New.
10078         (linux_wait_1): Add `ptid' argument.  Change return type to
10079         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
10080         that exit from the process table.
10081         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
10082         Adjust.
10083         (mark_lwp_dead): New.
10084         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
10085         stopping all threads, mark its main lwp as dead.
10086         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
10087         ptids.
10088         (fetch_register, usr_store_inferior_registers)
10089         (regsets_fetch_inferior_registers)
10090         (regsets_store_inferior_registers, linux_read_memory)
10091         (linux_write_memory): Inline `inferior_pid'.
10092         (linux_look_up_symbols): Adjust to use per-process
10093         `thread_db_active'.
10094         (linux_request_interrupt): Adjust to use ptids.
10095         (linux_read_auxv): Inline `inferior_pid'.
10096         (initialize_low): Don't reference thread_db_active.
10097         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
10098         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
10099         (ps_getpid): Return the pid of the current inferior.
10100         * thread-db.c (proc_handle, thread_agent): Delete.
10101         (thread_db_create_event, thread_db_enable_reporting): Adjust to
10102         per-process data.
10103         (find_one_thread): Change argument type to ptid_t.  Adjust to
10104         per-process data.
10105         (maybe_attach_thread): Adjust to per-process data and ptids.
10106         (thread_db_find_new_threads): Ditto.
10107         (thread_db_init): Ditto.
10108         * spu-low.c (spu_create_inferior, spu_attach): Add process to
10109         processes table.  Adjust to use ptids.
10110         (spu_kill, spu_detach): Adjust interface.  Remove process from
10111         processes table.
10112         (spu_join, spu_thread_alive): Adjust interface.
10113         (spu_wait): Adjust interface.  Remove process from processes
10114         table.  Adjust to use ptids.
10115         * win32-low.c (current_inferior_tid): Delete.
10116         (current_inferior_ptid): New.
10117         (debug_event_ptid): New.
10118         (thread_rec): Take a ptid.  Adjust.
10119         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
10120         (child_delete_thread): Ditto.
10121         (do_initial_child_stuff): Add `attached' argument.  Add process to
10122         processes table.
10123         (child_fetch_inferior_registers, child_store_inferior_registers):
10124         Adjust.
10125         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
10126         (win32_attach): Pass 1 to do_initial_child_stuff.
10127         (win32_kill): Adjust interface.  Remove process from processes
10128         table.
10129         (win32_detach): Ditto.
10130         (win32_join): Adjust interface.
10131         (win32_thread_alive): Take a ptid.
10132         (win32_resume): Adjust to use ptids.
10133         (get_child_debug_event): Ditto.
10134         (win32_wait): Adjust interface.  Remove exiting process from
10135         processes table.
10136
10137 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10138
10139         Non-stop mode support.
10140
10141         * server.h (non_stop): Declare.
10142         (gdb_client_data, handler_func): Declare.
10143         (delete_file_handler, add_file_handler, start_event_loop):
10144         Declare.
10145         (handle_serial_event, handle_target_event, push_event)
10146         (putpkt_notif): Declare.
10147         * target.h (enum resume_kind): New.
10148         (struct thread_resume): Replace `step' field by `kind' field.
10149         (TARGET_WNOHANG): Define.
10150         (struct target_ops) <wait>: Add `options' argument.
10151         <supports_non_stop, async, start_non_stop>: New fields.
10152         (target_supports_non_stop, target_async): New.
10153         (start_non_stop): Declare.
10154         (mywait): Add `options' argument.
10155         * target.c (mywait): Add `options' argument.  Print child exit
10156         notifications here.
10157         (start_non_stop): New.
10158         * server.c (non_stop, own_buf, mem_buf): New globals.
10159         (struct vstop_notif): New.
10160         (notif_queue): New global.
10161         (queue_stop_reply, push_event, discard_queued_stop_replies)
10162         (send_next_stop_reply): New.
10163         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10164         interface changes.
10165         (attach_inferior): In non-stop mode, don't wait for the target
10166         here.
10167         (handle_general_set): Handle QNonStop.
10168         (handle_query): When handling qC, return the current general
10169         thread, instead of the first thread of the list.
10170         (handle_query): If the backend supports non-stop mode, include
10171         QNonStop+ in the qSupported query response.
10172         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10173         and non-stop mode.
10174         (handle_v_attach, handle_v_run): Handle non-stop mode.
10175         (handle_v_stopped): New.
10176         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10177         (myresume): Adjust to use resume_kind.  Handle non-stop.
10178         (queue_stop_reply_callback): New.
10179         (handle_status): Handle non-stop mode.
10180         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10181         Refactor serial protocol handling from here ...
10182         (process_serial_event): ... to this new function.  When GDB
10183         selects any thread, select one here.  In non-stop mode, wait until
10184         GDB acks all pending events before exiting.
10185         (handle_serial_event, handle_target_event): New.
10186         * remote-utils.c (remote_open): Install remote_desc in the event
10187         loop.
10188         (remote_close): Remove remote_desc from the event loop.
10189         (putpkt_binary): Rename to...
10190         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10191         (putpkt_binary): New as wrapper around putpkt_binary_1.
10192         (putpkt_notif): New.
10193         (prepare_resume_reply): In non-stop mode, don't change the
10194         general_thread.
10195         * event-loop.c: New.
10196         * Makefile.in (OBJ): Add event-loop.o.
10197         (event-loop.o): New rule.
10198
10199         * linux-low.h (pid_of): Moved here.
10200         (lwpid_of): New.
10201         (get_lwp_thread): Use lwpid_of.
10202         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10203         * linux-low.c (pid_of): Delete.
10204         (inferior_pid): Use lwpid_of.
10205         (linux_event_pipe): New.
10206         (target_is_async_p): New.
10207         (delete_lwp): New.
10208         (handle_extended_wait): Use lwpid_of.
10209         (add_lwp): Don't set lwpid field.
10210         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10211         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10212         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10213         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10214         first.  Adjust to linux_wait_for_event interface changes.  Use
10215         lwpid_of.
10216         (linux_detach): Don't delete the main lwp here.
10217         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10218         (status_pending_p): Don't consider explicitly suspended lwps.
10219         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10220         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10221         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10222         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10223         pointer.  Add status pointer argument.  Return a pid instead of a
10224         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10225         changes.  In non-stop mode, don't switch to a random thread.
10226         (linux_wait): Rename to...
10227         (linux_wait_1): ... this.  Add target_options argument, and handle
10228         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10229         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10230         clean exit and signal exit code.  Don't stop all threads in
10231         non-stop mode.  In all-stop mode, only stop all threads when
10232         reporting a stop to GDB.  Handle explicit thread stop requests.
10233         (async_file_flush, async_file_mark): New.
10234         (linux_wait): New.
10235         (send_sigstop): Use lwpid_of.
10236         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10237         interface changes.  In non-stop mode, don't switch to a random
10238         thread.
10239         (linux_resume_one_lwp): Use lwpid_of.
10240         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10241         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10242         non-stop mode, don't look for pending flag in all threads.
10243         (resume_status_pending_p): Don't consider explicitly suspended
10244         threads.
10245         (my_waitpid): Reimplement.  Emulate __WALL.
10246         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10247         Use lwpid_of.
10248         (sigchld_handler, linux_supports_non_stop, linux_async)
10249         (linux_start_non_stop): New.
10250         (linux_target_ops): Register linux_supports_non_stop, linux_async
10251         and linux_start_non_stop.
10252         (initialize_low): Install SIGCHLD handler.
10253         * thread-db.c (thread_db_create_event, find_one_thread)
10254         (thread_db_get_tls_address): Use lwpid_of.
10255         * win32-low.c (win32_detach): Adjust to use resume_kind.
10256         (win32_wait): Add `options' argument.
10257         * spu-low.c (spu_resume): Adjust to use resume_kind.
10258         (spu_wait): Add `options' argument.
10259
10260 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10261
10262         Decouple target code from remote protocol.
10263
10264         * target.h (enum target_waitkind): New.
10265         (struct target_waitstatus): New.
10266         (struct target_ops) <wait>: Return an unsigned long.  Take a
10267         target_waitstatus pointer instead of a char pointer.
10268         (mywait): Likewise.
10269         * target.c (mywait): Change prototype to return an unsigned long.
10270         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10271         * server.h (thread_from_wait, old_thread_from_wait): Delete
10272         declarations.
10273         (prepare_resume_reply): Change prototype to take a
10274         target_waitstatus.
10275         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10276         (last_status, last_ptid): New.
10277         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10278         pid instead of a signal.
10279         (attach_inferior): Remove "status" and "signal" parameters.
10280         Adjust.
10281         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10282         not as an address.
10283         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10284         (handle_v_requests, myresume): Remove "status" and "signal"
10285         parameters.  Adjust.
10286         (handle_status): New.
10287         (main): Delete local `status'.  Adjust.
10288         * remote-utils.c: Include target.h.
10289         (prepare_resume_reply): Change prototype to take a
10290         target_waitstatus.  Adjust.
10291
10292         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10293         interface.
10294         * spu-low.c (spu_wait): Adjust.
10295         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10296         Delete.
10297         (win32_wait): Adjust.
10298
10299 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10300
10301         * target.h (struct thread_resume): Delete leave_stopped member.
10302         (struct target_ops): Add a `n' argument to the `resume' callback.
10303         * server.c (start_inferior): Adjust.
10304         (handle_v_cont, myresume): Adjust.
10305         * linux-low.c (check_removed_breakpoint): Adjust to resume
10306         interface change, and to removed leave_stopped field.
10307         (resume_ptr): Delete.
10308         (struct thread_resume_array): New.
10309         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10310         resume interface change.
10311         (linux_continue_one_thread, linux_queue_one_thread)
10312         (resume_status_pending_p): Check if the resume field is NULL
10313         instead of checking the leave_stopped member.
10314         (linux_resume): Adjust to the target resume interface change.
10315         * spu-low.c (spu_resume): Adjust to the target resume interface
10316         change.
10317         * win32-low.c (win32_detach, win32_resume): Ditto.
10318
10319 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10320
10321         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10322         flag.
10323         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10324         pending.
10325         (linux_continue_one_thread): Only preserve the stepping flag if
10326         there's a pending breakpoint.
10327
10328 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10329
10330         * server.c (main): After the inferior having exited, call
10331         remote_close before exiting gdbserver.
10332
10333 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10334
10335         Fix size of FPSCR in Power 7 processors.
10336         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10337         (PPC_FEATURE_HAS_DFP): New #define.
10338         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10339         size of the FPSCR.
10340
10341 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10342
10343         * server.c (handle_query) Whitespace and formatting.
10344
10345 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10346
10347         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10348         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10349         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10350         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10351         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10352         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10353         Makefile.in, configure.ac: Fix whitespace throughout.
10354         * configure: Regenerate.
10355
10356 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10357
10358         * inferiors.c (find_inferior): Make it safe for the callback
10359         function to delete the currently iterated inferior.
10360
10361 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10362
10363         * Makefile.in (linuw_low_h): Move higher.
10364         (thread-db.o): Depend on $(linux_low_h).
10365
10366 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10367
10368         Rename "process" to "lwp" throughout.
10369
10370         * linux-low.c (all_processes): Rename to...
10371         (all_lwps): ... this.
10372         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10373         (add_process): Rename to ...
10374         (add_lwp): ... this.  Adjust.
10375         (linux_create_inferior): Adjust.
10376         (linux_attach_lwp): Adjust.
10377         (linux_attach): Adjust.
10378         (linux_kill_one_process): Rename to ...
10379         (linux_kill_one_lwp): ... this.  Adjust.
10380         (linux_kill): Adjust.
10381         (linux_detach_one_process): Rename to ...
10382         (linux_detach_one_lwp): ... this.  Adjust.
10383         (linux_detach): Adjust.
10384         (check_removed_breakpoint): Adjust.
10385         (status_pending_p): Adjust.
10386         (linux_wait_for_process): Rename to ...
10387         (linux_wait_for_lwp): ... this.  Adjust.
10388         (linux_wait_for_event): Adjust.
10389         (send_sigstop): Adjust.
10390         (wait_for_sigstop): Adjust.
10391         (stop_all_processes): Rename to ...
10392         (stop_all_lwps): ... this.
10393         (linux_resume_one_process): Rename to ...
10394         (linux_resume_one_lwp): ... this.  Adjust.
10395         (linux_set_resume_request, linux_continue_one_thread)
10396         (linux_queue_one_thread, resume_status_pending_p)
10397         (usr_store_inferior_registers, regsets_store_inferior_registers)
10398         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10399         Adjust.
10400         * linux-low.h (get_process): Rename to ...
10401         (get_lwp): ... this.  Adjust.
10402         (get_thread_process): Rename to ...
10403         (get_thread_lwp): ... this.  Adjust.
10404         (get_process_thread): Rename to ...
10405         (get_lwp_thread): ... this.  Adjust.
10406         (struct process_info): Rename to ...
10407         (struct lwp_info): ... this.
10408         (all_processes): Rename to ...
10409         (all_lwps): ... this.
10410         * proc-service.c (ps_lgetregs): Adjust.
10411         * thread-db.c (thread_db_create_event, find_one_thread)
10412         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10413
10414 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10415
10416         * server.c (handle_query): Handle "qAttached".
10417
10418 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10419
10420         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10421         GPLv3, update license URL.
10422
10423 2009-03-01  Doug Evans  <dje@google.com>
10424
10425         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10426         (server_h): Add gdb_signals.h.
10427         (signals.o): Update.
10428         * server.h (target_signal_from_host,target_signal_to_host_p)
10429         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10430
10431 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10432
10433         * remote-utils.c (getpkt): Also generate remote-debug
10434         information if noack_mode is set.
10435
10436 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10437
10438         * server.c (handle_query): Report qXfer:siginfo:read and
10439         qXfer:siginfo:write as supported and handle them.
10440         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10441         * linux-low.c (linux_xfer_siginfo): New.
10442         (linux_target_ops): Set it.
10443
10444 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10445
10446         * server.c (gdbserver_usage): Mention --remote-debug.
10447         (main): Accept '--remote-debug' switch.
10448
10449 2009-01-18  Doug Evans  <dje@google.com>
10450
10451         * regcache.c (new_register_cache): No need to check result of xcalloc.
10452         * server.c (handle_search_memory): Back out calls to xmalloc,
10453         result is checked and error is returned to user upon failure.
10454         (handle_query): Ditto.  Add more checks for result of malloc.
10455         (handle_v_cont): Check result of malloc, report error back to
10456         user upon failure.
10457         (handle_v_run): Ditto.  Call freeargv.
10458         * server.h (freeargv): Declare.
10459         * utils.c (freeargv): New fn.
10460
10461 2009-01-15  Doug Evans  <dje@google.com>
10462
10463         * gdbreplay.c (perror_with_name): Make arg const char *.
10464         * server.h (target_signal_to_name): Make return type const char *.
10465         * thread-db.c (thread_db_err_str): Make return type const char *.
10466         * utils.c (perror_with_name): Make arg const char *.
10467
10468 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10469
10470         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10471         when handling a EXIT_PROCESS_DEBUG_EVENT.
10472
10473 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10474
10475         * gdbreplay.c (gdbreplay_version): Update copyright year.
10476         * server.c (gdbserver_version): Likewise.
10477
10478 2009-01-05  Doug Evans  <dje@google.com>
10479
10480         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10481         (handle_extended_wait): Improve comment.
10482
10483 2008-12-13  Doug Evans  <dje@google.com>
10484
10485         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10486         * server.h (ATTR_MALLOC): New macro.
10487         (xmalloc,xcalloc,xstrdup): Declare.
10488         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10489         * inferiors.c: Ditto.
10490         * linux-low.c: Ditto.
10491         * mem-break.c: Ditto.
10492         * regcache.c: Ditto.
10493         * remote-utils.c: Ditto.
10494         * server.c: Ditto.
10495         * target.c: Ditto.
10496         * win32-low.c: Ditto.
10497
10498 2008-12-12  Doug Evans  <dje@google.com>
10499
10500         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10501         in debugging printf.
10502
10503         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10504
10505 2008-12-09  Doug Evans  <dje@google.com>
10506
10507         * linux-low.h (struct process_info): Delete member tid, unused.
10508         * thread-db.c (find_one_thread): Update.
10509         (maybe_attach_thread): Update.
10510
10511 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10512
10513         * target.h (struct target_ops): Add qxfer_osdata member.
10514         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10515         and dirent.h.
10516         (linux_qxfer_osdata): New functions.
10517         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10518         callback.
10519         * server.c (handle_query): Handle "qXfer:osdata:read:".
10520         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10521         (buffer_xml_printf): New functions.
10522         * server.h (struct buffer): New.
10523         (buffer_grow_str, buffer_grow_str0): New macros.
10524         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10525         (buffer_xml_printf): Declare.
10526
10527 2008-11-24  Doug Evans  <dje@google.com>
10528
10529         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10530
10531 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10532
10533         * server.c (handle_v_run): Always use the supplied argument list.
10534
10535 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10536
10537         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10538         (xtensa_regmap_table): Add entry for scompare1.
10539
10540 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10541
10542         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10543         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10544         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10545         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10546         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10547         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10548         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10549         XML target descriptions.
10550         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10551         when inferior is running on an ISA 2.05 or later processor.  Add
10552         special case to return offset for full 64-bit slot of FPSCR when
10553         in 32-bits.
10554
10555 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10556
10557         * Makefile.in (SFILES, clean): Added sparc64 files.
10558         (reg-sparc64.o, reg-sparc64.c): New.
10559         * configure.srv (sparc*-*-linux*): New configuration.
10560         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10561         syscall arguments for SPARC.
10562         (regsets_store_inferior_registers): Likewise.
10563         * linux-sparc-low.c: New file.
10564
10565 2008-10-21  Doug Evans  <dje@google.com>
10566
10567         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10568         (READLINE_DIR,READLINE_DEP): Delete.
10569         (INTERNAL_CFLAGS): Update.
10570         (LINTFLAGS): Update.
10571
10572 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10573
10574         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10575         whole argv from the last run, not just argv[0].
10576
10577 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10578
10579         * regcache.c (new_register_cache): Return NULL if the register
10580         cache size isn't known yet.
10581         (free_register_cache): Avoid dereferencing a NULL regcache.
10582
10583 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10584
10585         * configure.srv: Merge MIPS and MIPS64.
10586
10587 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10588
10589         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10590
10591 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10592
10593         * Makefile.in: Add required vsx dependencies.
10594
10595         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10596         Declare init_registers_powerpc_vsx32l.
10597         Declare init_registers_powerpc_vsx64l.
10598         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10599         (ppc_arch_setup): Check for VSX in hwcap.
10600         (ppc_fill_vsxregset): New function.
10601         (ppc_store_vsxregset): New function.
10602         Add new VSX entry in regset_info target_regsets.
10603
10604         * configure.srv: Add new VSX dependencies.
10605
10606 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10607
10608         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10609         (remote_open): Set or clear transport_is_reliable.
10610         (putpkt_binary): Don't expect acks in noack mode.
10611         (getpkt): Don't send ack/nac in noack mode.
10612         * server.c (handle_general_set): Handle QStartNoAckMode.
10613         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10614         qSupported.
10615         (main): Reset noack_mode on every connection.
10616         * server.h (noack_mode): Declare.
10617
10618 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10619
10620         * Makefile.in (GDBREPLAY_OBS): New variable.
10621         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10622
10623 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10624             Daniel Jacobowitz  <dan@codesourcery.com>
10625
10626         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10627         (usr_store_inferior_registers): Likewise.
10628         (regsets_store_inferior_registers): Likewise.
10629
10630 2008-07-31  Rolf Jansen  <rj@surtec.com>
10631             Pedro Alves  <pedro@codesourcery.com>
10632
10633         * configure.ac: Check for memmem declaration.
10634         * server.c [HAVE_MALLOC_H]: Include malloc.h.
10635         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
10636         (disable_packet_qfThreadInfo): Unconditionally compile.
10637         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
10638         * configure, config.in: Regenerate.
10639
10640 2008-07-28  Doug Kwan  <dougkwan@google.com>
10641
10642         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
10643         (linux_write_memory): Remove declaration of errno.
10644
10645 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
10646
10647         * linux-low.c (handle_extended_wait): Do not use "status"
10648         variable uninitialized.
10649
10650 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
10651
10652         * server.c (handle_v_attach): Inhibit reporting dll changes.
10653
10654 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
10655
10656         * remote-utils.c (prepare_resume_reply): If requested, don't
10657         output "thread:TID" in the T stop reply.
10658
10659         * server.c (disable_packet_vCont, disable_packet_Tthread)
10660         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
10661         (handle_query): If requested, disable support for qC, qfThreadInfo
10662         and qsThreadInfo.
10663         (handle_v_requests): If requested, disable support for vCont.
10664         (gdbserver_show_disableable): New.
10665         (main): Handle --disable-packet and --disable-packet=LIST.
10666
10667         * server.h (disable_packet_vCont, disable_packet_Tthread)
10668         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
10669
10670 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
10671
10672         * server.c (gdbserver_usage): Mention --version.
10673
10674 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
10675
10676         * Makefile.in (gdbreplay.o): New rule.
10677
10678 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
10679
10680         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
10681         message, not gdbserver.
10682
10683 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
10684             Nathan Sidwell  <nathan@codesourcery.com>
10685             Joseph Myers  <joseph@codesourcery.com>
10686
10687         * acinclude.m4: Include ../../config/acx.m4.
10688         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
10689         * configure, config.in: Regenerate.
10690         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
10691         * server.c (gdbserver_version): Print PKGVERSION.
10692         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
10693         (main): Adjust gdbserver_usage calls.
10694         * gdbreplay.c (version, host_name): Add declarations.
10695         (gdbreplay_version, gdbreplay_usage): New.
10696         (main): Accept --version and --help options.
10697
10698 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
10699
10700         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
10701         (arm_breakpoint_at): Handle Thumb.
10702         (the_low_target): Add comment.
10703
10704 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
10705
10706         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
10707
10708 2008-05-09  Doug Evans  <dje@google.com>
10709
10710         * server.h (decode_search_memory_packet): Declare.
10711         * remote-utils.c (decode_search_memory_packet): New fn.
10712         * server.c (handle_search_memory_1): New fn.
10713         (handle_search_memory): New fn.
10714         (handle_query): Process qSearch:memory packets.
10715
10716 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
10717
10718         * regcache.c (registers_length): Remove.
10719         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
10720         full register packet.
10721         * regcache.h (registers_length): Remove prototype.
10722         * server.h (PBUFSIZ): Define to 16384.
10723
10724 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
10725
10726         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
10727         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
10728         powerpc-64l.o, and powerpc-altivec64l.o.
10729         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
10730         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
10731         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
10732         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
10733         rs6000/power-linux.xml, and rs6000/power64-linux.xml
10734         to srv_xmlfiles.
10735
10736         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
10737         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
10738         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
10739         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
10740         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
10741         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
10742         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
10743         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
10744         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
10745         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
10746         (clean): Update.
10747
10748         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
10749         (init_registers_powerpc_32l): ... this new prototype.
10750         (init_registers_powerpc_32): Remove, replace by ...
10751         (init_registers_powerpc_altivec32l): ... this new prototype.
10752         (init_registers_powerpc_e500): Remove, replace by ...
10753         (init_registers_powerpc_e500l): ... this new prototype.
10754         (init_registers_ppc64): Remove, replace by ...
10755         (init_registers_powerpc_64l): ... this new prototype.
10756         (init_registers_powerpc_64): Remove, replace by ...
10757         (init_registers_powerpc_altivec64l): ... this new prototype.
10758         (ppc_num_regs): Set to 73.
10759         (PT_ORIG_R3, PT_TRAP): Define if necessary.
10760         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
10761         (ppc_cannot_store_register): Handle orig_r3 and trap.
10762         (ppc_arch_setup): Update init_registers_... calls.
10763         (ppc_fill_gregset): Handle orig_r3 and trap.
10764
10765         * inferiors.c (clear_inferiors): Reset current_inferior.
10766
10767 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
10768
10769         * acinclude.m4: Add override.m4.
10770         * configure: Regenerate.
10771
10772 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10773
10774         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
10775         initial call to init_register_ppc64.
10776
10777 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10778
10779         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
10780         single powerpc*-*-linux* case.
10781         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
10782
10783 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
10784
10785         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
10786         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
10787         from reg_xmlfiles.
10788         * linux-ppc-low.c: Include <elf.h>.
10789         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
10790         (ppc_hwcap): New global variable.
10791         (ppc_regmap): Remove __SPE__ #ifdef sections.
10792         (ppc_regmap_e500): New global variable.
10793         (ppc_cannot_store_register): Update __SPE__ special case.
10794         (ppc_get_hwcap): New function.
10795         (ppc_arch_setup): Use it to determine whether inferior supports
10796         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
10797         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
10798         Do not access registers if target does not support AltiVec.
10799         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
10800         Do not access registers if target does not support SPE.
10801         (target_regsets): Unconditionally include AltiVec and SPE regsets.
10802
10803 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
10804
10805         * linux-low.c (disabled_regsets, num_regsets): New.
10806         (use_regsets_p): Delete.
10807         (linux_wait_for_process): Clear disabled_regsets.
10808         (regsets_fetch_inferior_registers): Check and set it.
10809         (regsets_store_inferior_registers): Likewise.
10810         (linux_fetch_registers, linux_store_registers): Do not use
10811         use_regsets_p.
10812         (initialize_low): Allocate disabled_regsets.
10813
10814 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
10815
10816         * Makefile.in (LIBOBJS): New.
10817         (OBS): Use LIBOBJS.
10818         (memmem.o): New rule.
10819         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
10820         * configure: Regenerated.
10821
10822 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
10823
10824         * server.c (handle_query): Never return "unsupported" for
10825         qXfer:features:read queries.
10826
10827 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
10828
10829         * server.c (get_features_xml): Fix inverted condition.
10830         (handle_query): Always support qXfer:feature:read.
10831
10832 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
10833
10834         * server.c (wrapper_argv): New.
10835         (start_inferior): Handle wrapper_argv.  If set, expect an extra
10836         trap.
10837         (gdbserver_usage): Document --wrapper.
10838         (main): Parse --wrapper.
10839
10840 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10841
10842         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
10843         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
10844         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
10845         (ppc_set_pc): Likewise.
10846         (ppc_arch_setup): New function.
10847         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
10848         of collect_register.
10849         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
10850
10851 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10852
10853         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
10854         instead of linux-ppc64-low.o.
10855         * linux-ppc64-low.c: Remove file.
10856         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
10857         (linux-ppc64-low.o): Remove rule.
10858
10859         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
10860         (init_registers_powerpc_64): Likewise.
10861         (ppc_regmap): Conditionally define depending on __powerpc64__.
10862         (ppc_cannot_store_register): Do not special-case "fpscr" when
10863         compiled on __powerpc64__.
10864         (ppc_collect_ptrace_register): New function.
10865         (ppc_supply_ptrace_register): New function.
10866         (ppc_breakpoint): Change type to "unsigned int".
10867         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
10868         (the_low_target): Conditionally provide initializers for the
10869         arch_setup member depending on __powerpc64__.  Install
10870         collect_ptrace_register and supply_ptrace_register members.
10871
10872 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10873
10874         * regcache.h (gdbserver_xmltarget): Add extern declaration.
10875         * server.c (gdbserver_xmltarget): Define.
10876         (get_features_xml): Use it to replace "target.xml" and arch_string.
10877
10878         * configure.srv: Remove srv_xmltarget.  Add XML files that were
10879         mentioned there to srv_xmlfiles instead.  Remove conditional tests
10880         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
10881         srv_xmlfiles and srv_regobj to include all possible choices.
10882         * configure.ac (srv_xmltarget): Remove.
10883         (srv_xmlfiles): Do not add "target.xml".
10884         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
10885         checks for supplementary target information.
10886         * configure: Regenerate.
10887         * Makefile.in (XML_TARGET): Remove.
10888         (target.xml): Remove rule.
10889         (clean): Do not clean up target.xml.
10890         (.PRECIOUS): Do not mention target.xml.
10891
10892         * target.h (struct target_ops): Remove arch_string member.
10893         * linux-low.c (linux_arch_string): Remove.
10894         (linux_target_ops): Remove arch_string initializer.
10895         * linux-low.h (struct linux_target_ops): Remove arch_string member.
10896         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
10897         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
10898         * spu-low.c (spu_arch_string): Remove.
10899         (spu_target_ops): Remove arch_string initializer.
10900         * win32-low.c (win32_arch_string): Remove.
10901         (win32_target_ops): Remove arch_string initializer.
10902         * win32-low.h (struct win32_target_ops): Remove arch_string member.
10903         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
10904         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
10905
10906 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10907
10908         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
10909         by collect_ptrace_register and supply_ptrace_register hooks.
10910         * linux-low.c (fetch_register): Use supply_ptrace_register callback
10911         instead of checking for the_low_target.left_pad_xfer.
10912         (usr_store_inferior_registers): Use collect_ptrace_register callback
10913         instead of checking for the_low_target.left_pad_xfer.
10914
10915         * linux-s390-low.c (s390_collect_ptrace_register): New function.
10916         (s390_supply_ptrace_register): Likewise.
10917         (s390_fill_gregset): Call s390_collect_ptrace_register.
10918         (the_low_target): Update.
10919
10920         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
10921         (ppc_supply_ptrace_register): Likewise.
10922         (the_low_target): Update.
10923
10924         * linux-i386-low.c (the_low_target): Update.
10925         * linux-x86-64-low.c (the_low_target): Update.
10926
10927 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10928
10929         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
10930         reg-s390.o and reg-s390x.o.
10931
10932         * linux-low.c (new_inferior): New global variable.
10933         (linux_create_inferior, linux_attach): Set it.
10934         (linux_wait_for_process): Call the_low_target.arch_setup after the
10935         target has stopped for the first time.
10936         (initialize_low): Do not call the_low_target.arch_setup.
10937
10938         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
10939         (s390_set_pc): Likewise.
10940         (s390_arch_setup): New function.
10941         (the_low_target): Use s390_arch_setup as arch_setup routine.
10942
10943         * regcache.c (realloc_register_cache): New function.
10944         (set_register_cache): Call it for each existing regcache.
10945
10946 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10947
10948         * server.h (init_registers): Remove prototype.
10949
10950         * linux-low.h (struct linux_target_ops): Add arch_setup field.
10951         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
10952         instead of init_registers ().
10953         * linux-arm-low.c (init_registers_arm): Add prototype.
10954         (init_registers_arm_with_iwmmxt): Likewise.
10955         (the_low_target): Add initializer for arch_setup field.
10956         * linux-cris-low.c (init_registers_cris): Add prototype.
10957         (the_low_target): Add initializer for arch_setup field.
10958         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
10959         (the_low_target): Add initializer for arch_setup field.
10960         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
10961         (the_low_target): Add initializer for arch_setup field.
10962         * linux-ia64-low.c (init_registers_ia64): Add prototype.
10963         (the_low_target): Add initializer for arch_setup field.
10964         * linux-m32r-low.c (init_registers_m32r): Add prototype.
10965         (the_low_target): Add initializer for arch_setup field.
10966         * linux-m68k-low.c (init_registers_m68k): Add prototype.
10967         (the_low_target): Add initializer for arch_setup field.
10968         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
10969         (init_registers_mips64_linux): Likewise.
10970         (the_low_target): Add initializer for arch_setup field.
10971         * linux-ppc-low.c (init_registers_ppc): Add prototype.
10972         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
10973         (the_low_target): Add initializer for arch_setup field.
10974         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
10975         (init_registers_powerpc_64): Likewise.
10976         (the_low_target): Add initializer for arch_setup field.
10977         * linux-s390-low.c (init_registers_s390): Add prototype.
10978         (init_registers_s390x): Likewise.
10979         (the_low_target): Add initializer for arch_setup field.
10980         * linux-sh-low.c (init_registers_sh): Add prototype.
10981         (the_low_target): Add initializer for arch_setup field.
10982         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
10983         (the_low_target): Add initializer for arch_setup field.
10984         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
10985         (the_low_target): Add initializer for arch_setup field.
10986
10987         * win32-low.h (struct win32_target_ops): Add arch_setup field.
10988         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
10989         instead of init_registers ().
10990         * win32-arm-low.c (init_registers_arm): Add prototype.
10991         (the_low_target): Add initializer for arch_setup field.
10992         * win32-i386-low.c (init_registers_i386): Add prototype.
10993         (the_low_target): Add initializer for arch_setup field.
10994
10995         * spu-low.c (init_registers_spu): Add prototype.
10996         (initialize_low): Call initialie_registers_spu () instead of
10997         initialize_registers ().
10998
10999 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
11000
11001         * server.c (handle_v_requests): When handling the vRun and vAttach
11002         packets, if already debugging a process, don't kill it.  Return an
11003         error instead.
11004
11005 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
11006
11007         * server.c (handle_query): Correct length check.
11008
11009 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
11010
11011         * win32-low.c (do_initial_child_stuff): Add process handle
11012         parameter.  Set current_process_handle and current_process_id from the
11013         parameters. Clear globals.
11014         (win32_create_inferior): Don't set current_process_handle and
11015         current_process_id here.  Instead pass them on the call to
11016         do_initial_child_stuff.
11017         (win32_attach): Likewise.
11018         (win32_clear_inferiors): New.
11019         (win32_kill): Don't close the current process handle or the
11020         current thread handle here.  Instead call win32_clear_inferiors.
11021         (win32_detach): Don't open a new handle to the process.  Call
11022         win32_clear_inferiors.
11023         (win32_join): Don't rely on current_process_handle; open a new
11024         handle using the process id.
11025         (win32_wait): Call win32_clear_inferiors when the inferior process
11026         has exited.
11027
11028 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
11029
11030         * server.c (monitor_show_help): Add "exit".
11031
11032 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
11033
11034         * Makefile.in (SFILES): Add linux-xtensa-low.c.
11035         (clean): Add reg-xtensa.c.
11036         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
11037         * configure.srv (xtensa*-*-linux*) New target.
11038         * linux-xtensa-low.c: New.
11039         * xtensa-xtregs.c: New.
11040
11041 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
11042
11043         * hostio.c: Don't include errno.h.
11044         (errno_to_fileio_errno): Move to hostio-errno.
11045         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
11046         error number outputting to the target->hostio_last_error callback.
11047         (hostio_packet_error): Use FILEIO_EINVAL directly.
11048         (handle_open, handle_pread, hostio_error, handle_unlink): Update
11049         calls to hostio_error.
11050         * hostio-errno.c: New.
11051         * server.h (hostio_last_error_from_errno): Declare.
11052         * target.h (target_ops): Add hostio_last_error member.
11053         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
11054         as hostio_last_error handler.
11055         * spu-low.c (spu_target_ops): Likewise.
11056         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
11057         (wince_hostio_last_error): New functions.
11058         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
11059         as hostio_last_error handler.
11060         (win32_target_ops) [!_WIN32_WCE]: Register
11061         hostio_last_error_from_errno as hostio_last_error handler.
11062         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
11063         (hostio-errno.o): New rule.
11064         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
11065         * configure.srv (srv_hostio_err_objs): New variable.  Default to
11066         hostio-errno.o.
11067         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
11068         * configure: Regenerate.
11069
11070 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11071
11072         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
11073         (linux_kill, linux_detach): Clean up the process list.
11074         * remote-utils.c (remote_open): Improve port number parsing.
11075         (putpkt_binary, input_interrupt): Only send interrupts if the target
11076         is running.
11077         * server.c (extended_protocol): Make static.
11078         (attached): Define earlier.
11079         (exit_requested, response_needed, program_argv): New variables.
11080         (target_running): New.
11081         (start_inferior): Clear attached here.
11082         (attach_inferior): Set attached here.
11083         (require_running): Define.
11084         (handle_query): Use require_running and target_running.  Implement
11085         "monitor exit".
11086         (handle_v_attach, handle_v_run): New.
11087         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
11088         (gdbserver_usage): Update.
11089         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
11090         --attach along with other options or after the port.  Save
11091         program_argv.  Support no initial program.  Resynchronize
11092         communication with GDB after an error.  Handle "monitor exit".
11093         Use require_running and target_running.  Always allow the extended
11094         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
11095         restart in extended mode.
11096         * README: Refer to the GDB manual.  Update --attach usage.
11097
11098 2007-12-20  Andreas Schwab  <schwab@suse.de>
11099
11100         * linux-low.c (STACK_SIZE): Define.
11101         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
11102         (linux_test_for_tracefork): Likewise.
11103
11104 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
11105
11106         * linux-low.c (linux_wait_for_event): Update messages.  Do not
11107         reinsert auto-delete breakpoints.
11108         * mem-break.c (struct breakpoint): Change return type of handler to
11109         int.
11110         (set_breakpoint_at): Update handler type.
11111         (reinsert_breakpoint_handler): Return 1 instead of calling
11112         delete_breakpoint.
11113         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
11114         setting a new one.
11115         (check_breakpoints): Delete auto-delete breakpoints and return 2.
11116         * mem-break.h (set_breakpoint_at): Update handler type.
11117         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
11118         * win32-low.c (auto_delete_breakpoint): New.
11119         (get_child_debug_event): Use it.
11120
11121 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
11122
11123         * configure.ac: Check for pread and pwrite.
11124         * hostio.c (handle_pread): Fall back to lseek and read.
11125         (handle_pwrite): Fall back to lseek and write.
11126         * config.in, configure: Regenerated.
11127
11128 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
11129
11130         * server.c (myresume): Add own_buf argument.
11131         (main): Update calls.
11132
11133 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
11134
11135         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
11136         * remote-utils.c (remote_open): Do not call disable_async_io.
11137         (block_async_io): Delete.
11138         (unblock_async_io): Make static.
11139         (initialize_async_io): New.
11140         * server.c (handle_v_cont): Handle async I/O here.
11141         (myresume): Likewise.  Move other common resume tasks here...
11142         (main): ... from here.  Call initialize_async_io.  Disable async
11143         I/O before the main loop.
11144         * server.h (initialize_async_io): Declare.
11145         (block_async_io, unblock_async_io): Delete prototypes.
11146         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
11147
11148 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
11149
11150         * remote-utils.c (readchar): Allow binary data in received messages.
11151
11152 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11153
11154         * win32-low.c (attaching): New global.
11155         (win32_create_inferior): Clear the `attaching' global.
11156         (win32_attach): Set the `attaching' global.
11157         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11158         attaching.  Only set a breakpoint at the entry point if not
11159         attaching.
11160
11161 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11162
11163         * server.c (main): Don't report dll events on the initial
11164         connection on attaches.
11165
11166 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11167
11168         * server.c (main): Relax numerical bases supported for the pid of
11169         the --attach command line argument.
11170
11171 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11172
11173         * win32-low.c (win32_attach): Call OpenProcess before
11174         DebugActiveProcess, not after.  Add last error output to error
11175         call.
11176
11177 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11178
11179         * win32-low.c (win32_get_thread_context)
11180         (win32_set_thread_context): New functions.
11181         (thread_rec): Use win32_get_thread_context.
11182         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11183         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11184         field.
11185
11186 2007-12-03  Leo Zayas
11187             Pedro Alves  <pedro_alves@portugalmail.pt>
11188
11189         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11190         global variables.
11191         (child_add_thread): Minor cleanup.
11192         (child_continue): Resume artificially suspended threads before
11193         calling ContinueDebugEvent.
11194         (suspend_one_thread): New.
11195         (fake_breakpoint_event): New.
11196         (get_child_debug_event): Change return type to int.  Check here if
11197         gdb sent an interrupt request.  If a soft interrupt was requested,
11198         fake a breakpoint event.  Return 0 if there is no event to handle,
11199         and 1 otherwise.
11200         (win32_wait): Don't check here if gdb sent an interrupt request.
11201         Ensure there is a valid event to handle.
11202         (win32_request_interrupt): Add soft interruption method as last
11203         resort.
11204
11205 2007-12-03  Leo Zayas
11206             Pedro Alves  <pedro_alves@portugalmail.pt>
11207
11208         * win32-low.h (win32_thread_info): Add descriptions to the
11209         structure members.  Replace `suspend_count' counter by a
11210         `suspended' flag.
11211         * win32-low.c (thread_rec): Update condition of when to get the
11212         context from the inferior.  Rely on ContextFlags being set if it
11213         has already been retrieved.  Only suspend the inferior thread if
11214         we haven't already.  Warn if that fails.
11215         (continue_one_thread): s/suspend_count/suspended/.  Only call
11216         ResumeThread once.  Warn if that fails.
11217
11218 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11219
11220         * win32-low.c (win32_wait): Don't read from the inferior when it
11221         has already exited.
11222
11223 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11224
11225         * Makefile.in (win32_low_h): New variable.
11226         (win32-low.o): Add dependency on $(win32_low_h).
11227         (win32-arm-low.o, win32-i386-low.o): New rules.
11228
11229 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11230
11231         * hostio.c: Correct copyright year.
11232
11233 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11234
11235         * Makefile.in (OBS): Add hostio.o.
11236         (hostio.o): New rule.
11237         * server.h (handle_vFile): Declare.
11238         * hostio.c: New file.
11239         * server.c (handle_v_requests): Take packet_len and new_packet_len
11240         for binary packets.  Call handle_vFile.
11241         (main): Update call to handle_v_requests.
11242
11243 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11244
11245         * linux-low.c: Include <sched.h>.
11246
11247 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11248
11249         * linux-low.c (linux_tracefork_grandchild): New.
11250         (linux_tracefork_child): Use clone.
11251         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11252
11253 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11254
11255         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11256
11257 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11258
11259         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11260
11261 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11262
11263         * inferiors.c (change_inferior_id): Delete.
11264         (add_pid_to_list, pull_pid_from_list): New.
11265         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11266         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11267         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11268         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11269         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11270         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11271         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11272         (using_threads): Always set to 1.
11273         (handle_extended_wait): New.
11274         (add_process): Do not set TID.
11275         (linux_create_inferior): Set must_set_ptrace_flags.
11276         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11277         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11278         (linux_thread_alive): Rename TID argument to LWPID.
11279         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11280         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11281         call to dead_thread_notify.  Call handle_extended_wait.
11282         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11283         (send_sigstop): Delete sigstop_sent.
11284         (wait_for_sigstop): Avoid TID.
11285         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11286         (linux_test_for_tracefork): New.
11287         (linux_lookup_signals): Use thread_db_active and
11288         linux_supports_tracefork_flag.
11289         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11290         * linux-low.h (get_process_thread): Avoid TID.
11291         (struct process_ifo): Move thread_known and tid to the end.  Remove
11292         sigstop_sent.
11293         (linux_attach_lwp, thread_db_init): Update prototypes.
11294         * server.h (change_inferior_id): Delete prototype.
11295         (add_pid_to_list, pull_pid_from_list): New prototypes.
11296         * thread-db.c (thread_db_use_events): New.
11297         (find_first_thread): Rename to...
11298         (find_one_thread): ...this.  Update callers and messages.  Do not
11299         call fatal.  Check thread_db_use_events.  Do not call
11300         change_inferior_id or new_thread_notify.
11301         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11302         (thread_db_init): Set thread_db_use_events.  Check use_events.
11303         * utils.c (fatal, warning): Correct message prefix.
11304
11305 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11306
11307         * Makefile.in (clean): Remove new files.
11308         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11309         (powerpc-64.o, powerpc-64.c): New rules.
11310         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11311         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11312         with SPE.
11313         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11314         SPE targets.
11315         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11316         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11317         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11318         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11319         (target_regsets): Add AltiVec and SPE register sets.
11320         * configure.ac: Check for AltiVec and SPE.
11321         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11322         (ppc_fill_vrregset, ppc_store_vrregset): New.
11323         (target_regsets): Add AltiVec register set.
11324         * configure: Regenerated.
11325
11326 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11327
11328         * linux-low.c (O_LARGEFILE): Define.
11329         (linux_read_memory): Use /proc/PID/mem.
11330         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11331         * configure, config.in: Regenerated.
11332
11333 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11334
11335         * linux-low.c (linux_wait_for_event): Do not pass signals while
11336         single-stepping.
11337
11338 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11339
11340         * win32-low.c (create_process): New.
11341         (win32_create_inferior): Use create_process instead of
11342         CreateProcess.  If create_process failed retry appending an ".exe"
11343         suffix.  Store the GetLastError result immediatelly after
11344         create_process calls and use it on the call to error.
11345
11346 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11347
11348         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11349
11350 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11351
11352         * configure.ac: Switch license to GPLv3.
11353
11354 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11355
11356         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11357
11358 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11359
11360         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11361         typedef.
11362         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11363         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11364         CloseToolhelp32Snapshot.
11365         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11366         CloseToolhelp32Snapshot.
11367
11368 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11369
11370         * server.c (main): Check for inferior exit before main loop.
11371
11372 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11373
11374         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11375         instead of on tmp_desc.
11376
11377 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11378             Daniel Jacobowitz  <dan@codesourcery.com>
11379
11380         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11381         (add_thread): Minor cleanups.
11382         (clear_inferiors): Move lower in the file.  Clear the DLL
11383         list.
11384         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11385         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11386         (xml_escape_text): New.
11387         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11388         for qSupported.
11389         (handle_v_cont): Report errors.
11390         (gdbserver_version): Update.
11391         (main): Correct size of own_buf.  Do not report initial DLL events.
11392         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11393         (unloaded_dll, xml_escape_text): New.
11394         * win32-low.c (enum target_waitkind): Update comments.
11395         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11396         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11397         (win32_EnumProcessModules, win32_GetModuleInformation)
11398         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11399         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11400         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11401         (win32_Module32First, win32_Module32Next, load_toolhelp)
11402         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11403         (get_child_debug_event): Handle DLL events.
11404         (win32_wait): Likewise.
11405
11406 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11407
11408         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11409         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11410
11411 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11412
11413         * win32-low.c (handle_output_debug_string): Ignore event if not
11414         waiting.
11415
11416 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11417
11418         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11419
11420 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11421
11422         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11423
11424 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11425
11426         * inferiors.c (change_inferior_id): Add comment.
11427         * linux-low.c (check_removed_breakpoint): Add an early
11428         prototype.  Improve debug output.
11429         (linux_attach): Doc update.
11430         (linux_detach_one_process, linux_detach): Clean up before releasing
11431         each process.
11432         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11433         * linux-low.h (struct process_info): Doc improvement.
11434         * mem-break.c (delete_all_breakpoints): New.
11435         * mem-break.h (delete_all_breakpoints): New prototype.
11436         * thread-db.c (find_first_thread): New.
11437         (thread_db_create_event): Call it instead of
11438         thread_db_find_new_threads.  Clean up unused variables.
11439         (maybe_attach_thread): Remove first thread handling.
11440         (thread_db_find_new_threads): Use find_first_thread.
11441         (thread_db_get_tls_address): Likewise.
11442
11443 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11444
11445         * thread-db.c (thread_db_find_new_threads): Add prototype.
11446         (thread_db_create_event): Check for the main thread before adding
11447         a new thread.
11448         (maybe_attach_thread): Only enable event reporting if TID == 0.
11449         (thread_db_get_tls_address): Check for new threads.
11450
11451 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11452
11453         * linux-low.c (linux_create_inferior): Try execv before execvp.
11454         * spu-low.c (spu_create_inferior): Likewise.
11455
11456 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11457
11458         * linux-low.c (linux_create_inferior): Change execv to execvp.
11459         * spu-low.c (spu_create_inferior): Likewies.
11460
11461 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11462
11463         * Makefile.in (clean): Clean new files instead of deleted ones.
11464         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11465         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11466         rules.
11467         * configure.srv: Specify XML files and new regformats for MIPS and
11468         MIPS64 GNU/Linux.
11469         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11470         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11471         an entry for the restart register.
11472         (mips_cannot_fetch_register, mips_cannot_store_register)
11473         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11474         register names to match the XML descriptions.
11475         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11476         restart register instead of $0.
11477
11478 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11479             Markus Deuling  <deuling@de.ibm.com>
11480
11481         * remote-utils.c (decode_xfer_write): New function.
11482         * server.h (decode_xfer_write): Add prototype.
11483         * server.c (handle_query): Add PACKET_LEN argument.  Support
11484         qXfer:spu:read and qXfer:spu:write packets.
11485         (main): Pass packet_len to handle_query.
11486         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11487         * target.h (target_ops): Add qxfer_spu.
11488
11489 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11490
11491         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11492         accessing non-seekable spufs files.
11493
11494 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11495
11496         * server.c (handle_query): Add reply for qC packet.
11497
11498 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11499             Leo Zayas  <lerele@champenstudios@com>
11500
11501         * server.h (check_remote_input_interrupt_request): New function.
11502         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11503         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11504         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11505         (check_remote_input_interrupt_request): New function.
11506         * server.h (check_remote_input_interrupt_request): Declare.
11507         * win32-low.c (winapi_DebugBreakProcess,
11508         winapi_GenerateConsoleCtrlEvent): New typedefs.
11509         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11510         to 250 ms.
11511         (win32_wait): Check for remote interrupt request
11512         with check_remote_input_interrupt_request.
11513         (win32_request_interrupt): New function.
11514         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11515
11516 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11517
11518         * win32-low.c (debug_registers_changed,
11519         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11520         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11521         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11522         (thread_rec): Get context using the low target.
11523         (child_add_thread): Call thread_added on the low target,
11524         which does the same thing.
11525         (regptr): Delete.
11526         (do_initial_child_stuff): Remove debug registers references.
11527         Set context using the low target.  Resume threads after
11528         setting the contexts.
11529         (child_continue): Remove dead variable.  Remove debug
11530         registers references.
11531         (child_fetch_inferior_registers): Go through the low target.
11532         (do_child_store_inferior_registers): Remove.
11533         (child_store_inferior_registers): Go through the low target.
11534         (win32_resume): Remove debug registers references.
11535         Set context using the low target.
11536         (handle_exception): Change return type to void.  Don't record
11537         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11538         first chance exception.
11539         (get_child_debug_event): Change return type to void.  Remove
11540         goto loop.  Always return after waiting for debug event.
11541         (win32_wait): Convert to switch statement.  Handle spurious
11542         events.
11543
11544         * win32-i386-low.c (debug_registers_changed,
11545         debug_registers_used): New.
11546         (initial_stuff): Rename to ...
11547         (i386_initial_stuff): ... this.  Clear debug registers
11548         state variables.
11549         (store_debug_registers): Delete.
11550         (i386_get_thread_context): New.
11551         (load_debug_registers): Delete.
11552         (i386_set_thread_context): New.
11553         (i386_thread_added): New.
11554         (single_step): Rename to ...
11555         (i386_single_step): ... this.
11556         (do_fetch_inferior_registers): Rename to ...
11557         (i386_fetch_inferior_register): ... this.
11558         (i386_store_inferior_register): New.
11559         (the_low_target): Adapt to new interface.
11560
11561         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11562         (arm_get_thread_context): New.
11563         (arm_set_thread_context): New.
11564         (regptr): New.
11565         (do_fetch_inferior_registers): Rename to ...
11566         (arm_fetch_inferior_register): ... this.
11567         (arm_store_inferior_register): New.
11568         (arm_wince_breakpoint): Reimplement as unsigned long.
11569         (arm_wince_breakpoint_len): Define.
11570         (the_low_target): Adapt to new interface.
11571
11572         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11573         load_debug_registers.  Add get_thread_context, set_thread_context,
11574         thread_added and store_inferior_register.  Rename
11575         fetch_inferior_registers to fetch_inferior_register.
11576         (regptr): Remove declaration.
11577
11578 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11579
11580         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11581         * spu-low.c (spu_detach): Likewise.
11582
11583 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11584
11585         * target.h (target_ops): Change return type of detach to int.
11586         Add join.
11587         (join_inferior): New.
11588         * server.c (main): Don't skip detach support on mingw32.
11589         If the inferior doesn't support detaching return error.
11590         Call join_inferior instead of using waitpid.
11591         * linux-low.c (linux_join): New.
11592         (linux_target_op): Add linux_join.
11593         * spu-low.c (spu_join): New.
11594         (spu_target_ops): Add spu_join.
11595         * win32-low.c (win32_detach): Adapt to new interface.
11596         Reopen current_process_handle before detaching.  Issue a child
11597         resume before detaching.
11598         (win32_join): New.
11599         (win32_target_op): Add win32_join.
11600
11601 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11602
11603         * win32-low.c (win32-attach): Fix return value.
11604         * target.h (target_ops): Describe ATTACH return values.
11605
11606 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11607
11608         * win32-low.c (GETPROCADDRESS): Define.
11609         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11610         (winapi_DebugSetProcessKillOnExit): Likewise.
11611         (win32_create_inferior): Force usage of ansi CreateProcessA.
11612         (win32_attach): Use GETPROCADDRESS.
11613         (win32_detach): Likewise.
11614
11615 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11616
11617         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11618
11619 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11620
11621         * win32-low.c: Commit leftover changes from 2007-03-29.
11622
11623 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11624
11625         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11626         fields short instead of int.  Add explicit padding.
11627         (i387_cache_to_fsave): Remove unnecessary casts.
11628         (i387_fsave_to_cache): Doc fix.
11629         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11630
11631 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11632
11633         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
11634         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
11635
11636 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11637
11638         * configure.srv (arm*-*-mingw32ce*): Move near the other
11639         arm targets.
11640
11641 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11642
11643         * configure.ac: Add errno checking.
11644         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
11645         sys/file.h and malloc.h.
11646         (AC_CHECK_DECLS): Add perror.
11647         (srv_mingwce): Handle.
11648         * configure.srv (i[34567]86-*-cygwin*): Add
11649         win32-i386-low.o to srv_tgtobj.
11650         (i[34567]86-*-mingw*): Likewise.
11651         (arm*-*-mingw32ce*): Add case.
11652         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11653         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
11654         [__MINGW32CE__] (strerror): New function.
11655         [__MINGW32CE__] (errno): Define to GetLastError.
11656         [__MINGW32CE__] (COUNTOF): New macro.
11657         (remote_open): Remove extra close call.
11658         * mem-break.c (delete_breakpoint_at): New function.
11659         * mem-break.h (delete_breakpoint_at): Declare.
11660         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11661         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
11662         [USE_WIN32API] (read, write): Add char* casts.
11663         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
11664         * server.h: Include wincecompat.h on Windows CE.
11665         [HAVE_ERRNO_H]: Check.
11666         (perror): Declare if not declared.
11667         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
11668         (perror_with_name): Remove errno declaration.
11669         * wincecompat.h: New.
11670         * wincecompat.c: New.
11671         * win32-low.h: New.
11672         * win32-arm-low.c: New.
11673         * win32-i386-low.c: New.
11674         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
11675         (OUTMSG2): Make it safe.
11676         (_T): New macro.
11677         (COUNTOF): New macro.
11678         (NUM_REGS): Get it from the low target.
11679         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
11680         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
11681         (thread_rec): Let low target handle debug registers.
11682         (child_add_thread): Likewise.
11683         (child_init_thread_list): Likewise.
11684         (continue_one_thread): Likewise.
11685         (regptr): New.
11686         (do_child_fetch_inferior_registers): Move to ...
11687         * win32-i386-low.c: ... here, and rename to ...
11688         (do_fetch_inferior_registers): ... this.
11689         * win32-low.c (child_fetch_inferior_registers):
11690         Go through the low target.
11691         (do_child_store_inferior_registers): Use regptr.
11692         (strwinerror): New function.
11693         (win32_create_inferior): Handle Windows CE.
11694         Use strwinerror instead of strerror on Windows error
11695         codes.  Add program to the error output.
11696         Don't close the main thread handle on Windows CE.
11697         (win32_attach): Use coredll.dll on Windows CE.
11698         (win32_kill): Close current process and current
11699         thread handles.
11700         (win32_detach): Use coredll.dll on Windows CE.
11701         (win32_resume): Let low target handle debug registers, and
11702         step request.
11703         (handle_exception): Add/Remove initial breakpoint.  Avoid
11704         non-existant WSTOPSIG on Windows CE.
11705         (win32_read_inferior_memory): Cast to remove warning.
11706         (win32_arch_string): Go through the low target.
11707         (initialize_low): Call set_breakpoint_data with the low
11708         target's breakpoint.
11709         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
11710         FOP_REGNUM, mappings): Move to ...
11711         * win32-i386-low.c: ... here.
11712         * win32-low.c (win32_thread_info): Move to ...
11713         * win32-low.h: ... here.
11714         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
11715         win32-arm-low.c and wincecompat.c.
11716         (all:): Add $EXEEXT.
11717         (install-only:): Likewise.
11718         (gdbserver:): Likewise.
11719         (gdbreplay:): Likewise.
11720         * config.in: Regenerate.
11721         * configure: Regenerate.
11722
11723 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11724
11725         * win32-low.c: Rename typedef thread_info to
11726         win32_thread_info throughout.
11727
11728 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11729
11730         * win32-i386-low.c: Rename to ...
11731         * win32-low.c: ... this.
11732         * configure.srv: Replace win32-i386-low.o with win32-low.o.
11733         * Makefile.in: Likewise.
11734
11735 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
11736
11737         * remote-utils.c (monitor_output): Constify msg parameter.
11738         * server.h (monitor_output): Likewise.
11739         * win32-i386-low.c (handle_output_debug_string): New.
11740         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
11741         handle_output_debug_string.
11742         (get_child_debug_event): Likewise.
11743
11744 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
11745
11746         * server.c (main): Correct strtoul check.
11747
11748 2007-03-27  Jon Ringle  <jon@ringle.org>
11749
11750         * linux-low.c: Check __ARCH_HAS_MMU__ also.
11751
11752 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
11753
11754         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
11755
11756 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
11757
11758         * terminal.h: Check HAVE_SGTTY_H.
11759
11760 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
11761
11762         * remote-utils.c (remote_open): Print out the assigned port number.
11763
11764 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
11765
11766         * remote-utils.c (monitor_output): New function.
11767         * server.c (debug_threads): Define here.
11768         (monitor_show_help): New function.
11769         (handle_query): Handle qRcmd.
11770         (main): Do not handle 'd' packet.
11771         * server.h (debug_threads, remote_debug, monitor_output): Declare.
11772         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
11773         of debug_threads.
11774
11775 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11776
11777         * Makefile.in (EXEEXT): New.
11778         (clean): Use $(EXEEXT).
11779
11780 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11781
11782         * target.h (target_ops): Rename send_signal to request_interrupt,
11783         and remove enum target_signal parameter.
11784         * linux-low.c (linux_request_interrupt): Rename from
11785         linux_send_signal, and always send SIGINT.
11786         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
11787         and always send SIGINT.
11788         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
11789         of send_signal.
11790         (input_interrupt): Likewise.
11791
11792 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11793
11794         * server.c (get_features_xml): Check if target implemented
11795         arch_string.
11796         * win32-i386-low.c (win32_arch_string): New.
11797         (win32_target_ops): Add win32_arch_string as arch_string member.
11798
11799 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
11800
11801         * spu-low.c (spu_arch_string): New.
11802         (spu_target_ops): Add spu_arch_string.
11803
11804 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
11805
11806         * remote-utils.c: Remove HAVE_TERMINAL_H check.
11807         * configure.ac: Do not check for terminal.h.
11808         * configure, config.in: Regenerated.
11809
11810 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11811
11812         * Makefile.in (OBS): Add $(XML_BUILTIN).
11813         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
11814         (clean): Update.
11815         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
11816         (arm-with-iwmmxt.c): New.
11817         * config.in, configure: Regenerate.
11818         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
11819         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
11820         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
11821         (arm*-*-linux*): Add iWMMXt and regset support.
11822         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
11823         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
11824         (arm_store_wmmxregset, target_regsets): New.
11825         * server.c (get_features_xml): Take annex argument.  Check builtin
11826         XML documents.
11827         (handle_query): Handle multiple annexes.
11828
11829 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11830
11831         * remote-utils.c [USE_WIN32API] (read, write): Define.
11832         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
11833         write.
11834
11835 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
11836
11837         * linux-i386-low.c (the_low_target): Set arch_string.
11838         * linux-x86-64-low.c (the_low_target): Likewise.
11839         * linux-low.c (linux_arch_string): New.
11840         (linux_target_ops): Add it.
11841         * linux-low.h (struct linux_target_ops): Add arch_string.
11842         * server.c (write_qxfer_response): Use const void * for DATA.
11843         (get_features_xml): New.
11844         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
11845         * target.h (struct target_ops): Add arch_string method.
11846
11847 2007-01-03  Denis Pilat  <denis.pilat@st.com>
11848             Daniel Jacobowitz  <dan@codesourcery.com>
11849
11850         * linux-low.c (linux_kill): Handle being called with no threads.
11851         * win32-i386-low.c (win32_kill): Likewise.
11852         (get_child_debug_event): Clear current_process_handle.
11853
11854 2006-12-30  Denis PILAT  <denis.pilat@st.com>
11855             Daniel Jacobowitz  <dan@codesourcery.com>
11856
11857         * remote-utils.c (remote_open): Check the type of specified
11858         serial port devices before opening them.
11859         * server.c (main): Kill the inferior if an error occurs during
11860         the first remote_open.
11861
11862 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
11863
11864         * README: Update supported targets.
11865
11866 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
11867
11868         * Makefile.in (clean): Remove reg-mips64.c.
11869         (reg-mips64.c, reg-mips64.o): New rules.
11870         * configure.srv: Handle mips64.  Include regset support for mips.
11871         * linux-mips-low.c (union mips_register): New.
11872         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
11873         (mips_breakpoint, mips_breakpoint_at): Use int.
11874         (mips_collect_register, mips_supply_register)
11875         (mips_collect_register_32bit, mips_supply_register_32bit)
11876         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
11877         (mips_store_fpregset, target_regsets): New.
11878         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
11879
11880 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
11881
11882         * configure.srv: Add target "spu*-*-*".
11883         * Makefile.in (clean): Remove reg-spu.c.
11884         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
11885         * spu-low.c: New file.
11886
11887 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11888
11889         * configure.ac: Correct td_thr_tls_get_addr test.
11890         * configure: Regenerated.
11891
11892 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11893
11894         * linux-low.c (linux_wait_for_event): Reformat.  Use the
11895         pass_signals array.
11896         * remote-utils.c (decode_address_to_semicolon): New.
11897         * server.c (pass_signals, handle_general_set): New.
11898         (handle_query): Mention QPassSignals for qSupported.
11899         (main): Call handle_general_set.
11900         * server.h (pass_signals, decode_address_to_semicolon): New.
11901
11902 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
11903
11904         * server.c (handle_query): Correct error handling for read_auxv.
11905
11906 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
11907
11908         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
11909         and srv_linux_thread_db to yes.
11910         * linux-s390-low.c (s390_fill_gregset): New function.
11911         (target_regsets): Define data structure.
11912
11913 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
11914
11915         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
11916         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
11917         * config.in, configure: Regenerated.
11918         * inferiors.c (gdb_id_to_thread): New function.
11919         (gdb_id_to_thread_id): Use it.
11920         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
11921         * linux-low.h (struct process_info): Add th member.
11922         (thread_db_get_tls_address): New prototype.
11923         * remote-utils.c (decode_address): Make non-static.
11924         * server.c (handle_query): Handle qGetTLSAddr.
11925         * server.h (gdb_id_to_thread, decode_address): New prototypes.
11926         * target.h (struct target_ops): Add get_tls_address.
11927         * thread-db.c (maybe_attach_thread): Save the thread handle.
11928         (thread_db_get_tls_address): New.
11929
11930 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
11931
11932         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
11933         (linux_resume_one_process): Take a siginfo_t *.  Update all
11934         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
11935         (struct pending_signals): Add a siginfo_t.
11936         (linux_wait_for_process): Always set last_status.
11937         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
11938         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
11939         * linux-low.h (struct process_info): Add last_status.
11940
11941 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
11942
11943         * remote-utils.c (try_rle): New function.
11944         (putpkt_binary): Use it.
11945
11946 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
11947
11948         * Makefile.in (clean): Clean reg-x86-64-linux.c.
11949         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
11950         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
11951         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
11952         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
11953         point registers.
11954
11955 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
11956
11957         * server.c (terminal_fd): New variable.
11958         (old_foreground_pgrp): Likewise.
11959         (restore_old_foreground_pgrp): New function.
11960         (start_inferior): Record the terminal file descriptor in terminal_fd
11961         and its original foreground group in old_foreground_pgrp.  Register
11962         restore_old_foreground_pgrp with atexit().
11963
11964 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
11965
11966         * server.c (handle_query): Correct qPart to qXfer.
11967
11968 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
11969
11970         * configure.ac: Check for more headers which are missing on
11971         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
11972         * configure.srv: Add Cygwin and mingw32.
11973         * remote-utils.c: Don't include headers unconditionally which
11974         are missing on mingw32.  Include <winsock.h> for mingw32.
11975         (remote_open): Adjust for mingw32 support.  Flush
11976         standard error after writing to it.
11977         (remote_close, putpkt_binary, input_interrupt, block_async_io)
11978         (unblock_async_io, enable_async_io, disable_async_io)
11979         (readchar, getpkt): Update for Winsock support.
11980         (prepare_resume_reply): Expect a protocol signal number.
11981         * server.c: Disable <sys/wait.h> on mingw32.
11982         (start_inferior): Adjust for mingw32 support.  Flush
11983         standard error after writing to it.
11984         (attach_inferior): Likewise.  Use protocol signal
11985         numbers.
11986         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
11987         and names.
11988         * win32-i386-low.c: New file.
11989         * Makefile.in (XM_CLIBS): Set.
11990         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
11991         (win32-i386-low.o): New dependency rule.
11992         * linux-low.c (linux_wait): Use target signal numbers.
11993         * target.h (struct target_ops): Doc fix.
11994         * server.h (target_signal_to_name): New prototype.
11995         * gdbreplay.c: Don't include headers unconditionally which
11996         are missing on mingw32.  Include <winsock.h> for mingw32.
11997         (remote_close, remote_open): Adjust for Winsock support.
11998         * configure, config.in: Regenerated.
11999
12000 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12001
12002         * server.c (decode_xfer_read, write_qxfer_response): New.
12003         (handle_query): Take a packet length argument.  Handle
12004         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
12005         the qSupported response.
12006         (main): Update call to handle_query.
12007
12008 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
12009
12010         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
12011         (putpkt_binary): Renamed from putpkt and adjusted for binary
12012         data.
12013         (putpkt): New wrapper for putpkt_binary.
12014         (readchar): Don't mask off the high bit.
12015         (decode_X_packet): New function.
12016         * server.c (main): Call putpkt_binary if a handler sets the packet
12017         length.  Save the length of the incoming packet.  Handle 'X'.
12018         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
12019
12020 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
12021
12022         * server.c (handle_query): Handle qSupported.
12023
12024 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12025
12026         * remote-utils.c (all_symbols_looked_up): New variable.
12027         (look_up_one_symbol): Check it.
12028         * server.h (look_up_one_symbol): New declaration.
12029         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
12030
12031 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12032
12033         * Makefile.in (linux-arm-low.o): Update dependencies.
12034         * linux-arm-low.c: Include "gdb_proc_service.h".
12035         (PTRACE_GET_THREAD_AREA): Define.
12036         (ps_get_thread_area): New function.
12037
12038 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
12039
12040         * configure.srv (m68k*-*-uclinux*): New target.
12041         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
12042         (linux_resume_one_process): Remove extraneous cast.
12043         (linux_read_offsets): New.
12044         (linux_target_op): Add linux_read_offsets on mmuless systems.
12045         * server.c (handle_query): Add qOffsets logic.
12046         * target.h (struct target_ops): Add read_offsets.
12047
12048 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12049
12050         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
12051         (PTRACE_GET_THREAD_AREA): Define.
12052         (ps_get_thread_area): New function.
12053         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
12054         (linux-x86-64-low.o): Update.
12055
12056 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12057
12058         * configure.ac: Remove checks for prfpregset_t.
12059         * gdb_proc_service.h: New file.
12060         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
12061         new "gdb_proc_service.h".
12062         * proc-service.c: Likewise.
12063         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
12064         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
12065         * Makefile.in (gdb_proc_service_h): Updated.
12066         * configure, config.in: Regenerated.
12067
12068 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12069
12070         * remote-utils.c (prepare_resume_reply): Move declaration
12071         of gdb_id_from_wait to the top of the block.
12072
12073 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
12074
12075         * linux-low.c (regsets_store_inferior_registers): Read the regset
12076         from the target before filling it.
12077
12078 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12079
12080         * server.c (attach_inferior): Return SIGTRAP for a successful
12081         attach.
12082
12083 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
12084
12085         * Makefile.in (OBS): Add version.o.
12086         (STAGESTUFF): Delete.
12087         (version.o): Add dependencies.
12088         (version.c): Replace rule.
12089         (clean): Remove version.c.
12090         * server.c (gdbserver_version): New.
12091         (gdbserver_usage): Use printf.
12092         (main): Handle --version and --help.
12093         * server.h (version, host_name): Add declarations.
12094
12095 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
12096
12097         * linux-arm-low.c:
12098         * linux-arm-low.c:
12099         * inferiors.c:
12100         * i387-fp.h:
12101         * i387-fp.c:
12102         * gdbreplay.c:
12103         * regcache.c:
12104         * proc-service.c:
12105         * mem-break.h:
12106         * mem-break.c:
12107         * linux-x86-64-low.c:
12108         * linux-sh-low.c:
12109         * linux-s390-low.c:
12110         * linux-ppc64-low.c:
12111         * linux-ppc-low.c:
12112         * linux-mips-low.c:
12113         * linux-m68k-low.c:
12114         * linux-m32r-low.c:
12115         * linux-low.h:
12116         * linux-low.c:
12117         * linux-ia64-low.c:
12118         * linux-i386-low.c:
12119         * linux-crisv32-low.c:
12120         * thread-db.c:
12121         * terminal.h:
12122         * target.h:
12123         * target.c:
12124         * server.h:
12125         * server.c:
12126         * remote-utils.c:
12127         * regcache.h:
12128         * utils.c:
12129         * Makefile.in:
12130         * configure.ac:
12131         * gdbserver.1: Add (C) after Copyright.  Update the FSF
12132         address.
12133
12134 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
12135
12136         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
12137         (arm_breakpoint_at): Recognize both breakpoints.
12138         (the_low_target): Use the correct breakpoint instruction.
12139
12140 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
12141
12142         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
12143         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
12144         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
12145         (the_low_target): Update.
12146
12147 2005-10-25  Andreas Schwab  <schwab@suse.de>
12148
12149         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12150
12151         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12152         (ia64_num_regs): Reduce to 462.
12153
12154 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12155
12156         * acinclude.m4: Correct quoting.
12157         * aclocal.m4: Regenerated.
12158
12159         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12160         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12161         (thread_db_init): Call thread_db_err_str.
12162         * configure.ac: Check for TD_VERSION.
12163         * config.in, configure: Regenerated.
12164
12165 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12166
12167         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12168
12169 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12170
12171         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12172         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12173         * config.in, configure: Regenerated.
12174         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12175         * linux-i386-low.c, linux-m68k-low.c: Update to use
12176         HAVE_PTRACE_GETREGS.
12177         * linux-low.c (regsets_fetch_inferior_registers)
12178         (regsets_store_inferior_registers): Only return 0 if we processed
12179         GENERAL_REGS.
12180         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12181         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12182
12183 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12184
12185         * inferiors.c (struct thread_info): Add gdb_id.
12186         (add_thread): Add gdb_id argument.
12187         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12188         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12189         calls to add_thread.
12190         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12191         * server.c (handle_query): Use thread_to_gdb_id.
12192         (handle_v_cont, main): Use gdb_id_to_thread_id.
12193         * server.h (add_thread): Update prototype.
12194         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12195         prototypes.
12196
12197 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12198
12199         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12200         left-padded registers.
12201         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12202         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12203
12204 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12205
12206         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12207         * configure: Regenerate.
12208         * config.in: Regenerate.
12209         * server.h (NEED_DECLARATION_STRERROR):
12210         Replace with !HAVE_DECL_STRERROR.
12211
12212 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12213
12214         * linux-low.c (linux_wait, linux_send_signal): Don't test
12215         an unsigned long variable for > 0 if it could be MAX_ULONG.
12216         * server.c (myresume): Likewise.
12217         * target.c (set_desired_inferior): Likewise.
12218
12219 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12220
12221         * configure.ac: Simplify and improve check for socklen_t.
12222         * configure, config.in: Regenerate.
12223
12224 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12225
12226         * acconfig.h: Remove.
12227         * configure.ac: Add a test for socklen_t.  Use three-argument
12228         AC_DEFINE throughout.
12229         * config.in: Regenerated using autoheader 2.59.
12230         * configure: Regenerated.
12231
12232         * gdbreplay.c (socklen_t): Provide a default.
12233         (remote_open): Use socklen_t.
12234         * remote-utils.c (socklen_t): Provide a default.
12235         (remote_open): Use socklen_t.
12236         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12237         unsigned char.
12238
12239         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12240         char for buffers.
12241         * linux-low.c (linux_read_memory, linux_write_memory)
12242         (linux_read_auxv): Likewise.
12243         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12244         (check_mem_write): Likewise.
12245         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12246         Likewise.
12247         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12248         (registers_from_string, register_data): Likewise.
12249         * server.c (handle_query, main): Likewise.
12250         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12251         (decode_M_packet): Likewise.
12252         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12253         * target.h (struct target_ops): Update read_memory, write_memory,
12254         and read_auxv.
12255         (read_inferior_memory, write_inferior_memory): Update.
12256         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12257         to unsigned char *.
12258         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12259         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12260         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12261         linux-s390-low.c, linux-sh-low.c: Update for changes in
12262         read_inferior_memory and the_low_target->breakpoint.
12263
12264 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12265
12266         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12267         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12268         * configure.srv: Add powerpc64-*-linux*.
12269         * linux-ppc64-low.c: New file.
12270
12271 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12272
12273         * linux-cris-low.c: New file with support for CRIS.
12274         * linux-crisv32-low.c: Ditto for CRISv32.
12275         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12276         (clean): Add reg-cris.c and reg-crisv32.c.
12277         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12278         reg-crisv32.o, and reg-crisv32.c to make rules.
12279         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12280         recognized targets.
12281
12282 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12283
12284         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12285         of sizeof (PTRACE_XFER_TYPE).
12286         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12287
12288 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12289
12290         * target.h (struct target_ops): Add insert_watchpoint,
12291         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12292         pointers for hardware watchpoint support.
12293         * linux-low.h (struct linux_target_ops): Ditto.
12294         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12295         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12296         to linux_target_ops.
12297         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12298         reply packet.
12299         * server.c (main): Recognize 'Z' and 'z' packets.
12300
12301 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12302
12303         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12304         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12305         (the_low_target): Add new members.
12306
12307 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12308
12309         * proc-service.c (ps_lgetregs): Search all_processes instead of
12310         all_threads.
12311
12312 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12313
12314         * server.c (start_inferior): Change return type to int.
12315         (attach_inferior): Change sigptr to int *.
12316         (handle_v_cont, handle_v_requests): Change signal to int *.
12317         (main): Change signal to int.
12318
12319 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12320
12321         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12322         * configure.srv: Add m32r*-*-linux*.
12323         * linux-m32r-low.c: New file.
12324
12325 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12326
12327         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12328
12329 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12330
12331         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12332         Take unsigned long arguments for PIDs.
12333         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12334         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12335         (wait_for_sigstop, linux_resume_one_process)
12336         (regsets_fetch_inferior_registers, linux_send_signal)
12337         (linux_read_auxv): Likewise.  Update the types of variables holding
12338         PIDs.  Update format string specifiers.
12339         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12340         * remote-utils.c (prepare_resume_reply): Likewise.
12341         * server.c (cont_thread, general_thread, step_thread)
12342         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12343         unsigned long.
12344         (handle_query): Update format specifiers.
12345         (handle_v_cont, main): Use strtoul for thread IDs.
12346         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12347         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12348         (general_thread, step_thread, thread_from_wait)
12349         (old_thread_from_wait): Update.
12350         * target.h (struct thread_resume): Use unsigned long for THREAD.
12351         (struct target_ops): Use unsigned long for arguments to attach and
12352         thread_alive.
12353
12354 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12355
12356         * acinclude.m4: Include bfd/bfd.m4 directly.
12357         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12358         <agriffis@toolchain.org>.
12359         * aclocal.m4, configure: Regenerated.
12360
12361 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12362
12363         * configure.ac: Rename configure.in, require autoconf 2.59.
12364         * configure: Re-generate.
12365
12366 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12367
12368         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12369         LIBS when finished.
12370         * aclocal.m4: Regenerated.
12371         * configure: Regenerated.
12372
12373 2004-11-21  Andreas Schwab  <schwab@suse.de>
12374
12375         * linux-m68k-low.c (m68k_num_gregs): Define.
12376         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12377         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12378         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12379         (m68k_breakpoint_at): New.  Add to the_low_target.
12380
12381         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12382         srv_linux_thread_db to yes.
12383
12384 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12385
12386         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12387         (ARCH_SET_FS): Likewise.
12388         (ARCH_GET_FS): Likewise.
12389         (ARCH_GET_GS): Likewise.
12390
12391 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12392
12393         * linux-i386-low.c (ps_get_thread_area): New.
12394         * linux-x86-64-low.c (ps_get_thread_area): New.
12395         * linux-low.c: Include <sys/syscall.h>.
12396         (linux_kill_one_process): Don't kill the first thread here.
12397         (linux_kill): Kill the first thread here.
12398         (kill_lwp): New function.
12399         (send_sigstop, linux_send_signal): Use it.
12400         * proc-service.c: Clean up #ifdefs.
12401         (fpregset_info): Delete.
12402         (ps_lgetregs): Update and enable implementation.
12403         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12404         implementations.
12405         * remote-utils.c (struct sym_cache, symbol_cache): New.
12406         (input_interrupt): Print a clearer message.
12407         (async_io_enabled): New variable.
12408         (enable_async_io, disable_async_io): Use it.  Update comments.
12409         (look_up_one_symbol): Use the symbol cache.
12410         * thread-db.c (thread_db_look_up_symbols): New function.
12411         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12412
12413 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12414
12415         * configure.in: Test for -rdynamic.
12416         * configure: Regenerated.
12417         * Makefile (INTERNAL_LDFLAGS): New.
12418         (gdbserver, gdbreplay): Use it.
12419
12420 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12421
12422         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12423
12424 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12425
12426         * linux-low.c (linux_wait): Clear all_processes list also.
12427
12428 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12429
12430         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12431         errno.
12432
12433 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12434
12435         * gdbreplay.c, server.h, utils.c: Update copyright years.
12436
12437 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12438
12439         * server.c (main): Print child status or termination signal from
12440         variable 'signal', not 'sig'.
12441
12442 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12443
12444         * linux-low.c (linux_read_memory): Change return type to
12445         int.  Check for and return error from ptrace().
12446         * target.c (read_inferior_memory): Change return type to int.  Pass
12447         back return status from the_target->read_memory().
12448         * target.h (struct target_ops): Adapt *read_memory() prototype.
12449         Update comment.
12450         (read_inferior_memory): Adapt prototype.
12451         * server.c (main): Return an error packet if
12452         read_inferior_memory() returns an error.
12453
12454 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12455
12456         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12457         Unify with other clean targets.
12458
12459 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12460
12461         * server.c (handle_v_cont): Call set_desired_inferior.
12462
12463 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12464
12465         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12466
12467 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12468
12469         * linux-low.c (linux_wait): Unblock async I/O.
12470         (linux_resume): Block and enable async I/O.
12471         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12472         * server.h (block_async_io, unblock_async_io): Add prototypes.
12473
12474 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12475
12476         * remote-utils.c (remote_open): Print a status notice after
12477         opening a TCP port.
12478         * server.c (attach_inferior): Print a status notice after
12479         attaching.
12480
12481 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12482
12483         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12484
12485 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12486
12487         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12488         error packet.
12489         * server.c, target.h: Update copyright years.
12490
12491 2004-02-25  Roland McGrath  <roland@redhat.com>
12492
12493         * target.h (struct target_ops): New member `read_auxv'.
12494         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12495         * linux-low.c (linux_read_auxv): New function.
12496         (linux_target_ops): Initialize `read_auxv' member to that.
12497
12498 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12499
12500         Committed by Jim Blandy  <jimb@redhat.com>.
12501
12502         * linux-s390-low.c (s390_num_regs): Update.
12503         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12504         instead of GPR_SIZE to distiguish s390 and s390x targets.
12505
12506 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12507
12508         * linux-low.c: Update copyright year.
12509         (check_removed_breakpoint): Clear pending_is_breakpoint.
12510         (linux_set_resume_request, linux_queue_one_thread)
12511         (resume_status_pending_p): New functions.
12512         (linux_continue_one_thread): Use process->resume.
12513         (linux_resume): Only resume threads if there are no pending events.
12514         * linux-low.h (struct process_info): Add resume request
12515         pointer.
12516
12517 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12518
12519         * regcache.c (new_register_cache): Clear the allocated register
12520         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12521
12522 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12523
12524         * linux-low.c (linux_resume): Take a struct thread_resume *
12525         argument.
12526         (linux_wait): Update call.
12527         (resume_ptr): New static variable.
12528         (linux_continue_one_thread): Renamed from
12529         linux_continue_one_process.  Use resume_ptr.
12530         (linux_resume): Use linux_continue_one_thread.
12531         * server.c (handle_v_cont, handle_v_requests): New functions.
12532         (myresume): New function.
12533         (main): Handle 'v' case.
12534         * target.h (struct thread_resume): New type.
12535         (struct target_ops): Change argument of "resume" to struct
12536         thread_resume *.
12537         (myresume): Delete macro.
12538
12539 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12540
12541         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12542         (uninstall): Support DESTDIR.
12543
12544 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12545
12546         * configure.srv: Add xscale*linux copy of arm*linux entry.
12547
12548 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12549
12550         * linux-arm-low.c (arm_reinsert_addr): New function.
12551         (the_low_target): Add arm_reinsert_addr.
12552
12553 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12554
12555         * mem-break.c: Remove whitespace at end of file.
12556
12557 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12558
12559         * configure.in: Check whether we need to prototype strerror.
12560         * server.h: Optionally prototype strerror.
12561         * gdbreplay.c (perror_with_name): Use strerror.
12562         * linux-low.c (linux_attach_lwp): Use strerror.
12563         * utils.c (perror_with_name): Use strerror.
12564         * config.in, configure: Regenerated.
12565
12566 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12567
12568         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12569         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12570
12571 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12572
12573         * Makefile.in (SFILES): Update.
12574         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12575         low-sun3.c: Remove files.
12576
12577 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12578
12579         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12580         (linux_detach_one_process, linux_detach): New functions.
12581         (linux_target_ops): Add linux_detach.
12582         * server.c (main): Handle 'D' packet.
12583         * target.h (struct target_ops): Add "detach" member.
12584         (detach_inferior): Define.
12585
12586 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12587
12588         From Kelley Cook  <kelleycook@wideopenwest.com>:
12589         * configure.srv: Accept i[34567]86 variants.
12590
12591 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12592
12593         * linux-low.c (linux_wait_for_event): Correct comment typos.
12594         (linux_resume_one_process): Call check_removed_breakpoint.
12595         (linux_send_signal): New function.
12596         (linux_target_ops): Add linux_send_signal.
12597         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12598         of kill.
12599         * target.h (struct target_ops): Add send_signal.
12600
12601 2003-05-29  Jim Blandy  <jimb@redhat.com>
12602
12603         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12604         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12605         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12606         away part of the register's value.
12607
12608 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12609
12610         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12611         (linux_wait_for_event, linux_init_signals): Likewise.
12612
12613 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12614
12615         * configure.in: Check for stdlib.h.
12616         * configure: Regenerated.
12617         * config.in: Regenerated.
12618
12619 2003-01-04  Andreas Schwab  <schwab@suse.de>
12620
12621         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12622
12623 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12624
12625         * Makefile.in: Remove obsolete code.
12626
12627 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12628
12629         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12630         defined(PT_FPR0_HI).
12631
12632 2002-11-17  Stuart Hughes  <seh@zee2.com>
12633
12634         * linux-arm-low.c (arm_num_regs): Increase.
12635         (arm_regmap): Include status register.
12636
12637 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
12638
12639         * linux-low.c (register_addr): Remove incorrect -1 check.
12640
12641 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
12642
12643         * linux-low.c (linux_create_inferior): Call setpgid.  Return
12644         the new PID.
12645         (unstopped_p, linux_signal_pid): Remove.
12646         (linux_target_ops): Remove linux_signal_pid.
12647         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
12648         global instead of target method.
12649         * target.h (struct target_ops): Remove signal_pid.  Update comment
12650         for create_inferior.
12651         * server.c (signal_pid): New variable.
12652         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
12653         gdbserver.  Set the child to be the foreground process group.
12654         (attach_inferior): Set signal_pid.
12655
12656 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
12657
12658         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
12659
12660 2002-08-20  Jim Blandy  <jimb@redhat.com>
12661
12662         * Makefile.in (LDFLAGS): Allow the configure script to establish a
12663         default for this.
12664
12665 2002-08-01  Andrew Cagney  <cagney@redhat.com>
12666
12667         * Makefile.in: Make chill references obsolete.
12668
12669 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
12670
12671         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
12672         * configure: Regenerate.
12673         * config.in: Regenerate.
12674
12675 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
12676
12677         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
12678         (perror_with_name, remote_close, remote_open, expect, play): Static.
12679
12680 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
12681
12682         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
12683         byte offsets instead of an array of indexes.
12684         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
12685
12686 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
12687
12688         * regcache.c: Add comment.
12689
12690 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
12691
12692         * thread-db.c: New file.
12693         * proc-service.c: New file.
12694         * acinclude.m4: New file.
12695         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
12696         proc-service.o, and thread-db.o.
12697         (linux-low.o): Add USE_THREAD_DB.
12698         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
12699         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
12700         * aclocal.m4: Regenerated.
12701         * config.in: Regenerated.
12702         * configure: Regenerated.
12703         * configure.in: Check for proc_service.h, sys/procfs.h,
12704         thread_db.h, and linux/elf.h headrs.
12705         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
12706         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
12707         Check for -lthread_db and thread support.
12708         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
12709         PowerPC, and SuperH.
12710         * i387-fp.c: Constify arguments.
12711         * i387-fp.h: Likewise.
12712         * inferiors.c: (struct thread_info): Renamed from
12713         `struct inferior_info'.  Remove PID member.  Use generic inferior
12714         list header.  All uses updated.
12715         (inferiors, signal_pid): Removed.
12716         (all_threads): New variable.
12717         (get_thread): Define.
12718         (add_inferior_to_list): New function.
12719         (for_each_inferior): New function.
12720         (change_inferior_id): New function.
12721         (add_inferior): Removed.
12722         (remove_inferior): New function.
12723         (add_thread): New function.
12724         (free_one_thread): New function.
12725         (remove_thread): New function.
12726         (clear_inferiors): Use for_each_inferior and free_one_thread.
12727         (find_inferior): New function.
12728         (find_inferior_id): New function.
12729         (inferior_target_data): Update argument type.
12730         (set_inferior_target_data): Likewise.
12731         (inferior_regcache_data): Likewise.
12732         (set_inferior_regcache_data): Likewise.
12733         * linux-low.c (linux_bp_reinsert): Remove.
12734         (all_processes, stopping_threads, using_thrads)
12735         (struct pending_signals, debug_threads, pid_of): New.
12736         (inferior_pid): Replace with macro.
12737         (struct inferior_linux_data): Remove.
12738         (get_stop_pc, add_process): New functions.
12739         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
12740         Use add_process and add_thread.
12741         (linux_attach_lwp): New function, based on old linux_attach.  Use
12742         add_process and add_thread.  Set stop_expected for new threads.
12743         (linux_attach): New function.
12744         (linux_kill_one_process): New function.
12745         (linux_kill): Kill all LWPs.
12746         (linux_thread_alive): Use find_inferior_id.
12747         (check_removed_breakpoints, status_pending_p): New functions.
12748         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
12749         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
12750         struct for the found process.
12751         (linux_wait_for_event): New function.
12752         (linux_wait): Use it.  Support LWPs.
12753         (send_sigstop, wait_for_sigstop, stop_all_processes)
12754         (linux_resume_one_process, linux_continue_one_process): New functions.
12755         (linux_resume): Support LWPs.
12756         (REGISTER_RAW_SIZE): Remove.
12757         (fetch_register): Use register_size instead.  Call supply_register.
12758         (usr_store_inferior_registers): Likewise.  Call collect_register.
12759         Fix recursive case.
12760         (regsets_fetch_inferior_registers): Improve error message.
12761         (regsets_store_inferior_registers): Add debugging.
12762         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
12763         (unstopped_p, linux_signal_pid): New functions.
12764         (linux_target_ops): Add linux_signal_pid.
12765         (linux_init_signals): New function.
12766         (initialize_low): Call it.  Initialize using_threads.
12767         * regcache.c (inferior_regcache_data): Add valid
12768         flag.
12769         (get_regcache): Fetch registers lazily.  Add fetch argument
12770         and update all callers.
12771         (regcache_invalidate_one, regcache_invalidate): New
12772         functions.
12773         (new_register_cache): Renamed from create_register_cache.
12774         Return the new regcache.
12775         (free_register_cache): Change argument to a void *.
12776         (registers_to_string, registers_from_string): Call get_regcache
12777         with fetch flag set.
12778         (register_data): Make static.  Pass fetch flag to get_regcache.
12779         (supply_register): Call get_regcache with fetch flag clear.
12780         (collect_register): Call get_regcache with fetch flag set.
12781         (collect_register_as_string): New function.
12782         * regcache.h: Update.
12783         * remote-utils.c (putpkt): Flush after debug output and use
12784         stderr.
12785         Handle input interrupts while waiting for an ACK.
12786         (input_interrupt): Use signal_pid method.
12787         (getpkt): Flush after debug output and use stderr.
12788         (outreg): Use collect_register_as_string.
12789         (new_thread_notify, dead_thread_notify): New functions.
12790         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
12791         and general_thread.
12792         (look_up_one_symbol): Flush after debug output.
12793         * server.c (step_thread, server_waiting): New variables.
12794         (start_inferior): Don't use signal_pid.  Update call to mywait.
12795         (attach_inferior): Update call to mywait.
12796         (handle_query): Handle qfThreadInfo and qsThreadInfo.
12797         (main): Don't fetch/store registers explicitly.  Use
12798         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
12799         calls to mywait.
12800         * server.h: Update.
12801         (struct inferior_list, struct_inferior_list_entry): New.
12802         * target.c (set_desired_inferior): New.
12803         (write_inferior_memory): Constify.
12804         (mywait): New function.
12805         * target.h: Update.
12806         (struct target_ops): New signal_pid method.
12807         (mywait): Removed macro, added prototype.
12808
12809         * linux-low.h (regset_func): Removed.
12810         (regset_fill_func, regset_store_func): New.
12811         (enum regset_type): New.
12812         (struct regset_info): Add type field.  Use new operation types.
12813         (struct linux_target_ops): stop_pc renamed to get_pc.
12814         Add decr_pc_after_break and breakpoint_at.
12815         (get_process, get_thread_proess, get_process_thread)
12816         (strut process_info, all_processes, linux_attach_lwp)
12817         (thread_db_init): New.
12818
12819         * linux-arm-low.c (arm_get_pc, arm_set_pc,
12820         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
12821         (the_low_target): Add new members.
12822         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
12823         (i386_store_fpxregset): Constify.
12824         (target_regsets): Add new kind identifier.
12825         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
12826         (i386_set_pc): Add debugging.
12827         (i386_breakpoint_at): New function.
12828         (the_low_target): Add new members.
12829         * linux-mips-low.c (mips_get_pc, mips_set_pc)
12830         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
12831         (mips_breakpoint_at): New.
12832         (the_low_target): Add new members.
12833         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
12834         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
12835         (the_low_target): Add new members.
12836         * linux-sh-low.c (sh_get_pc, sh_set_pc)
12837         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
12838         (the_low_target): Add new members.
12839         * linux-x86-64-low.c (target_regsets): Add new kind
12840         identifier.
12841
12842 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
12843
12844         From Martin Pool <mbp@samba.org>:
12845         * server.c (gdbserver_usage): New function.
12846         (main): Call it.
12847
12848 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
12849
12850         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
12851         stop_at -> stop_pc.
12852
12853 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
12854
12855         * Makefile.in: Remove obsolete code.
12856
12857 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
12858
12859         * linux-low.c (regsets_fetch_inferior_registers),
12860         (regsets_store_inferior_registers): Removed cast to int from
12861         ptrace() calls.
12862         * regcache.h: Added declaration of struct inferior_info.
12863
12864 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12865
12866         * inferiors.c (struct inferior_info): Add regcache_data.
12867         (add_inferior): Call create_register_cache.
12868         (clear_inferiors): Call free_register_cache.
12869         (inferior_regcache_data, set_inferior_regcache_data): New functions.
12870         * regcache.c (struct inferior_regcache_data): New.
12871         (registers): Remove.
12872         (get_regcache): New function.
12873         (create_register_cache, free_register_cache): New functions.
12874         (set_register_cache): Don't initialize the register cache here.
12875         (registers_to_string, registers_from_string, register_data): Call
12876         get_regcache.
12877         * regcache.h: Add prototypes.
12878         * server.h: Likewise.
12879
12880 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12881
12882         * mem-break.c: New file.
12883         * mem-break.h: New file.
12884         * Makefile.in: Add mem-break.o rule; update server.h
12885         dependencies.
12886         * inferiors.c (struct inferior_info): Add target_data
12887         member.
12888         (clear_inferiors): Free target_data member if set.
12889         (inferior_target_data, set_inferior_target_data): New functions.
12890         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
12891         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
12892         * linux-low.c (linux_bp_reinsert): New variable.
12893         (struct inferior_linux_data): New.
12894         (linux_create_inferior): Use set_inferior_target_data.
12895         (linux_attach): Likewise.  Call add_inferior.
12896         (linux_wait_for_one_inferior): New function.
12897         (linux_wait): Call it.
12898         (linux_write_memory): Add const.
12899         (initialize_low): Call set_breakpoint_data.
12900         * linux-low.h (struct linux_target_ops): Add breakpoint
12901         handling members.
12902         * server.c (attach_inferior): Remove extra add_inferior
12903         call.
12904         * server.h: Include mem-break.h.  Update inferior.c
12905         prototypes.
12906         * target.c (read_inferior_memory)
12907         (write_inferior_memory): New functions.
12908         * target.h (read_inferior_memory)
12909         (write_inferior_memory): Change macros to prototypes.
12910         (struct target_ops): Update comments.  Add const to write_memory
12911         definition.
12912
12913 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
12914
12915         * linux-low.c (usr_store_inferior_registers): Support
12916         registers which are allowed to fail to store.
12917         * linux-low.h (linux_target_ops): Likewise.
12918         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
12919         (ppc_cannot_store_register): FPSCR may not be storable.
12920
12921 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12922
12923         * server.h: Include <string.h> if HAVE_STRING_H.
12924         * ChangeLog: Correct paths in last ChangeLog entry.
12925
12926 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12927
12928         * linux-low.h: Remove obsolete prototypes.
12929         (struct linux_target_ops): New.
12930         (extern the_low_target): New.
12931         * linux-low.c (num_regs, regmap): Remove declarations.
12932         (register_addr): Use the_low_target explicitly.
12933         (fetch_register): Likewise.
12934         (usr_fetch_inferior_registers): Likewise.
12935         (usr_store_inferior_registers): Likewise.
12936         * linux-arm-low.c (num_regs): Remove.
12937         (arm_num_regs): Define.
12938         (arm_regmap): Renamed from regmap, made static.
12939         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
12940         made static.
12941         (arm_cannot_store_register): Renamed from cannot_store_register,
12942         made static.
12943         (the_low_target): New.
12944         * linux-i386-low.c (num_regs): Remove.
12945         (i386_num_regs): Define.
12946         (i386_regmap): Renamed from regmap, made static.
12947         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
12948         made static.
12949         (i386_cannot_store_register): Renamed from cannot_store_register,
12950         made static.
12951         (the_low_target): New.
12952         * linux-ia64-low.c (num_regs): Remove.
12953         (ia64_num_regs): Define.
12954         (ia64_regmap): Renamed from regmap, made static.
12955         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
12956         made static.
12957         (ia64_cannot_store_register): Renamed from cannot_store_register,
12958         made static.
12959         (the_low_target): New.
12960         * linux-m68k-low.c (num_regs): Remove.
12961         (m68k_num_regs): Define.
12962         (m68k_regmap): Renamed from regmap, made static.
12963         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
12964         made static.
12965         (m68k_cannot_store_register): Renamed from cannot_store_register,
12966         made static.
12967         (the_low_target): New.
12968         * linux-mips-low.c (num_regs): Remove.
12969         (mips_num_regs): Define.
12970         (mips_regmap): Renamed from regmap, made static.
12971         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
12972         made static.
12973         (mips_cannot_store_register): Renamed from cannot_store_register,
12974         made static.
12975         (the_low_target): New.
12976         * linux-ppc-low.c (num_regs): Remove.
12977         (ppc_num_regs): Define.
12978         (ppc_regmap): Renamed from regmap, made static.
12979         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
12980         made static.
12981         (ppc_cannot_store_register): Renamed from cannot_store_register,
12982         made static.
12983         (the_low_target): New.
12984         * linux-s390-low.c (num_regs): Remove.
12985         (s390_num_regs): Define.
12986         (s390_regmap): Renamed from regmap, made static.
12987         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
12988         made static.
12989         (s390_cannot_store_register): Renamed from cannot_store_register,
12990         made static.
12991         (the_low_target): New.
12992         * linux-sh-low.c (num_regs): Remove.
12993         (sh_num_regs): Define.
12994         (sh_regmap): Renamed from regmap, made static.
12995         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
12996         made static.
12997         (sh_cannot_store_register): Renamed from cannot_store_register,
12998         made static.
12999         (the_low_target): New.
13000         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
13001         (the_low_target): New.
13002
13003 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13004
13005         * Makefile.in: Add stamp-h target.
13006         * configure.in: Create stamp-h.
13007         * configure: Regenerated.
13008
13009 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13010
13011         * inferiors.c: New file.
13012         * target.c: New file.
13013         * target.h: New file.
13014         * Makefile.in:  Add target.o and inferiors.o.  Update
13015         dependencies.
13016         * linux-low.c (inferior_pid): New static variable,
13017         moved from server.c.
13018         (linux_create_inferior): Renamed from create_inferior.
13019         Call add_inferior.  Return 0 on success instead of a PID.
13020         (linux_attach): Renamed from myattach.
13021         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
13022         (linux_thread_alive): Renamed from mythread_alive.
13023         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
13024         child dies.
13025         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
13026         (regsets_store_inferior_registers): Correct error message.
13027         Add missing ``return 0''.
13028         (linux_fetch_registers): Renamed from fetch_inferior_registers.
13029         (linux_store_registers): Renamed from store_inferior_registers.
13030         (linux_read_memory): Renamed from read_inferior_memory.
13031         (linux_write_memory): Renamed from write_inferior_memory.
13032         (linux_target_ops): New structure.
13033         (initialize_low): Call set_target_ops ().
13034         * remote-utils.c (unhexify): New function.
13035         (hexify): New function.
13036         (input_interrupt): Send signals to ``signal_pid''.
13037         * server.c (inferior_pid): Remove.
13038         (start_inferior): Update create_inferior call.
13039         (attach_inferior): Call add_inferior.
13040         (handle_query): New function.
13041         (main): Call handle_query for `q' packets.
13042         * server.h: Include "target.h".  Remove obsolete prototypes.
13043         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
13044
13045 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13046
13047         * Makefile.in: Add WARN_CFLAGS.  Update configury
13048         dependencies.
13049         * configure.in: Check for <string.h>
13050         * configure: Regenerate.
13051         * config.in: Regenerate.
13052         * gdbreplay.c: Include needed system headers.
13053         (remote_open): Remove strchr prototype.
13054         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
13055         * regcache.c (supply_register): Change buf argument to const void *.
13056         (supply_register_by_name): Likewise.
13057         (collect_register): Change buf argument to void *.
13058         (collect_register_by_name): Likewise.
13059         * regcache.h: Add missing prototypes.
13060         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
13061         * server.c (handle_query): New function.
13062         (attached): New static variable, moved out of main.
13063         (main): Quiet longjmp clobber warnings.
13064         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
13065         * utils.c (error): Remove NORETURN.
13066         (fatal): Likewise.